vendor: 6,431 bytes, lines 1-9
1var gue=Object.defineProperty;var q6=t=>{throw TypeError(t)};var xue=(t,e,n)=>e in t?gue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var $n=(t,e,n)=>xue(t,typeof e!="symbol"?e+"":e,n),y3=(t,e,n)=>e.has(t)||q6("Cannot "+n);var st=(t,e,n)=>(y3(t,e,"read from private field"),n?n.call(t):e.get(t)),Qn=(t,e,n)=>e.has(t)?q6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),wn=(t,e,n,r)=>(y3(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Vr=(t,e,n)=>(y3(t,e,"access private method"),n);var uE=(t,e,n,r)=>({set _(i){wn(t,e,i,n)},get _(){return st(t,e,r)}});function vue(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var vN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function DS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bq={exports:{}},JT={},wq={exports:{}},Ur={};/** 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 BS=Symbol.for("react.element"),yue=Symbol.for("react.portal"),bue=Symbol.for("react.fragment"),wue=Symbol.for("react.strict_mode"),_ue=Symbol.for("react.profiler"),Sue=Symbol.for("react.provider"),Aue=Symbol.for("react.context"),Eue=Symbol.for("react.forward_ref"),kue=Symbol.for("react.suspense"),Cue=Symbol.for("react.memo"),Nue=Symbol.for("react.lazy"),X6=Symbol.iterator;function Tue(t){return t===null||typeof t!="object"?null:(t=X6&&t[X6]||t["@@iterator"],typeof t=="function"?t:null)}var _q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sq=Object.assign,Aq={};function d1(t,e,n){this.props=t,this.context=e,this.refs=Aq,this.updater=n||_q}d1.prototype.isReactComponent={};d1.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};d1.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Eq(){}Eq.prototype=d1.prototype;function lB(t,e,n){this.props=t,this.context=e,this.refs=Aq,this.updater=n||_q}var cB=lB.prototype=new Eq;cB.constructor=lB;Sq(cB,d1.prototype);cB.isPureReactComponent=!0;var Y6=Array.isArray,kq=Object.prototype.hasOwnProperty,uB={current:null},Cq={key:!0,ref:!0,__self:!0,__source:!0};function Nq(t,e,n){var r,i={},s=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)kq.call(e,r)&&!Cq.hasOwnProperty(r)&&(i[r]=e[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:BS,type:t,key:s,ref:a,props:i,_owner:uB.current}}function Mue(t,e){return{$$typeof:BS,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function dB(t){return typeof t=="object"&&t!==null&&t.$$typeof===BS}function Rue(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var J6=/\/+/g;function b3(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Rue(""+t.key):e.toString(36)}function wC(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case BS:case yue:a=!0}}if(a)return a=t,i=i(a),t=r===""?"."+b3(a,0):r,Y6(i)?(n="",t!=null&&(n=t.replace(J6,"$&/")+"/"),wC(i,e,n,"",function(u){return u})):i!=null&&(dB(i)&&(i=Mue(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(J6,"$&/")+"/")+t)),e.push(i)),1;if(a=0,r=r===""?".":r+":",Y6(t))for(var o=0;o<t.length;o++){s=t[o];var l=r+b3(s,o);a+=wC(s,e,n,l,i)}else if(l=Tue(t),typeof l=="function")for(t=l.call(t),o=0;!(s=t.next()).done;)s=s.value,l=r+b3(s,o++),a+=wC(s,e,n,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function dE(t,e,n){if(t==null)return t;var r=[],i=0;return wC(t,r,"","",function(s){return e.call(n,s,i++)}),r}function jue(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var _l={current:null},_C={transition:null},Pue={ReactCurrentDispatcher:_l,ReactCurrentBatchConfig:_C,ReactCurrentOwner:uB};function Tq(){throw Error("act(...) is not supported in production builds of React.")}Ur.Children={map:dE,forEach:function(t,e,n){dE(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return dE(t,function(){e++}),e},toArray:function(t){return dE(t,function(e){return e})||[]},only:function(t){if(!dB(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ur.Component=d1;Ur.Fragment=bue;Ur.Profiler=_ue;Ur.PureComponent=lB;Ur.StrictMode=wue;Ur.Suspense=kue;
vendor: 9,041 bytes, lines 9-33
9Ur.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Pue;Ur.act=Tq;Ur.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=Sq({},t.props),i=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=uB.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)kq.call(e,l)&&!Cq.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:BS,type:t.type,key:i,ref:s,props:r,_owner:a}};Ur.createContext=function(t){return t={$$typeof:Aue,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Sue,_context:t},t.Consumer=t};Ur.createElement=Nq;Ur.createFactory=function(t){var e=Nq.bind(null,t);return e.type=t,e};Ur.createRef=function(){return{current:null}};Ur.forwardRef=function(t){return{$$typeof:Eue,render:t}};Ur.isValidElement=dB;Ur.lazy=function(t){return{$$typeof:Nue,_payload:{_status:-1,_result:t},_init:jue}};Ur.memo=function(t,e){return{$$typeof:Cue,type:t,compare:e===void 0?null:e}};Ur.startTransition=function(t){var e=_C.transition;_C.transition={};try{t()}finally{_C.transition=e}};Ur.unstable_act=Tq;Ur.useCallback=function(t,e){return _l.current.useCallback(t,e)};Ur.useContext=function(t){return _l.current.useContext(t)};Ur.useDebugValue=function(){};Ur.useDeferredValue=function(t){return _l.current.useDeferredValue(t)};Ur.useEffect=function(t,e){return _l.current.useEffect(t,e)};Ur.useId=function(){return _l.current.useId()};Ur.useImperativeHandle=function(t,e,n){return _l.current.useImperativeHandle(t,e,n)};Ur.useInsertionEffect=function(t,e){return _l.current.useInsertionEffect(t,e)};Ur.useLayoutEffect=function(t,e){return _l.current.useLayoutEffect(t,e)};Ur.useMemo=function(t,e){return _l.current.useMemo(t,e)};Ur.useReducer=function(t,e,n){return _l.current.useReducer(t,e,n)};Ur.useRef=function(t){return _l.current.useRef(t)};Ur.useState=function(t){return _l.current.useState(t)};Ur.useSyncExternalStore=function(t,e,n){return _l.current.useSyncExternalStore(t,e,n)};Ur.useTransition=function(){return _l.current.useTransition()};Ur.version="18.3.1";wq.exports=Ur;var E=wq.exports;const Bt=DS(E),hB=vue({__proto__:null,default:Bt},[E]);/** 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 Lue=E,Iue=Symbol.for("react.element"),Due=Symbol.for("react.fragment"),Bue=Object.prototype.hasOwnProperty,Fue=Lue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Oue={key:!0,ref:!0,__self:!0,__source:!0};function Mq(t,e,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)Bue.call(e,r)&&!Oue.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Iue,type:t,key:s,ref:a,props:i,_owner:Fue.current}}JT.Fragment=Due;JT.jsx=Mq;JT.jsxs=Mq;bq.exports=JT;var c=bq.exports,Rq={exports:{}},Ic={},jq={exports:{}},Pq={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(t){function e(V,W){var O=V.length;V.push(W);e:for(;0<O;){var Y=O-1>>>1,z=V[Y];if(0<i(z,W))V[Y]=W,V[O]=z,O=Y;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var W=V[0],O=V.pop();if(O!==W){V[0]=O;e:for(var Y=0,z=V.length,I=z>>>1;Y<I;){var q=2*(Y+1)-1,te=V[q],se=q+1,ie=V[se];if(0>i(te,O))se<z&&0>i(ie,te)?(V[Y]=ie,V[se]=O,Y=se):(V[Y]=te,V[q]=O,Y=q);else if(se<z&&0>i(ie,O))V[Y]=ie,V[se]=O,Y=se;else break e}}return W}function i(V,W){var O=V.sortIndex-W.sortIndex;return O!==0?O:V.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,h=null,p=3,f=!1,m=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(V){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=V)r(u),W.sortIndex=W.expirationTime,e(l,W);else break;W=n(u)}}function S(V){if(x=!1,y(V),!m)if(n(l)!==null)m=!0,U(A);else{var W=n(u);W!==null&&Z(S,W.startTime-V)}}function A(V,W){m=!1,x&&(x=!1,g(T),T=-1),f=!0;var O=p;try{for(y(W),h=n(l);h!==null&&(!(h.expirationTime>W)||V&&!P());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,p=h.priorityLevel;var z=Y(h.expirationTime<=W);W=t.unstable_now(),typeof z=="function"?h.callback=z:h===n(l)&&r(l),y(W)}else r(l);h=n(l)}if(h!==null)var I=!0;else{var q=n(u);q!==null&&Z(S,q.startTime-W),I=!1}return I}finally{h=null,p=O,f=!1}}var k=!1,M=null,T=-1,C=5,R=-1;function P(){return!(t.unstable_now()-R<C)}function j(){if(M!==null){var V=t.unstable_now();R=V;var W=!0;try{W=M(!0,V)}finally{W?G():(k=!1,M=null)}}else k=!1}var G;if(typeof b=="function")G=function(){b(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,$=B.port2;B.port1.onmessage=j,G=function(){$.postMessage(null)}}else G=function(){v(j,0)};function U(V){M=V,k||(k=!0,G())}function Z(V,W){T=v(function(){V(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,U(A))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var O=p;p=W;try{return V()}finally{p=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,W){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var O=p;p=V;try{return W()}finally{p=O}},t.unstable_scheduleCallback=function(V,W,O){var Y=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?Y+O:Y):O=Y,V){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=O+z,V={id:d++,callback:W,priorityLevel:V,startTime:O,expirationTime:z,sortIndex:-1},O>Y?(V.sortIndex=O,e(u,V),n(l)===null&&V===n(u)&&(x?(g(T),T=-1):x=!0,Z(S,O-Y))):(V.sortIndex=z,e(l,V),m||f||(m=!0,U(A))),V},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(V){var W=p;return function(){var O=p;p=W;try{return V.apply(this,arguments)}finally{p=O}}}})(Pq);jq.exports=Pq;var zue=jq.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 Uue=E,Rc=zue;function Vt(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Lq=new Set,v2={};function kx(t,e){jb(t,e),jb(t+"Capture",e)}function jb(t,e){for(v2[t]=e,t=0;t<e.length;t++)Lq.add(e[t])}var kf=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),QP=Object.prototype.hasOwnProperty,Hue=/^[: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]*$/,Z6={},Q6={};function Gue(t){return QP.call(Q6,t)?!0:QP.call(Z6,t)?!1:Hue.test(t)?Q6[t]=!0:(Z6[t]=!0,!1)}function Vue(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Wue(t,e,n,r){if(e===null||typeof e>"u"||Vue(t,e,n,r))return!0;
vendor: 5,203 bytes, lines 33-34
33if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Sl(t,e,n,r,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var vo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){vo[t]=new Sl(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];vo[e]=new Sl(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){vo[t]=new Sl(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){vo[t]=new Sl(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){vo[t]=new Sl(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){vo[t]=new Sl(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){vo[t]=new Sl(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){vo[t]=new Sl(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){vo[t]=new Sl(t,5,!1,t.toLowerCase(),null,!1,!1)});var fB=/[\-:]([a-z])/g;function pB(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(fB,pB);vo[e]=new Sl(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(fB,pB);vo[e]=new Sl(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(fB,pB);vo[e]=new Sl(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){vo[t]=new Sl(t,1,!1,t.toLowerCase(),null,!1,!1)});vo.xlinkHref=new Sl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){vo[t]=new Sl(t,1,!1,t.toLowerCase(),null,!0,!0)});function mB(t,e,n,r){var i=vo.hasOwnProperty(e)?vo[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Wue(e,n,i,r)&&(n=null),r||i===null?Gue(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Of=Uue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hE=Symbol.for("react.element"),by=Symbol.for("react.portal"),wy=Symbol.for("react.fragment"),gB=Symbol.for("react.strict_mode"),eL=Symbol.for("react.profiler"),Iq=Symbol.for("react.provider"),Dq=Symbol.for("react.context"),xB=Symbol.for("react.forward_ref"),tL=Symbol.for("react.suspense"),nL=Symbol.for("react.suspense_list"),vB=Symbol.for("react.memo"),jp=Symbol.for("react.lazy"),Bq=Symbol.for("react.offscreen"),eU=Symbol.iterator;function Rw(t){return t===null||typeof t!="object"?null:(t=eU&&t[eU]||t["@@iterator"],typeof t=="function"?t:null)}var ks=Object.assign,w3;function y_(t){if(w3===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);w3=e&&e[1]||""}return` 34`+w3+t}var _3=!1;function S3(t,e){if(!t||_3)return"";_3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}
vendor: 5,503 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(` 35`),s=r.stack.split(` 36`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var l=` 37`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{_3=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?y_(t):""}function $ue(t){switch(t.tag){case 5:return y_(t.type);case 16:return y_("Lazy");case 13:return y_("Suspense");case 19:return y_("SuspenseList");case 0:case 2:case 15:return t=S3(t.type,!1),t;case 11:return t=S3(t.type.render,!1),t;case 1:return t=S3(t.type,!0),t;default:return""}}function rL(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case wy:return"Fragment";case by:return"Portal";case eL:return"Profiler";case gB:return"StrictMode";case tL:return"Suspense";case nL:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Dq:return(t.displayName||"Context")+".Consumer";case Iq:return(t._context.displayName||"Context")+".Provider";case xB:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case vB:return e=t.displayName||null,e!==null?e:rL(t.type)||"Memo";case jp:e=t._payload,t=t._init;try{return rL(t(e))}catch{}}return null}function Kue(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rL(e);case 8:return e===gB?"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 Rm(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Fq(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function que(t){var e=Fq(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fE(t){t._valueTracker||(t._valueTracker=que(t))}function Oq(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Fq(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function yN(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function iL(t,e){var n=e.checked;return ks({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function tU(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Rm(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function zq(t,e){e=e.checked,e!=null&&mB(t,"checked",e,!1)}function sL(t,e){zq(t,e);var n=Rm(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?aL(t,e.type,n):e.hasOwnProperty("defaultValue")&&aL(t,e.type,Rm(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function nU(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function aL(t,e,n){(e!=="number"||yN(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var b_=Array.isArray;function Ky(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Rm(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function oL(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Vt(91));return ks({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function rU(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(Vt(92));
vendor: 12,730 bytes, line 37
37if(b_(n)){if(1<n.length)throw Error(Vt(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Rm(n)}}function Uq(t,e){var n=Rm(e.value),r=Rm(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function iU(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Hq(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function lL(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Hq(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var pE,Gq=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(pE=pE||document.createElement("div"),pE.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=pE.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function y2(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var F_={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},Xue=["Webkit","ms","Moz","O"];Object.keys(F_).forEach(function(t){Xue.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),F_[e]=F_[t]})});function Vq(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||F_.hasOwnProperty(t)&&F_[t]?(""+e).trim():e+"px"}function Wq(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Vq(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Yue=ks({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 cL(t,e){if(e){if(Yue[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Vt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Vt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Vt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Vt(62))}}function uL(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dL=null;function yB(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hL=null,qy=null,Xy=null;function sU(t){if(t=zS(t)){if(typeof hL!="function")throw Error(Vt(280));var e=t.stateNode;e&&(e=n5(e),hL(t.stateNode,t.type,e))}}function $q(t){qy?Xy?Xy.push(t):Xy=[t]:qy=t}function Kq(){if(qy){var t=qy,e=Xy;if(Xy=qy=null,sU(t),e)for(t=0;t<e.length;t++)sU(e[t])}}function qq(t,e){return t(e)}function Xq(){}var A3=!1;function Yq(t,e,n){if(A3)return t(e,n);A3=!0;try{return qq(t,e,n)}finally{A3=!1,(qy!==null||Xy!==null)&&(Xq(),Kq())}}function b2(t,e){var n=t.stateNode;if(n===null)return null;var r=n5(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(Vt(231,e,typeof n));return n}var fL=!1;if(kf)try{var jw={};Object.defineProperty(jw,"passive",{get:function(){fL=!0}}),window.addEventListener("test",jw,jw),window.removeEventListener("test",jw,jw)}catch{fL=!1}function Jue(t,e,n,r,i,s,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var O_=!1,bN=null,wN=!1,pL=null,Zue={onError:function(t){O_=!0,bN=t}};function Que(t,e,n,r,i,s,a,o,l){O_=!1,bN=null,Jue.apply(Zue,arguments)}function ede(t,e,n,r,i,s,a,o,l){if(Que.apply(this,arguments),O_){if(O_){var u=bN;O_=!1,bN=null}else throw Error(Vt(198));wN||(wN=!0,pL=u)}}function Cx(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Jq(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function aU(t){if(Cx(t)!==t)throw Error(Vt(188))}function tde(t){var e=t.alternate;if(!e){if(e=Cx(t),e===null)throw Error(Vt(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return aU(i),t;if(s===r)return aU(i),e;s=s.sibling}throw Error(Vt(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(Vt(189))}}if(n.alternate!==r)throw Error(Vt(190))}if(n.tag!==3)throw Error(Vt(188));return n.stateNode.current===n?t:e}function Zq(t){return t=tde(t),t!==null?Qq(t):null}function Qq(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Qq(t);if(e!==null)return e;t=t.sibling}return null}var eX=Rc.unstable_scheduleCallback,oU=Rc.unstable_cancelCallback,nde=Rc.unstable_shouldYield,rde=Rc.unstable_requestPaint,qs=Rc.unstable_now,ide=Rc.unstable_getCurrentPriorityLevel,bB=Rc.unstable_ImmediatePriority,tX=Rc.unstable_UserBlockingPriority,_N=Rc.unstable_NormalPriority,sde=Rc.unstable_LowPriority,nX=Rc.unstable_IdlePriority,ZT=null,hh=null;function ade(t){if(hh&&typeof hh.onCommitFiberRoot=="function")try{hh.onCommitFiberRoot(ZT,t,void 0,(t.current.flags&128)===128)}catch{}}var fd=Math.clz32?Math.clz32:cde,ode=Math.log,lde=Math.LN2;function cde(t){return t>>>=0,t===0?32:31-(ode(t)/lde|0)|0}var mE=64,gE=4194304;function w_(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function SN(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=w_(o):(s&=a,s!==0&&(r=w_(s)))}else a=n&~i,a!==0?r=w_(a):s!==0&&(r=w_(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-fd(e),i=1<<n,r|=t[n],e&=~i;return r}function ude(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dde(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-fd(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=ude(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}function mL(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function rX(){var t=mE;return mE<<=1,!(mE&4194240)&&(mE=64),t}function E3(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function FS(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-fd(e),t[e]=n}function hde(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-fd(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function wB(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-fd(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ai=0;function iX(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var sX,_B,aX,oX,lX,gL=!1,xE=[],dm=null,hm=null,fm=null,w2=new Map,_2=new Map,Op=[],fde="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 lU(t,e){switch(t){case"focusin":case"focusout":dm=null;break;case"dragenter":case"dragleave":hm=null;break;case"mouseover":case"mouseout":fm=null;break;case"pointerover":case"pointerout":w2.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":_2.delete(e.pointerId)}}function Pw(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=zS(e),e!==null&&_B(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function pde(t,e,n,r,i){switch(e){case"focusin":return dm=Pw(dm,t,e,n,r,i),!0;case"dragenter":return hm=Pw(hm,t,e,n,r,i),!0;case"mouseover":return fm=Pw(fm,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return w2.set(s,Pw(w2.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,_2.set(s,Pw(_2.get(s)||null,t,e,n,r,i)),!0}return!1}function cX(t){var e=d0(t.target);if(e!==null){var n=Cx(e);if(n!==null){if(e=n.tag,e===13){if(e=Jq(n),e!==null){t.blockedOn=e,lX(t.priority,function(){aX(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function SC(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=xL(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);dL=r,n.target.dispatchEvent(r),dL=null}else return e=zS(n),e!==null&&_B(e),t.blockedOn=n,!1;e.shift()}return!0}function cU(t,e,n){SC(t)&&n.delete(e)}function mde(){gL=!1,dm!==null&&SC(dm)&&(dm=null),hm!==null&&SC(hm)&&(hm=null),fm!==null&&SC(fm)&&(fm=null),w2.forEach(cU),_2.forEach(cU)}function Lw(t,e){t.blockedOn===e&&(t.blockedOn=null,gL||(gL=!0,Rc.unstable_scheduleCallback(Rc.unstable_NormalPriority,mde)))}function S2(t){function e(i){return Lw(i,t)}if(0<xE.length){Lw(xE[0],t);for(var n=1;n<xE.length;n++){var r=xE[n];r.blockedOn===t&&(r.blockedOn=null)}}for(dm!==null&&Lw(dm,t),hm!==null&&Lw(hm,t),fm!==null&&Lw(fm,t),w2.forEach(e),_2.forEach(e),n=0;n<Op.length;n++)r=Op[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Op.length&&(n=Op[0],n.blockedOn===null);)cX(n),n.blockedOn===null&&Op.shift()}var Yy=Of.ReactCurrentBatchConfig,AN=!0;function gde(t,e,n,r){var i=Ai,s=Yy.transition;Yy.transition=null;try{Ai=1,SB(t,e,n,r)}finally{Ai=i,Yy.transition=s}}function xde(t,e,n,r){var i=Ai,s=Yy.transition;Yy.transition=null;try{Ai=4,SB(t,e,n,r)}finally{Ai=i,Yy.transition=s}}function SB(t,e,n,r){if(AN){var i=xL(t,e,n,r);if(i===null)I3(t,e,r,EN,n),lU(t,r);else if(pde(i,t,e,n,r))r.stopPropagation();else if(lU(t,r),e&4&&-1<fde.indexOf(t)){for(;i!==null;){var s=zS(i);if(s!==null&&sX(s),s=xL(t,e,n,r),s===null&&I3(t,e,r,EN,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else I3(t,e,r,null,n)}}var EN=null;function xL(t,e,n,r){if(EN=null,t=yB(r),t=d0(t),t!==null)if(e=Cx(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Jq(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return EN=t,null}
vendor: 10,457 bytes, line 37
37function uX(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ide()){case bB:return 1;case tX:return 4;case _N:case sde:return 16;case nX:return 536870912;default:return 16}default:return 16}}var nm=null,AB=null,AC=null;function dX(){if(AC)return AC;var t,e=AB,n=e.length,r,i="value"in nm?nm.value:nm.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===i[s-r];r++);return AC=i.slice(t,1<r?1-r:void 0)}function EC(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function vE(){return!0}function uU(){return!1}function Dc(t){function e(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?vE:uU,this.isPropagationStopped=uU,this}return ks(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vE)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vE)},persist:function(){},isPersistent:vE}),e}var h1={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},EB=Dc(h1),OS=ks({},h1,{view:0,detail:0}),vde=Dc(OS),k3,C3,Iw,QT=ks({},OS,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kB,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Iw&&(Iw&&t.type==="mousemove"?(k3=t.screenX-Iw.screenX,C3=t.screenY-Iw.screenY):C3=k3=0,Iw=t),k3)},movementY:function(t){return"movementY"in t?t.movementY:C3}}),dU=Dc(QT),yde=ks({},QT,{dataTransfer:0}),bde=Dc(yde),wde=ks({},OS,{relatedTarget:0}),N3=Dc(wde),_de=ks({},h1,{animationName:0,elapsedTime:0,pseudoElement:0}),Sde=Dc(_de),Ade=ks({},h1,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ede=Dc(Ade),kde=ks({},h1,{data:0}),hU=Dc(kde),Cde={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nde={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"},Tde={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mde(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Tde[t])?!!e[t]:!1}function kB(){return Mde}var Rde=ks({},OS,{key:function(t){if(t.key){var e=Cde[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=EC(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Nde[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kB,charCode:function(t){return t.type==="keypress"?EC(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?EC(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jde=Dc(Rde),Pde=ks({},QT,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fU=Dc(Pde),Lde=ks({},OS,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kB}),Ide=Dc(Lde),Dde=ks({},h1,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bde=Dc(Dde),Fde=ks({},QT,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Ode=Dc(Fde),zde=[9,13,27,32],CB=kf&&"CompositionEvent"in window,z_=null;kf&&"documentMode"in document&&(z_=document.documentMode);var Ude=kf&&"TextEvent"in window&&!z_,hX=kf&&(!CB||z_&&8<z_&&11>=z_),pU=" ",mU=!1;function fX(t,e){switch(t){case"keyup":return zde.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pX(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _y=!1;function Hde(t,e){switch(t){case"compositionend":return pX(e);case"keypress":return e.which!==32?null:(mU=!0,pU);case"textInput":return t=e.data,t===pU&&mU?null:t;default:return null}}function Gde(t,e){if(_y)return t==="compositionend"||!CB&&fX(t,e)?(t=dX(),AC=AB=nm=null,_y=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return hX&&e.locale!=="ko"?null:e.data;default:return null}}var Vde={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 gU(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Vde[t.type]:e==="textarea"}function mX(t,e,n,r){$q(r),e=kN(e,"onChange"),0<e.length&&(n=new EB("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var U_=null,A2=null;function Wde(t){kX(t,0)}function e5(t){var e=Ey(t);if(Oq(e))return t}function $de(t,e){if(t==="change")return e}var gX=!1;if(kf){var T3;if(kf){var M3="oninput"in document;if(!M3){var xU=document.createElement("div");xU.setAttribute("oninput","return;"),M3=typeof xU.oninput=="function"}T3=M3}else T3=!1;gX=T3&&(!document.documentMode||9<document.documentMode)}function vU(){U_&&(U_.detachEvent("onpropertychange",xX),A2=U_=null)}function xX(t){if(t.propertyName==="value"&&e5(A2)){var e=[];mX(e,A2,t,yB(t)),Yq(Wde,e)}}function Kde(t,e,n){t==="focusin"?(vU(),U_=e,A2=n,U_.attachEvent("onpropertychange",xX)):t==="focusout"&&vU()}function qde(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return e5(A2)}function Xde(t,e){if(t==="click")return e5(e)}function Yde(t,e){if(t==="input"||t==="change")return e5(e)}function Jde(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vd=typeof Object.is=="function"?Object.is:Jde;function E2(t,e){if(vd(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!QP.call(e,i)||!vd(t[i],e[i]))return!1}return!0}function yU(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bU(t,e){var n=yU(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yU(n)}}function vX(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vX(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yX(){for(var t=window,e=yN();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=yN(t.document)}return e}function NB(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Zde(t){var e=yX(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&vX(n.ownerDocument.documentElement,n)){if(r!==null&&NB(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=bU(n,s);var a=bU(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Qde=kf&&"documentMode"in document&&11>=document.documentMode,Sy=null,vL=null,H_=null,yL=!1;function wU(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yL||Sy==null||Sy!==yN(r)||(r=Sy,"selectionStart"in r&&NB(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,510 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),H_&&E2(H_,r)||(H_=r,r=kN(vL,"onSelect"),0<r.length&&(e=new EB("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Sy)))}function yE(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ay={animationend:yE("Animation","AnimationEnd"),animationiteration:yE("Animation","AnimationIteration"),animationstart:yE("Animation","AnimationStart"),transitionend:yE("Transition","TransitionEnd")},R3={},bX={};kf&&(bX=document.createElement("div").style,"AnimationEvent"in window||(delete Ay.animationend.animation,delete Ay.animationiteration.animation,delete Ay.animationstart.animation),"TransitionEvent"in window||delete Ay.transitionend.transition);function t5(t){if(R3[t])return R3[t];if(!Ay[t])return t;var e=Ay[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in bX)return R3[t]=e[n];return t}var wX=t5("animationend"),_X=t5("animationiteration"),SX=t5("animationstart"),AX=t5("transitionend"),EX=new Map,_U="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 ng(t,e){EX.set(t,e),kx(e,[t])}for(var j3=0;j3<_U.length;j3++){var P3=_U[j3],ehe=P3.toLowerCase(),the=P3[0].toUpperCase()+P3.slice(1);ng(ehe,"on"+the)}ng(wX,"onAnimationEnd");ng(_X,"onAnimationIteration");ng(SX,"onAnimationStart");ng("dblclick","onDoubleClick");ng("focusin","onFocus");ng("focusout","onBlur");ng(AX,"onTransitionEnd");jb("onMouseEnter",["mouseout","mouseover"]);jb("onMouseLeave",["mouseout","mouseover"]);jb("onPointerEnter",["pointerout","pointerover"]);jb("onPointerLeave",["pointerout","pointerover"]);kx("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));kx("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));kx("onBeforeInput",["compositionend","keypress","textInput","paste"]);kx("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));kx("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));kx("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var __="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(" "),nhe=new Set("cancel close invalid load scroll toggle".split(" ").concat(__));function SU(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,ede(r,e,void 0,t),t.currentTarget=null}function kX(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;SU(i,o,u),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;SU(i,o,u),s=l}}}if(wN)throw t=pL,wN=!1,pL=null,t}function Xi(t,e){var n=e[AL];n===void 0&&(n=e[AL]=new Set);var r=t+"__bubble";n.has(r)||(CX(e,t,2,!1),n.add(r))}function L3(t,e,n){var r=0;e&&(r|=4),CX(n,t,r,e)}var bE="_reactListening"+Math.random().toString(36).slice(2);function k2(t){if(!t[bE]){t[bE]=!0,Lq.forEach(function(n){n!=="selectionchange"&&(nhe.has(n)||L3(n,!1,t),L3(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[bE]||(e[bE]=!0,L3("selectionchange",!1,e))}}function CX(t,e,n,r){switch(uX(e)){case 1:var i=gde;break;case 4:i=xde;break;default:i=SB}n=i.bind(null,e,n,t),i=void 0,!fL||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function I3(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;
vendor: 5,340 bytes, lines 37-38
37if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;o!==null;){if(a=d0(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}Yq(function(){var u=s,d=yB(n),h=[];e:{var p=EX.get(t);if(p!==void 0){var f=EB,m=t;switch(t){case"keypress":if(EC(n)===0)break e;case"keydown":case"keyup":f=jde;break;case"focusin":m="focus",f=N3;break;case"focusout":m="blur",f=N3;break;case"beforeblur":case"afterblur":f=N3;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=dU;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=bde;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Ide;break;case wX:case _X:case SX:f=Sde;break;case AX:f=Bde;break;case"scroll":f=vde;break;case"wheel":f=Ode;break;case"copy":case"cut":case"paste":f=Ede;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=fU}var x=(e&4)!==0,v=!x&&t==="scroll",g=x?p!==null?p+"Capture":null:p;x=[];for(var b=u,y;b!==null;){y=b;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,g!==null&&(S=b2(b,g),S!=null&&x.push(C2(b,S,y)))),v)break;b=b.return}0<x.length&&(p=new f(p,m,null,n,d),h.push({event:p,listeners:x}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",p&&n!==dL&&(m=n.relatedTarget||n.fromElement)&&(d0(m)||m[Cf]))break e;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=u,m=m?d0(m):null,m!==null&&(v=Cx(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(f=null,m=u),f!==m)){if(x=dU,S="onMouseLeave",g="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(x=fU,S="onPointerLeave",g="onPointerEnter",b="pointer"),v=f==null?p:Ey(f),y=m==null?p:Ey(m),p=new x(S,b+"leave",f,n,d),p.target=v,p.relatedTarget=y,S=null,d0(d)===u&&(x=new x(g,b+"enter",m,n,d),x.target=y,x.relatedTarget=v,S=x),v=S,f&&m)t:{for(x=f,g=m,b=0,y=x;y;y=uv(y))b++;for(y=0,S=g;S;S=uv(S))y++;for(;0<b-y;)x=uv(x),b--;for(;0<y-b;)g=uv(g),y--;for(;b--;){if(x===g||g!==null&&x===g.alternate)break t;x=uv(x),g=uv(g)}x=null}else x=null;f!==null&&AU(h,p,f,x,!1),m!==null&&v!==null&&AU(h,v,m,x,!0)}}e:{if(p=u?Ey(u):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var A=$de;else if(gU(p))if(gX)A=Yde;else{A=qde;var k=Kde}else(f=p.nodeName)&&f.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(A=Xde);if(A&&(A=A(t,u))){mX(h,A,n,d);break e}k&&k(t,p,u),t==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&aL(p,"number",p.value)}switch(k=u?Ey(u):window,t){case"focusin":(gU(k)||k.contentEditable==="true")&&(Sy=k,vL=u,H_=null);break;case"focusout":H_=vL=Sy=null;break;case"mousedown":yL=!0;break;case"contextmenu":case"mouseup":case"dragend":yL=!1,wU(h,n,d);break;case"selectionchange":if(Qde)break;case"keydown":case"keyup":wU(h,n,d)}var M;if(CB)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else _y?fX(t,n)&&(T="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(hX&&n.locale!=="ko"&&(_y||T!=="onCompositionStart"?T==="onCompositionEnd"&&_y&&(M=dX()):(nm=d,AB="value"in nm?nm.value:nm.textContent,_y=!0)),k=kN(u,T),0<k.length&&(T=new hU(T,t,null,n,d),h.push({event:T,listeners:k}),M?T.data=M:(M=pX(n),M!==null&&(T.data=M)))),(M=Ude?Hde(t,n):Gde(t,n))&&(u=kN(u,"onBeforeInput"),0<u.length&&(d=new hU("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=M))}kX(h,e)})}function C2(t,e,n){return{instance:t,listener:e,currentTarget:n}}function kN(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=b2(t,n),s!=null&&r.unshift(C2(t,s,i)),s=b2(t,e),s!=null&&r.push(C2(t,s,i))),t=t.return}return r}function uv(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function AU(t,e,n,r,i){for(var s=e._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&u!==null&&(o=u,i?(l=b2(n,s),l!=null&&a.unshift(C2(n,l,o))):i||(l=b2(n,s),l!=null&&a.push(C2(n,l,o)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var rhe=/\r\n?/g,ihe=/\u0000|\uFFFD/g;function EU(t){return(typeof t=="string"?t:""+t).replace(rhe,` 38`).replace(ihe,"")}function wE(t,e,n){if(e=EU(e),EU(t)!==e&&n)throw Error(Vt(425))}function CN(){}var bL=null,wL=null;function _L(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var SL=typeof setTimeout=="function"?setTimeout:void 0,she=typeof clearTimeout=="function"?clearTimeout:void 0,kU=typeof Promise=="function"?Promise:void 0,ahe=typeof queueMicrotask=="function"?queueMicrotask:typeof kU<"u"?function(t){return kU.resolve(null).then(t).cat
vendor: 1,369 bytes, line 38
38ch(ohe)}:SL;function ohe(t){setTimeout(function(){throw t})}function D3(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),S2(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);S2(e)}function pm(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function CU(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var f1=Math.random().toString(36).slice(2),sh="__reactFiber$"+f1,N2="__reactProps$"+f1,Cf="__reactContainer$"+f1,AL="__reactEvents$"+f1,lhe="__reactListeners$"+f1,che="__reactHandles$"+f1;function d0(t){var e=t[sh];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Cf]||n[sh]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=CU(t);t!==null;){if(n=t[sh])return n;t=CU(t)}return e}t=n,n=t.parentNode}return null}function zS(t){return t=t[sh]||t[Cf],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ey(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Vt(33))}function n5(t){return t[N2]||null}var EL=[],ky=-1;function rg(t){return{current:t}}function Qi(t){0>ky||(t.current=EL[ky],EL[ky]=null,ky--)}
vendor: 15,460 bytes, line 38
38function Hi(t,e){ky++,EL[ky]=t.current,t.current=e}var jm={},Ko=rg(jm),$l=rg(!1),Y0=jm;function Pb(t,e){var n=t.type.contextTypes;if(!n)return jm;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Kl(t){return t=t.childContextTypes,t!=null}function NN(){Qi($l),Qi(Ko)}function NU(t,e,n){if(Ko.current!==jm)throw Error(Vt(168));Hi(Ko,e),Hi($l,n)}function NX(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Vt(108,Kue(t)||"Unknown",i));return ks({},n,r)}function TN(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||jm,Y0=Ko.current,Hi(Ko,t),Hi($l,$l.current),!0}function TU(t,e,n){var r=t.stateNode;if(!r)throw Error(Vt(169));n?(t=NX(t,e,Y0),r.__reactInternalMemoizedMergedChildContext=t,Qi($l),Qi(Ko),Hi(Ko,t)):Qi($l),Hi($l,n)}var uf=null,r5=!1,B3=!1;function TX(t){uf===null?uf=[t]:uf.push(t)}function uhe(t){r5=!0,TX(t)}function ig(){if(!B3&&uf!==null){B3=!0;var t=0,e=Ai;try{var n=uf;for(Ai=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}uf=null,r5=!1}catch(i){throw uf!==null&&(uf=uf.slice(t+1)),eX(bB,ig),i}finally{Ai=e,B3=!1}}return null}var Cy=[],Ny=0,MN=null,RN=0,su=[],au=0,J0=null,xf=1,vf="";function Yg(t,e){Cy[Ny++]=RN,Cy[Ny++]=MN,MN=t,RN=e}function MX(t,e,n){su[au++]=xf,su[au++]=vf,su[au++]=J0,J0=t;var r=xf;t=vf;var i=32-fd(r)-1;r&=~(1<<i),n+=1;var s=32-fd(e)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,xf=1<<32-fd(e)+i|n<<i|r,vf=s+t}else xf=1<<s|n<<i|r,vf=t}function TB(t){t.return!==null&&(Yg(t,1),MX(t,1,0))}function MB(t){for(;t===MN;)MN=Cy[--Ny],Cy[Ny]=null,RN=Cy[--Ny],Cy[Ny]=null;for(;t===J0;)J0=su[--au],su[au]=null,vf=su[--au],su[au]=null,xf=su[--au],su[au]=null}var Cc=null,_c=null,ls=!1,cd=null;function RX(t,e){var n=du(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function MU(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Cc=t,_c=pm(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Cc=t,_c=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=J0!==null?{id:xf,overflow:vf}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=du(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Cc=t,_c=null,!0):!1;default:return!1}}function kL(t){return(t.mode&1)!==0&&(t.flags&128)===0}function CL(t){if(ls){var e=_c;if(e){var n=e;if(!MU(t,e)){if(kL(t))throw Error(Vt(418));e=pm(n.nextSibling);var r=Cc;e&&MU(t,e)?RX(r,n):(t.flags=t.flags&-4097|2,ls=!1,Cc=t)}}else{if(kL(t))throw Error(Vt(418));t.flags=t.flags&-4097|2,ls=!1,Cc=t}}}function RU(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Cc=t}function _E(t){if(t!==Cc)return!1;if(!ls)return RU(t),ls=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!_L(t.type,t.memoizedProps)),e&&(e=_c)){if(kL(t))throw jX(),Error(Vt(418));for(;e;)RX(t,e),e=pm(e.nextSibling)}if(RU(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Vt(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){_c=pm(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}_c=null}}else _c=Cc?pm(t.stateNode.nextSibling):null;return!0}function jX(){for(var t=_c;t;)t=pm(t.nextSibling)}function Lb(){_c=Cc=null,ls=!1}function RB(t){cd===null?cd=[t]:cd.push(t)}var dhe=Of.ReactCurrentBatchConfig;function Dw(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Vt(309));var r=n.stateNode}if(!r)throw Error(Vt(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},e._stringRef=s,e)}if(typeof t!="string")throw Error(Vt(284));if(!n._owner)throw Error(Vt(290,t))}return t}function SE(t,e){throw t=Object.prototype.toString.call(e),Error(Vt(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function jU(t){var e=t._init;return e(t._payload)}function PX(t){function e(g,b){if(t){var y=g.deletions;y===null?(g.deletions=[b],g.flags|=16):y.push(b)}}function n(g,b){if(!t)return null;for(;b!==null;)e(g,b),b=b.sibling;return null}function r(g,b){for(g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function i(g,b){return g=vm(g,b),g.index=0,g.sibling=null,g}function s(g,b,y){return g.index=y,t?(y=g.alternate,y!==null?(y=y.index,y<b?(g.flags|=2,b):y):(g.flags|=2,b)):(g.flags|=1048576,b)}function a(g){return t&&g.alternate===null&&(g.flags|=2),g}function o(g,b,y,S){return b===null||b.tag!==6?(b=V3(y,g.mode,S),b.return=g,b):(b=i(b,y),b.return=g,b)}function l(g,b,y,S){var A=y.type;return A===wy?d(g,b,y.props.children,S,y.key):b!==null&&(b.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===jp&&jU(A)===b.type)?(S=i(b,y.props),S.ref=Dw(g,b,y),S.return=g,S):(S=jC(y.type,y.key,y.props,null,g.mode,S),S.ref=Dw(g,b,y),S.return=g,S)}function u(g,b,y,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=W3(y,g.mode,S),b.return=g,b):(b=i(b,y.children||[]),b.return=g,b)}function d(g,b,y,S,A){return b===null||b.tag!==7?(b=O0(y,g.mode,S,A),b.return=g,b):(b=i(b,y),b.return=g,b)}function h(g,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=V3(""+b,g.mode,y),b.return=g,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case hE:return y=jC(b.type,b.key,b.props,null,g.mode,y),y.ref=Dw(g,null,b),y.return=g,y;case by:return b=W3(b,g.mode,y),b.return=g,b;case jp:var S=b._init;return h(g,S(b._payload),y)}if(b_(b)||Rw(b))return b=O0(b,g.mode,y,null),b.return=g,b;SE(g,b)}return null}function p(g,b,y,S){var A=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return A!==null?null:o(g,b,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case hE:return y.key===A?l(g,b,y,S):null;case by:return y.key===A?u(g,b,y,S):null;case jp:return A=y._init,p(g,b,A(y._payload),S)}if(b_(y)||Rw(y))return A!==null?null:d(g,b,y,S,null);SE(g,y)}return null}function f(g,b,y,S,A){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(y)||null,o(b,g,""+S,A);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case hE:return g=g.get(S.key===null?y:S.key)||null,l(b,g,S,A);case by:return g=g.get(S.key===null?y:S.key)||null,u(b,g,S,A);case jp:var k=S._init;return f(g,b,y,k(S._payload),A)}if(b_(S)||Rw(S))return g=g.get(y)||null,d(b,g,S,A,null);SE(b,S)}return null}function m(g,b,y,S){for(var A=null,k=null,M=b,T=b=0,C=null;M!==null&&T<y.length;T++){M.index>T?(C=M,M=null):C=M.sibling;var R=p(g,M,y[T],S);if(R===null){M===null&&(M=C);break}t&&M&&R.alternate===null&&e(g,M),b=s(R,b,T),k===null?A=R:k.sibling=R,k=R,M=C}if(T===y.length)return n(g,M),ls&&Yg(g,T),A;if(M===null){for(;T<y.length;T++)M=h(g,y[T],S),M!==null&&(b=s(M,b,T),k===null?A=M:k.sibling=M,k=M);return ls&&Yg(g,T),A}for(M=r(g,M);T<y.length;T++)C=f(M,g,T,y[T],S),C!==null&&(t&&C.alternate!==null&&M.delete(C.key===null?T:C.key),b=s(C,b,T),k===null?A=C:k.sibling=C,k=C);return t&&M.forEach(function(P){return e(g,P)}),ls&&Yg(g,T),A}function x(g,b,y,S){var A=Rw(y);if(typeof A!="function")throw Error(Vt(150));if(y=A.call(y),y==null)throw Error(Vt(151));for(var k=A=null,M=b,T=b=0,C=null,R=y.next();M!==null&&!R.done;T++,R=y.next()){M.index>T?(C=M,M=null):C=M.sibling;var P=p(g,M,R.value,S);if(P===null){M===null&&(M=C);break}t&&M&&P.alternate===null&&e(g,M),b=s(P,b,T),k===null?A=P:k.sibling=P,k=P,M=C}if(R.done)return n(g,M),ls&&Yg(g,T),A;if(M===null){for(;!R.done;T++,R=y.next())R=h(g,R.value,S),R!==null&&(b=s(R,b,T),k===null?A=R:k.sibling=R,k=R);return ls&&Yg(g,T),A}for(M=r(g,M);!R.done;T++,R=y.next())R=f(M,g,T,R.value,S),R!==null&&(t&&R.alternate!==null&&M.delete(R.key===null?T:R.key),b=s(R,b,T),k===null?A=R:k.sibling=R,k=R);return t&&M.forEach(function(j){return e(g,j)}),ls&&Yg(g,T),A}function v(g,b,y,S){if(typeof y=="object"&&y!==null&&y.type===wy&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case hE:e:{for(var A=y.key,k=b;k!==null;){if(k.key===A){if(A=y.type,A===wy){if(k.tag===7){n(g,k.sibling),b=i(k,y.props.children),b.return=g,g=b;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===jp&&jU(A)===k.type){n(g,k.sibling),b=i(k,y.props),b.ref=Dw(g,k,y),b.return=g,g=b;break e}n(g,k);break}else e(g,k);k=k.sibling}y.type===wy?(b=O0(y.props.children,g.mode,S,y.key),b.return=g,g=b):(S=jC(y.type,y.key,y.props,null,g.mode,S),S.ref=Dw(g,b,y),S.return=g,g=S)}return a(g);case by:e:{for(k=y.key;b!==null;){if(b.key===k)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){n(g,b.sibling),b=i(b,y.children||[]),b.return=g,g=b;break e}else{n(g,b);break}else e(g,b);b=b.sibling}b=W3(y,g.mode,S),b.return=g,g=b}return a(g);case jp:return k=y._init,v(g,b,k(y._payload),S)}if(b_(y))return m(g,b,y,S);if(Rw(y))return x(g,b,y,S);SE(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(n(g,b.sibling),b=i(b,y),b.return=g,g=b):(n(g,b),b=V3(y,g.mode,S),b.return=g,g=b),a(g)):n(g,b)}return v}var Ib=PX(!0),LX=PX(!1),jN=rg(null),PN=null,Ty=null,jB=null;function PB(){jB=Ty=PN=null}function LB(t){var e=jN.current;Qi(jN),t._currentValue=e}function NL(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Jy(t,e){PN=t,jB=Ty=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Vl=!0),t.firstContext=null)}function bu(t){var e=t._currentValue;if(jB!==t)if(t={context:t,memoizedValue:e,next:null},Ty===null){if(PN===null)throw Error(Vt(308));Ty=t,PN.dependencies={lanes:0,firstContext:t}}else Ty=Ty.next=t;return e}var h0=null;function IB(t){h0===null?h0=[t]:h0.push(t)}function IX(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,IB(e)):(n.next=i.next,i.next=n),e.interleaved=n,Nf(t,r)}function Nf(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Pp=!1;function DB(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DX(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Sf(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function mm(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ei&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Nf(t,n)}return i=r.interleaved,i===null?(e.next=e,IB(r)):(e.next=i.next,i.next=e),r.interleaved=e,Nf(t,n)}function kC(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,wB(t,n)}}function PU(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function LN(t,e,n,r){var i=t.updateQueue;Pp=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;a=0,d=u=l=null,o=s;do{var p=o.lane,f=o.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=t,x=o;switch(p=e,f=n,x.tag){case 1:if(m=x.payload,typeof m=="function"){h=m.call(f,h,p);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,p=typeof m=="function"?m.call(f,h,p):m,p==null)break e;h=ks({},h,p);break e;case 2:Pp=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[o]:p.push(o))}else f={eventTime:f,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=f,l=h):d=d.next=f,a|=p;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Q0|=a,t.lanes=a,t.memoizedState=h}}function LU(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Vt(191,i));i.call(r)}}}var US={},fh=rg(US),T2=rg(US),M2=rg(US);function f0(t){if(t===US)throw Error(Vt(174));return t}function BB(t,e){switch(Hi(M2,e),Hi(T2,t),Hi(fh,US),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:lL(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=lL(e,t)}Qi(fh),Hi(fh,e)}function Db(){Qi(fh),Qi(T2),Qi(M2)}function BX(t){f0(M2.current);var e=f0(fh.current),n=lL(e,t.type);e!==n&&(Hi(T2,t),Hi(fh,n))}function FB(t){T2.current===t&&(Qi(fh),Qi(T2))}var ys=rg(0);function IN(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var F3=[];function OB(){for(var t=0;t<F3.length;t++)F3[t]._workInProgressVersionPrimary=null;F3.length=0}var CC=Of.ReactCurrentDispatcher,O3=Of.ReactCurrentBatchConfig,Z0=0,As=null,ka=null,Wa=null,DN=!1,G_=!1,R2=0,hhe=0;function Ro(){throw Error(Vt(321))}function zB(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!vd(t[n],e[n]))return!1;return!0}function UB(t,e,n,r,i,s){if(Z0=s,As=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,CC.current=t===null||t.memoizedState===null?ghe:xhe,t=n(r,i),G_){s=0;do{if(G_=!1,R2=0,25<=s)throw Error(Vt(301));s+=1,Wa=ka=null,e.updateQueue=null,CC.current=vhe,t=n(r,i)}while(G_)}if(CC.current=BN,e=ka!==null&&ka.next!==null,Z0=0,Wa=ka=As=null,DN=!1,e)throw Error(Vt(300));return t}function HB(){var t=R2!==0;return R2=0,t}function Jd(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wa===null?As.memoizedState=Wa=t:Wa=Wa.next=t,Wa}
vendor: 5,363 bytes, line 38
38function wu(){if(ka===null){var t=As.alternate;t=t!==null?t.memoizedState:null}else t=ka.next;var e=Wa===null?As.memoizedState:Wa.next;if(e!==null)Wa=e,ka=t;else{if(t===null)throw Error(Vt(310));ka=t,t={memoizedState:ka.memoizedState,baseState:ka.baseState,baseQueue:ka.baseQueue,queue:ka.queue,next:null},Wa===null?As.memoizedState=Wa=t:Wa=Wa.next=t}return Wa}function j2(t,e){return typeof e=="function"?e(t):e}function z3(t){var e=wu(),n=e.queue;if(n===null)throw Error(Vt(311));n.lastRenderedReducer=t;var r=ka,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,u=s;do{var d=u.lane;if((Z0&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=h,a=r):l=l.next=h,As.lanes|=d,Q0|=d}u=u.next}while(u!==null&&u!==s);l===null?a=r:l.next=o,vd(r,e.memoizedState)||(Vl=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,As.lanes|=s,Q0|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function U3(t){var e=wu(),n=e.queue;if(n===null)throw Error(Vt(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);vd(s,e.memoizedState)||(Vl=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function FX(){}function OX(t,e){var n=As,r=wu(),i=e(),s=!vd(r.memoizedState,i);if(s&&(r.memoizedState=i,Vl=!0),r=r.queue,GB(HX.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Wa!==null&&Wa.memoizedState.tag&1){if(n.flags|=2048,P2(9,UX.bind(null,n,r,i,e),void 0,null),Ka===null)throw Error(Vt(349));Z0&30||zX(n,e,i)}return i}function zX(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=As.updateQueue,e===null?(e={lastEffect:null,stores:null},As.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function UX(t,e,n,r){e.value=n,e.getSnapshot=r,GX(e)&&VX(t)}function HX(t,e,n){return n(function(){GX(e)&&VX(t)})}function GX(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!vd(t,n)}catch{return!0}}function VX(t){var e=Nf(t,1);e!==null&&pd(e,t,1,-1)}function IU(t){var e=Jd();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:j2,lastRenderedState:t},e.queue=t,t=t.dispatch=mhe.bind(null,As,t),[e.memoizedState,t]}function P2(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=As.updateQueue,e===null?(e={lastEffect:null,stores:null},As.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function WX(){return wu().memoizedState}function NC(t,e,n,r){var i=Jd();As.flags|=t,i.memoizedState=P2(1|e,n,void 0,r===void 0?null:r)}function i5(t,e,n,r){var i=wu();r=r===void 0?null:r;var s=void 0;if(ka!==null){var a=ka.memoizedState;if(s=a.destroy,r!==null&&zB(r,a.deps)){i.memoizedState=P2(e,n,s,r);return}}As.flags|=t,i.memoizedState=P2(1|e,n,s,r)}function DU(t,e){return NC(8390656,8,t,e)}function GB(t,e){return i5(2048,8,t,e)}function $X(t,e){return i5(4,2,t,e)}function KX(t,e){return i5(4,4,t,e)}function qX(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function XX(t,e,n){return n=n!=null?n.concat([t]):null,i5(4,4,qX.bind(null,e,t),n)}function VB(){}function YX(t,e){var n=wu();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&zB(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function JX(t,e){var n=wu();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&zB(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function ZX(t,e,n){return Z0&21?(vd(n,e)||(n=rX(),As.lanes|=n,Q0|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Vl=!0),t.memoizedState=n)}function fhe(t,e){var n=Ai;Ai=n!==0&&4>n?n:4,t(!0);var r=O3.transition;O3.transition={};try{t(!1),e()}finally{Ai=n,O3.transition=r}}function QX(){return wu().memoizedState}function phe(t,e,n){var r=xm(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eY(t))tY(e,n);else if(n=IX(t,e,n,r),n!==null){var i=gl();pd(n,t,r,i),nY(n,e,r)}}function mhe(t,e,n){var r=xm(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eY(t))tY(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,vd(o,a)){var l=e.interleaved;l===null?(i.next=i,IB(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=IX(t,e,i,r),n!==null&&(i=gl(),pd(n,t,r,i),nY(n,e,r))}}function eY(t){var e=t.alternate;return t===As||e!==null&&e===As}function tY(t,e){G_=DN=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function nY(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,wB(t,n)}}var BN={readContext:bu,useCallback:Ro,useContext:Ro,useEffect:Ro,useImperativeHandle:Ro,useInsertionEffect:Ro,useLayoutEffect:Ro,useMemo:Ro,useReducer:Ro,useRef
vendor: 7,311 bytes, lines 38-40
38:Ro,useState:Ro,useDebugValue:Ro,useDeferredValue:Ro,useTransition:Ro,useMutableSource:Ro,useSyncExternalStore:Ro,useId:Ro,unstable_isNewReconciler:!1},ghe={readContext:bu,useCallback:function(t,e){return Jd().memoizedState=[t,e===void 0?null:e],t},useContext:bu,useEffect:DU,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,NC(4194308,4,qX.bind(null,e,t),n)},useLayoutEffect:function(t,e){return NC(4194308,4,t,e)},useInsertionEffect:function(t,e){return NC(4,2,t,e)},useMemo:function(t,e){var n=Jd();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jd();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=phe.bind(null,As,t),[r.memoizedState,t]},useRef:function(t){var e=Jd();return t={current:t},e.memoizedState=t},useState:IU,useDebugValue:VB,useDeferredValue:function(t){return Jd().memoizedState=t},useTransition:function(){var t=IU(!1),e=t[0];return t=fhe.bind(null,t[1]),Jd().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=As,i=Jd();if(ls){if(n===void 0)throw Error(Vt(407));n=n()}else{if(n=e(),Ka===null)throw Error(Vt(349));Z0&30||zX(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,DU(HX.bind(null,r,s,t),[t]),r.flags|=2048,P2(9,UX.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Jd(),e=Ka.identifierPrefix;if(ls){var n=vf,r=xf;n=(r&~(1<<32-fd(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=R2++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=hhe++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},xhe={readContext:bu,useCallback:YX,useContext:bu,useEffect:GB,useImperativeHandle:XX,useInsertionEffect:$X,useLayoutEffect:KX,useMemo:JX,useReducer:z3,useRef:WX,useState:function(){return z3(j2)},useDebugValue:VB,useDeferredValue:function(t){var e=wu();return ZX(e,ka.memoizedState,t)},useTransition:function(){var t=z3(j2)[0],e=wu().memoizedState;return[t,e]},useMutableSource:FX,useSyncExternalStore:OX,useId:QX,unstable_isNewReconciler:!1},vhe={readContext:bu,useCallback:YX,useContext:bu,useEffect:GB,useImperativeHandle:XX,useInsertionEffect:$X,useLayoutEffect:KX,useMemo:JX,useReducer:U3,useRef:WX,useState:function(){return U3(j2)},useDebugValue:VB,useDeferredValue:function(t){var e=wu();return ka===null?e.memoizedState=t:ZX(e,ka.memoizedState,t)},useTransition:function(){var t=U3(j2)[0],e=wu().memoizedState;return[t,e]},useMutableSource:FX,useSyncExternalStore:OX,useId:QX,unstable_isNewReconciler:!1};function nd(t,e){if(t&&t.defaultProps){e=ks({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function TL(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:ks({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var s5={isMounted:function(t){return(t=t._reactInternals)?Cx(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=gl(),i=xm(t),s=Sf(r,i);s.payload=e,n!=null&&(s.callback=n),e=mm(t,s,i),e!==null&&(pd(e,t,i,r),kC(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=gl(),i=xm(t),s=Sf(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=mm(t,s,i),e!==null&&(pd(e,t,i,r),kC(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=gl(),r=xm(t),i=Sf(n,r);i.tag=2,e!=null&&(i.callback=e),e=mm(t,i,r),e!==null&&(pd(e,t,r,n),kC(e,t,r))}};function BU(t,e,n,r,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,a):e.prototype&&e.prototype.isPureReactComponent?!E2(n,r)||!E2(i,s):!0}function rY(t,e,n){var r=!1,i=jm,s=e.contextType;return typeof s=="object"&&s!==null?s=bu(s):(i=Kl(e)?Y0:Ko.current,r=e.contextTypes,s=(r=r!=null)?Pb(t,i):jm),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=s5,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function FU(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&s5.enqueueReplaceState(e,e.state,null)}function ML(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},DB(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=bu(s):(s=Kl(e)?Y0:Ko.current,i.context=Pb(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(TL(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&s5.enqueueReplaceState(i,i.state,null),LN(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Bb(t,e){try{var n="",r=e;do n+=$ue(r),r=r.return;while(r);var i=n}catch(s){i=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function H3(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function RL(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var yhe=typeof WeakMap=="function"?WeakMap:Map;function iY(t,e,n){n=Sf(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){ON||(ON=!0,UL=r),RL(t,e)},n}function sY(t,e,n){n=Sf(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){RL(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){RL(t,e),typeof r!="function"&&(gm===null?gm=new Set([this]):gm.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function OU(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new yhe;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=Phe.bind(null,t,e,n),e.then(t,t))}function zU(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function UU(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Sf(-1,1),e.tag=2,mm(n,e,1))),n.lanes|=1),t)}var bhe=Of.ReactCurrentOwner,Vl=!1;function ul(t,e,n,r){e.child=t===null?LX(e,null,n,r):Ib(e,t.child,n,r)}function HU(t,e,n,r,i){n=n.render;var s=e.ref;return Jy(e,i),r=UB(t,e,n,r,s,i),n=HB(),t!==null&&!Vl?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Tf(t,e,i)):(ls&&n&&TB(e),e.flags|=1,ul(t,e,r,i),e.child)}function GU(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!ZB(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,aY(t,e,s,r,i)):(t=jC(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:E2,n(a,r)&&t.ref===e.ref)return Tf(t,e,i)}
vendor: 8,998 bytes, line 40
40return e.flags|=1,t=vm(s,r),t.ref=e.ref,t.return=e,e.child=t}function aY(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(E2(s,r)&&t.ref===e.ref)if(Vl=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Vl=!0);else return e.lanes=t.lanes,Tf(t,e,i)}return jL(t,e,n,r,i)}function oY(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Hi(Ry,gc),gc|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Hi(Ry,gc),gc|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Hi(Ry,gc),gc|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,Hi(Ry,gc),gc|=r;return ul(t,e,i,n),e.child}function lY(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function jL(t,e,n,r,i){var s=Kl(n)?Y0:Ko.current;return s=Pb(e,s),Jy(e,i),n=UB(t,e,n,r,s,i),r=HB(),t!==null&&!Vl?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Tf(t,e,i)):(ls&&r&&TB(e),e.flags|=1,ul(t,e,n,i),e.child)}function VU(t,e,n,r,i){if(Kl(n)){var s=!0;TN(e)}else s=!1;if(Jy(e,i),e.stateNode===null)TC(t,e),rY(e,n,r),ML(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=bu(u):(u=Kl(n)?Y0:Ko.current,u=Pb(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&FU(e,a,r,u),Pp=!1;var p=e.memoizedState;a.state=p,LN(e,r,a,i),l=e.memoizedState,o!==r||p!==l||$l.current||Pp?(typeof d=="function"&&(TL(e,n,d,r),l=e.memoizedState),(o=Pp||BU(e,n,o,r,p,l,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,DX(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:nd(e.type,o),a.props=u,h=e.pendingProps,p=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=bu(l):(l=Kl(n)?Y0:Ko.current,l=Pb(e,l));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==h||p!==l)&&FU(e,a,r,l),Pp=!1,p=e.memoizedState,a.state=p,LN(e,r,a,i);var m=e.memoizedState;o!==h||p!==m||$l.current||Pp?(typeof f=="function"&&(TL(e,n,f,r),m=e.memoizedState),(u=Pp||BU(e,n,u,r,p,m,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),a.props=r,a.state=m,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return PL(t,e,n,r,s,i)}function PL(t,e,n,r,i,s){lY(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&TU(e,n,!1),Tf(t,e,s);r=e.stateNode,bhe.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=Ib(e,t.child,null,s),e.child=Ib(e,null,o,s)):ul(t,e,o,s),e.memoizedState=r.state,i&&TU(e,n,!0),e.child}function cY(t){var e=t.stateNode;e.pendingContext?NU(t,e.pendingContext,e.pendingContext!==e.context):e.context&&NU(t,e.context,!1),BB(t,e.containerInfo)}function WU(t,e,n,r,i){return Lb(),RB(i),e.flags|=256,ul(t,e,n,r),e.child}var LL={dehydrated:null,treeContext:null,retryLane:0};function IL(t){return{baseLanes:t,cachePool:null,transitions:null}}function uY(t,e,n){var r=e.pendingProps,i=ys.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Hi(ys,i&1),t===null)return CL(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,s?(r=e.mode,s=e.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=l5(a,r,0,null),t=O0(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=IL(n),e.memoizedState=LL,t):WB(e,a));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return whe(t,e,a,r,o,i,n);if(s){s=r.fallback,a=e.mode,i=t.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=vm(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=vm(o,s):(s=O0(s,a,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,a=t.child.memoizedState,a=a===null?IL(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~n,e.memoizedState=LL,r}return s=t.child,t=s.sibling,r=vm(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function WB(t,e){return e=l5({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function AE(t,e,n,r){return r!==null&&RB(r),Ib(e,t.child,null,n),t=WB(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function whe(t,e,n,r,i,s,a){if(n)return e.flags&256?(e.flags&=-257,r=H3(Error(Vt(422))),AE(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=l5({mode:"visible",children:r.children},i,0,null),s=O0(s,i,a,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Ib(e,t.child,null,a),e.child.memoizedState=IL(a),e.memoizedState=LL,s);if(!(e.mode&1))return AE(t,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(Vt(419)),r=H3(s,r,void 0),AE(t,e,a,r)}if(o=(a&t.childLanes)!==0,Vl||o){if(r=Ka,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Nf(t,i),pd(r,t,i,-1))}return JB(),r=H3(Error(Vt(421))),AE(t,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Lhe.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,_c=pm(i.nextSibling),Cc=e,ls=!0,cd=null,t!==null&&(su[au++]=xf,su[au++]=vf,su[au++]=J0,xf=t.id,vf=t.overflow,J0=e),e=WB(e,r.children),e.flags|=4096,e)}function $U(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),NL(t.return,e,n)}function G3(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function dY(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(ul(t,e,r.children,n),r=ys.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$U(t,n,e);else if(t.tag===19)$U(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Hi(ys,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&IN(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),G3(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&IN(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}G3(e,!0,n,null,s);break;case"together":G3(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function TC(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,907 bytes, line 40
40function Tf(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Q0|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Vt(153));if(e.child!==null){for(t=e.child,n=vm(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=vm(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function _he(t,e,n){switch(e.tag){case 3:cY(e),Lb();break;case 5:BX(e);break;case 1:Kl(e.type)&&TN(e);break;case 4:BB(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Hi(jN,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Hi(ys,ys.current&1),e.flags|=128,null):n&e.child.childLanes?uY(t,e,n):(Hi(ys,ys.current&1),t=Tf(t,e,n),t!==null?t.sibling:null);Hi(ys,ys.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return dY(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Hi(ys,ys.current),r)break;return null;case 22:case 23:return e.lanes=0,oY(t,e,n)}return Tf(t,e,n)}var hY,DL,fY,pY;hY=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};DL=function(){};fY=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,f0(fh.current);var s=null;switch(n){case"input":i=iL(t,i),r=iL(t,r),s=[];break;case"select":i=ks({},i,{value:void 0}),r=ks({},r,{value:void 0}),s=[];break;case"textarea":i=oL(t,i),r=oL(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=CN)}cL(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(v2.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(v2.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Xi("scroll",t),s||o===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};pY=function(t,e,n,r){n!==r&&(e.flags|=4)};function Bw(t,e){if(!ls)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function jo(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function She(t,e,n){var r=e.pendingProps;switch(MB(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jo(e),null;case 1:return Kl(e.type)&&NN(),jo(e),null;case 3:return r=e.stateNode,Db(),Qi($l),Qi(Ko),OB(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(_E(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,cd!==null&&(VL(cd),cd=null))),DL(t,e),jo(e),null;case 5:FB(e);var i=f0(M2.current);if(n=e.type,t!==null&&e.stateNode!=null)fY(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Vt(166));return jo(e),null}if(t=f0(fh.current),_E(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[sh]=e,r[N2]=s,t=(e.mode&1)!==0,n){case"dialog":Xi("cancel",r),Xi("close",r);break;case"iframe":case"object":case"embed":Xi("load",r);break;case"video":case"audio":for(i=0;i<__.length;i++)Xi(__[i],r);break;case"source":Xi("error",r);break;case"img":case"image":case"link":Xi("error",r),Xi("load",r);break;case"details":Xi("toggle",r);break;case"input":tU(r,s),Xi("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Xi("invalid",r);break;case"textarea":rU(r,s),Xi("invalid",r)}cL(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];
vendor: 32,572 bytes, line 40
40a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&wE(r.textContent,o,t),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&wE(r.textContent,o,t),i=["children",""+o]):v2.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Xi("scroll",r)}switch(n){case"input":fE(r),nU(r,s,!0);break;case"textarea":fE(r),iU(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=CN)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Hq(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[sh]=e,t[N2]=r,hY(t,e,!1,!1),e.stateNode=t;e:{switch(a=uL(n,r),n){case"dialog":Xi("cancel",t),Xi("close",t),i=r;break;case"iframe":case"object":case"embed":Xi("load",t),i=r;break;case"video":case"audio":for(i=0;i<__.length;i++)Xi(__[i],t);i=r;break;case"source":Xi("error",t),i=r;break;case"img":case"image":case"link":Xi("error",t),Xi("load",t),i=r;break;case"details":Xi("toggle",t),i=r;break;case"input":tU(t,r),i=iL(t,r),Xi("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=ks({},r,{value:void 0}),Xi("invalid",t);break;case"textarea":rU(t,r),i=oL(t,r),Xi("invalid",t);break;default:i=r}cL(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?Wq(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Gq(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&y2(t,l):typeof l=="number"&&y2(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(v2.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Xi("scroll",t):l!=null&&mB(t,s,l,a))}switch(n){case"input":fE(t),nU(t,r,!1);break;case"textarea":fE(t),iU(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Rm(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?Ky(t,!!r.multiple,s,!1):r.defaultValue!=null&&Ky(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=CN)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return jo(e),null;case 6:if(t&&e.stateNode!=null)pY(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Vt(166));if(n=f0(M2.current),f0(fh.current),_E(e)){if(r=e.stateNode,n=e.memoizedProps,r[sh]=e,(s=r.nodeValue!==n)&&(t=Cc,t!==null))switch(t.tag){case 3:wE(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&wE(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sh]=e,e.stateNode=r}return jo(e),null;case 13:if(Qi(ys),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ls&&_c!==null&&e.mode&1&&!(e.flags&128))jX(),Lb(),e.flags|=98560,s=!1;else if(s=_E(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(Vt(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Vt(317));s[sh]=e}else Lb(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;jo(e),s=!1}else cd!==null&&(VL(cd),cd=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||ys.current&1?Ca===0&&(Ca=3):JB())),e.updateQueue!==null&&(e.flags|=4),jo(e),null);case 4:return Db(),DL(t,e),t===null&&k2(e.stateNode.containerInfo),jo(e),null;case 10:return LB(e.type._context),jo(e),null;case 17:return Kl(e.type)&&NN(),jo(e),null;case 19:if(Qi(ys),s=e.memoizedState,s===null)return jo(e),null;if(r=(e.flags&128)!==0,a=s.rendering,a===null)if(r)Bw(s,!1);else{if(Ca!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=IN(t),a!==null){for(e.flags|=128,Bw(s,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Hi(ys,ys.current&1|2),e.child}t=t.sibling}s.tail!==null&&qs()>Fb&&(e.flags|=128,r=!0,Bw(s,!1),e.lanes=4194304)}else{if(!r)if(t=IN(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Bw(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!ls)return jo(e),null}else 2*qs()-s.renderingStartTime>Fb&&n!==1073741824&&(e.flags|=128,r=!0,Bw(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(n=s.last,n!==null?n.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=qs(),e.sibling=null,n=ys.current,Hi(ys,r?n&1|2:n&1),e):(jo(e),null);case 22:case 23:return YB(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?gc&1073741824&&(jo(e),e.subtreeFlags&6&&(e.flags|=8192)):jo(e),null;case 24:return null;case 25:return null}throw Error(Vt(156,e.tag))}function Ahe(t,e){switch(MB(e),e.tag){case 1:return Kl(e.type)&&NN(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Db(),Qi($l),Qi(Ko),OB(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return FB(e),null;case 13:if(Qi(ys),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Vt(340));Lb()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Qi(ys),null;case 4:return Db(),null;case 10:return LB(e.type._context),null;case 22:case 23:return YB(),null;case 24:return null;default:return null}}var EE=!1,Go=!1,Ehe=typeof WeakSet=="function"?WeakSet:Set,xn=null;function My(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ds(t,e,r)}else n.current=null}function BL(t,e,n){try{n()}catch(r){Ds(t,e,r)}}var KU=!1;function khe(t,e){if(bL=AN,t=yX(),NB(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,h=t,p=null;t:for(;;){for(var f;h!==n||i!==0&&h.nodeType!==3||(o=a+i),h!==s||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(f=h.firstChild)!==null;)p=h,h=f;for(;;){if(h===t)break t;if(p===n&&++u===i&&(o=a),p===s&&++d===r&&(l=a),(f=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=f}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wL={focusedElem:t,selectionRange:n},AN=!1,xn=e;xn!==null;)if(e=xn,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xn=t;else for(;xn!==null;){e=xn;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var x=m.memoizedProps,v=m.memoizedState,g=e.stateNode,b=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:nd(e.type,x),v);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Vt(163))}}catch(S){Ds(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,xn=t;break}xn=e.return}return m=KU,KU=!1,m}function V_(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&BL(e,n,s)}i=i.next}while(i!==r)}}function a5(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function FL(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function mY(t){var e=t.alternate;e!==null&&(t.alternate=null,mY(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[sh],delete e[N2],delete e[AL],delete e[lhe],delete e[che])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function gY(t){return t.tag===5||t.tag===3||t.tag===4}function qU(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gY(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function OL(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=CN));else if(r!==4&&(t=t.child,t!==null))for(OL(t,e,n),t=t.sibling;t!==null;)OL(t,e,n),t=t.sibling}function zL(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(zL(t,e,n),t=t.sibling;t!==null;)zL(t,e,n),t=t.sibling}var ho=null,od=!1;function dp(t,e,n){for(n=n.child;n!==null;)xY(t,e,n),n=n.sibling}function xY(t,e,n){if(hh&&typeof hh.onCommitFiberUnmount=="function")try{hh.onCommitFiberUnmount(ZT,n)}catch{}switch(n.tag){case 5:Go||My(n,e);case 6:var r=ho,i=od;ho=null,dp(t,e,n),ho=r,od=i,ho!==null&&(od?(t=ho,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ho.removeChild(n.stateNode));break;case 18:ho!==null&&(od?(t=ho,n=n.stateNode,t.nodeType===8?D3(t.parentNode,n):t.nodeType===1&&D3(t,n),S2(t)):D3(ho,n.stateNode));break;case 4:r=ho,i=od,ho=n.stateNode.containerInfo,od=!0,dp(t,e,n),ho=r,od=i;break;case 0:case 11:case 14:case 15:if(!Go&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&BL(n,e,a),i=i.next}while(i!==r)}dp(t,e,n);break;case 1:if(!Go&&(My(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Ds(n,e,o)}dp(t,e,n);break;case 21:dp(t,e,n);break;case 22:n.mode&1?(Go=(r=Go)||n.memoizedState!==null,dp(t,e,n),Go=r):dp(t,e,n);break;default:dp(t,e,n)}}function XU(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Ehe),e.forEach(function(r){var i=Ihe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Wu(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:ho=o.stateNode,od=!1;break e;case 3:ho=o.stateNode.containerInfo,od=!0;break e;case 4:ho=o.stateNode.containerInfo,od=!0;break e}o=o.return}if(ho===null)throw Error(Vt(160));xY(s,a,i),ho=null,od=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Ds(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)vY(e,t),e=e.sibling}function vY(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Wu(e,t),$d(t),r&4){try{V_(3,t,t.return),a5(3,t)}catch(x){Ds(t,t.return,x)}try{V_(5,t,t.return)}catch(x){Ds(t,t.return,x)}}break;case 1:Wu(e,t),$d(t),r&512&&n!==null&&My(n,n.return);break;case 5:if(Wu(e,t),$d(t),r&512&&n!==null&&My(n,n.return),t.flags&32){var i=t.stateNode;try{y2(i,"")}catch(x){Ds(t,t.return,x)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,a=n!==null?n.memoizedProps:s,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&zq(i,s),uL(o,a);var u=uL(o,s);for(a=0;a<l.length;a+=2){var d=l[a],h=l[a+1];d==="style"?Wq(i,h):d==="dangerouslySetInnerHTML"?Gq(i,h):d==="children"?y2(i,h):mB(i,d,h,u)}switch(o){case"input":sL(i,s);break;case"textarea":Uq(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?Ky(i,!!s.multiple,f,!1):p!==!!s.multiple&&(s.defaultValue!=null?Ky(i,!!s.multiple,s.defaultValue,!0):Ky(i,!!s.multiple,s.multiple?[]:"",!1))}i[N2]=s}catch(x){Ds(t,t.return,x)}}break;case 6:if(Wu(e,t),$d(t),r&4){if(t.stateNode===null)throw Error(Vt(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(x){Ds(t,t.return,x)}}break;case 3:if(Wu(e,t),$d(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{S2(e.containerInfo)}catch(x){Ds(t,t.return,x)}break;case 4:Wu(e,t),$d(t);break;case 13:Wu(e,t),$d(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(qB=qs())),r&4&&XU(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Go=(u=Go)||d,Wu(e,t),Go=u):Wu(e,t),$d(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(xn=t,d=t.child;d!==null;){for(h=xn=d;xn!==null;){switch(p=xn,f=p.child,p.tag){case 0:case 11:case 14:case 15:V_(4,p,p.return);break;case 1:My(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(x){Ds(r,n,x)}}break;case 5:My(p,p.return);break;case 22:if(p.memoizedState!==null){JU(h);continue}}f!==null?(f.return=p,xn=f):JU(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=h.stateNode,l=h.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=Vq("display",a))}catch(x){Ds(t,t.return,x)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(x){Ds(t,t.return,x)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Wu(e,t),$d(t),r&4&&XU(t);break;case 21:break;default:Wu(e,t),$d(t)}}function $d(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(gY(n)){var r=n;break e}n=n.return}throw Error(Vt(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(y2(i,""),r.flags&=-33);var s=qU(t);zL(t,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=qU(t);OL(t,o,a);break;default:throw Error(Vt(161))}}catch(l){Ds(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Che(t,e,n){xn=t,yY(t)}function yY(t,e,n){for(var r=(t.mode&1)!==0;xn!==null;){var i=xn,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||EE;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Go;o=EE;var u=Go;if(EE=a,(Go=l)&&!u)for(xn=i;xn!==null;)a=xn,l=a.child,a.tag===22&&a.memoizedState!==null?ZU(i):l!==null?(l.return=a,xn=l):ZU(i);for(;s!==null;)xn=s,yY(s),s=s.sibling;xn=i,EE=o,Go=u}YU(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,xn=s):YU(t)}}function YU(t){for(;xn!==null;){var e=xn;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Go||a5(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Go)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:nd(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&LU(e,s,r);break;case 3:var a=e.updateQueue;if(a!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}LU(e,a,n)}break;case 5:var o=e.stateNode;if(n===null&&e.flags&4){n=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&S2(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Vt(163))}Go||e.flags&512&&FL(e)}catch(p){Ds(e,e.return,p)}}if(e===t){xn=null;break}if(n=e.sibling,n!==null){n.return=e.return,xn=n;break}xn=e.return}}function JU(t){for(;xn!==null;){var e=xn;if(e===t){xn=null;break}var n=e.sibling;if(n!==null){n.return=e.return,xn=n;break}xn=e.return}}function ZU(t){for(;xn!==null;){var e=xn;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{a5(4,e)}catch(l){Ds(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Ds(e,i,l)}}var s=e.return;try{FL(e)}catch(l){Ds(e,s,l)}break;case 5:var a=e.return;try{FL(e)}catch(l){Ds(e,a,l)}}}catch(l){Ds(e,e.return,l)}if(e===t){xn=null;break}var o=e.sibling;if(o!==null){o.return=e.return,xn=o;break}xn=e.return}}var Nhe=Math.ceil,FN=Of.ReactCurrentDispatcher,$B=Of.ReactCurrentOwner,fu=Of.ReactCurrentBatchConfig,ei=0,Ka=null,ha=null,go=0,gc=0,Ry=rg(0),Ca=0,L2=null,Q0=0,o5=0,KB=0,W_=null,Ul=null,qB=0,Fb=1/0,of=null,ON=!1,UL=null,gm=null,kE=!1,rm=null,zN=0,$_=0,HL=null,MC=-1,RC=0;function gl(){return ei&6?qs():MC!==-1?MC:MC=qs()}function xm(t){return t.mode&1?ei&2&&go!==0?go&-go:dhe.transition!==null?(RC===0&&(RC=rX()),RC):(t=Ai,t!==0||(t=window.event,t=t===void 0?16:uX(t.type)),t):1}function pd(t,e,n,r){if(50<$_)throw $_=0,HL=null,Error(Vt(185));FS(t,n,r),(!(ei&2)||t!==Ka)&&(t===Ka&&(!(ei&2)&&(o5|=n),Ca===4&&zp(t,go)),ql(t,r),n===1&&ei===0&&!(e.mode&1)&&(Fb=qs()+500,r5&&ig()))}function ql(t,e){var n=t.callbackNode;dde(t,e);var r=SN(t,t===Ka?go:0);if(r===0)n!==null&&oU(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&oU(n),e===1)t.tag===0?uhe(QU.bind(null,t)):TX(QU.bind(null,t)),ahe(function(){!(ei&6)&&ig()}),n=null;else{switch(iX(r)){case 1:n=bB;break;case 4:n=tX;break;case 16:n=_N;break;case 536870912:n=nX;break;default:n=_N}n=CY(n,bY.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function bY(t,e){if(MC=-1,RC=0,ei&6)throw Error(Vt(327));var n=t.callbackNode;if(Zy()&&t.callbackNode!==n)return null;var r=SN(t,t===Ka?go:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=UN(t,r);else{e=r;var i=ei;ei|=2;var s=_Y();(Ka!==t||go!==e)&&(of=null,Fb=qs()+500,F0(t,e));do try{Rhe();break}catch(o){wY(t,o)}while(!0);PB(),FN.current=s,ei=i,ha!==null?e=0:(Ka=null,go=0,e=Ca)}if(e!==0){if(e===2&&(i=mL(t),i!==0&&(r=i,e=GL(t,i))),e===1)throw n=L2,F0(t,0),zp(t,r),ql(t,qs()),n;if(e===6)zp(t,r);else{if(i=t.current.alternate,!(r&30)&&!The(i)&&(e=UN(t,r),e===2&&(s=mL(t),s!==0&&(r=s,e=GL(t,s))),e===1))throw n=L2,F0(t,0),zp(t,r),ql(t,qs()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(Vt(345));case 2:Jg(t,Ul,of);break;case 3:if(zp(t,r),(r&130023424)===r&&(e=qB+500-qs(),10<e)){if(SN(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){gl(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=SL(Jg.bind(null,t,Ul,of),e);break}Jg(t,Ul,of);break;case 4:if(zp(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var a=31-fd(r);s=1<<a,a=e[a],a>i&&(i=a),r&=~s}if(r=i,r=qs()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Nhe(r/1960))-r,10<r){t.timeoutHandle=SL(Jg.bind(null,t,Ul,of),r);break}Jg(t,Ul,of);break;case 5:Jg(t,Ul,of);break;default:throw Error(Vt(329))}}}return ql(t,qs()),t.callbackNode===n?bY.bind(null,t):null}function GL(t,e){var n=W_;return t.current.memoizedState.isDehydrated&&(F0(t,e).flags|=256),t=UN(t,e),t!==2&&(e=Ul,Ul=n,e!==null&&VL(e)),t}function VL(t){Ul===null?Ul=t:Ul.push.apply(Ul,t)}function The(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!vd(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function zp(t,e){for(e&=~KB,e&=~o5,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-fd(e),r=1<<n;t[n]=-1,e&=~r}}function QU(t){if(ei&6)throw Error(Vt(327));Zy();var e=SN(t,0);if(!(e&1))return ql(t,qs()),null;var n=UN(t,e);if(t.tag!==0&&n===2){var r=mL(t);r!==0&&(e=r,n=GL(t,r))}if(n===1)throw n=L2,F0(t,0),zp(t,e),ql(t,qs()),n;if(n===6)throw Error(Vt(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Jg(t,Ul,of),ql(t,qs()),null}function XB(t,e){var n=ei;ei|=1;try{return t(e)}finally{ei=n,ei===0&&(Fb=qs()+500,r5&&ig())}}function ex(t){rm!==null&&rm.tag===0&&!(ei&6)&&Zy();var e=ei;ei|=1;var n=fu.transition,r=Ai;try{if(fu.transition=null,Ai=1,t)return t()}finally{Ai=r,fu.transition=n,ei=e,!(ei&6)&&ig()}}function YB(){gc=Ry.current,Qi(Ry)}function F0(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,she(n)),ha!==null)for(n=ha.return;n!==null;){var r=n;switch(MB(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&NN();break;case 3:Db(),Qi($l),Qi(Ko),OB();break;case 5:FB(r);break;case 4:Db();break;case 13:Qi(ys);break;case 19:Qi(ys);break;case 10:LB(r.type._context);break;case 22:case 23:YB()}n=n.return}if(Ka=t,ha=t=vm(t.current,null),go=gc=e,Ca=0,L2=null,KB=o5=Q0=0,Ul=W_=null,h0!==null){for(e=0;e<h0.length;e++)if(n=h0[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}h0=null}return t}function wY(t,e){do{var n=ha;try{if(PB(),CC.current=BN,DN){for(var r=As.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}DN=!1}if(Z0=0,Wa=ka=As=null,G_=!1,R2=0,$B.current=null,n===null||n.return===null){Ca=1,L2=e,ha=null;break}e:{var s=t,a=n.return,o=n,l=e;if(e=go,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=zU(a);if(f!==null){f.flags&=-257,UU(f,a,o,s,e),f.mode&1&&OU(s,u,e),e=f,l=u;var m=e.updateQueue;if(m===null){var x=new Set;x.add(l),e.updateQueue=x}else m.add(l);break e}else{if(!(e&1)){OU(s,u,e),JB();break e}l=Error(Vt(426))}}else if(ls&&o.mode&1){var v=zU(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),UU(v,a,o,s,e),RB(Bb(l,o));break e}}s=l=Bb(l,o),Ca!==4&&(Ca=2),W_===null?W_=[s]:W_.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=iY(s,l,e);PU(s,g);break e;case 1:o=l;var b=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(gm===null||!gm.has(y)))){s.flags|=65536,e&=-e,s.lanes|=e;var S=sY(s,o,e);PU(s,S);break e}}s=s.return}while(s!==null)}AY(n)}catch(A){e=A,ha===n&&n!==null&&(ha=n=n.return);continue}break}while(!0)}function _Y(){var t=FN.current;return FN.current=BN,t===null?BN:t}function JB(){(Ca===0||Ca===3||Ca===2)&&(Ca=4),Ka===null||!(Q0&268435455)&&!(o5&268435455)||zp(Ka,go)}function UN(t,e){var n=ei;ei|=2;var r=_Y();(Ka!==t||go!==e)&&(of=null,F0(t,e));do try{Mhe();break}catch(i){wY(t,i)}while(!0);if(PB(),ei=n,FN.current=r,ha!==null)throw Error(Vt(261));return Ka=null,go=0,Ca}function Mhe(){for(;ha!==null;)SY(ha)}function Rhe(){for(;ha!==null&&!nde();)SY(ha)}function SY(t){var e=kY(t.alternate,t,gc);t.memoizedProps=t.pendingProps,e===null?AY(t):ha=e,$B.current=null}function AY(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Ahe(n,e),n!==null){n.flags&=32767,ha=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ca=6,ha=null;return}}else if(n=She(n,e,gc),n!==null){ha=n;return}if(e=e.sibling,e!==null){ha=e;return}ha=e=t}while(e!==null);Ca===0&&(Ca=5)}function Jg(t,e,n){var r=Ai,i=fu.transition;try{fu.transition=null,Ai=1,jhe(t,e,n,r)}finally{fu.transition=i,Ai=r}return null}function jhe(t,e,n,r){do Zy();while(rm!==null);if(ei&6)throw Error(Vt(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Vt(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(hde(t,s),t===Ka&&(ha=Ka=null,go=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||kE||(kE=!0,CY(_N,function(){return Zy(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=fu.transition,fu.transition=null;var a=Ai;Ai=1;var o=ei;ei|=4,$B.current=null,khe(t,n),vY(n,t),Zde(wL),AN=!!bL,wL=bL=null,t.current=n,Che(n),rde(),ei=o,Ai=a,fu.transition=s}else t.current=n;if(kE&&(kE=!1,rm=t,zN=i),s=t.pendingLanes,s===0&&(gm=null),ade(n.stateNode),ql(t,qs()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ON)throw ON=!1,t=UL,UL=null,t;return zN&1&&t.tag!==0&&Zy(),s=t.pendingLanes,s&1?t===HL?$_++:($_=0,HL=t):$_=0,ig(),null}function Zy(){if(rm!==null){var t=iX(zN),e=fu.transition,n=Ai;try{if(fu.transition=null,Ai=16>t?16:t,rm===null)var r=!1;else{if(t=rm,rm=null,zN=0,ei&6)throw Error(Vt(331));var i=ei;for(ei|=4,xn=t.current;xn!==null;){var s=xn,a=s.child;if(xn.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(xn=u;xn!==null;){var d=xn;switch(d.tag){case 0:case 11:case 15:V_(8,d,s)}var h=d.child;if(h!==null)h.return=d,xn=h;else for(;xn!==null;){d=xn;var p=d.sibling,f=d.return;if(mY(d),d===u){xn=null;break}if(p!==null){p.return=f,xn=p;break}xn=f}}}var m=s.alternate;if(m!==null){var x=m.child;if(x!==null){m.child=null;do{var v=x.sibling;x.sibling=null,x=v}while(x!==null)}}xn=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,xn=a;else e:for(;xn!==null;){if(s=xn,s.flags&2048)switch(s.tag){case 0:case 11:case 15:V_(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,xn=g;break e}xn=s.return}}var b=t.current;for(xn=b;xn!==null;){a=xn;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,xn=y;else e:for(a=b;xn!==null;){if(o=xn,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:a5(9,o)}}catch(A){Ds(o,o.return,A)}if(o===a){xn=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,xn=S;break e}xn=o.return}}if(ei=i,ig(),hh&&typeof hh.onPostCommitFiberRoot=="function")try{hh.onPostCommitFiberRoot(ZT,t)}catch{}r=!0}return r}finally{Ai=n,fu.transition=e}}return!1}function e8(t,e,n){e=Bb(n,e),e=iY(t,e,1),t=mm(t,e,1),e=gl(),t!==null&&(FS(t,1,e),ql(t,e))}function Ds(t,e,n){if(t.tag===3)e8(t,t,n);else for(;e!==null;){if(e.tag===3){e8(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(gm===null||!gm.has(r))){t=Bb(n,t),t=sY(e,t,1),e=mm(e,t,1),t=gl(),e!==null&&(FS(e,1,t),ql(e,t));break}}e=e.return}}function Phe(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=gl(),t.pingedLanes|=t.suspendedLanes&n,Ka===t&&(go&n)===n&&(Ca===4||Ca===3&&(go&130023424)===go&&500>qs()-qB?F0(t,0):KB|=n),ql(t,e)}function EY(t,e){e===0&&(t.mode&1?(e=gE,gE<<=1,!(gE&130023424)&&(gE=4194304)):e=1);var n=gl();t=Nf(t,e),t!==null&&(FS(t,e,n),ql(t,n))}function Lhe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),EY(t,n)}function Ihe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Vt(314))}r!==null&&r.delete(e),EY(t,n)}var kY;kY=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||$l.current)Vl=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Vl=!1,_he(t,e,n);Vl=!!(t.flags&131072)}else Vl=!1,ls&&e.flags&1048576&&MX(e,RN,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;TC(t,e),t=e.pendingProps;var i=Pb(e,Ko.current);Jy(e,n),i=UB(null,e,r,t,i,n);var s=HB();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Kl(r)?(s=!0,TN(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,DB(e),i.updater=s5,e.stateNode=i,i._reactInternals=e,ML(e,r,t,n),e=PL(null,e,r,!0,s,n)):(e.tag=0,ls&&s&&TB(e),ul(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(TC(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Bhe(r),t=nd(r,t),i){case 0:e=jL(null,e,r,t,n);break e;case 1:e=VU(null,e,r,t,n);break e;case 11:e=HU(null,e,r,t,n);break e;case 14:e=GU(null,e,r,nd(r.type,t),n);break e}throw Error(Vt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nd(r,i),jL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nd(r,i),VU(t,e,r,i,n);case 3:e:{if(cY(e),t===null)throw Error(Vt(387));r=e.pendingProps,s=e.memoizedState,i=s.element,DX(t,e),LN(e,r,null,n);var a=e.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Bb(Error(Vt(423)),e),e=WU(t,e,r,n,i);break e}else if(r!==i){i=Bb(Error(Vt(424)),e),e=WU(t,e,r,n,i);break e}else for(_c=pm(e.stateNode.containerInfo.firstChild),Cc=e,ls=!0,cd=null,n=LX(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Lb(),r===i){e=Tf(t,e,n);break e}ul(t,e,r,n)}e=e.child}return e;case 5:return BX(e),t===null&&CL(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,_L(r,i)?a=null:s!==null&&_L(r,s)&&(e.flags|=32),lY(t,e),ul(t,e,a,n),e.child;case 6:return t===null&&CL(e),null;case 13:return uY(t,e,n);case 4:return BB(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ib(e,null,r,n):ul(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nd(r,i),HU(t,e,r,i,n);case 7:return ul(t,e,e.pendingProps,n),e.child;case 8:return ul(t,e,e.pendingProps.children,n),e.child;case 12:return ul(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,Hi(jN,r._currentValue),r._currentValue=a,s!==null)if(vd(s.value,a)){if(s.children===i.children&&!$l.current){e=Tf(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Sf(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),NL(s.return,n,e),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(Vt(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),NL(a,n,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}ul(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Jy(e,n),i=bu(i),r=r(i),e.flags|=1,ul(t,e,r,n),e.child;case 14:return r=e.type,i=nd(r,e.pendingProps),i=nd(r.type,i),GU(t,e,r,i,n);case 15:return aY(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nd(r,i),TC(t,e),e.tag=1,Kl(r)?(t=!0,TN(e)):t=!1,Jy(e,n),rY(e,r,i),ML(e,r,i,n),PL(null,e,r,!0,t,n);case 19:return dY(t,e,n);case 22:return oY(t,e,n)}throw Error(Vt(156,e.tag))};function CY(t,e){return eX(t,e)}function Dhe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function du(t,e,n,r){return new Dhe(t,e,n,r)}function ZB(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Bhe(t){if(typeof t=="function")return ZB(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xB)return 11;if(t===vB)return 14}return 2}function vm(t,e){var n=t.alternate;return n===null?(n=du(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 4,464 bytes, line 40
40ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function jC(t,e,n,r,i,s){var a=2;if(r=t,typeof t=="function")ZB(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case wy:return O0(n.children,i,s,e);case gB:a=8,i|=8;break;case eL:return t=du(12,n,e,i|2),t.elementType=eL,t.lanes=s,t;case tL:return t=du(13,n,e,i),t.elementType=tL,t.lanes=s,t;case nL:return t=du(19,n,e,i),t.elementType=nL,t.lanes=s,t;case Bq:return l5(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Iq:a=10;break e;case Dq:a=9;break e;case xB:a=11;break e;case vB:a=14;break e;case jp:a=16,r=null;break e}throw Error(Vt(130,t==null?t:typeof t,""))}return e=du(a,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function O0(t,e,n,r){return t=du(7,t,r,e),t.lanes=n,t}function l5(t,e,n,r){return t=du(22,t,r,e),t.elementType=Bq,t.lanes=n,t.stateNode={isHidden:!1},t}function V3(t,e,n){return t=du(6,t,null,e),t.lanes=n,t}function W3(t,e,n){return e=du(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Fhe(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E3(0),this.expirationTimes=E3(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E3(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function QB(t,e,n,r,i,s,a,o,l){return t=new Fhe(t,e,n,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=du(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},DB(s),t}function Ohe(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:by,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function NY(t){if(!t)return jm;t=t._reactInternals;e:{if(Cx(t)!==t||t.tag!==1)throw Error(Vt(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Kl(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Vt(171))}if(t.tag===1){var n=t.type;if(Kl(n))return NX(t,n,e)}return e}function TY(t,e,n,r,i,s,a,o,l){return t=QB(n,r,!0,t,i,s,a,o,l),t.context=NY(null),n=t.current,r=gl(),i=xm(n),s=Sf(r,i),s.callback=e??null,mm(n,s,i),t.current.lanes=i,FS(t,i,r),ql(t,r),t}function c5(t,e,n,r){var i=e.current,s=gl(),a=xm(i);return n=NY(n),e.context===null?e.context=n:e.pendingContext=n,e=Sf(s,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=mm(i,e,a),t!==null&&(pd(t,i,a,s),kC(t,i,a)),a}function HN(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function t8(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function eF(t,e){t8(t,e),(t=t.alternate)&&t8(t,e)}function zhe(){return null}var MY=typeof reportError=="function"?reportError:function(t){console.error(t)};function tF(t){this._internalRoot=t}u5.prototype.render=tF.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Vt(409));c5(t,e,null,null)};u5.prototype.unmount=tF.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;ex(function(){c5(null,t,null,null)}),e[Cf]=null}};function u5(t){this._internalRoot=t}u5.prototype.unstable_scheduleHydration=function(t){if(t){var e=oX();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Op.length&&e!==0&&e<Op[n].priority;n++);Op.splice(n,0,t),n===0&&cX(t)}};function nF(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d5(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function n8(){}function Uhe(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=HN(a);s.call(u)}}var a=TY(e,r,t,0,null,!1,!1,"",n8);
vendor: 4,921 bytes, line 40
40return t._reactRootContainer=a,t[Cf]=a.current,k2(t.nodeType===8?t.parentNode:t),ex(),a}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=HN(l);o.call(u)}}var l=QB(t,0,!1,null,null,!1,!1,"",n8);return t._reactRootContainer=l,t[Cf]=l.current,k2(t.nodeType===8?t.parentNode:t),ex(function(){c5(e,l,n,r)}),l}function h5(t,e,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=HN(a);o.call(l)}}c5(e,a,t,i)}else a=Uhe(n,e,t,i,r);return HN(a)}sX=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=w_(e.pendingLanes);n!==0&&(wB(e,n|1),ql(e,qs()),!(ei&6)&&(Fb=qs()+500,ig()))}break;case 13:ex(function(){var r=Nf(t,1);if(r!==null){var i=gl();pd(r,t,1,i)}}),eF(t,1)}};_B=function(t){if(t.tag===13){var e=Nf(t,134217728);if(e!==null){var n=gl();pd(e,t,134217728,n)}eF(t,134217728)}};aX=function(t){if(t.tag===13){var e=xm(t),n=Nf(t,e);if(n!==null){var r=gl();pd(n,t,e,r)}eF(t,e)}};oX=function(){return Ai};lX=function(t,e){var n=Ai;try{return Ai=t,e()}finally{Ai=n}};hL=function(t,e,n){switch(e){case"input":if(sL(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=n5(r);if(!i)throw Error(Vt(90));Oq(r),sL(r,i)}}}break;case"textarea":Uq(t,n);break;case"select":e=n.value,e!=null&&Ky(t,!!n.multiple,e,!1)}};qq=XB;Xq=ex;var Hhe={usingClientEntryPoint:!1,Events:[zS,Ey,n5,$q,Kq,XB]},Fw={findFiberByHostInstance:d0,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ghe={bundleType:Fw.bundleType,version:Fw.version,rendererPackageName:Fw.rendererPackageName,rendererConfig:Fw.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Of.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Zq(t),t===null?null:t.stateNode},findFiberByHostInstance:Fw.findFiberByHostInstance||zhe,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 CE=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!CE.isDisabled&&CE.supportsFiber)try{ZT=CE.inject(Ghe),hh=CE}catch{}}Ic.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hhe;Ic.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nF(e))throw Error(Vt(200));return Ohe(t,e,null,n)};Ic.createRoot=function(t,e){if(!nF(t))throw Error(Vt(299));var n=!1,r="",i=MY;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=QB(t,1,!1,null,null,n,!1,r,i),t[Cf]=e.current,k2(t.nodeType===8?t.parentNode:t),new tF(e)};Ic.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Vt(188)):(t=Object.keys(t).join(","),Error(Vt(268,t)));return t=Zq(e),t=t===null?null:t.stateNode,t};Ic.flushSync=function(t){return ex(t)};Ic.hydrate=function(t,e,n){if(!d5(e))throw Error(Vt(200));return h5(null,t,e,!0,n)};Ic.hydrateRoot=function(t,e,n){if(!nF(t))throw Error(Vt(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=MY;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=TY(e,null,t,1,n??null,i,!1,s,a),t[Cf]=e.current,k2(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new u5(e)};Ic.render=function(t,e,n){if(!d5(e))throw Error(Vt(200));return h5(null,t,e,!1,n)};Ic.unmountComponentAtNode=function(t){if(!d5(t))throw Error(Vt(40));return t._reactRootContainer?(ex(function(){h5(null,null,t,!1,function(){t._reactRootContainer=null,t[Cf]=null})}),!0):!1};Ic.unstable_batchedUpdates=XB;Ic.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!d5(n))throw Error(Vt(200));if(t==null||t._reactInternals===void 0)throw Error(Vt(38));return h5(t,e,n,!1,r)};Ic.version="18.3.1-next-f1338f8080-20240426";function RY(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RY)}catch(t){console.error(t)}}RY(),Rq.exports=Ic;var Nx=Rq.exports;const jY=DS(Nx);var PY,r8=Nx;PY=r8.createRoot,r8.hydrateRoot;const Vhe=1,Whe=1e6;let $3=0;function $he(){return $3=($3+1)%Number.MAX_SAFE_INTEGER,$3.toString()}const K3=new Map,i8=t=>
40{if(K3.has(t))return;const e=setTimeout(()=>{K3.delete(t),K_({type:"REMOVE_TOAST",toastId:t})},Whe);K3.set(t,e)},Khe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Vhe)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?i8(n):t.toasts.forEach(r=>{i8(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},PC=[];let LC={toasts:[]};function K_(t){LC=Khe(LC,t),PC.forEach(e=>{e(LC)})}function dn({...t}){const e=$he(),n=i=>K_({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>K_({type:"DISMISS_TOAST",toastId:e});return K_({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function HS(){const[t,e]=E.useState(LC);return E.useEffect(()=>(PC.push(e),()=>{const n=PC.indexOf(e);n>-1&&PC.splice(n,1)}),[t]),{...t,toast:dn,dismiss:n=>K_({type:"DISMISS_TOAST",toastId:n})}}function cn(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function s8(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function LY(...t){return e=>{let n=!1;const r=t.map(i=>{const s=s8(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():s8(t[i],null)}}}}function ur(...t){return E.useCallback(LY(...t),t)}function qhe(t,e){const n=E.createContext(e),r=s=>{const{children:a,...o}=s,l=E.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(s){const a=E.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function ja(t,e=[]){let n=[];function r(s,a){const o=E.createContext(a),l=n.length;n=[...n,a];const u=h=>{var g;const{scope:p,children:f,...m}=h,x=((g=p==null?void 0:p[t])==null?void 0:g[l])||o,v=E.useMemo(()=>m,Object.values(m));return c.jsx(x.Provider,{value:v,children:f})};u.displayName=s+"Provider";function d(h,p){var x;const f=((x=p==null?void 0:p[t])==null?void 0:x[l])||o,m=E.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(a=>E.createContext(a));return function(o){const l=(o==null?void 0:o[t])||s;return E.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return i.scopeName=t,[r,Xhe(i,...e)]}function Xhe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...o,...h}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function tx(t){const e=Jhe(t),n=E.forwardRef((r,i)=>{const{children:s,...a}=r,o=E.Children.toArray(s),l=o.find(Zhe);if(l){const u=l.props.children,d=o.map(h=>h===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:h);return c.jsx(e,{...a,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,d):null})}return c.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var Yhe=tx("Slot");function Jhe(t){const e=E.forwardRef((n,r)=>{const{children:i,...s}=n;if(E.isValidElement(i)){const a=efe(i),o=Qhe(s,i.props);return i.type!==E.Fragment&&(o.ref=r?LY(r,a):a),E.cloneElement(i,o)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var IY=Symbol("radix.slottable");function DY(t){const e=({children:n})=>c.jsx(c.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=IY,e}function Zhe(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===IY}function Qhe(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}
vendor: 10,929 bytes, line 40
40:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function efe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function GS(t){const e=t+"CollectionProvider",[n,r]=ja(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:v,children:g}=x,b=Bt.useRef(null),y=Bt.useRef(new Map).current;return c.jsx(i,{scope:v,itemMap:y,collectionRef:b,children:g})};a.displayName=e;const o=t+"CollectionSlot",l=tx(o),u=Bt.forwardRef((x,v)=>{const{scope:g,children:b}=x,y=s(o,g),S=ur(v,y.collectionRef);return c.jsx(l,{ref:S,children:b})});u.displayName=o;const d=t+"CollectionItemSlot",h="data-radix-collection-item",p=tx(d),f=Bt.forwardRef((x,v)=>{const{scope:g,children:b,...y}=x,S=Bt.useRef(null),A=ur(v,S),k=s(d,g);return Bt.useEffect(()=>(k.itemMap.set(S,{ref:S,...y}),()=>void k.itemMap.delete(S))),c.jsx(p,{[h]:"",ref:A,children:b})});f.displayName=d;function m(x){const v=s(t+"CollectionConsumer",x);return Bt.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((k,M)=>y.indexOf(k.ref.current)-y.indexOf(M.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},m,r]}var tfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vn=tfe.reduce((t,e)=>{const n=tx(`Primitive.${e}`),r=E.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function BY(t,e){t&&Nx.flushSync(()=>t.dispatchEvent(e))}function _u(t){const e=E.useRef(t);return E.useEffect(()=>{e.current=t}),E.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function nfe(t,e=globalThis==null?void 0:globalThis.document){const n=_u(t);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var rfe="DismissableLayer",WL="dismissableLayer.update",ife="dismissableLayer.pointerDownOutside",sfe="dismissableLayer.focusOutside",a8,FY=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),p1=E.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=t,u=E.useContext(FY),[d,h]=E.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=E.useState({}),m=ur(e,M=>h(M)),x=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=x.indexOf(v),b=d?x.indexOf(d):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=g,A=ofe(M=>{const T=M.target,C=[...u.branches].some(R=>R.contains(T));!S||C||(i==null||i(M),a==null||a(M),M.defaultPrevented||o==null||o())},p),k=lfe(M=>{const T=M.target;[...u.branches].some(R=>R.contains(T))||(s==null||s(M),a==null||a(M),M.defaultPrevented||o==null||o())},p);return nfe(M=>{b===u.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&o&&(M.preventDefault(),o()))},p),E.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(a8=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),o8(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=a8)}},[d,p,n,u]),E.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),o8())},[d,u]),E.useEffect(()=>{const M=()=>f({});return document.addEventListener(WL,M),()=>document.removeEventListener(WL,M)},[]),c.jsx(vn.div,{...l,ref:m,style:{pointerEvents:y?S?"auto":"none":void 0,...t.style},onFocusCapture:cn(t.onFocusCapture,k.onFocusCapture),onBlurCapture:cn(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:cn(t.onPointerDownCapture,A.onPointerDownCapture)})});p1.displayName=rfe;var afe="DismissableLayerBranch",OY=E.forwardRef((t,e)=>{const n=E.useContext(FY),r=E.useRef(null),i=ur(e,r);return E.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(vn.div,{...t,ref:i})});OY.displayName=afe;function ofe(t,e=globalThis==null?void 0:globalThis.document){const n=_u(t),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){zY(ife,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function lfe(t,e=globalThis==null?void 0:globalThis.document){const n=_u(t),r=E.useRef(!1);return E.useEffect(()=>{const i=s=>{s.target&&!r.current&&zY(sfe,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function o8(){const t=new CustomEvent(WL);document.dispatchEvent(t)}function zY(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?BY(i,s):i.dispatchEvent(s)}var cfe=p1,ufe=OY,Ya=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},dfe="Portal",VS=E.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[i,s]=E.useState(!1);Ya(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?jY.createPortal(c.jsx(vn.div,{...r,ref:e}),a):null});VS.displayName=dfe;function hfe(t,e){return E.useReducer((n,r)=>e[n][r]??n,t)}var Cu=t=>{const{present:e,children:n}=t,r=ffe(e),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),s=ur(r.ref,pfe(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:s}):null};Cu.displayName="Presence";function ffe(t){const[e,n]=E.useState(),r=E.useRef(null),i=E.useRef(t),s=E.useRef("none"),a=t?"mounted":"unmounted",[o,l]=hfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=NE(r.current);s.current=o==="mounted"?u:"none"},[o]),Ya(()=>{const u=r.current,d=i.current;if(d!==t){const p=s.current,f=NE(u);t?l("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Ya(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=f=>{const x=NE(r.current).includes(f.animationName);if(f.target===e&&x&&(l("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},p=f=>{f.target===e&&(s.current=NE(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function NE(t){return(t==null?void 0:t.animationName)||"none"}function pfe(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var mfe=hB[" useInsertionEffect ".trim().toString()]||Ya;function Ja({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,a]=gfe({defaultProp:e,onChange:n}),o=t!==void 0,l=o?t:i;{const d=E.useRef(t!==void 0);E.useEffect(()=>{const h=d.current;h!==o&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=E.useCallback(d=>{var h;if(o){const p=xfe(d)?d(t):d;p!==t&&((h=a.current)==null||h.call(a,p))}else s(d)},[o,t,s,a]);return[l,u]}function gfe({defaultProp:t,onChange:e}){const[n,r]=E.useState(t),i=E.useRef(n),s=E.useRef(e);return mfe(()=>{s.current=e},[e]),E.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function xfe(t){return typeof t=="function"}var UY=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),vfe="VisuallyHidden",f5=E.forwardRef((t,e)=>c.jsx(vn.span,{...t,ref:e,style:{...UY,...t.style}}));f5.displayName=vfe;var yfe=f5,rF="ToastProvider",[iF,bfe,wfe]=GS("Toast"),[HY,iqe]=ja("Toast",[wfe]),[_fe,p5]=HY(rF),GY=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=t,[o,l]=E.useState(null),[u,d]=E.useState(0),h=E.useRef(!1),p=E.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${rF}\`. Expected non-empty \`string\`.`),c.jsx(iF.Provider,{scope:e,children:c.jsx(_fe,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:E.useCallback(()=>d(f=>f+1),[]),onToastRemove:E.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:a})})};GY.displayName=rF;var VY="ToastViewport",Sfe=["F8"],$L="toast.viewportPause",KL="toast.viewportResume",WY=E.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=Sfe,label:i="Notifications ({hotkey})",...s}=t,a=p5(VY,n),o=bfe(n),l=E.useRef(null),u=E.useRef(null),d=E.useRef(null),h=E.useRef(null),p=ur(e,h,a.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;E.useEffect(()=>{const v=g=>{var y;r.length!==0&&r.every(S=>g[S]||g.code===S)&&((y=h.current)==null||y.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),E.useEffect(()=>{const v=l.current,g=h.current;if(m&&v&&g){const b=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent($L);g.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>
40{if(a.isClosePausedRef.current){const k=new CustomEvent(KL);g.dispatchEvent(k),a.isClosePausedRef.current=!1}},S=k=>{!v.contains(k.relatedTarget)&&y()},A=()=>{v.contains(document.activeElement)||y()};return v.addEventListener("focusin",b),v.addEventListener("focusout",S),v.addEventListener("pointermove",b),v.addEventListener("pointerleave",A),window.addEventListener("blur",b),window.addEventListener("focus",y),()=>{v.removeEventListener("focusin",b),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",b),v.removeEventListener("pointerleave",A),window.removeEventListener("blur",b),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const x=E.useCallback(({tabbingDirection:v})=>{const b=o().map(y=>{const S=y.ref.current,A=[S,...Dfe(S)];return v==="forwards"?A:A.reverse()});return(v==="forwards"?b.reverse():b).flat()},[o]);return E.useEffect(()=>{const v=h.current;if(v){const g=b=>{var A,k,M;const y=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!y){const T=document.activeElement,C=b.shiftKey;if(b.target===v&&C){(A=u.current)==null||A.focus();return}const j=x({tabbingDirection:C?"backwards":"forwards"}),G=j.findIndex(B=>B===T);q3(j.slice(G+1))?b.preventDefault():C?(k=u.current)==null||k.focus():(M=d.current)==null||M.focus()}};return v.addEventListener("keydown",g),()=>v.removeEventListener("keydown",g)}},[o,x]),c.jsxs(ufe,{ref:l,role:"region","aria-label":i.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&c.jsx(qL,{ref:u,onFocusFromOutsideViewport:()=>{const v=x({tabbingDirection:"forwards"});q3(v)}}),c.jsx(iF.Slot,{scope:n,children:c.jsx(vn.ol,{tabIndex:-1,...s,ref:p})}),m&&c.jsx(qL,{ref:d,onFocusFromOutsideViewport:()=>{const v=x({tabbingDirection:"backwards"});q3(v)}})]})});WY.displayName=VY;var $Y="ToastFocusProxy",qL=E.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=p5($Y,n);return c.jsx(f5,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=s.viewport)!=null&&u.contains(o))&&r()}})});qL.displayName=$Y;var WS="Toast",Afe="toast.swipeStart",Efe="toast.swipeMove",kfe="toast.swipeCancel",Cfe="toast.swipeEnd",KY=E.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}=t,[o,l]=Ja({prop:r,defaultProp:i??!0,onChange:s,caller:WS});return c.jsx(Cu,{present:n||o,children:c.jsx(Mfe,{open:o,...a,ref:e,onClose:()=>l(!1),onPause:_u(t.onPause),onResume:_u(t.onResume),onSwipeStart:cn(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:cn(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:cn(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:cn(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});KY.displayName=WS;var[Nfe,Tfe]=HY(WS,{onClose(){}}),Mfe=E.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:f,...m}=t,x=p5(WS,n),[v,g]=E.useState(null),b=ur(e,B=>g(B)),y=E.useRef(null),S=E.useRef(null),A=i||x.duration,k=E.useRef(0),M=E.useRef(A),T=E.useRef(0),{onToastAdd:C,onToastRemove:R}=x,P=_u(()=>{var $;(v==null?void 0:v.contains(document.activeElement))&&(($=x.viewport)==null||$.focus()),a()}),j=E.useCallback(B=>
40{!B||B===1/0||(window.clearTimeout(T.current),k.current=new Date().getTime(),T.current=window.setTimeout(P,B))},[P]);E.useEffect(()=>{const B=x.viewport;if(B){const $=()=>{j(M.current),u==null||u()},U=()=>{const Z=new Date().getTime()-k.current;M.current=M.current-Z,window.clearTimeout(T.current),l==null||l()};return B.addEventListener($L,U),B.addEventListener(KL,$),()=>{B.removeEventListener($L,U),B.removeEventListener(KL,$)}}},[x.viewport,A,l,u,j]),E.useEffect(()=>{s&&!x.isClosePausedRef.current&&j(A)},[s,A,x.isClosePausedRef,j]),E.useEffect(()=>(C(),()=>R()),[C,R]);const G=E.useMemo(()=>v?eJ(v):null,[v]);return x.viewport?c.jsxs(c.Fragment,{children:[G&&c.jsx(Rfe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:G}),c.jsx(Nfe,{scope:n,onClose:P,children:Nx.createPortal(c.jsx(iF.ItemSlot,{scope:n,children:c.jsx(cfe,{asChild:!0,onEscapeKeyDown:cn(o,()=>{x.isFocusedToastEscapeKeyDownRef.current||P(),x.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(vn.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":x.swipeDirection,...m,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:cn(t.onKeyDown,B=>{B.key==="Escape"&&(o==null||o(B.nativeEvent),B.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:cn(t.onPointerDown,B=>{B.button===0&&(y.current={x:B.clientX,y:B.clientY})}),onPointerMove:cn(t.onPointerMove,B=>{if(!y.current)return;const $=B.clientX-y.current.x,U=B.clientY-y.current.y,Z=!!S.current,V=["left","right"].includes(x.swipeDirection),W=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,O=V?W(0,$):0,Y=V?0:W(0,U),z=B.pointerType==="touch"?10:2,I={x:O,y:Y},q={originalEvent:B,delta:I};Z?(S.current=I,TE(Efe,h,q,{discrete:!1})):l8(I,x.swipeDirection,z)?(S.current=I,TE(Afe,d,q,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs($)>z||Math.abs(U)>z)&&(y.current=null)}),onPointerUp:cn(t.onPointerUp,B=>{const $=S.current,U=B.target;if(U.hasPointerCapture(B.pointerId)&&U.releasePointerCapture(B.pointerId),S.current=null,y.current=null,$){const Z=B.currentTarget,V={originalEvent:B,delta:$};l8($,x.swipeDirection,x.swipeThreshold)?TE(Cfe,f,V,{discrete:!0}):TE(kfe,p,V,{discrete:!0}),Z.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),x.viewport)})]}):null}),Rfe=t=>{const{__scopeToast:e,children:n,...r}=t,i=p5(WS,e),[s,a]=E.useState(!1),[o,l]=E.useState(!1);return Lfe(()=>a(!0)),E.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(VS,{asChild:!0,children:c.jsx(f5,{...r,children:s&&c.jsxs(c.Fragment,{children:[i.label," ",n]})})})},jfe="ToastTitle",qY=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(vn.div,{...r,ref:e})});qY.displayName=jfe;var Pfe="ToastDescription",XY=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(vn.div,{...r,ref:e})});XY.displayName=Pfe;var YY="ToastAction",JY=E.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?c.jsx(QY,{altText:n,asChild:!0,children:c.jsx(sF,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${YY}\`. Expected non-empty \`string\`.`),null)});JY.displayName=YY;var ZY="ToastClose",sF=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=Tfe(ZY,n);return c.jsx(QY,{asChild:!0,children:c.jsx(vn.button,{type:"button",...r,ref:e,onClick:cn(t.onClick,i.onClose)})})});sF.displayName=ZY;var QY=E.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return c.jsx(vn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function eJ(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),Ife(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...eJ(r))}}),e}function TE(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?BY(i,s):i.dispatchEvent(s)}var l8=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function Lfe(t=()=>{}){const e=_u(t);Ya(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function Ife(t){return t.nodeType===t.ELEMENT_NODE}function Dfe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function q3(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var Bfe=GY,tJ=WY,nJ=KY,rJ=qY,iJ=XY,sJ=JY,aJ=sF;function oJ(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=oJ(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function lJ(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=oJ(t))&&(r&&(r+=" "),r+=e);return r}const c8=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,u8=lJ,m1=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return u8(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],h=s==null?void 0:s[u];if(d===null)return null;const p=c8(d)||c8(h);return i[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;
vendor: 10,281 bytes, lines 40-184
40return p===void 0||(u[h]=p),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...f}=d;return Object.entries(f).every(m=>{let[x,v]=m;return Array.isArray(v)?v.includes({...s,...o}[x]):{...s,...o}[x]===v})?[...u,h,p]:u},[]);return u8(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const Ffe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cJ=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var Ofe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const zfe=E.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>E.createElement("svg",{ref:l,...Ofe,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:cJ("lucide",i),...o},[...a.map(([u,d])=>E.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Yt=(t,e)=>{const n=E.forwardRef(({className:r,...i},s)=>E.createElement(zfe,{ref:s,iconNode:e,className:cJ(`lucide-${Ffe(t)}`,r),...i}));return n.displayName=`${t}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const Ufe=Yt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const zf=Yt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const uJ=Yt("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const Hfe=Yt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const Gfe=Yt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Cp=Yt("BookmarkCheck",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z",key:"169p4p"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const dJ=Yt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const Vfe=Yt("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const hJ=Yt("Brush",[["path",{d:"m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08",key:"1styjt"}],["path",{d:"M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z",key:"z0l1mu"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Wfe=Yt("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const $fe=Yt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const Kfe=Yt("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const ti=Yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const Su=Yt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const Ob=Yt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const nx=Yt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const g1=Yt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const m5=Yt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const aF=Yt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const qfe=Yt("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const fJ=Yt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const Xfe=Yt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Yfe=Yt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const ou=Yt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree.
185 */const oF=Yt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const Jfe=Yt("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const Zd=Yt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const Zfe=Yt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const pJ=Yt("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const _d=Yt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const mJ=Yt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const Vo=Yt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const Qfe=Yt("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const gJ=Yt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const epe=Yt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const tpe=Yt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree.
245 */const npe=Yt("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const x1=Yt("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const rpe=Yt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const v1=Yt("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const xc=Yt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const pa=Yt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const sg=Yt("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const ipe=Yt("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const spe=Yt("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const md=Yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree.
295 */const d8=Yt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const ape=Yt("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const ope=Yt("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const xJ=Yt("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const lpe=Yt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const h8=Yt("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const vJ=Yt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const y1=Yt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const g5=Yt("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const x5=Yt("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const Mf=Yt("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const Uf=Yt("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const v5=Yt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const ph=Yt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 361 * @license lucide-react v0.462.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const rx=Yt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 366 * @license lucide-react v0.462.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const b1=Yt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 371 * @license lucide-react v0.462.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const cpe=Yt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** 376 * @license lucide-react v0.462.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const Hf=Yt("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}
380],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/** 381 * @license lucide-react v0.462.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const I2=Yt("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 386 * @license lucide-react v0.462.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const lF=Yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 391 * @license lucide-react v0.462.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const upe=Yt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 396 * @license lucide-react v0.462.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const $S=Yt("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** 401 * @license lucide-react v0.462.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const cF=Yt("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 406 * @license lucide-react v0.462.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const dpe=Yt("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** 411 * @license lucide-react v0.462.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const yJ=Yt("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** 416 * @license lucide-react v0.462.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const y5=Yt("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 421 * @license lucide-react v0.462.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const bJ=Yt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 426 * @license lucide-react v0.462.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const wJ=Yt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 431 * @license lucide-react v0.462.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const b5=Yt("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/** 436 * @license lucide-react v0.462.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree.
440 */const hpe=Yt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 441 * @license lucide-react v0.462.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const yo=Yt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 446 * @license lucide-react v0.462.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const fpe=Yt("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 451 * @license lucide-react v0.462.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const Ah=Yt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 456 * @license lucide-react v0.462.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const ppe=Yt("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/** 461 * @license lucide-react v0.462.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const pu=Yt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 466 * @license lucide-react v0.462.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const IC=Yt("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 471 * @license lucide-react v0.462.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const Bc=Yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 476 * @license lucide-react v0.462.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const _J=Yt("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),uF="-",mpe=t=>{const e=xpe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(uF);return o[0]===""&&o.length!==1&&o.shift(),SJ(o,e)||gpe(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},SJ=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?SJ(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(uF);return(a=e.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},f8=/^\[(.+)\]$/,gpe=t=>{if(f8.test(t)){const e=f8.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},xpe=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};
vendor: 4,187 bytes, line 480
480return ype(Object.entries(t.classGroups),n).forEach(([s,a])=>{XL(a,r,s,e)}),r},XL=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:p8(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(vpe(i)){XL(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{XL(a,p8(e,s),n,r)})})},p8=(t,e)=>{let n=t;return e.split(uF).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vpe=t=>t.isThemeGetter,ype=(t,e)=>e?t.map(([n,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[n,i]}):t,bpe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},AJ="!",wpe=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,a=o=>{const l=[];let u=0,d=0,h;for(let v=0;v<o.length;v++){let g=o[v];if(u===0){if(g===i&&(r||o.slice(v,v+s)===e)){l.push(o.slice(d,v)),d=v+s;continue}if(g==="/"){h=v;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?o:o.substring(d),f=p.startsWith(AJ),m=f?p.substring(1):p,x=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:x}};return n?o=>n({className:o,parseClassName:a}):a},_pe=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},Spe=t=>({cache:bpe(t.cacheSize),parseClassName:wpe(t),...mpe(t)}),Ape=/\s+/,Epe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(Ape);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:f}=n(u);let m=!!f,x=r(m?p.substring(0,f):p);if(!x){if(!m){o=u+(o.length>0?" "+o:o);continue}if(x=r(p),!x){o=u+(o.length>0?" "+o:o);continue}m=!1}const v=_pe(d).join(":"),g=h?v+AJ:v,b=g+x;if(s.includes(b))continue;s.push(b);const y=i(x,m);for(let S=0;S<y.length;++S){const A=y[S];s.push(g+A)}o=u+(o.length>0?" "+o:o)}return o};function kpe(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=EJ(e))&&(r&&(r+=" "),r+=n);return r}const EJ=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=EJ(t[r]))&&(n&&(n+=" "),n+=e);return n};function Cpe(t,...e){let n,r,i,s=a;function a(l){const u=e.reduce((d,h)=>h(d),t());return n=Spe(u),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const u=r(l);if(u)return u;const d=Epe(l,n);return i(l,d),d}return function(){return s(kpe.apply(null,arguments))}}const qi=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},kJ=/^\[(?:([a-z-]+):)?(.+)\]$/i,Npe=/^\d+\/\d+$/,Tpe=new Set(["px","full","screen"]),Mpe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rpe=/\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$/,jpe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ppe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lpe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kh=t=>Qy(t)||Tpe.has(t)||Npe.test(t),hp=t=>w1(t,"length",Hpe),Qy=t=>!!t&&!Number.isNaN(Number(t)),X3=t=>w1(t,"number",Qy),Ow=t=>!!t&&Number.isInteger(Number(t)),Ipe=t=>t.endsWith("%")&&Qy(t.slice(0,-1)),Er=t=>kJ.test(t),fp=t=>Mpe.test(t),Dpe=new Set(["length","size","percentage"]),Bpe=t=>w1(t,Dpe,CJ),Fpe=t=>w1(t,"position",CJ),Ope=new Set(["image","url"]),zpe=t=>w1(t,Ope,Vpe),Upe=t=>w1(t,"",Gpe),zw=()=>!0,w1=(t,e,n)=>{const r=kJ.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Hpe=t=>Rpe.test(t)&&!jpe.test(t),CJ=()=>!1,Gpe=t=>Ppe.test(t),Vpe=t=>Lpe.test(t),Wpe=()=>{const t=qi("colors"),e=qi("spacing"),n=qi("blur"),r=qi("brightness"),i=qi("borderColor"),s=qi("borderRadius"),a=qi("borderSpacing"),o=qi("borderWidth"),l=qi("contrast"),u=qi("grayscale"),d=qi("hueRotate"),h=qi("invert"),p=qi("gap"),f=qi("gradientColorStops"),m=q
vendor: 12,511 bytes, line 480
480i("gradientColorStopPositions"),x=qi("inset"),v=qi("margin"),g=qi("opacity"),b=qi("padding"),y=qi("saturate"),S=qi("scale"),A=qi("sepia"),k=qi("skew"),M=qi("space"),T=qi("translate"),C=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Er,e],j=()=>[Er,e],G=()=>["",Kh,hp],B=()=>["auto",Qy,Er],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",Er],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Qy,Er];return{cacheSize:500,separator:":",theme:{colors:[zw],spacing:[Kh,hp],blur:["none","",fp,Er],brightness:Y(),borderColor:[t],borderRadius:["none","","full",fp,Er],borderSpacing:j(),borderWidth:G(),contrast:Y(),grayscale:W(),hueRotate:Y(),invert:W(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[Ipe,hp],inset:P(),margin:P(),opacity:Y(),padding:j(),saturate:Y(),scale:Y(),sepia:W(),skew:Y(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Er]}],container:["container"],columns:[{columns:[fp]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...$(),Er]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ow,Er]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Er]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Ow,Er]}],"grid-cols":[{"grid-cols":[zw]}],"col-start-end":[{col:["auto",{span:["full",Ow,Er]},Er]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[zw]}],"row-start-end":[{row:["auto",{span:[Ow,Er]},Er]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Er]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Er]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Er,e]}],"min-w":[{"min-w":[Er,e,"min","max","fit"]}],"max-w":[{"max-w":[Er,e,"none","full","min","max","fit","prose",{screen:[fp]},fp]}],h:[{h:[Er,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Er,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Er,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Er,e,"auto","min","max","fit"]}],"font-size":[{text:["base",fp,hp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",X3]}],"font-family":[{font:[zw]}],"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",Er]}],"line-clamp":[{"line-clamp":["none",Qy,X3]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kh,Er]}],"list-image":[{"list-image":["none",Er]}],"list-style-type":[{list:["none","disc","decimal",Er]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kh,hp]}],"underline-offset":[{"underline-offset":["auto",Kh,Er]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Er]}],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",Er]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Fpe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bpe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zpe]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],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":[g]}],"border-style":[{border:[...U(),"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":[g]}],"divide-style":[{divide:U()}],"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:["",...U()]}],"outline-offset":[{"outline-offset":[Kh,Er]}],"outline-w":[{outline:[Kh,hp]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Kh,hp]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",fp,Upe]}],"shadow-color":[{shadow:[zw]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fp,Er]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[y]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"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":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",Er]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",Er]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",Er]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ow,Er]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Er]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Er]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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"]}
vendor: 4,657 bytes, line 480
480],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",Er]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Kh,hp,X3]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$pe=Cpe(Wpe);function rn(...t){return $pe(lJ(t))}const Kpe=Bfe,NJ=E.forwardRef(({className:t,...e},n)=>c.jsx(tJ,{ref:n,className:rn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));NJ.displayName=tJ.displayName;const qpe=m1("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),TJ=E.forwardRef(({className:t,variant:e,...n},r)=>c.jsx(nJ,{ref:r,className:rn(qpe({variant:e}),t),...n}));TJ.displayName=nJ.displayName;const Xpe=E.forwardRef(({className:t,...e},n)=>c.jsx(sJ,{ref:n,className:rn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));Xpe.displayName=sJ.displayName;const MJ=E.forwardRef(({className:t,...e},n)=>c.jsx(aJ,{ref:n,className:rn("absolute right-2 top-2 rounded-md p-1 text-foreground
480/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(Bc,{className:"h-4 w-4"})}));MJ.displayName=aJ.displayName;const RJ=E.forwardRef(({className:t,...e},n)=>c.jsx(rJ,{ref:n,className:rn("text-sm font-semibold",t),...e}));RJ.displayName=rJ.displayName;const jJ=E.forwardRef(({className:t,...e},n)=>c.jsx(iJ,{ref:n,className:rn("text-sm opacity-90",t),...e}));jJ.displayName=iJ.displayName;function Ype(){const{toasts:t}=HS();return c.jsxs(Kpe,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return c.jsxs(TJ,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(RJ,{children:n}),r&&c.jsx(jJ,{children:r})]}),i,c.jsx(MJ,{})]},e)}),c.jsx(NJ,{})]})}var m8=["light","dark"],Jpe="(prefers-color-scheme: dark)",Zpe=E.createContext(void 0),Qpe={setTheme:t=>{},themes:[]},eme=()=>{var t;return(t=E.useContext(Zpe))!=null?t:Qpe};E.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:l})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?m8.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(m,x=!1,v=!0)=>{let g=a?a[m]:m,b=x?m+"|| ''":`'${g}'`,y="";return i&&v&&!x&&m8.includes(m)&&(y+=`d.style.colorScheme = '${m}';`),n==="class"?x||g?y+=`c.add(${b})`:y+="null":g&&(y+=`d[s](n,${b})`),y},f=t?`!function(){${d}${p(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${Jpe}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${u?"":"else{"+p(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(s,!1,!1)};}${h}}catch(t){}}();`;return E.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:f}})});var tme=t=>{switch(t){case"success":return ime;case"info":return ame;case"warning":return sme;case"error":return ome;default:return null}},nme=Array(12).fill(0),rme=({visible:t,className:e})=>Bt.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Bt.createElement("div",{className:"sonner-spinner"},nme.map((n,r)=>Bt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ime=Bt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Bt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),sme=Bt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Bt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ame=Bt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Bt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ome=Bt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Bt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lme=Bt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Bt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Bt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cme=()=>{let[t,e]=Bt.useState(document.hidden);return Bt.useEffect(()=>{let n=()=>{e(document.hidden)};
480return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},YL=1,ume=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...i}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:YL++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...i,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let i=e instanceof Promise?e:e(),s=r!==void 0,a,o=i.then(async u=>{if(a=["resolve",u],Bt.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(hme(u)&&!u.ok){s=!1;let d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description;this.create({id:r,type:"error",message:d,description:h})}else if(n.success!==void 0){s=!1;let d=typeof n.success=="function"?await n.success(u):n.success,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"success",message:d,description:h})}}).catch(async u=>{if(a=["reject",u],n.error!==void 0){s=!1;let d=typeof n.error=="function"?await n.error(u):n.error,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"error",message:d,description:h})}}).finally(()=>{var u;s&&(this.dismiss(r),r=void 0),(u=n.finally)==null||u.call(n)}),l=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,n)=>{let r=(n==null?void 0:n.id)||YL++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ol=new ume,dme=(t,e)=>{let n=(e==null?void 0:e.id)||YL++;return Ol.addToast({title:t,...e,id:n}),n},hme=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",fme=dme,pme=()=>Ol.toasts,mme=()=>Ol.getActiveToasts(),zb=Object.assign(fme,{success:Ol.success,info:Ol.info,warning:Ol.warning,error:Ol.error,custom:Ol.custom,message:Ol.message,promise:Ol.promise,dismiss:Ol.dismiss,loading:Ol.loading},{getHistory:pme,getToasts:mme});function gme(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}gme(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
480left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
480:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
480--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 481`);function ME(t){return t.label!==void 0}var xme=3,vme="32px",yme="16px",g8=4e3,bme=356,wme=14,_me=20,Sme=200;function $u(...t){return t.filter(Boolean).join(" ")}function Ame(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var Eme=t=>{var e,n,r,i,s,a,o,l,u,d,h;let{invert:p,toast:f,unstyled:m,interacting:x,setHeights:v,visibleToasts:g,heights:b,index:y,toasts:S,expanded:A,removeToast:k,defaultRichColors:M,closeButton:T,style:C,cancelButtonStyle:R,actionButtonStyle:P,className:j="",descriptionClassName:G="",duration:B,position:$,gap:U,loadingIcon:Z,expandByDefault:V,classNames:W,icons:O,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:z}=t,[I,q]=Bt.useState(null),[te,se]=Bt.useState(null),[ie,le]=Bt.useState(!1),[xe,Ee]=Bt.useState(!1),[ae,Q]=Bt.useState(!1),[we,Ae]=Bt.useState(!1),[K,pe]=Bt.useState(!1),[ye,Se]=Bt.useState(0),[ee,re]=Bt.useState(0),me=Bt.useRef(f.duration||B||g8),Ge=Bt.useRef(null),He=Bt.useRef(null),_e=y===0,Ne=y+1<=g,ue=f.type,Ce=f.dismissible!==!1,Ke=f.className||"",Qe=f.descriptionClassName||"",je=Bt.useMemo(()=>b.findIndex(_t=>_t.toastId===f.id)||0,[b,f.id]),We=Bt.useMemo(()=>{var _t;return(_t=f.closeButton)!=null?_t:T},[f.closeButton,T]),xt=Bt.useMemo(()=>f.duration||B||g8,[f.duration,B]),et=Bt.useRef(0),Je=Bt.useRef(0),Ze=Bt.useRef(0),Me=Bt.useRef(null),[Xe,ut]=$.split("-"),lt=Bt.useMemo(()=>b.reduce((_t,Lt,Dt)=>Dt>=je?_t:_t+Lt.height,0),[b,je]),Fe=cme(),Le=f.invert||p,bt=ue==="loading";Je.current=Bt.useMemo(()=>je*U+lt,[je,lt]),Bt.useEffect(()=>{me.current=xt},[xt]),Bt.useEffect(()=>{le(!0)},[]),Bt.useEffect(()=>{let _t=He.current;if(_t){let Lt=_t.getBoundingClientRect().height;return re(Lt),v(Dt=>[{toastId:f.id,height:Lt,position:f.position},...Dt]),()=>v(Dt=>Dt.filter(en=>en.toastId!==f.id))}},[v,f.id]),Bt.useLayoutEffect(()=>{if(!ie)return;let _t=He.current,Lt=_t.style.height;_t.style.height="auto";let Dt=_t.getBoundingClientRect().height;_t.style.height=Lt,re(Dt),v(en=>en.find(Mt=>Mt.toastId===f.id)?en.map(Mt=>Mt.toastId===f.id?{...Mt,height:Dt}:Mt):[{toastId:f.id,height:Dt,position:f.position},...en])},[ie,f.title,f.description,v,f.id]);let dt=Bt.useCallback(()=>{Ee(!0),Se(Je.current),v(_t=>_t.filter(Lt=>Lt.toastId!==f.id)),setTimeout(()=>{k(f)},Sme)},[f,k,v,Je]);Bt.useEffect(()=>{if(f.promise&&ue==="loading"||f.duration===1/0||f.type==="loading")return;let _t;return A||x||z&&Fe?(()=>
481{if(Ze.current<et.current){let Lt=new Date().getTime()-et.current;me.current=me.current-Lt}Ze.current=new Date().getTime()})():me.current!==1/0&&(et.current=new Date().getTime(),_t=setTimeout(()=>{var Lt;(Lt=f.onAutoClose)==null||Lt.call(f,f),dt()},me.current)),()=>clearTimeout(_t)},[A,x,f,ue,z,Fe,dt]),Bt.useEffect(()=>{f.delete&&dt()},[dt,f.delete]);function Nt(){var _t,Lt,Dt;return O!=null&&O.loading?Bt.createElement("div",{className:$u(W==null?void 0:W.loader,(_t=f==null?void 0:f.classNames)==null?void 0:_t.loader,"sonner-loader"),"data-visible":ue==="loading"},O.loading):Z?Bt.createElement("div",{className:$u(W==null?void 0:W.loader,(Lt=f==null?void 0:f.classNames)==null?void 0:Lt.loader,"sonner-loader"),"data-visible":ue==="loading"},Z):Bt.createElement(rme,{className:$u(W==null?void 0:W.loader,(Dt=f==null?void 0:f.classNames)==null?void 0:Dt.loader),visible:ue==="loading"})}return Bt.createElement("li",{tabIndex:0,ref:He,className:$u(j,Ke,W==null?void 0:W.toast,(e=f==null?void 0:f.classNames)==null?void 0:e.toast,W==null?void 0:W.default,W==null?void 0:W[ue],(n=f==null?void 0:f.classNames)==null?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:M,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":ie,"data-promise":!!f.promise,"data-swiped":K,"data-removed":xe,"data-visible":Ne,"data-y-position":Xe,"data-x-position":ut,"data-index":y,"data-front":_e,"data-swiping":ae,"data-dismissible":Ce,"data-type":ue,"data-invert":Le,"data-swipe-out":we,"data-swipe-direction":te,"data-expanded":!!(A||V&&ie),style:{"--index":y,"--toasts-before":y,"--z-index":S.length-y,"--offset":`${xe?ye:Je.current}px`,"--initial-height":V?"auto":`${ee}px`,...C,...f.style},onDragEnd:()=>{Q(!1),q(null),Me.current=null},onPointerDown:_t=>{bt||!Ce||(Ge.current=new Date,Se(Je.current),_t.target.setPointerCapture(_t.pointerId),_t.target.tagName!=="BUTTON"&&(Q(!0),Me.current={x:_t.clientX,y:_t.clientY}))},onPointerUp:()=>{var _t,Lt,Dt,en;if(we||!Ce)return;Me.current=null;let Mt=Number(((_t=He.current)==null?void 0:_t.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),nn=Number(((Lt=He.current)==null?void 0:Lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Tn=new Date().getTime()-((Dt=Ge.current)==null?void 0:Dt.getTime()),Fn=I==="x"?Mt:nn,lr=Math.abs(Fn)/Tn;if(Math.abs(Fn)>=_me||lr>.11){Se(Je.current),(en=f.onDismiss)==null||en.call(f,f),se(I==="x"?Mt>0?"right":"left":nn>0?"down":"up"),dt(),Ae(!0),pe(!1);return}Q(!1),q(null)},onPointerMove:_t=>{var Lt,Dt,en,Mt;if(!Me.current||!Ce||((Lt=window.getSelection())==null?void 0:Lt.toString().length)>0)return;let nn=_t.clientY-Me.current.y,Tn=_t.clientX-Me.current.x,Fn=(Dt=t.swipeDirections)!=null?Dt:Ame($);!I&&(Math.abs(Tn)>1||Math.abs(nn)>1)&&q(Math.abs(Tn)>Math.abs(nn)?"x":"y");let lr={x:0,y:0};I==="y"?(Fn.includes("top")||Fn.includes("bottom"))&&(Fn.includes("top")&&nn<0||Fn.includes("bottom")&&nn>0)&&(lr.y=nn):I==="x"&&(Fn.includes("left")||Fn.includes("right"))&&(Fn.includes("left")&&Tn<0||Fn.includes("right")&&Tn>0)&&(lr.x=Tn),(Math.abs(lr.x)>0||Math.abs(lr.y)>0)&&pe(!0),(en=He.current)==null||en.style.setProperty("--swipe-amount-x",`${lr.x}px`),(Mt=He.current)==null||Mt.style.setProperty("--swipe-amount-y",`${lr.y}px`)}},We&&!f.jsx?Bt.createElement("button",{"aria-label":Y,"data-disabled":bt,"data-close-button":!0,onClick:bt||!Ce?()=>{}:()=>{var _t;dt(),(_t=f.onDismiss)==null||_t.call(f,f)},className:$u(W==null?void 0:W.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},(s=O==null?void 0:O.close)!=null?s:lme):null,f.jsx||E.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:Bt.createElement(Bt.Fragment,null,ue||f.icon||f.promise?Bt.createElement("div",{"data-icon":"",className:$u(W==null?void 0:W.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Nt():null,f.type!=="loading"?f.icon||(O==null?void 0:O[ue])||tme(ue):null):null,Bt.createElement("div",{"data-content":"",className:$u(W==null?void 0:W.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},Bt.createElement("div",{"data-title":"",className:$u(W==null?void 0:W.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?Bt.createElement("div",{"data-description":"",className:$u(G,Qe,W==null?void 0:W.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),E.isValidElement(f.cancel)?f.cancel:f.cancel&&ME(f.cancel)?Bt.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:_t=>{var Lt,Dt;ME(f.cancel)&&Ce&&((Dt=(Lt=f.cancel).onClick)==null||Dt.call(Lt,_t),dt())},className:$u(W==null?void 0:W.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,E.isValidElement(f.action)?f.action:f.action&&ME(f.action)?Bt.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||P,onClick:_t=>{var Lt,Dt;ME(f.action)&&((Dt=(Lt=f.action).onClick)==null||Dt.call(Lt,_t),!_t.defaultPrevented&&dt())},className:$u(W==null?void 0:W.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function x8(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function kme(t,e){let n={};return[t,e].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?yme:vme;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=o:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),n}var Cme=E.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,mobileOffset:u,theme:d="light",richColors:h,duration:p,style:f,visibleToasts:m=xme,toastOptions:x,dir:v=x8(),gap:g=wme,loadingIcon:b,icons:y,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:A}=t,[k,M]=Bt.useState([]),T=Bt.useMemo(()=>Array.from(new Set([r].concat(k.filter(z=>z.position).map(z=>z.position)))),[k,r]),[C,R]=Bt.useState([]),[P,j]=Bt.useState(!1),[G,B]=Bt.useState(!1),[$,U]=Bt.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
481k":"light"),Z=Bt.useRef(null),V=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=Bt.useRef(null),O=Bt.useRef(!1),Y=Bt.useCallback(z=>{M(I=>{var q;return(q=I.find(te=>te.id===z.id))!=null&&q.delete||Ol.dismiss(z.id),I.filter(({id:te})=>te!==z.id)})},[]);return Bt.useEffect(()=>Ol.subscribe(z=>{if(z.dismiss){M(I=>I.map(q=>q.id===z.id?{...q,delete:!0}:q));return}setTimeout(()=>{jY.flushSync(()=>{M(I=>{let q=I.findIndex(te=>te.id===z.id);return q!==-1?[...I.slice(0,q),{...I[q],...z},...I.slice(q+1)]:[z,...I]})})})}),[]),Bt.useEffect(()=>{if(d!=="system"){U(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:I})=>{U(I?"dark":"light")})}catch{z.addListener(({matches:q})=>{try{U(q?"dark":"light")}catch(te){console.error(te)}})}},[d]),Bt.useEffect(()=>{k.length<=1&&j(!1)},[k]),Bt.useEffect(()=>{let z=I=>{var q,te;i.every(se=>I[se]||I.code===se)&&(j(!0),(q=Z.current)==null||q.focus()),I.code==="Escape"&&(document.activeElement===Z.current||(te=Z.current)!=null&&te.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),Bt.useEffect(()=>{if(Z.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,O.current=!1)}},[Z.current]),Bt.createElement("section",{ref:e,"aria-label":`${S} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((z,I)=>{var q;let[te,se]=z.split("-");return k.length?Bt.createElement("ol",{key:z,dir:v==="auto"?x8():v,tabIndex:-1,ref:Z,className:o,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":te,"data-lifted":P&&k.length>1&&!s,"data-x-position":se,style:{"--front-toast-height":`${((q=C[0])==null?void 0:q.height)||0}px`,"--width":`${bme}px`,"--gap":`${g}px`,...f,...kme(l,u)},onBlur:ie=>{O.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(O.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||O.current||(O.current=!0,W.current=ie.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{G||j(!1)},onDragEnd:()=>j(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},k.filter(ie=>!ie.position&&I===0||ie.position===z).map((ie,le)=>{var xe,Ee;return Bt.createElement(Eme,{key:ie.id,icons:y,index:le,toast:ie,defaultRichColors:h,duration:(xe=x==null?void 0:x.duration)!=null?xe:p,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:m,closeButton:(Ee=x==null?void 0:x.closeButton)!=null?Ee:a,interacting:G,position:z,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:Y,toasts:k.filter(ae=>ae.position==ie.position),heights:C.filter(ae=>ae.position==ie.position),setHeights:R,expandByDefault:s,gap:g,loadingIcon:b,expanded:P,pauseWhenPageIsHidden:A,swipeDirections:t.swipeDirections})})):null}))});const Nme=({...t})=>{const{theme:e="system"}=eme();return c.jsx(Cme,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var Tme=hB[" useId ".trim().toString()]||(()=>{}),Mme=0;function mu(t){const[e,n]=E.useState(Tme());return Ya(()=>{n(r=>r??String(Mme++))},[t]),e?`radix-${e}`:""}const Rme=["top","right","bottom","left"],Pm=Math.min,vc=Math.max,GN=Math.round,RE=Math.floor,mh=t=>({x:t,y:t}
vendor: 11,966 bytes, line 481
481),jme={left:"right",right:"left",bottom:"top",top:"bottom"},Pme={start:"end",end:"start"};function JL(t,e,n){return vc(t,Pm(e,n))}function Rf(t,e){return typeof t=="function"?t(e):t}function jf(t){return t.split("-")[0]}function _1(t){return t.split("-")[1]}function dF(t){return t==="x"?"y":"x"}function hF(t){return t==="y"?"height":"width"}const Lme=new Set(["top","bottom"]);function ch(t){return Lme.has(jf(t))?"y":"x"}function fF(t){return dF(ch(t))}function Ime(t,e,n){n===void 0&&(n=!1);const r=_1(t),i=fF(t),s=hF(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=VN(a)),[a,VN(a)]}function Dme(t){const e=VN(t);return[ZL(t),e,ZL(e)]}function ZL(t){return t.replace(/start|end/g,e=>Pme[e])}const v8=["left","right"],y8=["right","left"],Bme=["top","bottom"],Fme=["bottom","top"];function Ome(t,e,n){switch(t){case"top":case"bottom":return n?e?y8:v8:e?v8:y8;case"left":case"right":return e?Bme:Fme;default:return[]}}function zme(t,e,n,r){const i=_1(t);let s=Ome(jf(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(ZL)))),s}function VN(t){return t.replace(/left|right|bottom|top/g,e=>jme[e])}function Ume(t){return{top:0,right:0,bottom:0,left:0,...t}}function PJ(t){return typeof t!="number"?Ume(t):{top:t,right:t,bottom:t,left:t}}function WN(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function b8(t,e,n){let{reference:r,floating:i}=t;const s=ch(e),a=fF(e),o=hF(a),l=jf(e),u=s==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[o]/2-i[o]/2;let f;switch(l){case"top":f={x:d,y:r.y-i.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-i.width,y:h};break;default:f={x:r.x,y:r.y}}switch(_1(e)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1);break}return f}const Hme=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:h}=b8(u,r,l),p=r,f={},m=0;for(let x=0;x<o.length;x++){const{name:v,fn:g}=o[x],{x:b,y,data:S,reset:A}=await g({x:d,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:f,rects:u,platform:a,elements:{reference:t,floating:e}});d=b??d,h=y??h,f={...f,[v]:{...f[v],...S}},A&&m<=50&&(m++,typeof A=="object"&&(A.placement&&(p=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:d,y:h}=b8(u,p,l)),x=-1)}return{x:d,y:h,placement:p,strategy:i,middlewareData:f}};async function D2(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=Rf(e,t),m=PJ(f),v=o[p?h==="floating"?"reference":"floating":h],g=WN(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),b=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},A=WN(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:y,strategy:l}):b);return{top:(g.top-A.top+m.top)/S.y,bottom:(A.bottom-g.bottom+m.bottom)/S.y,left:(g.left-A.left+m.left)/S.x,right:(A.right-g.right+m.right)/S.x}}const Gme=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=e,{element:u,padding:d=0}=Rf(t,e)||{};if(u==null)return{};const h=PJ(d),p={x:n,y:r},f=fF(i),m=hF(f),x=await a.getDimensions(u),v=f==="y",g=v?"top":"left",b=v?"bottom":"right",y=v?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[f]-p[f]-s.floating[m],A=p[f]-s.reference[f],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let M=k?k[y]:0;(!M||!await(a.isElement==null?void 0:a.isElement(k)))&&(M=o.floating[y]||s.floating[m]);const T=S/2-A/2,C=M/2-x[m]/2-1,R=Pm(h[g],C),P=Pm(h[b],C),j=R,G=M-x[m]-P,B=M/2-x[m]/2+T,$=JL(j,B,G),U=!l.arrow&&_1(i)!=null&&B!==$&&s.reference[m]/2-(B<j?R:P)-x[m]/2<0,Z=U?B<j?B-j:B-G:0;return{[f]:p[f]+Z,data:{[f]:$,centerOffset:B-$-Z,...U&&{alignmentOffset:Z}},reset:U}}}),Vme=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:x=!0,...v}=Rf(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=jf(i),b=ch(o),y=jf(o)===o,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),A=p||(y||!x?[VN(o)]:Dme(o)),k=m!=="none";!p&&k&&A.push(...zme(o,x,m,S));const M=[o,...A],T=await D2(e,v),C=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&C.push(T[g]),h){const B=Ime(i,a,S);C.push(T[B[0]],T[B[1]])}if(R=[...R,{placement:i,overflows:C}],!C.every(B=>B<=0)){var P,j;const B=(((P=s.flip)==null?void 0:P.index)||0)+1,$=M[B];if($&&(!(h==="alignment"?b!==ch($):!1)||R.every(V=>V.overflows[0]>0&&ch(V.placement)===b)))return{data:{index:B,overflows:R},reset:{placement:$}};let U=(j=R.filter(Z=>Z.overflows[0]<=0).sort((Z,V)=>Z.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!U)switch(f){case"bestFit":{var G;const Z=(G=R.filter(V=>{if(k){const W=ch(V.placement);return W===b||W==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(W=>W>0).reduce((W,O)=>W+O,0)]).sort((V,W)=>V[1]-W[1])[0])==null?void 0:G[0];Z&&(U=Z);break}case"initialPlacement":U=o;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function w8(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _8(t){return Rme.some(e=>t[e]>=0)}const Wme=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Rf(t,e);switch(r){case"referenceHidden":{const s=await D2(e,{...i,elementContext:"reference"}),a=w8(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:_8(a)}}}case"escaped":{const s=await D2(e,{...i,altBoundary:!0}),a=w8(s,n.floating);return{data:{escapedOffsets:a,escaped:_8(a)}}}default:return{}}}}},LJ=new Set(["left","top"]);async function $me(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=jf(n),o=_1(n),l=ch(n)==="y",u=LJ.has(a)?-1:1,d=s&&l?-1:1,h=Rf(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof m=="number"&&(f=o==="end"?m*-1:m),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const Kme=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=e,l=await $me(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},qme=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:v=>{let{x:g,y:b}=v;return{x:g,y:b}}},...l}=Rf(t,e),u={x:n,y:r},d=await D2(e,l),h=ch(jf(i)),p=dF(h);let f=u[p],m=u[h];if(s){const v=p==="y"?"top":"left",g=p==="y"?"bottom":"right",b=f+d[v],y=f-d[g];f=JL(b,f,y)}if(a){const v=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=m+d[v],y=m-d[g];m=JL(b,m,y)}const x=o.fn({...e,[p]:f,[h]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:s,[h]:a}}}}}},Xme=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Rf(t,e),d={x:n,y:r},h=ch(i),p=dF(h);let f=d[p],m=d[h];const x=Rf(o,e),v=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const y=p==="y"?"height":"width",S=s.reference[p]-s.floating[y]+v.mainAxis,A=s.reference[p]+s.reference[y]-v.mainAxis;f<S?f=S:f>A&&(f=A)}if(u){var g,b;const y=p==="y"?"width":"height",S=LJ.has(jf(i)),A=s.reference[h]-s.floating[y]+(S&&((g=a.offset)==null?void 0:g[h])||0)+(S?0:v.crossAxis),k=s.reference[h]+s.reference[y]+(S?0:((b=a.offset)==null?void 0:b[h])||0)-(S?v.crossAxis:0);m<A?m=A:m>k&&(m=k)}return{[p]:f,[h]:m}}}},Yme=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:l=()=>{},...u}=Rf(t,e),d=await D2(e,u),h=jf(i),p=_1(i),f=ch(i)==="y",{width:m,height:x}=s.floating;let v,g;h==="top"||h==="bottom"?(v=h,g=p===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(g=h,v=p==="end"?"top":"bottom");const b=x-d.top-d.bottom,y=m-d.left-d.right,S=Pm(x-d[v],b),A=Pm(m-d[g],y),k=!e.middlewareData.shift;let M=S,T=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=y),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=b),k&&!p){const R=vc(d.left,0),P=vc(d.right,0),j=vc(d.top,0),G=vc(d.bottom,0);f?T=m-2*(R!==0||P!==0?R+P:vc(d.left,d.right)):M=x-2*(j!==0||G!==0?j+G:vc(d.top,d.bottom))}await l({...e,availableWidth:T,availableHeight:M});const C=await a.getDimensions(o.floating);return m!==C.width||x!==C.height?{reset:{rects:!0}}:{}}}};function w5(){return typeof window<"u"}function S1(t){return IJ(t)?(t.nodeName||"").toLowerCase():"#document"}function Nc(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Rh(t){var e;return(e=(IJ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function IJ(t){return w5()?t instanceof Node||t instanceof Nc(t).Node:!1}function yd(t){return w5()?t instanceof Element||t instanceof Nc(t).Element:!1}function Eh(t){return w5()?t instanceof HTMLElement||t instanceof Nc(t).HTMLElement:!1}function S8(t){return!w5()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Nc(t).ShadowRoot}const Jme=new Set(["inline","contents"]);function KS(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=bd(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!Jme.has(i)}const Zme=new Set(["table","td","th"]);function Qme(t){return Zme.has(S1(t))}const ege=[":popover-open",":modal"];function _5(t){return ege.some(e=>{try{return t.matches(e)}catch{return!1}})}const tge=["transform","translate","scale","rotate","perspective"],nge=["transform","translate","scale","rotate","perspective","filter"],rge=["paint","layout","strict","content"];function pF(t){const e=mF(),n=yd(t)?bd(t):t;return tge.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||nge.some(r=>(n.willChange||"").includes(r))||rge.some(r=>(n.contain||"").includes(r))}function ige(t){let e=Lm(t);for(;Eh(e)&&!Ub(e);){if(pF(e))return e;if(_5(e))return null;e=Lm(e)}return null}function mF(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sge=new Set(["html","body","#document"]);function Ub(t){return sge.has(S1(t))}function bd(t){return Nc(t).getComputedStyle(t)}function S5(t){return yd(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Lm(t){if(S1(t)==="html")return t;const e=t.assignedSlot||t.parentNode||S8(t)&&t.host||Rh(t);return S8(e)?e.host:e}function DJ(t){const e=Lm(t);return Ub(e)?t.ownerDocument?t.ownerDocument.body:t.body:Eh(e)&&KS(e)?e:DJ(e)}function B2(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=DJ(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=Nc(i);if(s){const o=QL(a);
vendor: 4,428 bytes, line 481
481return e.concat(a,a.visualViewport||[],KS(i)?i:[],o&&n?B2(o):[])}return e.concat(i,B2(i,[],n))}function QL(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function BJ(t){const e=bd(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Eh(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,o=GN(n)!==s||GN(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function gF(t){return yd(t)?t:t.contextElement}function eb(t){const e=gF(t);if(!Eh(e))return mh(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=BJ(e);let a=(s?GN(n.width):n.width)/r,o=(s?GN(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const age=mh(0);function FJ(t){const e=Nc(t);return!mF()||!e.visualViewport?age:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function oge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Nc(t)?!1:e}function ix(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=gF(t);let a=mh(1);e&&(r?yd(r)&&(a=eb(r)):a=eb(t));const o=oge(s,n,r)?FJ(s):mh(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 p=Nc(s),f=r&&yd(r)?Nc(r):r;let m=p,x=QL(m);for(;x&&r&&f!==m;){const v=eb(x),g=x.getBoundingClientRect(),b=bd(x),y=g.left+(x.clientLeft+parseFloat(b.paddingLeft))*v.x,S=g.top+(x.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,h*=v.y,l+=y,u+=S,m=Nc(x),x=QL(m)}}return WN({width:d,height:h,x:l,y:u})}function xF(t,e){const n=S5(t).scrollLeft;return e?e.left+n:ix(Rh(t)).left+n}function OJ(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:xF(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function lge(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Rh(r),o=e?_5(e.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},u=mh(1);const d=mh(0),h=Eh(r);if((h||!h&&!s)&&((S1(r)!=="body"||KS(a))&&(l=S5(r)),Eh(r))){const f=ix(r);u=eb(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=a&&!h&&!s?OJ(a,l,!0):mh(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function cge(t){return Array.from(t.getClientRects())}function uge(t){const e=Rh(t),n=S5(t),r=t.ownerDocument.body,i=vc(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=vc(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xF(t);const o=-n.scrollTop;return bd(r).direction==="rtl"&&(a+=vc(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function dge(t,e){const n=Nc(t),r=Rh(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const u=mF();(!u||u&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}const hge=new Set(["absolute","fixed"]);function fge(t,e){const n=ix(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Eh(t)?eb(t):mh(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:a,height:o,x:l,y:u}}function A8(t,e,n){let r;if(e==="viewport")r=dge(t,n);else if(e==="document")r=uge(Rh(t));else if(yd(e))r=fge(e,n);else{const i=FJ(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return WN(r)}function zJ(t,e){const n=Lm(t);return n===e||!yd(n)||Ub(n)?!1:bd(n).position==="fixed"||zJ(n,e)}function pge(t,e){const n=e.get(t);if(n)return n;let r=B2(t,[],!1).filter(o=>yd(o)&&S1(o)!=="body"),i=null;const s=bd(t).position==="fixed";let a=s?Lm(t):t;for(;yd(a)&&!Ub(a);){const o=bd(a),l=pF(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&hge.has(i.position)||KS(a)&&!l&&zJ(t,a))?r=r.filter(d=>d!==a):i=o,a=Lm(a)}return e.set(t,r),r}function mge(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?_5(e)?[]:pge(e,this._c):[].concat(n),r],o=a[0],l=a.reduce((u,d)=>{const h=A8(e,d,i);return u.top=vc(h.top,u.top),u.right=Pm(h.right,u.right),u.bottom=Pm(h.bottom,u.bottom),u.left=vc(h.left,u.left),u},A8(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gge(t){const{width:e,height:n}=BJ(t);return{width:e,height:n}}function xge(t,e,n){const r=Eh(e),i=Rh(e),s=n==="fixed",a=ix(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const l=mh(0);function u(){l.x=xF(i)}if(r||!r&&!s)if((S1(e)!=="body"||KS(i))&&(o=S5(e)),r){const f=ix(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&u();s&&!r&&i&&u();
vendor: 8,620 bytes, line 481
481const d=i&&!r&&!s?OJ(i,o):mh(0),h=a.left+o.scrollLeft-l.x-d.x,p=a.top+o.scrollTop-l.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function Y3(t){return bd(t).position==="static"}function E8(t,e){if(!Eh(t)||bd(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Rh(t)===n&&(n=n.ownerDocument.body),n}function UJ(t,e){const n=Nc(t);if(_5(t))return n;if(!Eh(t)){let i=Lm(t);for(;i&&!Ub(i);){if(yd(i)&&!Y3(i))return i;i=Lm(i)}return n}let r=E8(t,e);for(;r&&Qme(r)&&Y3(r);)r=E8(r,e);return r&&Ub(r)&&Y3(r)&&!pF(r)?n:r||ige(t)||n}const vge=async function(t){const e=this.getOffsetParent||UJ,n=this.getDimensions,r=await n(t.floating);return{reference:xge(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yge(t){return bd(t).direction==="rtl"}const bge={convertOffsetParentRelativeRectToViewportRelativeRect:lge,getDocumentElement:Rh,getClippingRect:mge,getOffsetParent:UJ,getElementRects:vge,getClientRects:cge,getDimensions:gge,getScale:eb,isElement:yd,isRTL:yge};function HJ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wge(t,e){let n=null,r;const i=Rh(t);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(o||e(),!p||!f)return;const m=RE(h),x=RE(i.clientWidth-(d+p)),v=RE(i.clientHeight-(h+f)),g=RE(d),y={rootMargin:-m+"px "+-x+"px "+-v+"px "+-g+"px",threshold:vc(0,Pm(1,l))||1};let S=!0;function A(k){const M=k[0].intersectionRatio;if(M!==l){if(!S)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!HJ(u,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(A,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,y)}n.observe(t)}return a(!0),s}function _ge(t,e,n,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=gF(t),d=i||s?[...u?B2(u):[],...B2(e)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const h=u&&o?wge(u,n):null;let p=-1,f=null;a&&(f=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(e)})),n()}),u&&!l&&f.observe(u),f.observe(e));let m,x=l?ix(t):null;l&&v();function v(){const g=ix(t);x&&!HJ(x,g)&&n(),x=g,m=requestAnimationFrame(v)}return n(),()=>{var g;d.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h==null||h(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const Sge=Kme,Age=qme,Ege=Vme,kge=Yme,Cge=Wme,k8=Gme,Nge=Xme,Tge=(t,e,n)=>{const r=new Map,i={platform:bge,...n},s={...i.platform,_c:r};return Hme(t,e,{...i,platform:s})};var Mge=typeof document<"u",Rge=function(){},DC=Mge?E.useLayoutEffect:Rge;function $N(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!$N(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!$N(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function GJ(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function C8(t,e){const n=GJ(t);return Math.round(e*n)/n}function J3(t){const e=E.useRef(t);return DC(()=>{e.current=t}),e}function jge(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[d,h]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,f]=E.useState(r);$N(p,r)||f(r);const[m,x]=E.useState(null),[v,g]=E.useState(null),b=E.useCallback(V=>{V!==k.current&&(k.current=V,x(V))},[]),y=E.useCallback(V=>{V!==M.current&&(M.current=V,g(V))},[]),S=s||m,A=a||v,k=E.useRef(null),M=E.useRef(null),T=E.useRef(d),C=l!=null,R=J3(l),P=J3(i),j=J3(u),G=E.useCallback(()=>{if(!k.current||!M.current)return;const V={placement:e,strategy:n,middleware:p};P.current&&(V.platform=P.current),Tge(k.current,M.current,V).then(W=>{const O={...W,isPositioned:j.current!==!1};B.current&&!$N(T.current,O)&&(T.current=O,Nx.flushSync(()=>{h(O)}))})},[p,e,n,P,j]);DC(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[u]);const B=E.useRef(!1);DC(()=>(B.current=!0,()=>{B.current=!1}),[]),DC(()=>{if(S&&(k.current=S),A&&(M.current=A),S&&A){if(R.current)return R.current(S,A,G);G()}},[S,A,G,R,C]);const $=E.useMemo(()=>({reference:k,floating:M,setReference:b,setFloating:y}),[b,y]),U=E.useMemo(()=>({reference:S,floating:A}),[S,A]),Z=E.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const W=C8(U.floating,d.x),O=C8(U.floating,d.y);return o?{...V,transform:"translate("+W+"px, "+O+"px)",...GJ(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:O}},[n,o,U.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:G,refs:$,elements:U,floatingStyles:Z}),[d,G,$,U,Z])}const Pge=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?k8({element:r.current,padding:i}).fn(n):{}:r?k8({element:r,padding:i}).fn(n):{}}}},Lge=(t,e)=>({...Sge(t),options:[t,e]}),Ige=(t,e)=>({...Age(t),options:[t,e]}),Dge=(t,e)=>({...Nge(t),options:[t,e]}),Bge=(t,e)=>({...Ege(t),options:[t,e]}),Fge=(t,e)=>({...kge(t),options:[t,e]}),Oge=(t,e)=>({...Cge(t),options:[t,e]}),zge=(t,e)=>({...Pge(t),options:[t,e]});var Uge="Arrow",VJ=E.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return c.jsx(vn.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});VJ.displayName=Uge;var Hge=VJ;function qS(t){const[e,n]=E.useState(void 0);return Ya(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var vF="Popper",[WJ,A1]=ja(vF),[Gge,$J]=WJ(vF),KJ=t=>{const{__scopePopper:e,children:n}=t,[r,i]=E.useState(null);return c.jsx(Gge,{scope:e,anchor:r,onAnchorChange:i,children:n})};KJ.displayName=vF;var qJ="PopperAnchor",XJ=E.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=$J(qJ,n),a=E.useRef(null),o=ur(e,a);return E.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:c.jsx(vn.div,{...i,ref:o})});XJ.displayName=qJ;var yF="PopperContent",[Vge,Wge]=WJ(yF),YJ=E.forwardRef((t,e)=>{var ie,le,xe,Ee,ae,Q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:m,...x}=t,v=$J(yF,n),[g,b]=E.useState(null),y=ur(e,we=>b(we)),[S,A]=E.useState(null),k=qS(S),M=(k==null?void 0:k.width)??0,T=(k==null?void 0:k.height)??0,C=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],j=P.length>0,G={padding:R,boundary:P.filter(Kge),altBoundary:j},{refs:B,floatingStyles:$,placement:U,isPositioned:Z,middlewareData:V}=jge({strategy:"fixed",placement:C,whileElementsMounted:(...we)=>_ge(...we,{animationFrame:f==="always"}),elements:{reference:v.anchor},middleware:[Lge({mainAxis:i+T,alignmentAxis:a}),l&&Ige({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Dge():void 0,...G}),l&&Bge({...G}),Fge({...G,apply:({elements:we,rects:Ae,availableWidth:K,availableHeight:pe})=>{const{width:ye,height:Se}=Ae.reference,ee=we.floating.style;ee.setProperty("--radix-popper-available-width",`${K}px`),ee.setProperty("--radix-popper-available-height",`${pe}px`),ee.setProperty("--radix-popper-anchor-width",`${ye}px`),ee.setProperty("--radix-popper-anchor-height",`${Se}px`)}}),S&&zge({element:S,padding:o}),qge({arrowWidth:M,arrowHeight:T}),p&&Oge({strategy:"referenceHidden",...G})]}
vendor: 5,736 bytes, line 481
481),[W,O]=QJ(U),Y=_u(m);Ya(()=>{Z&&(Y==null||Y())},[Z,Y]);const z=(ie=V.arrow)==null?void 0:ie.x,I=(le=V.arrow)==null?void 0:le.y,q=((xe=V.arrow)==null?void 0:xe.centerOffset)!==0,[te,se]=E.useState();return Ya(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:Z?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(Ee=V.transformOrigin)==null?void 0:Ee.x,(ae=V.transformOrigin)==null?void 0:ae.y].join(" "),...((Q=V.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(Vge,{scope:n,placedSide:W,onArrowChange:A,arrowX:z,arrowY:I,shouldHideArrow:q,children:c.jsx(vn.div,{"data-side":W,"data-align":O,...x,ref:y,style:{...x.style,animation:Z?void 0:"none"}})})})});YJ.displayName=yF;var JJ="PopperArrow",$ge={top:"bottom",right:"left",bottom:"top",left:"right"},ZJ=E.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=Wge(JJ,r),a=$ge[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Hge,{...i,ref:n,style:{...i.style,display:"block"}})})});ZJ.displayName=JJ;function Kge(t){return t!==null}var qge=t=>({name:"transformOrigin",options:t,fn(e){var v,g,b;const{placement:n,rects:r,middlewareData:i}=e,a=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[u,d]=QJ(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(((g=i.arrow)==null?void 0:g.x)??0)+o/2,f=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let m="",x="";return u==="bottom"?(m=a?h:`${p}px`,x=`${-l}px`):u==="top"?(m=a?h:`${p}px`,x=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,x=a?h:`${f}px`):u==="left"&&(m=`${r.floating.width+l}px`,x=a?h:`${f}px`),{data:{x:m,y:x}}}});function QJ(t){const[e,n="center"]=t.split("-");return[e,n]}var bF=KJ,A5=XJ,wF=YJ,_F=ZJ,[E5,aqe]=ja("Tooltip",[A1]),k5=A1(),eZ="TooltipProvider",Xge=700,eI="tooltip.open",[Yge,SF]=E5(eZ),tZ=t=>{const{__scopeTooltip:e,delayDuration:n=Xge,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,a=E.useRef(!0),o=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(Yge,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:E.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};tZ.displayName=eZ;var F2="Tooltip",[Jge,C5]=E5(F2),nZ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=t,l=SF(F2,t.__scopeTooltip),u=k5(e),[d,h]=E.useState(null),p=mu(),f=E.useRef(0),m=a??l.disableHoverableContent,x=o??l.delayDuration,v=E.useRef(!1),[g,b]=Ja({prop:r,defaultProp:i??!1,onChange:M=>{M?(l.onOpen(),document.dispatchEvent(new CustomEvent(eI))):l.onClose(),s==null||s(M)},caller:F2}),y=E.useMemo(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),S=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v.current=!1,b(!0)},[b]),A=E.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),k=E.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{v.current=!0,b(!0),f.current=0},x)},[x,b]);return E.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(bF,{...u,children:c.jsx(Jge,{scope:e,contentId:p,open:g,stateAttribute:y,trigger:d,onTriggerChange:h,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?k():S()},[l.isOpenDelayedRef,k,S]),onTriggerLeave:E.useCallback(()=>{m?A():(window.clearTimeout(f.current),f.current=0)},[A,m]),onOpen:S,onClose:A,disableHoverableContent:m,children:n})})};nZ.displayName=F2;var tI="TooltipTrigger",rZ=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=C5(tI,n),s=SF(tI,n),a=k5(n),o=E.useRef(null),l=ur(e,o,i.onTriggerChange),u=E.useRef(!1),d=E.useRef(!1),h=E.useCallback(()=>u.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(A5,{asChild:!0,...a,children:c.jsx(vn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:cn(t.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:cn(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:cn(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:cn(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:cn(t.onBlur,i.onClose),onClick:cn(t.onClick,i.onClose)})})});rZ.displayName=tI;var Zge="TooltipPortal",[oqe,Qge]=E5(Zge,{forceMount:void 0}),Hb="TooltipContent",iZ=E.forwardRef((t,e)=>{const n=Qge(Hb,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,a=C5(Hb,t.__scopeTooltip);return c.jsx(Cu,{present:r||a.open,children:a.disableHoverableContent?c.jsx(sZ,{side:i,...s,ref:e}):c.jsx(e0e,{side:i,...s,ref:e})})}),e0e=E.forwardRef((t,e)=>{const n=C5(Hb,t.__scopeTooltip),r=SF(Hb,t.__scopeTooltip),i=E.useRef(null),s=ur(e,i),[a,o]=E.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,p=E.useCallback(()=>{o(null),h(!1)}
vendor: 4,208 bytes, line 481
481,[h]),f=E.useCallback((m,x)=>{const v=m.currentTarget,g={x:m.clientX,y:m.clientY},b=s0e(g,v.getBoundingClientRect()),y=a0e(g,b),S=o0e(x.getBoundingClientRect()),A=c0e([...y,...S]);o(A),h(!0)},[h]);return E.useEffect(()=>()=>p(),[p]),E.useEffect(()=>{if(l&&d){const m=v=>f(v,d),x=v=>f(v,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",x),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",x)}}},[l,d,f,p]),E.useEffect(()=>{if(a){const m=x=>{const v=x.target,g={x:x.clientX,y:x.clientY},b=(l==null?void 0:l.contains(v))||(d==null?void 0:d.contains(v)),y=!l0e(g,a);b?p():y&&(p(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,a,u,p]),c.jsx(sZ,{...t,ref:s})}),[t0e,n0e]=E5(F2,{isInside:!1}),r0e=DY("TooltipContent"),sZ=E.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=t,l=C5(Hb,n),u=k5(n),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(eI,d),()=>document.removeEventListener(eI,d)),[d]),E.useEffect(()=>{if(l.trigger){const h=p=>{const f=p.target;f!=null&&f.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),c.jsx(p1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(wF,{"data-state":l.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(r0e,{children:r}),c.jsx(t0e,{scope:n,isInside:!0,children:c.jsx(yfe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});iZ.displayName=Hb;var aZ="TooltipArrow",i0e=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=k5(n);return n0e(aZ,n).isInside?null:c.jsx(_F,{...i,...r,ref:e})});i0e.displayName=aZ;function s0e(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function a0e(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function o0e(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function l0e(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const o=e[s],l=e[a],u=o.x,d=o.y,h=l.x,p=l.y;d>r!=p>r&&n<(h-u)*(r-d)/(p-d)+u&&(i=!i)}return i}function c0e(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),u0e(e)}function u0e(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var d0e=tZ,h0e=nZ,f0e=rZ,oZ=iZ;const KN=d0e,qN=h0e,XN=f0e,O2=E.forwardRef(({className:t,sideOffset:e=4,...n},r)=>c.jsx(oZ,{ref:r,sideOffset:e,className:rn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
481de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));O2.displayName=oZ.displayName;var XS=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sx=typeof window>"u"||"Deno"in globalThis;function zl(){}function p0e(t,e){return typeof t=="function"?t(e):t}function nI(t){return typeof t=="number"&&t>=0&&t!==1/0}function lZ(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ym(t,e){return typeof t=="function"?t(e):t}function iu(t,e){return typeof t=="function"?t(e):t}function N8(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==AF(a,e.options))return!1}else if(!U2(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function T8(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(z2(e.options.mutationKey)!==z2(s))return!1}else if(!U2(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function AF(t,e){return((e==null?void 0:e.queryKeyHashFn)||z2)(t)}function z2(t){return JSON.stringify(t,(e,n)=>iI(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function U2(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>U2(t[n],e[n])):!1}function cZ(t,e){if(t===e)return t;const n=M8(t)&&M8(e);if(n||iI(t)&&iI(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,o=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<a;d++){const h=n?d:s[d];(!n&&l.has(h)||n)&&t[h]===void 0&&e[h]===void 0?(o[h]=void 0,u++):(o[h]=cZ(t[h],e[h]),o[h]===t[h]&&t[h]!==void 0&&u++)}return i===a&&u===i?t:o}return e}function rI(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function M8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function iI(t){if(!R8(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!R8(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function R8(t){return Object.prototype.toString.call(t)==="[object Object]"}function m0e(t){return new Promise(e=>{setTimeout(e,t)})}function sI(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?cZ(t,e):e}function g0e(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function x0e(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var EF=Symbol();function uZ(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===EF?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function v0e(t,e){return typeof t=="function"?t(...e):!!t}var T0,qp,bb,dq,y0e=(dq=class extends XS{constructor(){super();Qn(this,T0);Qn(this,qp);Qn(this,bb);wn(this,bb,e=>{if(!sx&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){st(this,qp)||this.setEventListener(st(this,bb))}onUnsubscribe(){var e;this.hasListeners()||((e=st(this,qp))==null||e.call(this),wn(this,qp,void 0))}setEventListener(e){var n;wn(this,bb,e),(n=st(this,qp))==null||n.call(this),wn(this,qp,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){st(this,T0)!==e&&(wn(this,T0,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof st(this,T0)=="boolean"?st(this,T0):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},T0=new WeakMap,qp=new WeakMap,bb=new WeakMap,dq),kF=new y0e,wb,Xp,_b,hq,b0e=(hq=class extends XS{constructor(){super();Qn(this,wb,!0);Qn(this,Xp);Qn(this,_b);wn(this,_b,e=>{if(!sx&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){st(this,Xp)||this.setEventListener(st(this,_b))}onUnsubscribe(){var e;this.hasListeners()||((e=st(this,Xp))==null||e.call(this),wn(this,Xp,void 0))}setEventListener(e){var n;wn(this,_b,e),(n=st(this,Xp))==null||n.call(this),wn(this,Xp,e(this.setOnline.bind(this)))}setOnline(e){st(this,wb)!==e&&(wn(this,wb,e),this.listeners.forEac
vendor: 30,592 bytes, line 481
481h(r=>{r(e)}))}isOnline(){return st(this,wb)}},wb=new WeakMap,Xp=new WeakMap,_b=new WeakMap,hq),YN=new b0e;function aI(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function w0e(t){return Math.min(1e3*2**t,3e4)}function dZ(t){return(t??"online")==="online"?YN.isOnline():!0}var hZ=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Z3(t){return t instanceof hZ}function fZ(t){let e=!1,n=0,r=!1,i;const s=aI(),a=x=>{var v;r||(p(new hZ(x)),(v=t.abort)==null||v.call(t))},o=()=>{e=!0},l=()=>{e=!1},u=()=>kF.isFocused()&&(t.networkMode==="always"||YN.isOnline())&&t.canRun(),d=()=>dZ(t.networkMode)&&t.canRun(),h=x=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,x),i==null||i(),s.resolve(x))},p=x=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,x),i==null||i(),s.reject(x))},f=()=>new Promise(x=>{var v;i=g=>{(r||u())&&x(g)},(v=t.onPause)==null||v.call(t)}).then(()=>{var x;i=void 0,r||(x=t.onContinue)==null||x.call(t)}),m=()=>{if(r)return;let x;const v=n===0?t.initialPromise:void 0;try{x=v??t.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(h).catch(g=>{var k;if(r)return;const b=t.retry??(sx?0:3),y=t.retryDelay??w0e,S=typeof y=="function"?y(n,g):y,A=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,g);if(e||!A){p(g);return}n++,(k=t.onFail)==null||k.call(t,n,g),m0e(S).then(()=>u()?void 0:f()).then(()=>{e?p(g):m()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?m():f().then(m),s)}}var _0e=t=>setTimeout(t,0);function S0e(){let t=[],e=0,n=o=>{o()},r=o=>{o()},i=_0e;const s=o=>{e?t.push(o):i(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var mo=S0e(),M0,fq,pZ=(fq=class{constructor(){Qn(this,M0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nI(this.gcTime)&&wn(this,M0,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(sx?1/0:5*60*1e3))}clearGcTimeout(){st(this,M0)&&(clearTimeout(st(this,M0)),wn(this,M0,void 0))}},M0=new WeakMap,fq),Sb,R0,ru,j0,Uo,jS,P0,sd,af,pq,A0e=(pq=class extends pZ{constructor(e){super();Qn(this,sd);Qn(this,Sb);Qn(this,R0);Qn(this,ru);Qn(this,j0);Qn(this,Uo);Qn(this,jS);Qn(this,P0);wn(this,P0,!1),wn(this,jS,e.defaultOptions),this.setOptions(e.options),this.observers=[],wn(this,j0,e.client),wn(this,ru,st(this,j0).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,wn(this,Sb,E0e(this.options)),this.state=e.state??st(this,Sb),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=st(this,Uo))==null?void 0:e.promise}setOptions(e){this.options={...st(this,jS),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&st(this,ru).remove(this)}setData(e,n){const r=sI(this.state.data,e,this.options);return Vr(this,sd,af).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Vr(this,sd,af).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=st(this,Uo))==null?void 0:r.promise;return(i=st(this,Uo))==null||i.cancel(e),n?n.then(zl).catch(zl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(st(this,Sb))}isActive(){return this.observers.some(e=>iu(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===EF||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ym(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!lZ(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=st(this,Uo))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=st(this,Uo))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),st(this,ru).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(st(this,Uo)&&(st(this,P0)?st(this,Uo).cancel({revert:!0}):st(this,Uo).cancelRetry()),this.scheduleGc()),st(this,ru).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Vr(this,sd,af).call(this,{type:"invalidate"})}fetch(e,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(st(this,Uo))return st(this,Uo).continueRetry(),st(this,Uo).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(wn(this,P0,!0),r.signal)})},s=()=>{const p=uZ(this.options,n),m=(()=>{const x={client:st(this,j0),queryKey:this.queryKey,meta:this.meta};return i(x),x})();return wn(this,P0,!1),this.options.persister?this.options.persister(p,m,this):p(m)},o=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:st(this,j0),state:this.state,fetchFn:s};return i(p),p})();(u=this.options.behavior)==null||u.onFetch(o,this),wn(this,R0,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Vr(this,sd,af).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const l=p=>{var f,m,x,v;Z3(p)&&p.silent||Vr(this,sd,af).call(this,{type:"error",error:p}),Z3(p)||((m=(f=st(this,ru).config).onError)==null||m.call(f,p,this),(v=(x=st(this,ru).config).onSettled)==null||v.call(x,this.state.data,p,this)),this.scheduleGc()};return wn(this,Uo,fZ({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,m,x,v;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(g){l(g);return}(m=(f=st(this,ru).config).onSuccess)==null||m.call(f,p,this),(v=(x=st(this,ru).config).onSettled)==null||v.call(x,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,f)=>{Vr(this,sd,af).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{Vr(this,sd,af).call(this,{type:"pause"})},onContinue:()=>{Vr(this,sd,af).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),st(this,Uo).start()}},Sb=new WeakMap,R0=new WeakMap,ru=new WeakMap,j0=new WeakMap,Uo=new WeakMap,jS=new WeakMap,P0=new WeakMap,sd=new WeakSet,af=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mZ(r.data,this.options),fetchMeta:e.meta??null};case"success":return wn(this,R0,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Z3(i)&&i.revert&&st(this,R0)?{...st(this,R0),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),mo.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),st(this,ru).notify({query:this,type:"updated",action:e})})},pq);function mZ(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dZ(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function E0e(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var nh,mq,k0e=(mq=class extends XS{constructor(e={}){super();Qn(this,nh);this.config=e,wn(this,nh,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??AF(i,n);let a=this.get(s);return a||(a=new A0e({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){st(this,nh).has(e.queryHash)||(st(this,nh).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=st(this,nh).get(e.queryHash);n&&(e.destroy(),n===e&&st(this,nh).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){mo.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return st(this,nh).get(e)}getAll(){return[...st(this,nh).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>N8(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>N8(e,r)):n}notify(e){mo.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){mo.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mo.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},nh=new WeakMap,mq),rh,ll,L0,ih,Np,gq,C0e=(gq=class extends pZ{constructor(e){super();Qn(this,ih);Qn(this,rh);Qn(this,ll);Qn(this,L0);this.mutationId=e.mutationId,wn(this,ll,e.mutationCache),wn(this,rh,[]),this.state=e.state||N0e(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){st(this,rh).includes(e)||(st(this,rh).push(e),this.clearGcTimeout(),st(this,ll).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){wn(this,rh,st(this,rh).filter(n=>n!==e)),this.scheduleGc(),st(this,ll).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){st(this,rh).length||(this.state.status==="pending"?this.scheduleGc():st(this,ll).remove(this))}continue(){var e;return((e=st(this,L0))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,a,o,l,u,d,h,p,f,m,x,v,g,b,y,S,A,k,M,T;const n=()=>{Vr(this,ih,Np).call(this,{type:"continue"})};wn(this,L0,fZ({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(C,R)=>{Vr(this,ih,Np).call(this,{type:"failed",failureCount:C,error:R})},onPause:()=>{Vr(this,ih,Np).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>st(this,ll).canRun(this)}));const r=this.state.status==="pending",i=!st(this,L0).canStart();try{if(r)n();else{Vr(this,ih,Np).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(s=st(this,ll).config).onMutate)==null?void 0:a.call(s,e,this));const R=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e));R!==this.state.context&&Vr(this,ih,Np).call(this,{type:"pending",context:R,variables:e,isPaused:i})}const C=await st(this,L0).start();return await((d=(u=st(this,ll).config).onSuccess)==null?void 0:d.call(u,C,e,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,C,e,this.state.context)),await((m=(f=st(this,ll).config).onSettled)==null?void 0:m.call(f,C,null,this.state.variables,this.state.context,this)),await((v=(x=this.options).onSettled)==null?void 0:v.call(x,C,null,e,this.state.context)),Vr(this,ih,Np).call(this,{type:"success",data:C}),C}catch(C){try{throw await((b=(g=st(this,ll).config).onError)==null?void 0:b.call(g,C,e,this.state.context,this)),await((S=(y=this.options).onError)==null?void 0:S.call(y,C,e,this.state.context)),await((k=(A=st(this,ll).config).onSettled)==null?void 0:k.call(A,void 0,C,this.state.variables,this.state.context,this)),await((T=(M=this.options).onSettled)==null?void 0:T.call(M,void 0,C,e,this.state.context)),C}finally{Vr(this,ih,Np).call(this,{type:"error",error:C})}}finally{st(this,ll).runNext(this)}}},rh=new WeakMap,ll=new WeakMap,L0=new WeakMap,ih=new WeakSet,Np=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),mo.batch(()=>{st(this,rh).forEach(r=>{r.onMutationUpdate(e)}),st(this,ll).notify({mutation:this,type:"updated",action:e})})},gq);function N0e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pf,ad,PS,xq,T0e=(xq=class extends XS{constructor(e={}){super();Qn(this,pf);Qn(this,ad);Qn(this,PS);this.config=e,wn(this,pf,new Set),wn(this,ad,new Map),wn(this,PS,0)}build(e,n,r){const i=new C0e({mutationCache:this,mutationId:++uE(this,PS)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){st(this,pf).add(e);const n=jE(e);if(typeof n=="string"){const r=st(this,ad).get(n);r?r.push(e):st(this,ad).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(st(this,pf).delete(e)){const n=jE(e);if(typeof n=="string"){const r=st(this,ad).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&st(this,ad).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=jE(e);if(typeof n=="string"){const r=st(this,ad).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=jE(e);if(typeof n=="string"){const i=(r=st(this,ad).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){mo.batch(()=>{st(this,pf).forEach(e=>{this.notify({type:"removed",mutation:e})}),st(this,pf).clear(),st(this,ad).clear()})}getAll(){return Array.from(st(this,pf))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>T8(n,r))}findAll(e={}){return this.getAll().filter(n=>T8(e,n))}notify(e){mo.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return mo.batch(()=>Promise.all(e.map(n=>n.continue().catch(zl))))}},pf=new WeakMap,ad=new WeakMap,PS=new WeakMap,xq);function jE(t){var e;return(e=t.options.scope)==null?void 0:e.id}function j8(t){return{onFetch:(e,n)=>{var d,h,p,f,m;const r=e.options,i=(p=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((f=e.state.data)==null?void 0:f.pages)||[],a=((m=e.state.data)==null?void 0:m.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let x=!1;const v=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(e.signal.aborted?x=!0:e.signal.addEventListener("abort",()=>{x=!0}),e.signal)})},g=uZ(e.options,e.fetchOptions),b=async(y,S,A)=>{if(x)return Promise.reject();if(S==null&&y.pages.length)return Promise.resolve(y);const M=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:A?"backward":"forward",meta:e.options.meta};return v(P),P})(),T=await g(M),{maxPages:C}=e.options,R=A?x0e:g0e;return{pages:R(y.pages,T,C),pageParams:R(y.pageParams,S,C)}};if(i&&s.length){const y=i==="backward",S=y?M0e:P8,A={pages:s,pageParams:a},k=S(r,A);o=await b(A,k,y)}else{const y=t??s.length;do{const S=l===0?a[0]??r.initialPageParam:P8(r,o);if(l>0&&S==null)break;o=await b(o,S),l++}while(l<y)}return o};e.options.persister?e.fetchFn=()=>{var x,v;return(v=(x=e.options).persister)==null?void 0:v.call(x,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function P8(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function M0e(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var js,Yp,Jp,Ab,Eb,Zp,kb,Cb,vq,R0e=(vq=class{constructor(t={}){Qn(this,js);Qn(this,Yp);Qn(this,Jp);Qn(this,Ab);Qn(this,Eb);Qn(this,Zp);Qn(this,kb);Qn(this,Cb);wn(this,js,t.queryCache||new k0e),wn(this,Yp,t.mutationCache||new T0e),wn(this,Jp,t.defaultOptions||{}),wn(this,Ab,new Map),wn(this,Eb,new Map),wn(this,Zp,0)}mount(){uE(this,Zp)._++,st(this,Zp)===1&&(wn(this,kb,kF.subscribe(async t=>{t&&(await this.resumePausedMutations(),st(this,js).onFocus())})),wn(this,Cb,YN.subscribe(async t=>{t&&(await this.resumePausedMutations(),st(this,js).onOnline())})))}unmount(){var t,e;uE(this,Zp)._--,st(this,Zp)===0&&((t=st(this,kb))==null||t.call(this),wn(this,kb,void 0),(e=st(this,Cb))==null||e.call(this),wn(this,Cb,void 0))}isFetching(t){return st(this,js).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return st(this,Yp).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=st(this,js).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=st(this,js).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ym(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return st(this,js).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=st(this,js).get(r.queryHash),s=i==null?void 0:i.state.data,a=p0e(e,s);if(a!==void 0)return st(this,js).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return mo.batch(()=>st(this,js).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=st(this,js).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=st(this,js);mo.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=st(this,js);return mo.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=mo.batch(()=>st(this,js).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(zl).catch(zl)}invalidateQueries(t,e={}){return mo.batch(()=>(st(this,js).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=mo.batch(()=>st(this,js).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(zl)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(zl)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=st(this,js).build(this,e);return n.isStaleByTime(ym(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(zl).catch(zl)}fetchInfiniteQuery(t){return t.behavior=j8(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(zl).catch(zl)}ensureInfiniteQueryData(t){return t.behavior=j8(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return YN.isOnline()?st(this,Yp).resumePausedMutations():Promise.resolve()}getQueryCache(){return st(this,js)}getMutationCache(){return st(this,Yp)}getDefaultOptions(){return st(this,Jp)}setDefaultOptions(t){wn(this,Jp,t)}setQueryDefaults(t,e){st(this,Ab).set(z2(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...st(this,Ab).values()],n={};return e.forEach(r=>{U2(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){st(this,Eb).set(z2(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...st(this,Eb).values()],n={};return e.forEach(r=>{U2(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...st(this,Jp).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=AF(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===EF&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...st(this,Jp).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){st(this,js).clear(),st(this,Yp).clear()}},js=new WeakMap,Yp=new WeakMap,Jp=new WeakMap,Ab=new WeakMap,Eb=new WeakMap,Zp=new WeakMap,kb=new WeakMap,Cb=new WeakMap,vq),Fl,Wr,LS,cl,I0,Nb,Qp,em,IS,Tb,Mb,D0,B0,tm,Rb,vi,S_,oI,lI,cI,uI,dI,hI,fI,gZ,yq,j0e=(yq=class extends XS{constructor(e,n){super();Qn(this,vi);Qn(this,Fl);Qn(this,Wr);Qn(this,LS);Qn(this,cl);Qn(this,I0);Qn(this,Nb);Qn(this,Qp);Qn(this,em);Qn(this,IS);Qn(this,Tb);Qn(this,Mb);Qn(this,D0);Qn(this,B0);Qn(this,tm);Qn(this,Rb,new Set);this.options=n,wn(this,Fl,e),wn(this,em,null),wn(this,Qp,aI()),this.options.experimental_prefetchInRender||st(this,Qp).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(st(this,Wr).addObserver(this),L8(st(this,Wr),this.options)?Vr(this,vi,S_).call(this):this.updateResult(),Vr(this,vi,uI).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pI(st(this,Wr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pI(st(this,Wr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Vr(this,vi,dI).call(this),Vr(this,vi,hI).call(this),st(this,Wr).removeObserver(this)}setOptions(e){const n=this.options,r=st(this,Wr);if(this.options=st(this,Fl).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof iu(this.options.enabled,st(this,Wr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Vr(this,vi,fI).call(this),st(this,Wr).setOptions(this.options),n._defaulted&&!rI(this.options,n)&&st(this,Fl).getQueryCache().notify({type:"observerOptionsUpdated",query:st(this,Wr),observer:this});const i=this.hasListeners();i&&I8(st(this,Wr),r,this.options,n)&&Vr(this,vi,S_).call(this),this.updateResult(),i&&(st(this,Wr)!==r||iu(this.options.enabled,st(this,Wr))!==iu(n.enabled,st(this,Wr))||ym(this.options.staleTime,st(this,Wr))!==ym(n.staleTime,st(this,Wr)))&&Vr(this,vi,oI).call(this);const s=Vr(this,vi,lI).call(this);i&&(st(this,Wr)!==r||iu(this.options.enabled,st(this,Wr))!==iu(n.enabled,st(this,Wr))||s!==st(this,tm))&&Vr(this,vi,cI).call(this,s)}getOptimisticResult(e){const n=st(this,Fl).getQueryCache().build(st(this,Fl),e),r=this.createResult(n,e);return L0e(this,r)&&(wn(this,cl,r),wn(this,Nb,this.options),wn(this,I0,st(this,Wr).state)),r}getCurrentResult(){return st(this,cl)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(e){st(this,Rb).add(e)}getCurrentQuery(){return st(this,Wr)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=st(this,Fl).defaultQueryOptions(e),r=st(this,Fl).getQueryCache().build(st(this,Fl),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Vr(this,vi,S_).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),st(this,cl)))}createResult(e,n){var C;const r=st(this,Wr),i=this.options,s=st(this,cl),a=st(this,I0),o=st(this,Nb),u=e!==r?e.state:st(this,LS),{state:d}=e;let h={...d},p=!1,f;if(n._optimisticResults){const R=this.hasListeners(),P=!R&&L8(e,n),j=R&&I8(e,r,n,i);(P||j)&&(h={...h,...mZ(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:v}=h;f=h.data;let g=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(R=s.data,g=!0):R=typeof n.placeholderData=="function"?n.placeholderData((C=st(this,Mb))==null?void 0:C.state.data,st(this,Mb)):n.placeholderData,R!==void 0&&(v="success",f=sI(s==null?void 0:s.data,R,n),p=!0)}if(n.select&&f!==void 0&&!g)if(s&&f===(a==null?void 0:a.data)&&n.select===st(this,IS))f=st(this,Tb);else try{wn(this,IS,n.select),f=n.select(f),f=sI(s==null?void 0:s.data,f,n),wn(this,Tb,f),wn(this,em,null)}catch(R){wn(this,em,R)}st(this,em)&&(m=st(this,em),f=st(this,Tb),x=Date.now(),v="error");const b=h.fetchStatus==="fetching",y=v==="pending",S=v==="error",A=y&&b,k=f!==void 0,T={status:v,fetchStatus:h.fetchStatus,isPending:y,isSuccess:v==="success",isError:S,isInitialLoading:A,isLoading:A,data:f,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:x,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:b,isRefetching:b&&!y,isLoadingError:S&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&k,isStale:CF(e,n),refetch:this.refetch,promise:st(this,Qp),isEnabled:iu(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=G=>{T.status==="error"?G.reject(T.error):T.data!==void 0&&G.resolve(T.data)},P=()=>{const G=wn(this,Qp,T.promise=aI());R(G)},j=st(this,Qp);switch(j.status){case"pending":e.queryHash===r.queryHash&&R(j);break;case"fulfilled":(T.status==="error"||T.data!==j.value)&&P();break;case"rejected":(T.status!=="error"||T.error!==j.reason)&&P();break}}return T}updateResult(){const e=st(this,cl),n=this.createResult(st(this,Wr),this.options);if(wn(this,I0,st(this,Wr).state),wn(this,Nb,this.options),st(this,I0).data!==void 0&&wn(this,Mb,st(this,Wr)),rI(n,e))return;wn(this,cl,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!st(this,Rb).size)return!0;const a=new Set(s??st(this,Rb));return this.options.throwOnError&&a.add("error"),Object.keys(st(this,cl)).some(o=>{const l=o;return st(this,cl)[l]!==e[l]&&a.has(l)})};Vr(this,vi,gZ).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Vr(this,vi,uI).call(this)}},Fl=new WeakMap,Wr=new WeakMap,LS=new WeakMap,cl=new WeakMap,I0=new WeakMap,Nb=new WeakMap,Qp=new WeakMap,em=new WeakMap,IS=new WeakMap,Tb=new WeakMap,Mb=new WeakMap,D0=new WeakMap,B0=new WeakMap,tm=new WeakMap,Rb=new WeakMap,vi=new WeakSet,S_=function(e){Vr(this,vi,fI).call(this);let n=st(this,Wr).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(zl)),n},oI=function(){Vr(this,vi,dI).call(this);const e=ym(this.options.staleTime,st(this,Wr));if(sx||st(this,cl).isStale||!nI(e))return;const r=lZ(st(this,cl).dataUpdatedAt,e)+1;wn(this,D0,setTimeout(()=>{st(this,cl).isStale||this.updateResult()},r))},lI=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(st(this,Wr)):this.options.refetchInterval)??!1},cI=function(e){Vr(this,vi,hI).call(this),wn(this,tm,e),!(sx||iu(this.options.enabled,st(this,Wr))===!1||!nI(st(this,tm))||st(this,tm)===0)&&wn(this,B0,setInterval(()=>{(this.options.refetchIntervalInBackground||kF.isFocused())&&Vr(this,vi,S_).call(this)},st(this,tm)))},uI=function(){Vr(this,vi,oI).call(this),Vr(this,vi,cI).call(this,Vr(this,vi,lI).call(this))},dI=function(){st(this,D0)&&(clearTimeout(st(this,D0)),wn(this,D0,void 0))},hI=function(){st(this,B0)&&(clearInterval(st(this,B0)),wn(this,B0,void 0))},fI=function(){const e=st(this,Fl).getQueryCache().build(st(this,Fl),this.options);if(e===st(this,Wr))return;const n=st(this,Wr);wn(this,Wr,e),wn(this,LS,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},gZ=function(e){mo.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(st(this,cl))}),st(this,Fl).getQueryCache().notify({query:st(this,Wr),type:"observerResultsUpdated"})})},yq);function P0e(t,e){return iu(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function L8(t,e){return P0e(t,e)||t.state.data!==void 0&&pI(t,e,e.refetchOnMount)}function pI(t,e,n){if(iu(e.enabled,t)!==!1&&ym(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&CF(t,e)}return!1}function I8(t,e,n,r){return(t!==e||iu(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&CF(t,n)}function CF(t,e){return iu(e.enabled,t)!==!1&&t.isStaleByTime(ym(e.staleTime,t))}function L0e(t,e){return!rI(t.getCurrentResult(),e)}var xZ=E.createContext(void 0),I0e=t=>{const e=E.useContext(xZ);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},D0e=({client:t,children:e})=>(E.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(xZ.Provider,{value:t,children:e})),vZ=E.createContext(!1),B0e=()=>E.useContext(vZ);vZ.Provider;function F0e(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var O0e=E.createContext(F0e()),z0e=()=>E.useContext(O0e),U0e=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOn
481Mount=!1))},H0e=t=>{E.useEffect(()=>{t.clearReset()},[t])},G0e=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||v0e(n,[t.error,r])),V0e=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},W0e=(t,e)=>t.isLoading&&t.isFetching&&!e,$0e=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,D8=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function K0e(t,e,n){var h,p,f,m,x;const r=B0e(),i=z0e(),s=I0e(),a=s.defaultQueryOptions(t);(p=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,a),a._optimisticResults=r?"isRestoring":"optimistic",V0e(a),U0e(a,i),H0e(i);const o=!s.getQueryCache().get(a.queryHash),[l]=E.useState(()=>new e(s,a)),u=l.getOptimisticResult(a),d=!r&&t.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(v=>{const g=d?l.subscribe(mo.batchCalls(v)):zl;return l.updateResult(),g},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(a)},[a,l]),$0e(a,u))throw D8(a,l,i);if(G0e({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((m=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,a,u),a.experimental_prefetchInRender&&!sx&&W0e(u,r)){const v=o?D8(a,l,i):(x=s.getQueryCache().get(a.queryHash))==null?void 0:x.promise;v==null||v.catch(zl).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function q0e(t,e){return K0e(t,j0e)}/** 482 * @remix-run/router v1.23.0 483 * 484 * Copyright (c) Remix Software Inc. 485 * 486 * This source code is licensed under the MIT license found in the 487 * LICENSE.md file in the root directory of this source tree. 488 * 489 * @license MIT 490 */function H2(){return H2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H2.apply(this,arguments)}var im;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(im||(im={}));const B8="popstate";function X0e(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:a,hash:o}=r.location;return mI("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:JN(i)}return J0e(e,n,null,t)}function Es(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function yZ(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Y0e(){return Math.random().toString(36).substr(2,8)}function F8(t,e){return{usr:t.state,key:t.key,idx:e}}function mI(t,e,n,r){return n===void 0&&(n=null),H2({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?E1(e):e,{state:n,key:e&&e.key||r||Y0e()})}function JN(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function E1(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function J0e(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=im.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(H2({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=im.Pop;let v=d(),g=v==null?null:v-u;u=v,l&&l({action:o,location:x.location,delta:g})}function p(v,g){o=im.Push;let b=mI(x.location,v,g);u=d()+1;let y=F8(b,u),S=x.createHref(b);try{a.pushState(y,"",S)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(S)}s&&l&&l({action:o,location:x.location,delta:1})}function f(v,g){o=im.Replace;let b=mI(x.location,v,g);u=d();let y=F8(b,u),S=x.createHref(b);a.replaceState(y,"",S),s&&l&&l({action:o,location:x.location,delta:0})}function m(v){let g=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof v=="string"?v:JN(v);return b=b.replace(/ $/,"%20"),Es(g,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,g)}let x={get action(){return o},get location(){return t(i,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(B8,h),l=v,()=>{i.removeEventListener(B8,h),l=null}},createHref(v){return e(i,v)},createURL:m,encodeLocation(v){let g=m(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:f,go(v){return a.go(v)}};return x}var O8;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(O8||(O8={}));function Z0e(t,e,n){return n===void 0&&(n="/"),Q0e(t,e,n,!1)}function Q0e(t,e,n,r){let i=typeof e=="string"?E1(e):e,s=Gb(i.pathname||"/",n);if(s==null)return null;let a=bZ(t);exe(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=dxe(s);o=cxe(a[l],u,r)}return o}function bZ(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),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("/")&&(Es(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
490id. 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=bm([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(Es(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),bZ(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:oxe(u,s.index),routesMeta:d})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of wZ(s.path))i(s,a,l)}),e}function wZ(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=wZ(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function exe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:lxe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const txe=/^:[\w-]+$/,nxe=3,rxe=2,ixe=1,sxe=10,axe=-2,z8=t=>t==="*";function oxe(t,e){let n=t.split("/"),r=n.length;return n.some(z8)&&(r+=axe),e&&(r+=rxe),n.filter(i=>!z8(i)).reduce((i,s)=>i+(txe.test(s)?nxe:s===""?ixe:sxe),r)}function lxe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function cxe(t,e,n){let{routesMeta:r}=t,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=ZN({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),p=l.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=ZN({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;
vendor: 6,994 bytes, lines 490-499
490Object.assign(i,h.params),a.push({params:i,pathname:bm([s,h.pathname]),pathnameBase:mxe(bm([s,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(s=bm([s,h.pathnameBase]))}return a}function ZN(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=uxe(t.path,t.caseSensitive,t.end),i=e.match(n);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:p,isOptional:f}=d;if(p==="*"){let x=o[h]||"";a=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const m=o[h];return f&&!m?u[p]=void 0:u[p]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:t}}function uxe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),yZ(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function dxe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yZ(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Gb(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function hxe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?E1(t):t;return{pathname:n?n.startsWith("/")?n:fxe(n,e):e,search:gxe(r),hash:xxe(i)}}function fxe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Q3(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function pxe(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function NF(t,e){let n=pxe(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function TF(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=E1(t):(i=H2({},t),Es(!i.pathname||!i.pathname.includes("?"),Q3("?","pathname","search",i)),Es(!i.pathname||!i.pathname.includes("#"),Q3("#","pathname","hash",i)),Es(!i.search||!i.search.includes("#"),Q3("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let h=e.length-1;if(!r&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}o=h>=0?e[h]:"/"}let l=hxe(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const bm=t=>t.join("/").replace(/\/\/+/g,"/"),mxe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),gxe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,xxe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function vxe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const _Z=["post","put","patch","delete"];new Set(_Z);const yxe=["get",..._Z];new Set(yxe);/** 491 * React Router v6.30.1 492 * 493 * Copyright (c) Remix Software Inc. 494 * 495 * This source code is licensed under the MIT license found in the 496 * LICENSE.md file in the root directory of this source tree. 497 * 498 * @license MIT 499 */function G2(){return G2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},G2.apply(this,arguments)}const N5=E.createContext(null),SZ=E.createContext(null),Gf=E.createContext(null),T5=E.createContext(null),Vf=E.createContext({outlet:null,matches:[],isDataRoute:!1}),AZ=E.createContext(null);function bxe(t,e){let{relative:n}=e===void 0?{}:e;k1()||Es(!1);let{basename:r,navigator:i}=E.useContext(Gf),{hash:s,pathname:a,search:o}=M5(t,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:bm([r,a])),i.createHref({pathname:l,search:o,hash:s})}function k1(){return E.useContext(T5)!=null}function Wf(){return k1()||Es(!1),E.useContext(T5).location}function EZ(t){E.useContext(Gf).static||E.useLayoutEffect(t)}function Tx(){let{isDataRoute:t}=E.useContext(Vf);return t?Ixe():wxe()}function wxe(){k1()||Es(!1);let t=E.useContext(N5),{basename:e,future:n,navigator:r}=E.useContext(Gf),{matches:i}=E.useContext(Vf),{pathname:s}=Wf(),a=JSON.stringify(NF(i,n.v7_relativeSplatPath)),o=E.useRef(!1);return EZ(()=>{o.current=!0}),E.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=TF(u,JSON.parse(a),s,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:bm([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,a,s,t])}const _xe=E.createContext(null);function Sxe(t){let e=E.useContext(Vf).outlet;return e&&E.createElement(_xe.Provider,{value:t},e)}function M5(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=E.useContext(Gf),{matches:i}=E.useContext(Vf),{pathname:s}=Wf(),a=JSON.stringify(NF(i,r.v7_relativeSplatPath));return E.useMemo(()=>TF(t,JSON.parse(a),s,n==="path"),[t,a,s,n])}function Axe(t,e){return Exe(t,e)}function Exe(t,e,n,r){k1()||Es(!1);let{navigator:i}=E.useContext(Gf),{matches:s}=E.useContext(Vf),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Wf(),d;if(e){var h;let v=typeof e=="string"?E1(e):e;l==="/"||(h=v.pathname)!=null&&h.startsWith(l)||Es(!1),d=v}else d=u;let p=d.pathname||"/",f=p;if(l!=="/"){let v=l.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=Z0e(t,{pathname:f}),x=Mxe(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:bm([l,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:bm([l,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,n,r);return e&&x?E.createElement(T5.Provider,{value:{location:G2({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:im.Pop}},x):x}function kxe(){let t=Lxe(),e=vxe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application
499Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),n?E.createElement("pre",{style:i},n):null,null)}const Cxe=E.createElement(kxe,null);class Nxe extends E.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?E.createElement(Vf.Provider,{value:this.props.routeContext},E.createElement(AZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Txe(t){let{routeContext:e,match:n,children:r}=t,i=E.useContext(N5);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(Vf.Provider,{value:e},r)}function Mxe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,o=(i=n)==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||Es(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(n&&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:p,errors:f}=n,m=h.route.loader&&p[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||m){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,p)=>{let f,m=!1,x=null,v=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,x=h.route.errorElement||Cxe,l&&(u<0&&p===0?(m=!0,v=null):u===p&&(m=!0,v=h.route.hydrateFallbackElement||null)));let g=e.concat(a.slice(0,p+1)),b=()=>{let y;return f?y=x:m?y=v:h.route.Component?y=E.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=d,E.createElement(Txe,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?E.createElement(Nxe,{location:n.location,revalidation:n.revalidation,component:x,error:f,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):b()},null)}var kZ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(kZ||{}),QN=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(QN||{});function Rxe(t){let e=E.useContext(N5);return e||Es(!1),e}function jxe(t){let e=E.useContext(SZ);return e||Es(!1),e}function Pxe(t){let e=E.useContext(Vf);return e||Es(!1),e}function CZ(t){let e=Pxe(),n=e.matches[e.matches.length-1];return n.route.id||Es(!1),n.route.id}function Lxe(){var t;let e=E.useContext(AZ),n=jxe(QN.UseRouteError),r=CZ(QN.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Ixe(){let{router:t}=Rxe(kZ.UseNavigateStable),e=CZ(QN.UseNavigateStable),n=E.useRef(!1);return EZ(()=>{n.current=!0}),E.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,G2({fromRouteId:e},s)))},[t,e])}function Dxe(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function R5(t){let{to:e,replace:n,state:r,relative:i}=t;k1()||Es(!1);let{future:s,static:a}=E.useContext(Gf),{matches:o}=E.useContext(Vf),{pathname:l}=Wf(),u=Tx(),d=TF(e,NF(o,s.v7_relativeSplatPath),l,i==="path"),h=JSON.stringify(d);return E.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:i}),[u,h,i,n,r]),null}function Bxe(t){return Sxe(t.context)}function jn(t){Es(!1)}function Fxe(t){let{basename:e="/",children:n=null,location:r,navigationType:i=im.Pop,navigator:s,static:a=!1,future:o}=t;k1()&&Es(!1);let l=e.replace(/^\/*/,"/"),u=E.useMemo(()=>({basename:l,navigator:s,static:a,future:G2({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=E1(r));let{pathname:d="/",search:h="",hash:p="",state:f=null,key:m="default"}=r,x=E.useMemo(()=>{let v=Gb(d,l);return v==null?null:{location:{pathname:v,search:h,hash:p,state:f,key:m},navigationType:i}},[l,d,h,p,f,m,i]);return x==null?null:E.createElement(Gf.Provider,{value:u},E.createElement(T5.Provider,{children:n,value:x}))}function Oxe(t){let{children:e,location:n}=t;return Axe(gI(e),n)}new Promise(()=>{});function gI(t,e){e===void 0&&(e=[]);let n=[];
499return E.Children.forEach(t,(r,i)=>{if(!E.isValidElement(r))return;let s=[...e,i];if(r.type===E.Fragment){n.push.apply(n,gI(r.props.children,s));return}r.type!==jn&&Es(!1),!r.props.index||!r.props.children||Es(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=gI(r.props.children,s)),n.push(a)}),n}/** 500 * React Router DOM v6.30.1 501 * 502 * Copyright (c) Remix Software Inc. 503 * 504 * This source code is licensed under the MIT license found in the 505 * LICENSE.md file in the root directory of this source tree. 506 * 507 * @license MIT 508 */function eT(){return eT=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},eT.apply(this,arguments)}function NZ(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function zxe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Uxe(t,e){return t.button===0&&(!e||e==="_self")&&!zxe(t)}function xI(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Hxe(t,e){let n=xI(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const Gxe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Vxe=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Wxe="6";try{window.__reactRouterVersion=Wxe}catch{}const $xe=E.createContext({isTransitioning:!1}),Kxe="startTransition",U8=hB[Kxe];function qxe(t){let{basename:e,children:n,future:r,window:i}=t,s=E.useRef();s.current==null&&(s.current=X0e({window:i,v5Compat:!0}));let a=s.current,[o,l]=E.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=E.useCallback(h=>{u&&U8?U8(()=>l(h)):l(h)},[l,u]);return E.useLayoutEffect(()=>a.listen(d),[a,d]),E.useEffect(()=>Dxe(r),[r]),E.createElement(Fxe,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const Xxe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yxe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ax=E.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:h}=e,p=NZ(e,Gxe),{basename:f}=E.useContext(Gf),m,x=!1;if(typeof u=="string"&&Yxe.test(u)&&(m=u,Xxe))try{let y=new URL(window.location.href),S=u.startsWith("//")?new URL(y.protocol+u):new URL(u),A=Gb(S.pathname,f);S.origin===y.origin&&A!=null?u=A+S.search+S.hash:x=!0}catch{}let v=bxe(u,{relative:i}),g=Qxe(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:h});function b(y){r&&r(y),y.defaultPrevented||g(y)}return E.createElement("a",eT({},p,{href:m||v,onClick:x||s?r:b,ref:n,target:l}))}),Jxe=E.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:l,viewTransition:u,children:d}=e,h=NZ(e,Vxe),p=M5(l,{relative:h.relative}),f=Wf(),m=E.useContext(SZ),{navigator:x,basename:v}=E.useContext(Gf),g=m!=null&&eve(p)&&u===!0,b=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,y=f.pathname,S=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(y=y.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&v&&(S=Gb(S,v)||S);const A=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let k=y===b||!a&&y.startsWith(b)&&y.charAt(A)==="/",M=S!=null&&(S===b||!a&&S.startsWith(b)&&S.charAt(b.length)==="/"),T={isActive:k,isPending:M,isTransitioning:g},C=k?r:void 0,R;typeof s=="function"?R=s(T):R=[s,k?"active":null,M?"pending":null,g?"transitioning":null].filter(
508Boolean).join(" ");let P=typeof o=="function"?o(T):o;return E.createElement(ax,eT({},h,{"aria-current":C,className:R,ref:n,style:P,to:l,viewTransition:u}),typeof d=="function"?d(T):d)});var vI;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(vI||(vI={}));var H8;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(H8||(H8={}));function Zxe(t){let e=E.useContext(N5);return e||Es(!1),e}function Qxe(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=e===void 0?{}:e,l=Tx(),u=Wf(),d=M5(t,{relative:a});return E.useCallback(h=>{if(Uxe(h,n)){h.preventDefault();let p=r!==void 0?r:JN(u)===JN(d);l(t,{replace:p,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,l,d,r,i,n,t,s,a,o])}function Al(t){let e=E.useRef(xI(t)),n=E.useRef(!1),r=Wf(),i=E.useMemo(()=>Hxe(r.search,n.current?null:e.current),[r.search]),s=Tx(),a=E.useCallback((o,l)=>{const u=xI(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,l)},[s,i]);return[i,a]}function eve(t,e){e===void 0&&(e={});let n=E.useContext($xe);n==null&&Es(!1);let{basename:r}=Zxe(vI.useViewTransitionState),i=M5(t,{relative:e.relative});if(!n.isTransitioning)return!1;let s=Gb(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Gb(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ZN(i.pathname,a)!=null||ZN(i.pathname,s)!=null}var ah=function(){return ah=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ah.apply(this,arguments)};function C1(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function tve(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(d){try{u(r.next(d))}catch(h){a(h)}}function l(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})}function nve(t,e,n){if(n||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 t.concat(s||Array.prototype.slice.call(e))}const rve=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class MF extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class ive extends MF{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class G8 extends MF{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class V8 extends MF{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var yI;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(yI||(yI={}));class sve{constructor(e,{headers:n={},customFetch:r,region:i=yI.Any}={}){this.url=e,this.headers=n,this.region=i,this.fetch=rve(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return tve(this,arguments,void 0,function*(n,r={}){var i;let s,a;try{const{headers:o,method:l,body:u,signal:d,timeout:h}=r;let p={},{region:f}=r;f||(f=this.region);const m=new URL(`${this.url}/${n}`);f&&f!=="any"&&(p["x-region"]=f,m.searchParams.set("forceFunctionRegion",f));let x;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",x=u):typeof u=="string"?(p["Content-Type"]="text/plain",x=u):typeof FormData<"u"&&u instanceof FormData?x=u:(p["Content-Type"]="application/json",x=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?x=JSON.stringify(u):x=u;let v=d;h&&(a=new AbortController,s=setTimeout(()=>a.abort(),h),d?(v=a.signal,d.addEventListener("abort",()=>a.abort())):v=a.signal);const g=yield this.fetch(m.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),o),body:x,signal:v}).catch(A=>{throw new ive(A)}),b=g.headers.get("x-relay-error");
508if(b&&b==="true")throw new G8(g);if(!g.ok)throw new V8(g);let y=((i=g.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),S;return y==="application/json"?S=yield g.json():y==="application/octet-stream"||y==="application/pdf"?S=yield g.blob():y==="text/event-stream"?S=g:y==="multipart/form-data"?S=yield g.formData():S=yield g.text(),{data:S,error:null,response:g}}catch(o){return{data:null,error:o,response:o instanceof V8||o instanceof G8?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var ave=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}},ove=class{constructor(t){var e,n,r;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(r=t.urlLengthLimit)!==null&&r!==void 0?r:8e3,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}then(t,e){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let a=null,o=null,l=null,u=s.status,d=s.statusText;if(s.ok){var h,p;if(n.method!=="HEAD"){var f;const g=await s.text();g===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((f=n.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?o=g:o=JSON.parse(g))}const x=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),v=(p=s.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");x&&v&&v.length>1&&(l=parseInt(v[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(o)&&(o.length>1?(a={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,l=null,u=406,d="Not Acceptable"):o.length===1?o=o[0]:o=null)}else{var m;const x=await s.text();try{a=JSON.parse(x),Array.isArray(a)&&s.status===404&&(o=[],a=null,u=200,d="OK")}catch{s.status===404&&x===""?(u=204,d="No Content"):a={message:x}}if(a&&n.isMaybeSingle&&(!(a==null||(m=a.details)===null||m===void 0)&&m.includes("0 rows"))&&(a=null,u=200,d="OK"),a&&n.shouldThrowOnError)throw new ave(a)}return{error:a,data:o,count:l,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(s=>{var a;let o="",l="",u="";const d=s==null?void 0:s.cause;if(d){var h,p,f,m;const g=(h=d==null?void 0:d.message)!==null&&h!==void 0?h:"",b=(p=d==null?void 0:d.code)!==null&&p!==void 0?p:"";o=`${(f=s==null?void 0:s.name)!==null&&f!==void 0?f:"FetchError"}: ${s==null?void 0:s.message}`,o+=` 509 510Caused by: ${(m=d==null?void 0:d.name)!==null&&m!==void 0?m:"Error"}: ${g}`,b&&(o+=` (${b})`),d!=null&&d.stack&&(o+=` 511${d.stack}`)}else{var x;o=(x=s==null?void 0:s.stack)!==null&&x!==void 0?x:""}const v=this.url.toString().length;return(s==null?void 0:s.name)==="AbortError"||(s==null?void 0:s.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(l+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:o,hint:l,code:u},data:null,count:null,status:0,statusText:""}}
511)),i.then(t,e)}returns(){return this}overrideTypes(){return this}},lve=class extends ove{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var a;const o=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const W8=new RegExp("[,()]");var sy=class extends lve{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&W8.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&W8.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${i}fts${s}.${e}`),this}match(t){return Object.entries(t).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},cve=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:i=8e3}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=i}
511cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},i=n?"HEAD":"GET";let s=!1;const a=(t??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",a),r&&l.append("Prefer",`count=${r}`),new sy({method:i,url:o,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),n||a.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(o.length>0){const l=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",l.join(","))}}return new sy({method:i,url:s,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),r&&l.append("Prefer",`count=${r}`),i||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);o.searchParams.set("columns",d.join(","))}}return new sy({method:a,url:o,headers:l,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit})}update(t,{count:e}={}){var n;const r="PATCH",{url:i,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new sy({method:r,url:i,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new sy({method:n,url:r,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit})}};function V2(t){"@babel/helpers - typeof";return V2=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},V2(t)}function uve(t,e){if(V2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(V2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dve(t){var e=uve(t,"string");return V2(e)=="symbol"?e:e+""}function hve(t,e,n){return(e=dve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function PE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$8(Object(n),!0).forEach(function(r){hve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var fve=class TZ{constructor(e,{headers:n={},schema:r,fetch:i,timeout:s,urlLengthLimit:a=8e3}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=a;const o=i??globalThis.fetch;s!==void 0&&s>0?this.fetch=(l,u)=>{const d=new AbortController,h=setTimeout(()=>d.abort(),s),p=u==null?void 0:u.signal;if(p){if(p.aborted)return clearTimeout(h),o(l,u);const f=()=>{clearTimeout(h),d.abort()};return p.addEventListener("abort",f,{once:!0}),o(l,PE(PE({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(h),p.removeEventListener("abort",f)})}return o(l,PE(PE({},u),{},{signal:d.signal})).finally(()=>clearTimeout(h))}:this.fetch=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new cve(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(e){return new TZ(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,n={},{head:r=!1,get:i=!1,count:s}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let u;const d=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(d)),h=r&&Object.values(n).some(d);h?(o="POST",u=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([f,m])=>m!==void 0).map(([f,m])=>[f,Array.isArray(m)?`{${m.join(",")}}`:`${m}
511`]).forEach(([f,m])=>{l.searchParams.append(f,m)})):(o="POST",u=n);const p=new Headers(this.headers);return h?p.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&p.set("Prefer",`count=${s}`),new sy({method:o,url:l,headers:p,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}};class pve{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 512import ws from "ws" 513new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=` 514 515Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const mve="2.97.0",gve=`realtime-js/${mve}`,xve="1.0.0",MZ="2.0.0",K8=MZ,bI=1e4,vve=1e3,yve=100;var Lp;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Lp||(Lp={}));var Aa;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Aa||(Aa={}));var ld;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(ld||(ld={}));var wI;(function(t){t.websocket="websocket"})(wI||(wI={}));var s0;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(s0||(s0={}));class bve{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var n,r;const i=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,n,r){var i,s;const a=e.topic,o=(i=e.ref)!==null&&i!==void 0?i:"",l=(s=e.join_ref)!==null&&s!==void 0?s:"",u=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+u.length+h.length,f=new ArrayBuffer(this.HEADER_LENGTH+p);let m=new DataView(f),x=0;m.setUint8(x++,this.KINDS.userBroadcastPush),m.setUint8(x++,l.length),m.setUint8(x++,o.length),m.setUint8(x++,a.length),m.setUint8(x++,u.length),m.setUint8(x++,h.length),m.setUint8(x++,n),Array.from(l,g=>m.setUint8(x++,g.charCodeAt(0))),Array.from(o,g=>m.setUint8(x++,g.charCodeAt(0))),Array.from(a,g=>m.setUint8(x++,g.charCodeAt(0))),Array.from(u,g=>m.setUint8(x++,g.charCodeAt(0))),Array.from(h,g=>m.setUint8(x++,g.charCodeAt(0)));var v=new Uint8Array(f.byteLength+r.byteLength);return v.set(new Uint8Array(f),0),v.set(new Uint8Array(r),f.byteLength),v.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[i,s,a,o,l]=r;
515return n({join_ref:i,ref:s,topic:a,event:o,payload:l})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,i)}}_decodeUserBroadcast(e,n,r){const i=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),o=n.getUint8(4);let l=this.HEADER_LENGTH+4;const u=r.decode(e.slice(l,l+i));l=l+i;const d=r.decode(e.slice(l,l+s));l=l+s;const h=r.decode(e.slice(l,l+a));l=l+a;const p=e.slice(l,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,m={type:this.BROADCAST_EVENT,event:d,payload:f};return a>0&&(m.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}class RZ{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Fi;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Fi||(Fi={}));const q8=(t,e,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,a)=>(s[a]=wve(a,t,e,i),s),{}):{}},wve=(t,e,n,r)=>{const i=e.find(o=>o.name===t),s=i==null?void 0:i.type,a=n[t];return s&&!r.includes(s)?jZ(s,a):_I(a)},jZ=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return Eve(e,n)}switch(t){case Fi.bool:return _ve(e);case Fi.float4:case Fi.float8:case Fi.int2:case Fi.int4:case Fi.int8:case Fi.numeric:case Fi.oid:return Sve(e);case Fi.json:case Fi.jsonb:return Ave(e);case Fi.timestamp:return kve(e);case Fi.abstime:case Fi.date:case Fi.daterange:case Fi.int4range:case Fi.int8range:case Fi.money:case Fi.reltime:case Fi.text:case Fi.time:case Fi.timestamptz:case Fi.timetz:case Fi.tsrange:case Fi.tstzrange:return _I(e);default:return _I(e)}},_I=t=>t,_ve=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Sve=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},Ave=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},Eve=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const a=t.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>jZ(e,o))}return t},kve=t=>typeof t=="string"?t.replace(" ","T"):t,PZ=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class eR{constructor(e,n,r={},i=bI){this.channel=e,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHo
515oks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var X8;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(X8||(X8={}));class q_{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=q_.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=q_.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=q_.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,i){const s=this.cloneDeep(e),a=this.transformState(n),o={},l={};return this.map(s,(u,d)=>{a[u]||(l[u]=d)}),this.map(a,(u,d)=>{const h=s[u];if(h){const p=d.map(v=>v.presence_ref),f=h.map(v=>v.presence_ref),m=d.filter(v=>f.indexOf(v.presence_ref)<0),x=h.filter(v=>p.indexOf(v.presence_ref)<0);m.length>0&&(o[u]=m),x.length>0&&(l[u]=x)}else o[u]=d}),this.syncDiff(s,{joins:o,leaves:l},r,i)}static syncDiff(e,n,r,i){const{joins:s,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(o,l)=>{var u;const d=(u=e[o])!==null&&u!==void 0?u:[];if(e[o]=this.cloneDeep(l),d.length>0){const h=e[o].map(f=>f.presence_ref),p=d.filter(f=>h.indexOf(f.presence_ref)<0);e[o].unshift(...p)}r(o,d,l)}),this.map(a,(o,l)=>{let u=e[o];if(!u)return;const d=l.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),e[o]=u,i(o,u,l),u.length===0&&delete e[o]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const i=e[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Y8;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Y8||(Y8={}));var X_;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(X_||(X_={}));var lf;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(lf||(lf={}));class jy{constructor(e,n={config:{}},r){var i,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Aa.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new eR(this,ld.join,this.params,this.timeout),this.rejoinTimer=new RZ(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Aa.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Aa.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Aa.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ld.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new q_(this),this.broadcastEndpointURL=PZ(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Aa.closed){const{config:{broadcast:a,presence:o,private:l}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[X_.PRESENCE]&&this.bindings[X_.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,h={},p={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(f=>e==null?void 0:e(lf.CHANNEL_ERROR,f)),this._onClose(()=>e==null?void 0:e(lf.CLOSED)),this.updateJoinPayload(Object.assign({config:p},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:f})=>{var m;if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){e==null||e(lf.SUBSCRIBED);return}else{const x=this.bindings.postgres_changes,v=(m=x==null?void 0:x.length)!==null&&m!==void 0?m:0,g=[];for(let b=0;b<v;b++){const y=x[b],{filter:{event:S,schema:A,table:k,filter:M}}=y,T=f&&f[b];if(T&&T.event===S&&jy.isFilterValueEqual(T.schema,A)&&jy.isFilterValueEqual(T.table,k)&&jy.isFilterValueEqual(T.filter,M))g.push(Object.assign(Object.assign({},y),{id:T.id}));else{this.unsubscribe(),this.state=Aa.errored,e==null||e(lf.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,e&&e(lf.SUBSCRIBED);return}}).receive("error",f=>{this.state=Aa.errored,e==null||e(lf.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(lf.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===Aa.joined&&e===X_.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,n,r)}async httpSend(e,n,r={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;
515try{const u=await o.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,n={}){var r,i;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:a}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,l;const u=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Aa.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ld.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new eR(this,ld.leave,{},e),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Aa.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new eR(this,e,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>yve){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var i,s;const a=e.toLocaleLowerCase(),{close:o,error:l,leave:u,join:d}=ld;if(r&&[o,l,u,d].indexOf(a)>=0&&r!==this._joinRef())return;let p=this._onMessage(a,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(f=>{var m,x,v;return((m=f.filter)===null||m===void 0?void 0:m.event)==="*"||((v=(x=f.filter)===null||x===void 0?void 0:x.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===a}).map(f=>f.callback(p,r)):(s=this.bindings[a])===null||s===void 0||s.filter(f=>{var m,x,v,g,b,y;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in f){const S=f.id,A=(m=f.filter)===null||m===void 0?void 0:m.event;return S&&((x=n.ids)===null||x===void 0?void 0:x.includes(S))&&(A==="*"||(A==null?void 0:A.toLocaleLowerCase())===((v=n.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const S=(b=(g=f==null?void 0:f.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return S==="*"||S===((y=n==null?void 0:n.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===a}).map(f=>{if(typeof p=="object"&&"ids"in p){const m=p.data,{schema:x,table:v,commit_timestamp:g,type:b,errors:y}=m;p=Object.assign(Object.assign({},{schema:x,table:v,commit_timestamp:g,eventType:b,new:{},old:{},errors:y}),this._getPayloadRecords(m))}f.callback(p,r)})}_isClosed(){return this.state===Aa.closed}_isJoined(){return this.state===Aa.joined}_isJoining(){return this.state===Aa.joining}_isLeaving(){return this.state===Aa.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const i=e.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&jy.isEqual(i.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(ld.close,{},e)}_onError(e){this._on(ld.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Aa.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=q8(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=q8(e.columns,e.old_record)),n}}const tR=()=>{},LE={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Cve=[1e3,2e3,5e3,1e4],Nve=1e4,Tve=` 516 addEventListener("message", (e) => { 517 if (e.data.event === "start") { 518 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 519 } 520 });`;class Mve{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=bI,this.transport=null,this.heartbeatIntervalMs=LE.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=tR,this.ref=0,this.reconnectTimer=null,this.vsn=K8,this.logger=tR,this.conn=null,this.sendBuffer=[],this.serializer
520=new bve,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...s)=>i(...s):(...s)=>fetch(...s),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${wI.websocket}`,this.httpEndpoint=PZ(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=pve.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n} 521 522To use Realtime in Node.js, you need to provide a WebSocket implementation: 523 524Option 1: Use Node.js 22+ which has native WebSocket support 525Option 2: Install and provide the "ws" package: 526 527 npm install ws 528 529 import ws from "ws" 530 const client = new RealtimeClient(url, { 531 ...options, 532 transport: ws 533 })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Lp.connecting:return s0.Connecting;case Lp.open:return s0.Open;case Lp.closing:return s0.Closing;default:return s0.Closed}}isConnected(){return this.connectionState()===s0.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new jy(`realtime:${e}`,n,this);return this.channels.push(s),s}}push(e){const{topic:n,event:r,payload:i,ref:s}=e,a=()=>{this.encode(e,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(vve,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},LE.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
5330&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:i,payload:s,ref:a}=n,o=a?`(${a})`:"",l=s.status||"";this.log("receive",`${l} ${r} ${i} ${o}`.trim(),s),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,s,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===Lp.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Lp.open||this.conn.readyState===Lp.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(e=>e._trigger(ld.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${e}${r}${i}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([Tve],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEac
533h(i=>{const s={access_token:n,version:gve};n&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(ld.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new RZ(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},LE.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,i,s,a,o,l,u,d,h,p,f;switch(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:bI,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:LE.HEARTBEAT_INTERVAL,this.worker=(s=e==null?void 0:e.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=e==null?void 0:e.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:tR,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:K8,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:m=>Cve[m-1]||Nve,this.vsn){case xve:this.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:(m,x)=>x(JSON.stringify(m)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:(m,x)=>x(JSON.parse(m));break;case MZ:this.encode=(p=e==null?void 0:e.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(f=e==null?void 0:e.decode)!==null&&f!==void 0?f:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}var W2=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Rve(t,e,n){const r=new URL(e,t);if(n)for(const[i,s]of Object.entries(n))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function jve(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function Pve(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=Rve(t.baseUrl,r,i),l=await jve(t.auth),u=await e(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...l,...a},body:s?JSON.stringify(s):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),p=h&&d?JSON.parse(d):d;if(!u.ok){const f=h?p:void 0,m=f==null?void 0:f.error;throw new W2((m==null?void 0:m.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:f})}return{status:u.status,headers:u.headers,data:p}}}}function IE(t){return t.join("�")}var Lve=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:IE(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${IE(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${IE(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${IE(t.namespace)}`}),!0}catch(e){if(e instanceof W2&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof W2&&n.status===409)return;throw n}}};function dv(t){return t.join("�")}var Ive=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${dv(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${dv(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${dv(t.namespace)}
533/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${dv(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${dv(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${dv(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof W2&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof W2&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},Dve=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=Pve({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new Lve(this.client,e),this.tableOps=new Ive(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},j5=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function P5(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var DE=class extends j5{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},LZ=class extends j5{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const Bve=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Fve=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},SI=t=>{if(Array.isArray(t))return t.map(n=>SI(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=SI(r)}),e},Ove=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function $2(t){"@babel/helpers - typeof";return $2=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},$2(t)}function zve(t,e){if($2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if($2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uve(t){var e=zve(t,"string");return $2(e)=="symbol"?e:e+""}function Hve(t,e,n){return(e=Uve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Kn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
533e%2?J8(Object(n),!0).forEach(function(r){Hve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const Z8=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},Gve=async(t,e,n,r)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const i=t,s=i.status||500;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";e(new DE(Z8(a),s,o,r))}).catch(()=>{if(r==="vectors"){const a=s+"";e(new DE(i.statusText||`HTTP ${s} error`,s,a,r))}else{const a=s+"";e(new DE(i.statusText||`HTTP ${s} error`,s,a,r))}});else{const a=s+"";e(new DE(i.statusText||`HTTP ${s} error`,s,a,r))}}else e(new LZ(Z8(t),t,r))},Vve=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||t==="HEAD"||!r?Kn(Kn({},i),n):(Fve(r)?(i.headers=Kn({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(r)):i.body=r,e!=null&&e.duplex&&(i.duplex=e.duplex),Kn(Kn({},i),n))};async function Uw(t,e,n,r,i,s,a){return new Promise((o,l)=>{t(n,Vve(e,r,i,s)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(a==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>Gve(u,l,r,a))})}function IZ(t="storage"){return{get:async(e,n,r,i)=>Uw(e,"GET",n,r,i,void 0,t),post:async(e,n,r,i,s)=>Uw(e,"POST",n,i,s,r,t),put:async(e,n,r,i,s)=>Uw(e,"PUT",n,i,s,r,t),head:async(e,n,r,i)=>Uw(e,"HEAD",n,Kn(Kn({},r),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,n,r,i,s)=>Uw(e,"DELETE",n,i,s,r,t)}}const Wve=IZ("storage"),{get:K2,post:rd,put:AI,head:$ve,remove:RF}=Wve,yc=IZ("vectors");var N1=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.fetch=Bve(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Kn(Kn({},this.headers),{},{[t]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(P5(n))return{data:null,error:n};throw n}}},Kve=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(P5(e))return{data:null,error:e};throw e}}};let DZ;DZ=Symbol.toStringTag;var qve=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[DZ]="BlobDownloadBuilder",this.promise=null}asStream(){return new Kve(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(P5(e))return{data:null,error:e};throw e}}};const Xve={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Q8={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Yve=class extends N1{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var i=this;return i.handleOperation(async()=>{let s;const a=Kn(Kn({},Q8),r);let o=Kn(Kn({},i.headers),t==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers&&(o=Kn(Kn({},o),r.headers));const u=i._removeEmptyFolders(e),d=i._getFinalPath(u),h=await(t=="PUT"?AI:rd)(i.fetch,`${i.url}/object/${d}`,s,Kn({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var i=this;const s=i._removeEmptyFolders(t),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),i.handleOperation(async()=>{let l;const u=Kn({upsert:Q8.upsert},r),d=Kn(Kn({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:s,fullPath:(await AI(i.fetch,o.toString(),l,{headers:d})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const i=Kn({},n.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const s=await rd(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(n.url+s.url),o=a.searchParams.get("token");if(!o)throw new j5("No token returned by API");return{signedUrl:a.toString(),path:t,token:o}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await rd(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await rd(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(t),s=await rd(r.fetch,`${r.url}/object/sign/${i}
533`,Kn({expiresIn:e},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${s.signedURL}${a}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const i=await rd(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(a=>Kn(Kn({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${s}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),s=i?`?${i}`:"",a=this._getFinalPath(t),o=()=>K2(this.fetch,`${this.url}/${r}/${a}${s}`,{headers:this.headers,noResolveJson:!0},n);return new qve(o,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>SI(await K2(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await $ve(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(P5(r)&&r instanceof LZ){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=[],i=e!=null&&e.download?`download=${e.download===!0?"":e.download}`:"";i!==""&&r.push(i);const s=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((e==null?void 0:e.transform)||{});a!==""&&r.push(a);let o=r.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${o}`)}}}async remove(t){var e=this;return e.handleOperation(async()=>await RF(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const i=Kn(Kn(Kn({},Xve),e),{},{prefix:t||""});return await rd(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=Kn({},t);return await rd(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const e=[];return t.width&&e.push(`width=${t.width}`),t.height&&e.push(`height=${t.height}`),t.resize&&e.push(`resize=${t.resize}`),t.format&&e.push(`format=${t.format}`),t.quality&&e.push(`quality=${t.quality}`),e.join("&")}};const Jve="2.97.0",YS={"X-Client-Info":`storage-js/${Jve}`};var Zve=class extends N1{constructor(t,e={},n,r){const i=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const s=i.href.replace(/\/$/,""),a=Kn(Kn({},YS),e);super(s,a,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await K2(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await K2(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await rd(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await AI(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await rd(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await RF(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},Qve=class extends N1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=Kn(Kn({},YS),e);super(r,i,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await rd(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),i=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await K2(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await RF(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!Ove(t))throw new j5("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new Dve({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
533),r=this.shouldThrowOnError;return new Proxy(n,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},eye=class extends N1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=Kn(Kn({},YS),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await yc.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await yc.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},tye=class extends N1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=Kn(Kn({},YS),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},nye=class extends N1{constructor(t,e={},n){const r=t.replace(/\/$/,""),i=Kn(Kn({},YS),{},{"Content-Type":"application/json"},e);super(r,i,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await yc.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},rye=class extends nye{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new iye(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},iye=class extends eye{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new sye(this.url,this.headers,this.vectorBucketName,t,this.fetch)}}
533,sye=class extends tye{constructor(t,e,n,r,i){super(t,e,i),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,Kn(Kn({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},aye=class extends Zve{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new Yve(this.url,this.headers,t,this.fetch)}get vectors(){return new rye(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Qve(this.url+"/iceberg",this.headers,this.fetch)}};const BZ="2.97.0",ay=30*1e3,EI=3,nR=EI*ay,oye="http://localhost:9999",lye="supabase.auth.token",cye={"X-Client-Info":`gotrue-js/${BZ}`},kI="X-Supabase-Api-Version",FZ={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},uye=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,dye=10*60*1e3;class q2 extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Mn(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class hye extends q2{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function fye(t){return Mn(t)&&t.name==="AuthApiError"}class a0 extends q2{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class $f extends q2{constructor(e,n,r,i){super(e,r,i),this.name=n,this.status=r}}class fc extends $f{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function rR(t){return Mn(t)&&t.name==="AuthSessionMissingError"}class hv extends $f{constructor(){super("Auth session or user missing","AuthInvalidToken
533ResponseError",500,void 0)}}class BE extends $f{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class FE extends $f{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function pye(t){return Mn(t)&&t.name==="AuthImplicitGrantRedirectError"}class e9 extends $f{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class mye extends $f{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class CI extends $f{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function iR(t){return Mn(t)&&t.name==="AuthRetryableFetchError"}class t9 extends $f{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class NI extends $f{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const tT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),n9=` 534\r=`.split(""),gye=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<n9.length;e+=1)t[n9[e].charCodeAt(0)]=-2;for(let e=0;e<tT.length;e+=1)t[tT[e].charCodeAt(0)]=e;return t})();function r9(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(tT[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(tT[r]),e.queuedBits-=6}}function OZ(t,e,n){const r=gye[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function i9(t){const e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{yye(a,r,n)};for(let a=0;a<t.length;a+=1)OZ(t.charCodeAt(a),i,s);return e.join("")}function xye(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function vye(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}xye(r,e)}}function yye(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function tb(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)OZ(t.charCodeAt(i),n,r);return new Uint8Array(e)}function bye(t){const e=[];return vye(t,n=>e.push(n)),new Uint8Array(e)}function p0(t){const e=[],n={queue:0,queuedBits:0},r=i=>{e.push(i)};return t.forEach(i=>r9(i,n,r)),r9(null,n,r),e.join("")}function wye(t){return Math.round(Date.now()/1e3)+t}function _ye(){return Symbol("auth-callback")}const uo=()=>typeof window<"u"&&typeof document<"u",Cg={tested:!1,writable:!1},zZ=()=>{if(!uo())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Cg.tested)return Cg.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Cg.tested=!0,Cg.writable=!0}catch{Cg.tested=!0,Cg.writable=!1}return Cg.writable};function Sye(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
534h((i,s)=>{e[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{e[i]=r}),e}const UZ=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),Aye=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",oy=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},Ng=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},oo=async(t,e)=>{await t.removeItem(e)};class L5{constructor(){this.promise=new L5.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}L5.promiseConstructor=Promise;function OE(t){const e=t.split(".");if(e.length!==3)throw new NI("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!uye.test(e[r]))throw new NI("JWT not in base64url format");return{header:JSON.parse(i9(e[0])),payload:JSON.parse(i9(e[1])),signature:tb(e[2]),raw:{header:e[0],payload:e[1]}}}async function Eye(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function kye(t,e){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await t(s);if(!e(s,null,a)){r(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function Cye(t){return("0"+t.toString(16)).substr(-2)}function Nye(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(e),Array.from(e,Cye).join("")}async function Tye(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function Mye(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await Tye(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function fv(t,e,n=!1){const r=Nye();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await oy(t,`${e}-code-verifier`,i);const s=await Mye(r);return[s,r===s?"plain":"s256"]}const Rye=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function jye(t){const e=t.headers.get(kI);if(!e||!e.match(Rye))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Pye(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function Lye(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Iye=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function pv(t){if(!Iye.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function sR(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Dye(t,e){return new Proxy(t,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(n,r,i)}})}function s9(t){return JSON.parse(JSON.stringify(t))}const Zg=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Bye
534=[502,503,504];async function a9(t){var e;if(!Aye(t))throw new CI(Zg(t),0);if(Bye.includes(t.status))throw new CI(Zg(t),t.status);let n;try{n=await t.json()}catch(s){throw new a0(Zg(s),s)}let r;const i=jye(t);if(i&&i.getTime()>=FZ["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new t9(Zg(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new fc}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new t9(Zg(n),t.status,n.weak_password.reasons);throw new hye(Zg(n),t.status||500,r)}const Fye=(t,e,n,r)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Xn(t,e,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[kI]||(s[kI]=FZ["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await Oye(t,e,n+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function Oye(t,e,n,r,i,s){const a=Fye(e,r,i,s);let o;try{o=await t(n,Object.assign({},a))}catch(l){throw console.error(l),new CI(Zg(l),0)}if(o.ok||await a9(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await a9(l)}}function Qu(t){var e;let n=null;Hye(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=wye(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function o9(t){const e=Qu(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Up(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function zye(t){return{data:t,error:null}}function Uye(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=t,a=C1(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function l9(t){return t}function Hye(t){return t.access_token&&t.refresh_token&&t.expires_in}const aR=["global","local","others"];class Gye{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=UZ(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,n=aR[0]){if(aR.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${aR.join(", ")}`);try{return await Xn(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Mn(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Xn(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Up})}catch(r){if(Mn(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=C1(e,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Xn(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:Uye,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Mn(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Xn(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Up})}catch(n){if(Mn(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Xn(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:l9});if(d.error)throw d.error;const h=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(m=>{const x=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(m.split(";")[1].split("=")[1]);u[`${v}Page`]=x}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Mn(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){pv(e);try{return await Xn(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Up})}catch(n){if(Mn(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){pv(e);try{return await Xn(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Up})}catch(r){if(Mn(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){pv(e);
534try{return await Xn(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Up})}catch(r){if(Mn(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){pv(e.userId);try{const{data:n,error:r}=await Xn(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Mn(n))return{data:null,error:n};throw n}}async _deleteFactor(e){pv(e.userId),pv(e.id);try{return{data:await Xn(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Mn(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,i,s,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Xn(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:l9});if(d.error)throw d.error;const h=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(m=>{const x=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(m.split(";")[1].split("=")[1]);u[`${v}Page`]=x}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Mn(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Xn(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Mn(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Xn(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Mn(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Xn(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Mn(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Xn(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Mn(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Xn(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Mn(n))return{data:null,error:n};throw n}}}function c9(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const mv={debug:!!(globalThis&&zZ()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class HZ extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class u9 extends HZ{}async function Vye(t,e,n){mv.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;e>0&&setTimeout(()=>{r.abort(),mv.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){mv.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{mv.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw mv.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new u9(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(mv.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}})}catch(i){throw(i==null?void 0:i.name)==="AbortError"?new u9(`Acquiring an exclusive Navigator LockManager lock "${t}" timed out waiting ${e}ms`):i}}function Wye(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function GZ(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
534" is invalid.`);return t.toLowerCase()}function $ye(t){return parseInt(t,16)}function Kye(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function qye(t){var e;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:d,uri:h,version:p}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(` 535`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const f=GZ(t.address),m=d?`${d}://${r}`:r,x=t.statement?`${t.statement} 536`:"",v=`${m} wants you to sign in with your Ethereum account: 537${f} 538 539${x}`;let g=`URI: ${h} 540Version: ${p} 541Chain ID: ${n}${a?` 542Nonce: ${a}`:""} 543Issued At: ${s.toISOString()}`;if(i&&(g+=` 544Expiration Time: ${i.toISOString()}`),o&&(g+=` 545Not Before: ${o.toISOString()}`),l&&(g+=` 546Request ID: ${l}`),u){let b=` 547Resources:`;for(const y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);b+=` 548- ${y}`}g+=b}return`${v} 549${g}`}
549class ua extends Error{constructor({message:e,code:n,cause:r,name:i}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class nT extends ua{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Xye({error:t,options:e}){var n,r,i;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ua({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new ua({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new ua({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new ua({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new ua({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new ua({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new ua({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new ua({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(VZ(a)){if(s.rp.id!==a)return new ua({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new ua({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Yye({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ua({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new ua({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(VZ(r)){if(n.rpId!==r)return new ua({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Jye{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Zye=new Jye;function Qye(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,i=C1(t,["challenge","user","excludeCredentials"]),s=tb(e).buffer,a=Object.assign(Object.assign({},n),{id:tb(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const u=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:tb(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function ebe(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=C1(t,["challenge","allowCredentials"]),i=tb(e).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:tb(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function tbe(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:p0(new Uint8Array(t.response.attestationObject)),clientDataJSON:p0(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function nbe(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:p0(new Uint8Array(i.authenticatorData)),clientDataJSON:p0(new Uint8Array(i.clientDataJSON)),signature:p0(new Uint8Array(i.signature)),userHandle:i.userHandle?p0(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function VZ(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function d9(){var t,e;return!!(uo()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function rbe(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new nT("Browser returned unexpected credential type",e)}:{data:null,error:new nT("Empty credential response",e)}}catch(e){return{data:null,error:Xye({error:e,options:t})}}}async function ibe(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new nT("Browser returned unexpected credential type",e)}:{data:null,error:new nT("Empty credential response",e)}}catch(e){return{data:null,error:Yye({error:e,options:t})}}}const sbe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},abe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function rT(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of t)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(e(a)){const o=r[s];e(o)?r[s]=rT(o,a):r[s]=rT(a)}else r[s]=a}return r}function obe(t,e){return rT(sbe,t,e||{})}function lbe(t,e){return rT(abe,t,e||{})}class cbe{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:i},s){var a;try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!o)return{data:null,error:l};const u=i??Zye.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;if(!d.name){const h=r;if(h)d.name=`${d.id}:${h}`;else{const f=(await this.client.getUser()).data.user,m=((a=f==null?void 0:f.user_metadata)===null||a===void 0?void 0:a.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";d.name=`${d.id}:${m}`}}d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=obe(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:h,error:p}=await rbe({publicKey:d,signal:u});return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}case"request":{const d=lbe(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:h,error:p}=await ibe(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}}}catch(o){return Mn(o)?{data:null,error:o}:{data:null,error:new a0("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new q2("rpId is required for WebAuthn authentication")};try{if(!d9())return{data:null,error:new a0("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return Mn(a)?{data:null,error:a}:{data:null,error:new a0("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new q2("rpId is required for WebAuthn registration")};try{if(!d9())return{data:null,error:new a0("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(d=>{var h;
549return(h=d.data)===null||h===void 0?void 0:h.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(a){return Mn(a)?{data:null,error:a}:{data:null,error:new a0("Unexpected error in register",a)}}}}Wye();const ube={url:oye,storageKey:lye,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:cye,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4,skipAutoInitialize:!1};async function h9(t,e,n){return await n()}const gv={};class X2{get jwks(){var e,n;return(n=(e=gv[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){gv[this.storageKey]=Object.assign(Object.assign({},gv[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=gv[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){gv[this.storageKey]=Object.assign(Object.assign({},gv[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},ube),e);if(this.storageKey=s.storageKey,this.instanceID=(n=X2.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,X2.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&uo()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Gye({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=UZ(s.fetch),this.lock=s.lock||h9,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&uo()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=Vye:this.lock=h9,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new cbe(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:zZ()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=c9(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=c9(this.memoryStorage)),uo()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}s.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${BZ}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(uo()&&(n=Sye(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),uo()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),pye(s)){const l=(e=s.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Mn(n)?this._returnResult({error:n}):this._returnResult({error:new a0("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,i;try{const s=await Xn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:Qu}),{data:a,error:o}=s;
549if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(Mn(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,i;try{let s;if("email"in e){const{email:d,password:h,options:p}=e;let f=null,m=null;this.flowType==="pkce"&&([f,m]=await fv(this.storage,this.storageKey)),s=await Xn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:h,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:f,code_challenge_method:m},xform:Qu})}else if("phone"in e){const{phone:d,password:h,options:p}=e;s=await Xn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(i=p==null?void 0:p.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Qu})}else throw new BE("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return await oo(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:a,options:o}=e;n=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:o9})}else if("phone"in e){const{phone:s,password:a,options:o}=e;n=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:o9})}else throw new BE("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new hv;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Mn(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,i,s,a,o,l,u,d,h,p;let f,m;if("message"in e)f=e.message,m=e.signature;else{const{chain:x,wallet:v,statement:g,options:b}=e;let y;if(uo())if(typeof v=="object")y=v;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")y=C.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=v}const S=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),A=await y.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!A||A.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=GZ(A[0]);let M=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!M){const C=await y.request({method:"eth_chainId"});M=$ye(C)}const T={domain:S.host,address:k,statement:g,uri:S.href,version:"1",chainId:M,nonce:(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=b==null?void 0:b.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.resources};f=qye(T),m=await y.request({method:"personal_sign",params:[Kye(f),k]})}try{const{data:x,error:v}=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:m}
549,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Qu});if(v)throw v;if(!x||!x.session||!x.user){const g=new hv;return this._returnResult({data:{user:null,session:null},error:g})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:v})}catch(x){if(Mn(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(e){var n,r,i,s,a,o,l,u,d,h,p,f;let m,x;if("message"in e)m=e.message,x=e.signature;else{const{chain:v,wallet:g,statement:b,options:y}=e;let S;if(uo())if(typeof g=="object")S=g;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))S=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=g}const A=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const k=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:A.host,uri:A.href}),b?{statement:b}:null));let M;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")M=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)M=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in M&&"signature"in M&&(typeof M.signedMessage=="string"||M.signedMessage instanceof Uint8Array)&&M.signature instanceof Uint8Array)m=typeof M.signedMessage=="string"?M.signedMessage:new TextDecoder().decode(M.signedMessage),x=M.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${A.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${A.href}`,`Issued At: ${(i=(r=y==null?void 0:y.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=y==null?void 0:y.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((a=y==null?void 0:y.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((h=(d=y==null?void 0:y.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...y.signInWithSolana.resources.map(M=>`- ${M}`)]:[]].join(` 550`);const k=await S.signMessage(new TextEncoder().encode(m),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=k}}try{const{data:v,error:g}=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:p0(x)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Qu});if(g)throw g;if(!v||!v.session||!v.user){const b=new hv;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:g})}catch(v){if(Mn(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(e){const n=await Ng(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new mye;const{data:s,error:a}=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Qu});if(await oo(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new hv;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=e,o=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Qu}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new hv;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(n){if(Mn(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,i,s,a;try{if("email"in e){const{email:o,options:l}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await fv(this.storage,this.storageKey));const{error:h}=await Xn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:o,options:l}=e,{data:u,error:d}=await Xn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new BE("You must provide either an email or phone number.")}catch(o){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var n,r;try{let i,s;"options"in e&&(i=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await Xn(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Qu});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,u=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(Mn(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var n,r,i,s,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await fv(this.storage,this.storageKey));const u=await Xn(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
550:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:zye});return!((s=u.data)===null||s===void 0)&&s.url&&uo()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new fc;const{error:i}=await Xn(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(Mn(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:i,options:s}=e,{error:a}=await Xn(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:i,options:s}=e,{data:a,error:o}=await Xn(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new BE("You must provide either an email or phone number and a type")}catch(n){if(Mn(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await Ng(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<nR:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const a=await Ng(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=sR()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=Dye(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Xn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Up}):await this._useSession(async n=>{var r,i,s;const{data:a,error:o}=n;
550if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new fc}:await Xn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Up})})}catch(n){if(Mn(n))return rR(n)&&(await this._removeSession(),await oo(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new fc;const a=i.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await fv(this.storage,this.storageKey));const{data:u,error:d}=await Xn(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:Up});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new fc;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=OE(e.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(Mn(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:a,error:o}=n;if(o)throw o;e=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new fc;const{data:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Mn(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!uo())throw new FE("No browser detected.");if(e.error||e.error_description||e.error_code)throw new FE(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new e9("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new FE("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new e9("No code detected.");const{data:b,error:y}=await this._exchangeCodeForSession(e.code);if(y)throw y;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:l,token_type:u}=e;if(!s||!o||!a||!u)throw new FE("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let p=d+h;l&&(p=parseInt(l));const f=p-d;
550f*1e3<=ay&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);const m=p-h;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,p,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,p,d);const{data:x,error:v}=await this._getUser(s);if(v)throw v;const g={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:p,refresh_token:a,token_type:u,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(r){if(Mn(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await Ng(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s&&!rR(s))return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(fye(o)&&(o.status===404||o.status===401||o.status===403)||rR(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await oo(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=_ye(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await fv(this.storage,this.storageKey,!0));try{return await Xn(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,l,u,d;const{data:h,error:p}=s;if(p)throw p;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Xn(this.fetch,"GET",f,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;
550return uo()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Mn(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:s}}=n;if(i)throw i;const{options:a,provider:o,token:l,access_token:u,nonce:d}=e,h=await Xn(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:l,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Qu}),{data:p,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new hv}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:f}))}catch(i){if(await oo(this.storage,`${this.storageKey}-code-verifier`),Mn(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await Xn(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await kye(async i=>(i>0&&await Eye(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Xn(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Qu})),(i,s)=>{const a=200*Math.pow(2,i);return s&&iR(s)&&Date.now()+a-r<ay})}catch(r){if(this._debug(n,"error",r),Mn(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),uo()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await Ng(this.storage,this.storageKey);if(i&&this.userStorage){let a=await Ng(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await oy(this.userStorage,this.storageKey+"-user",a)),i.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:sR()}else if(i&&!i.user&&!i.user){const a=await Ng(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await oo(this.storage,this.storageKey+"-user"),await oy(this.storage,this.storageKey,i)):i.user=sR()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<nR;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${nR}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),iR(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new fc;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new L5;const{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new fc;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),Mn(s)){const a={data:null,error:s};return iR(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,n,r=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,n)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await oo(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await oy(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=s9(i);await oy(this.storage,this.storageKey,s)}else{const i=s9(n);await oy(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await oo(this.storage,this.storageKey),await oo(this.storage,this.storageKey+"-code-verifier"),await oo(this.storage,this.storageKey+"-user"),this.userStorage&&await oo(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&uo()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
550catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),ay);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-e)/ay);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${ay}ms, refresh threshold is ${EI} ticks`),i<=EI&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof HZ)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!uo()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await fv(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?this._returnResult({data:null,error:s}):await Xn(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;
550if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await Xn(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?tbe(e.webauthn.credential_response):nbe(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await Xn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=await Xn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Qye(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:ebe(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,i,s;if(e)try{const{payload:f}=OE(e);let m=null;f.aal&&(m=f.aal);let x=m;const{data:{user:v},error:g}=await this.getUser(e);if(g)return this._returnResult({data:null,error:g});((r=(n=v==null?void 0:v.factors)===null||n===void 0?void 0:n.filter(S=>S.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(x="aal2");const y=f.amr||[];return{data:{currentLevel:m,nextLevel:x,currentAuthenticationMethods:y},error:null}}catch(f){if(Mn(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:a},error:o}
550=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=OE(a.access_token);let u=null;l.aal&&(u=l.aal);let d=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(f=>f.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const p=l.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Xn(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new fc})})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new fc});const a=await Xn(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&uo()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Mn(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new fc});const a=await Xn(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&uo()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Mn(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Xn(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new fc})})}catch(e){if(Mn(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await Xn(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new fc})})}catch(n){if(Mn(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+dye>i)return r;const{data:s,error:a}=await Xn(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:f,error:m}
550=await this.getSession();if(m||!f.session)return this._returnResult({data:null,error:m});r=f.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:l}}=OE(r);n!=null&&n.allowExpired||Pye(s.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:f}=await this.getUser(r);if(f)throw f;return{data:{claims:s,header:i,signature:a},error:null}}const d=Lye(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,a,bye(`${o}.${l}`)))throw new NI("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(Mn(r))return this._returnResult({data:null,error:r});throw r}}}X2.nextInstanceID={};const dbe=X2,hbe="2.97.0";let A_="";typeof Deno<"u"?A_="deno":typeof document<"u"?A_="web":typeof navigator<"u"&&navigator.product==="ReactNative"?A_="react-native":A_="node";const fbe={"X-Client-Info":`supabase-js-${A_}/${hbe}`},pbe={headers:fbe},mbe={schema:"public"},gbe={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},xbe={};function Y2(t){"@babel/helpers - typeof";return Y2=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},Y2(t)}function vbe(t,e){if(Y2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Y2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ybe(t){var e=vbe(t,"string");return Y2(e)=="symbol"?e:e+""}function bbe(t,e,n){return(e=ybe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f9(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ls(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?f9(Object(n),!0).forEach(function(r){bbe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f9(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const wbe=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_be=()=>Headers,Sbe=(t,e,n)=>{const r=wbe(n),i=_be();return async(s,a)=>{var o;const l=(o=await e())!==null&&o!==void 0?o:t;let u=new i(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(s,Ls(Ls({},a),{},{headers:u}))}};function Abe(t){return t.endsWith("/")?t:t+"/"}function Ebe(t,e){var n,r;const{db:i,auth:s,realtime:a,global:o}=t,{db:l,auth:u,realtime:d,global:h}=e,p={db:Ls(Ls({},l),i),auth:Ls(Ls({},u),s),realtime:Ls(Ls({},d),a),storage:{},global:Ls(Ls(Ls({},h),o),{},{headers:Ls(Ls({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}function kbe(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Abe(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Cbe=class extends dbe{constructor(t){super(t)}},Nbe=class{constructor(t,e,n){var r,i;this.supabaseUrl=t,this.supabaseKey=e;const s=kbe(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const a=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:mbe,realtime:xbe,auth:Ls(Ls({},gbe),{},{storageKey:a}),global:pbe},l=Ebe(n??{},o);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=Sbe(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ls({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new fve(new URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new aye(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new sve(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();
550return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:a,lock:o,debug:l,throwOnError:u},d,h){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Cbe({url:this.authUrl.href,headers:Ls(Ls({},p),d),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:l,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Mve(this.realtimeUrl.href,Ls(Ls({},t),{},{params:Ls(Ls({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Tbe=(t,e,n)=>new Nbe(t,e,n);function Mbe(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}Mbe()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function Rbe(){var v,g;if(typeof window>"u")return;const t=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(b=>t===b||t.endsWith("."+b)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",i=n?((v=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((g=t.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:g[1]):void 0,s=window.parent&&window.parent!==window;if(!i||!s)return localStorage;const a=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),o=a?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,l=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=l&&o.test(l)?[l]:a?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),f=(b,y,S)=>new Promise(A=>{const k=p();let M=!1,T;const C=j=>{M||(M=!0,clearTimeout(T),window.removeEventListener("message",R),A(j))},R=j=>{if(u.indexOf(j.origin)<0)return;const G=j.data;G&&G.type===d&&G.requestId===k&&C(G)};window.addEventListener("message",R);const P={type:b,requestId:k,projectId:i,key:y};S!==void 0&&(P.value=S);for(const j of u)window.parent.postMessage(P,j);T=setTimeout(()=>C(null),h)});let m=!0;const x=250;return{getItem:async b=>{let y=await f("lovable-preview-auth:get",b);return!y&&m&&(await new Promise(S=>setTimeout(S,x)),y=await f("lovable-preview-auth:get",b)),m=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(b),null):y.value:localStorage.getItem(b)},setItem:(b,y)=>(localStorage.setItem(b,y),f("lovable-preview-auth:set",b,y).then(S=>{S&&S.ok&&typeof S.value=="string"&&localStorage.getItem(b)===y&&(S.value===""?localStorage.removeItem(b):localStorage.setItem(b,S.value))})),removeItem:b=>(localStorage.removeItem(b),f("lovable-preview-auth:remove",b).then(()=>{}))}}const jbe="https://ntxxmvyoiatxvggtjtfg.supabase.co",Pbe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50eHhtdnlvaWF0eHZnZ3RqdGZnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE4NDgyNjgsImV4cCI6MjA4NzQyNDI2OH0.35kO11-oFUIEhCT5iqxnjPGFOhiJWhYbgk2zVQUsDXI",Ot=Tbe(jbe,Pbe,{auth:{storage:Rbe(),persistSession:!0,autoRefreshToken:!0}}),Lbe=Object.freeze(Object.defineProperty({__proto__:null,supabase:Ot},Symbol.toStringTag,{value:"Module"}));function WZ(){const[t,e]=E.useState(null),[n,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{let l=!1;const u=async h=>{if(!h){l||(s(!1),r(!1));return}try{const{data:p}=await Ot.from("user_roles").select("role").eq("user_id",h.id).eq("role","admin").maybeSingle();l||s(!!p)}catch{l||s(!1)}finally{l||r(!1)}},{data:{subscription:d}}=Ot.auth.onAuthStateChange((h,p)=>{const f=(p==null?void 0:p.user)??null;e(f),setTimeout(()=>{l||u(f)},0)});return Ot.auth.getSession().then(({data:{session:h}})=>{const p=(h==null?void 0:h.user)??null;l||e(p),u(p)}),()=>{l=!0,d.unsubscribe()}},[]),{user:t,loading:n,isAdmin:i,signIn:async(l,u)=>{const{error:d}=await Ot.auth.signInWithPassword({email:l,password:u});return{error:d}},signOut:async()=>{await Ot.auth.signOut(),s(!1)}}}const Dn=E.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:rn("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
550Dn.displayName="Card";const li=E.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:rn("flex flex-col space-y-1.5 p-6",t),...e}));li.displayName="CardHeader";const ci=E.forwardRef(({className:t,...e},n)=>c.jsx("h3",{ref:n,className:rn("text-2xl font-semibold leading-none tracking-tight",t),...e}));ci.displayName="CardTitle";const Ibe=E.forwardRef(({className:t,...e},n)=>c.jsx("p",{ref:n,className:rn("text-sm text-muted-foreground",t),...e}));Ibe.displayName="CardDescription";const Bn=E.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:rn("p-6 pt-0",t),...e}));Bn.displayName="CardContent";const Dbe=E.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:rn("flex items-center p-6 pt-0",t),...e}));Dbe.displayName="CardFooter";const yr=E.forwardRef(({className:t,type:e,...n},r)=>c.jsx("input",{type:e,className:rn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));yr.displayName="Input";var Bbe="Label",$Z=E.forwardRef((t,e)=>c.jsx(vn.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$Z.displayName=Bbe;var KZ=$Z;const Fbe=m1("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vn=E.forwardRef(({className:t,...e},n)=>c.jsx(KZ,{ref:n,className:rn(Fbe(),t),...e}));Vn.displayName=KZ.displayName;const jF=m1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Pt=E.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},s)=>{const a=r?Yhe:"button";return c.jsx(a,{className:rn(jF({variant:e,size:n,className:t})),ref:s,...i})});Pt.displayName="Button";const Fc="/assets/ladenbau-logo-D-059r8K.svg",Kf=({isEmbed:t})=>t?null:c.jsx("footer",{className:"border-t border-border bg-card/50 mt-8",children:c.jsxs("div",{className:"container mx-auto px-4 py-4 flex flex-col sm:flex-row items-center justify-center gap-2 sm:gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{children:["© ",new Date().getFullYear()," Blickfang E-Commerce GmbH"]}),c.jsx("span",{className:"hidden sm:inline text-border",children:"|"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ax,{to:"/impressum",target:"_blank",className:"hover:text-foreground transition-colors",children:"Impressum"}),c.jsx("span",{className:"text-border",children:"|"}),c.jsx(ax,{to:"/datenschutz",target:"_blank",className:"hover:text-foreground transition-colors",children:"Datenschutz"})]})]})}),Obe=()=>{const{signIn:t,user:e,loading:n,isAdmin:r}=WZ(),i=Tx(),[s,a]=E.useState(""),[o,l]=E.useState(""),[u,d]=E.useState(""),[h,p]=E.useState(!1);if(n)return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-secondary",children:c.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"})});if(e&&r)return c.jsx(R5,{to:"/admin",replace:!0});const f=async m=>{m.preventDefault(),d(""),p(!0);const{error:x}=await t(s,o);x?d("E-Mail oder Passwort ungültig."):i("/admin"),p(!1)};return c.jsxs("div",{className:"flex min-h-screen flex-col bg-secondary",children:[c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsxs("div",{className:"w-full max-w-md px-4",children:[c.jsx("div",{className:"flex justify-center mb-8",children:c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-14 w-auto"})}),c.jsxs(Dn,{className:"shadow-md",children:[c.jsxs(li,{className:"text-center",children:[c.jsx(ci,{className:"text-xl",children:"Admin-Login"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Ladenbau.de Konfigurator-Verwaltung"})]}),c.jsx(Bn,{children:c.jsxs("form",{onSubmit:f,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"email",children:"E-Mail"}),c.jsx(yr,{id:"email",type:"email",value:s,onChange:m=>a(m.target.value),required:!0,autoFocus:!0,className:"mt-1.5"})]}),c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"password",children:"Passwort"}),c.jsx(yr,{id:"password",type:"password",value:o,onChange:m=>l(m.target.value),required:!0,className:"mt-1.5"})]}),u&&c.jsx("p",{className:"text-sm text-destructive",children:u}),c.jsxs(Pt,{type:"submit",className:"w-full",disabled:h,children:[c.jsx(ape,{className:"w-4 h-4 mr-2"}),h?"Wird angemeldetâ¦":"Anmelden"]})]})})]})]})}),c.jsx(Kf,{})]})},zbe=()=>c.jsxs("div",{className:"min-h-screen bg-secondary/50",children:[c.jsx("header",{className:"bg-card/80 backdrop-blur-md border-b border-border sticky top-0 z-50",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Impressum"})})]})}),c.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[c.jsxs(ax,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors mb-6",children:[c.jsx(zf,{className:"w-4 h-4"}),"Zurück"]}),c.jsxs("div",{className:"bg-card rounded-lg border border-border p-6 sm:p-8 prose prose-sm max-w-none text-foreground prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary",children:[c.jsx("h1",{children:"Impressum"}),c.jsx("h2",{children:"Angaben gemäà § 5 TMG:"}),c.jsx("p",{children:c.jsx("strong",{children:"BETREIBER"})}),c.jsxs("p",{children:["BLICKFANG E-Commerce GmbH",c.jsx("br",{}),"WaltherstraÃe 78",c.jsx("br",{}
550),"D-51069 Köln"]}),c.jsx("p",{children:c.jsx("strong",{children:"GESCHÃFTSFÃHRER"})}),c.jsx("p",{children:"Dennis Heinzmann"}),c.jsx("h4",{children:"KONTAKT:"}),c.jsxs("p",{children:["Telefon: +49(0)221-969791-60",c.jsx("br",{}),"Telefax: +49(0)221-969791-78",c.jsx("br",{}),"E-Mail: ",c.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"})]}),c.jsx("h4",{children:"REGISTEREINTRAG:"}),c.jsxs("p",{children:["Eintragung im Handelsregister",c.jsx("br",{}),"Registergericht: Amtsgericht Köln",c.jsx("br",{}),"Registernummer: HRB 90681"]}),c.jsx("h4",{children:"UMSATZSTEUER-ID:"}),c.jsxs("p",{children:["Umsatzsteuer-Identifikationsnummer gemäà §27 a Umsatzsteuergesetz:",c.jsx("br",{}),"DE 312126374"]}),c.jsx("h2",{children:"Angaben zur Berufshaftpflichtversicherung"}),c.jsxs("p",{children:[c.jsx("strong",{children:"Name und Sitz des Versicherers:"}),c.jsx("br",{}),"Provinzial Versicherung AG",c.jsx("br",{}),"40195 Düsseldorf"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Geltungsraum der Versicherung:"}),c.jsx("br",{}),"Deutschland, Ãsterreich"]}),c.jsx("h2",{children:"Verbraucherstreitbeilegung/Universalschlichtungsstelle"}),c.jsxs("p",{children:["Wir nehmen an einem Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle teil. Zuständig ist die Universalschlichtungsstelle des Zentrums für Schlichtung e.V., StraÃburger StraÃe 8, 77694 Kehl am Rhein (",c.jsx("a",{href:"https://www.verbraucher-schlichter.de",target:"_blank",rel:"noopener noreferrer",children:"https://www.verbraucher-schlichter.de"}),")."]})]})]})]}),Ube=()=>c.jsxs("div",{className:"min-h-screen bg-secondary/50",children:[c.jsx("header",{className:"bg-card/80 backdrop-blur-md border-b border-border sticky top-0 z-50",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Datenschutzerklärung"})})]})}),c.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[c.jsxs(ax,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors mb-6",children:[c.jsx(zf,{className:"w-4 h-4"}),"Zurück"]}),c.jsxs("div",{className:"bg-card rounded-lg border border-border p-6 sm:p-8 prose prose-sm max-w-none text-foreground prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary",children:[c.jsx("h1",{children:"Datenschutzerklärung"}),c.jsx("h2",{children:"1. Datenschutz auf einen Blick"}),c.jsx("h3",{children:"Allgemeine Hinweise"}),c.jsx("p",{children:"Die folgenden Hinweise geben einen einfachen Ãberblick darüber, was mit Ihren personenbezogenen Daten passiert, wenn Sie diese Website besuchen. Personenbezogene Daten sind alle Daten, mit denen Sie persönlich identifiziert werden können. Ausführliche Informationen zum Thema Datenschutz entnehmen Sie unserer unter diesem Text aufgeführten Datenschutzerklärung."}),c.jsx("h3",{children:"Datenerfassung auf dieser Website"}),c.jsx("h4",{children:"Wer ist verantwortlich für die Datenerfassung auf dieser Website?"}),c.jsx("p",{children:'Die Datenverarbeitung auf dieser Website erfolgt durch den Websitebetreiber. Dessen Kontaktdaten können Sie dem Abschnitt âHinweis zur Verantwortlichen Stelle" in dieser Datenschutzerklärung entnehmen.'}),c.jsx("h4",{children:"Wie erfassen wir Ihre Daten?"}),c.jsx("p",{children:"Ihre Daten werden zum einen dadurch erhoben, dass Sie uns diese mitteilen. Hierbei kann es sich z. B. um Daten handeln, die Sie in ein Kontaktformular eingeben."}),c.jsx("p",{children:"Andere Daten werden automatisch oder nach Ihrer Einwilligung beim Besuch der Website durch unsere IT-Systeme erfasst. Das sind vor allem technische Daten (z. B. Internetbrowser, Betriebssystem oder Uhrzeit des Seitenaufrufs). Die Erfassung dieser Daten erfolgt automatisch, sobald Sie diese Website betreten."}),c.jsx("h4",{children:"Wofür nutzen wir Ihre Daten?"}),c.jsx("p",{children:"Ein Teil der Daten wird erhoben, um eine fehlerfreie Bereitstellung der Website zu gewährleisten. Andere Daten können zur Analyse Ihres Nutzerverhaltens verwendet werden. Sofern über die Website Verträge geschlossen oder angebahnt werden können, werden die übermittelten Daten auch für Vertragsangebote, Bestellungen oder sonstige Auftragsanfragen verarbeitet."}),c.jsx("h4",{children:"Welche Rechte haben Sie bezüglich Ihrer Daten?"}),c.jsx("p",{children:"Sie haben jederzeit das Recht, unentgeltlich Auskunft über Herkunft, Empfänger und Zweck Ihrer gespeicherten personenbezogenen Daten zu erhalten. Sie haben auÃerdem ein Recht, die Berichtigung oder Löschung dieser Daten zu verlangen. Wenn Sie eine Einwilligung zur Datenverarbeitung erteilt haben, können Sie diese Einwilligung jederzeit für die Zukunft widerrufen. AuÃerdem haben Sie das Recht, unter bestimmten Umständen die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten zu verlangen. Des Weiteren steht Ihnen ein Beschwerdere
550cht bei der zuständigen Aufsichtsbehörde zu."}),c.jsx("p",{children:"Hierzu sowie zu weiteren Fragen zum Thema Datenschutz können Sie sich jederzeit an uns wenden."}),c.jsx("h3",{children:"Analyse-Tools und Tools von Drittanbietern"}),c.jsx("p",{children:"Beim Besuch dieser Website kann Ihr Surf-Verhalten statistisch ausgewertet werden. Das geschieht vor allem mit sogenannten Analyseprogrammen."}),c.jsx("p",{children:"Detaillierte Informationen zu diesen Analyseprogrammen finden Sie in der folgenden Datenschutzerklärung."}),c.jsx("h2",{children:"2. Hosting"}),c.jsx("p",{children:"Wir hosten die Inhalte unserer Website bei folgendem Anbieter:"}),c.jsx("h3",{children:"Externes Hosting"}),c.jsx("p",{children:"Diese Website wird extern gehostet. Die personenbezogenen Daten, die auf dieser Website erfasst werden, werden auf den Servern des Hosters / der Hoster gespeichert. Hierbei kann es sich v. a. um IP-Adressen, Kontaktanfragen, Meta- und Kommunikationsdaten, Vertragsdaten, Kontaktdaten, Namen, Websitezugriffe und sonstige Daten, die über eine Website generiert werden, handeln."}),c.jsx("p",{children:"Das externe Hosting erfolgt zum Zwecke der Vertragserfüllung gegenüber unseren potenziellen und bestehenden Kunden (Art. 6 Abs. 1 lit. b DSGVO) und im Interesse einer sicheren, schnellen und effizienten Bereitstellung unseres Online-Angebots durch einen professionellen Anbieter (Art. 6 Abs. 1 lit. f DSGVO)."}),c.jsx("p",{children:"Unser(e) Hoster wird bzw. werden Ihre Daten nur insoweit verarbeiten, wie dies zur Erfüllung seiner Leistungspflichten erforderlich ist und unsere Weisungen in Bezug auf diese Daten befolgen."}),c.jsx("p",{children:"Wir setzen folgende(n) Hoster ein:"}),c.jsxs("p",{children:["maxcluster GmbH",c.jsx("br",{}),"Lise-Meitner-StraÃe 1b",c.jsx("br",{}),"33104 Paderborn"]}),c.jsx("h4",{children:"Auftragsverarbeitung"}),c.jsx("p",{children:"Wir haben einen Vertrag über Auftragsverarbeitung (AVV) zur Nutzung des oben genannten Dienstes geschlossen. Hierbei handelt es sich um einen datenschutzrechtlich vorgeschriebenen Vertrag, der gewährleistet, dass dieser die personenbezogenen Daten unserer Websitebesucher nur nach unseren Weisungen und unter Einhaltung der DSGVO verarbeitet."}),c.jsx("h2",{children:"3. Allgemeine Hinweise und Pflichtinformationen"}),c.jsx("h3",{children:"Datenschutz"}),c.jsx("p",{children:"Die Betreiber dieser Seiten nehmen den Schutz Ihrer persönlichen Daten sehr ernst. Wir behandeln Ihre personenbezogenen Daten vertraulich und entsprechend den gesetzlichen Datenschutzvorschriften sowie dieser Datenschutzerklärung."}),c.jsx("p",{children:"Wenn Sie diese Website benutzen, werden verschiedene personenbezogene Daten erhoben. Personenbezogene Daten sind Daten, mit denen Sie persönlich identifiziert werden können. Die vorliegende Datenschutzerklärung erläutert, welche Daten wir erheben und wofür wir sie nutzen. Sie erläutert auch, wie und zu welchem Zweck das geschieht."}),c.jsx("p",{children:"Wir weisen darauf hin, dass die Datenübertragung im Internet (z. B. bei der Kommunikation per E-Mail) Sicherheitslücken aufweisen kann. Ein lückenloser Schutz der Daten vor dem Zugriff durch Dritte ist nicht möglich."}),c.jsx("h3",{children:"Hinweis zur verantwortlichen Stelle"}),c.jsx("p",{children:"Die verantwortliche Stelle für die Datenverarbeitung auf dieser Website ist:"}),c.jsxs("p",{children:["Dennis Heinzmann",c.jsx("br",{}),"WaltherstraÃe 78",c.jsx("br",{}),"51069 Köln"]}),c.jsxs("p",{children:["Telefon: +49(0)221-969791-60",c.jsx("br",{}),"E-Mail: [email protected]"]}),c.jsx("p",{children:"Verantwortliche Stelle ist die natürliche oder juristische Person, die allein oder gemeinsam mit anderen über die Zwecke und Mittel der Verarbeitung von personenbezogenen Daten (z. B. Namen, E-Mail-Adressen o. Ã.) entscheidet."}),c.jsx("h3",{children:"Speicherdauer"}),c.jsx("p",{children:"Soweit innerhalb dieser Datenschutzerklärung keine speziellere Speicherdauer genannt wurde, verbleiben Ihre personenbezogenen Daten bei uns, bis der Zweck für die Datenverarbeitung entfällt. Wenn Sie ein berechtigtes Löschersuchen geltend machen oder eine Einwilligung zur Datenverarbeitung widerrufen, werden Ihre Daten gelöscht, sofern wir keine anderen rechtlich zulässigen Gründe für die Speicherung Ihrer personenbezogenen Daten haben (z. B. steuer- oder handelsrechtliche Aufbewahrungsfristen); im letztgenannten Fall erfolgt die Löschung nach Fortfall dieser Gründe."}),c.jsx("h3",{children:"Allgemeine Hinweise zu den Rechtsgrundlagen der Datenverarbeitung auf dieser Website"}),c.jsx("p",{children:"Sofern Sie in die Datenverarbeitung eingewilligt haben, verarbeiten wir Ihre personenbezogenen Daten auf Grundlage von Art. 6 Abs. 1 lit. a DSGVO bzw. Art. 9 Abs. 2 lit. a DSGVO, sofern besondere Datenkategorien nach Art. 9 Abs. 1 DSGVO verarbeitet werden. Sind Ihre Daten zur Vertragserfüllung oder zur Durchführung vorvertraglicher MaÃnahmen erforderlich, verarbeiten wir Ihre Daten auf Grundlage des Art. 6 Abs. 1 lit. b DSGVO. Des Weiteren verarbeiten wir Ihre Daten, sofern diese zur Erfüllung einer rechtlichen Verpflichtung erforderlich sind auf Grundlage von Art. 6 Abs. 1 lit. c DSGVO. Die Datenverarbeitung kann ferner auf Grundlage unseres berechtigten Interesses nach Art. 6 Abs. 1 lit. f DSGVO erfolgen."}),c.jsx("h3",{children:"Datenschutzbeauftragter"}),c.jsx("p",{children:"Wir haben einen Datenschutzbeauftragten benannt."}),c.jsxs("p",{children:["Dennis Heinzmann",c.jsx("br",{}),"WaltherstraÃe 78",c.jsx("br",{}
550),"51069 Köln"]}),c.jsxs("p",{children:["Telefon: +49(0)221-969791-60",c.jsx("br",{}),"E-Mail: [email protected]"]}),c.jsx("h3",{children:"Empfänger von personenbezogenen Daten"}),c.jsx("p",{children:"Im Rahmen unserer Geschäftstätigkeit arbeiten wir mit verschiedenen externen Stellen zusammen. Dabei ist teilweise auch eine Ãbermittlung von personenbezogenen Daten an diese externen Stellen erforderlich. Wir geben personenbezogene Daten nur dann an externe Stellen weiter, wenn dies im Rahmen einer Vertragserfüllung erforderlich ist, wenn wir gesetzlich hierzu verpflichtet sind (z. B. Weitergabe von Daten an Steuerbehörden), wenn wir ein berechtigtes Interesse nach Art. 6 Abs. 1 lit. f DSGVO an der Weitergabe haben oder wenn eine sonstige Rechtsgrundlage die Datenweitergabe erlaubt."}),c.jsx("h3",{children:"Widerruf Ihrer Einwilligung zur Datenverarbeitung"}),c.jsx("p",{children:"Viele Datenverarbeitungsvorgänge sind nur mit Ihrer ausdrücklichen Einwilligung möglich. Sie können eine bereits erteilte Einwilligung jederzeit widerrufen. Die RechtmäÃigkeit der bis zum Widerruf erfolgten Datenverarbeitung bleibt vom Widerruf unberührt."}),c.jsx("h3",{children:"Widerspruchsrecht gegen die Datenerhebung in besonderen Fällen sowie gegen Direktwerbung (Art. 21 DSGVO)"}),c.jsx("p",{children:"WENN DIE DATENVERARBEITUNG AUF GRUNDLAGE VON ART. 6 ABS. 1 LIT. E ODER F DSGVO ERFOLGT, HABEN SIE JEDERZEIT DAS RECHT, AUS GRÃNDEN, DIE SICH AUS IHRER BESONDEREN SITUATION ERGEBEN, GEGEN DIE VERARBEITUNG IHRER PERSONENBEZOGENEN DATEN WIDERSPRUCH EINZULEGEN; DIES GILT AUCH FÃR EIN AUF DIESE BESTIMMUNGEN GESTÃTZTES PROFILING."}),c.jsx("p",{children:"WERDEN IHRE PERSONENBEZOGENEN DATEN VERARBEITET, UM DIREKTWERBUNG ZU BETREIBEN, SO HABEN SIE DAS RECHT, JEDERZEIT WIDERSPRUCH GEGEN DIE VERARBEITUNG SIE BETREFFENDER PERSONENBEZOGENER DATEN ZUM ZWECKE DERARTIGER WERBUNG EINZULEGEN; DIES GILT AUCH FÃR DAS PROFILING, SOWEIT ES MIT SOLCHER DIREKTWERBUNG IN VERBINDUNG STEHT."}),c.jsx("h3",{children:"Beschwerderecht bei der zuständigen Aufsichtsbehörde"}),c.jsx("p",{children:"Im Falle von VerstöÃen gegen die DSGVO steht den Betroffenen ein Beschwerderecht bei einer Aufsichtsbehörde, insbesondere in dem Mitgliedstaat ihres gewöhnlichen Aufenthalts, ihres Arbeitsplatzes oder des Orts des mutmaÃlichen VerstoÃes zu."}),c.jsx("h3",{children:"Recht auf Datenübertragbarkeit"}),c.jsx("p",{children:"Sie haben das Recht, Daten, die wir auf Grundlage Ihrer Einwilligung oder in Erfüllung eines Vertrags automatisiert verarbeiten, an sich oder an einen Dritten in einem gängigen, maschinenlesbaren Format aushändigen zu lassen."}),c.jsx("h3",{children:"Auskunft, Berichtigung und Löschung"}),c.jsx("p",{children:"Sie haben im Rahmen der geltenden gesetzlichen Bestimmungen jederzeit das Recht auf unentgeltliche Auskunft über Ihre gespeicherten personenbezogenen Daten, deren Herkunft und Empfänger und den Zweck der Datenverarbeitung und ggf. ein Recht auf Berichtigung oder Löschung dieser Daten."}),c.jsx("h3",{children:"Recht auf Einschränkung der Verarbeitung"}),c.jsx("p",{children:"Sie haben das Recht, die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten zu verlangen. Das Recht auf Einschränkung der Verarbeitung besteht in folgenden Fällen:"}),c.jsxs("ul",{children:[c.jsx("li",{children:"Wenn Sie die Richtigkeit Ihrer bei uns gespeicherten personenbezogenen Daten bestreiten, benötigen wir in der Regel Zeit, um dies zu überprüfen. Für die Dauer der Prüfung haben Sie das Recht, die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten zu verlangen."}),c.jsx("li",{children:"Wenn die Verarbeitung Ihrer personenbezogenen Daten unrechtmäÃig geschah/geschieht, können Sie statt der Löschung die Einschränkung der Datenverarbeitung verlangen."}),c.jsx("li",{children:"Wenn wir Ihre personenbezogenen Daten nicht mehr benötigen, Sie sie jedoch zur Ausübung, Verteidigung oder Geltendmachung von Rechtsansprüchen benötigen, haben Sie das Recht, statt der Löschung die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten zu verlangen."}),c.jsx("li",{children:"Wenn Sie einen Widerspruch nach Art. 21 Abs. 1 DSGVO eingelegt haben, muss eine Abwägung zwischen Ihren und unseren Interessen vorgenommen werden. Solange noch nicht feststeht, wessen Interessen überwiegen, haben Sie das Recht, die Einschränkung der Verarbeitung Ihrer personenbezogenen Daten zu verlangen."})]}),c.jsx("h3",{children:"SSL- bzw. TLS-Verschlüsselung"}),c.jsx("p",{children:'Diese Seite nutzt aus Sicherheitsgründen und zum Schutz der Ãbertragung vertraulicher Inhalte, wie zum Beispiel Bestellungen oder Anfragen, die Sie an uns als Seitenbetreiber senden, eine SSL- bzw. TLS-Verschlüsselung. Eine verschlüsselte Verbindung erkennen Sie daran, dass die Adresszeile des Browsers von âhttp://" auf âhttps://" wechselt und an dem Schloss-Symbol in Ihrer Browserzeile.'}),c.jsx("h2",{children:"4. Datenerfassung auf dieser Website"}),c.jsx("h3",{children:"Cookies"}),c.jsx("p",{children:'Unsere Internetseiten verwenden so genannte âCookies". Cookies sind kleine Datenpakete und richten auf Ihrem Endgerät keinen Schaden an. Sie werden entweder vorübergehend für die Dauer einer Sitzung (Session-Cookies) oder dauerhaft (permanente Cookies) auf Ihrem Endgerät gespeichert. Session-Cookies werden nach Ende Ihres Besuchs automatisch gelöscht. Permanente Cookies bleiben auf Ihrem Endgerät gespeichert, bis Sie diese selbst löschen oder eine automatische Löschung durch Ihren Webbrowser erfolgt.'}),c.jsx("p",{children:"Cookies können von uns (First-Party-Cookies) oder von Drittunternehmen stammen (sog. Third-Party-Cookies). Third-Party-Cookies ermöglichen die Einbindung bestimmter Dienstleistungen von Drittunternehmen innerhalb von Webseiten (z. B. Cookies zur Abwicklung von Zahlungsdienstleistungen)."}),c.jsx("p",{children:"Sie können Ihren Browser so einstellen, dass Sie über das Setzen von Cookies informiert werden und Cookies nur im Einzelfall erlauben, die Annahme von Cookies für bestimmte Fälle oder generell ausschlieÃen sowie das automatische Löschen der Cookies beim SchlieÃen des Browsers aktivieren."}),c.jsx("h3",{children:"Kontaktformular"}),c.jsx("p",{children:"Wenn Sie uns per Kontaktformular Anfragen zukommen lassen, werden Ihre Angaben aus dem Anfrageformular inklusive der von Ihnen dort angegebenen Kontaktdaten zwecks Bearbeitung der Anfrage und für den Fall von Anschlussfragen bei uns gespeichert. Diese Daten geben wir nicht ohne Ihre Einwilligung weiter."}),c.jsx("p",{children:"Die Verarbeitung dieser Daten erfolgt auf Grundlage von Art. 6 Abs. 1 lit. b DSGVO, sofern Ihre Anfrage mit der Erfüllung eines Vertrags zusammenhängt oder zur Durchführung vorvertraglicher MaÃnahmen erforderlich ist."}),c.jsx("h3",{children:"Microsoft Bookings"}),c.jsx("p",{children:"Auf unserer Website haben Sie die Möglichkeit, Termine mit uns zu vereinbaren. Für die Terminbuchung nutzen wir Microsoft Bookings. Anbieter ist die Microsoft Ireland Operations Limited, One Microsoft Place, South County Business Park, Leopardstown, Dublin 18, Irland."}),c.jsx("h2",{children:"5. Analyse-Tools und Werbung"}),c.jsx("h3",{children:"Google Tag Manager"}),c.jsx("p",{children:"Wir setzen den Google Tag Manager ein. Anbieter ist die Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland."}),c.jsx("p",{children:"Der Google Tag Manager ist ein Tool, mit dessen Hilfe wir Tracking- oder Statistik-Tools und andere Technologien auf unserer Website einbinden können. Der Google Tag Manager selbst erstellt keine Nutzerprofile, speichert keine Cookies und nimmt keine eigenständigen Analysen vor."}),c.jsx("h3",{children:"Google Analytics"}),c.jsx("p",{children:'Diese Website nutzt Funktionen des Webanalysedie
550nstes Google Analytics. Anbieter ist die Google Ireland Limited (âGoogle"), Gordon House, Barrow Street, Dublin 4, Irland.'}),c.jsx("p",{children:"Google Analytics ermöglicht es dem Websitebetreiber, das Verhalten der Websitebesucher zu analysieren. Die Nutzung dieses Dienstes erfolgt auf Grundlage Ihrer Einwilligung nach Art. 6 Abs. 1 lit. a DSGVO und § 25 Abs. 1 TDDDG. Die Einwilligung ist jederzeit widerrufbar."}),c.jsx("h4",{children:"IP Anonymisierung"}),c.jsx("p",{children:"Die Google Analytics IP-Anonymisierung ist aktiviert. Dadurch wird Ihre IP-Adresse von Google innerhalb von Mitgliedstaaten der Europäischen Union oder in anderen Vertragsstaaten des Abkommens über den Europäischen Wirtschaftsraum vor der Ãbermittlung in die USA gekürzt."}),c.jsx("h3",{children:"WP Statistics"}),c.jsx("p",{children:"Diese Website nutzt das Analysetool WP Statistics, um Besucherzugriffe statistisch auszuwerten. Anbieter ist Veronalabs, Tatari 64, 10134, Tallinn, Estland."}),c.jsx("h2",{children:"6. Plugins und Tools"}),c.jsx("h3",{children:"Google Fonts (lokales Hosting)"}),c.jsx("p",{children:"Diese Seite nutzt zur einheitlichen Darstellung von Schriftarten so genannte Google Fonts, die von Google bereitgestellt werden. Die Google Fonts sind lokal installiert. Eine Verbindung zu Servern von Google findet dabei nicht statt."}),c.jsx("h3",{children:"Adobe Fonts"}),c.jsx("p",{children:"Diese Website nutzt zur einheitlichen Darstellung bestimmter Schriftarten Web Fonts von Adobe. Anbieter ist die Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA (Adobe)."}),c.jsx("h3",{children:"Google Maps"}),c.jsx("p",{children:'Diese Seite nutzt den Kartendienst Google Maps. Anbieter ist die Google Ireland Limited (âGoogle"), Gordon House, Barrow Street, Dublin 4, Irland. Die Nutzung von Google Maps erfolgt im Interesse einer ansprechenden Darstellung unserer Online-Angebote und an einer leichten Auffindbarkeit der von uns auf der Website angegebenen Orte.'}),c.jsx("h3",{children:"Google reCAPTCHA"}),c.jsx("p",{children:'Wir nutzen âGoogle reCAPTCHA" auf dieser Website. Anbieter ist die Google Ireland Limited (âGoogle"), Gordon House, Barrow Street, Dublin 4, Irland. Mit reCAPTCHA soll überprüft werden, ob die Dateneingabe auf dieser Website durch einen Menschen oder durch ein automatisiertes Programm erfolgt.'}),c.jsx("h3",{children:"Friendly Captcha"}),c.jsx("p",{children:"Wir nutzen Friendly Captcha auf dieser Website. Anbieter ist die Friendly Captcha GmbH, Am Anger 3-5, 82237 Wörthsee, Deutschland."}),c.jsx("h2",{children:"7. Audio- und Videokonferenzen"}),c.jsx("h3",{children:"Datenverarbeitung"}),c.jsx("p",{children:"Für die Kommunikation mit unseren Kunden setzen wir unter anderen Online-Konferenz-Tools ein. Die Konferenz-Tools erfassen dabei alle Daten, die Sie zur Nutzung der Tools bereitstellen/einsetzen (E-Mail-Adresse und/oder Ihre Telefonnummer)."}),c.jsx("h3",{children:"Eingesetzte Konferenz-Tools"}),c.jsx("p",{children:"Wir setzen folgende Konferenz-Tools ein:"}),c.jsx("h4",{children:"Microsoft Teams"}),c.jsxs("p",{children:["Wir nutzen Microsoft Teams. Anbieter ist die Microsoft Ireland Operations Limited, One Microsoft Place, South County Business Park, Leopardstown, Dublin 18, Irland. Details zur Datenverarbeitung entnehmen Sie der Datenschutzerklärung von Microsoft Teams: ",c.jsx("a",{href:"https://privacy.microsoft.com/de-de/privacystatement",target:"_blank",rel:"noopener noreferrer",children:"https://privacy.microsoft.com/de-de/privacystatement"}),"."]}),c.jsx("h2",{children:"8. Eigene Dienste"}),c.jsx("h3",{children:"Umgang mit Bewerberdaten"}),c.jsx("p",{children:"Wir bieten Ihnen die Möglichkeit, sich bei uns zu bewerben (z. B. per E-Mail, postalisch oder via Online-Bewerberformular). Im Folgenden informieren wir Sie über Umfang, Zweck und Verwendung Ihrer im Rahmen des Bewerbungsprozesses erhobenen personenbezogenen Daten."}),c.jsx("h4",{children:"Umfang und Zweck der Datenerhebung"}),c.jsx("p",{children:"Wenn Sie uns eine Bewerbung zukommen lassen, verarbeiten wir Ihre damit verbundenen personenbezogenen Daten (z. B. Kontakt- und Kommunikationsdaten, Bewerbungsunterlagen, Notizen im Rahmen von Bewerbungsgesprächen etc.), soweit dies zur Entscheidung über die Begründung eines BeschÃ
550¤ftigungsverhältnisses erforderlich ist. Rechtsgrundlage hierfür ist § 26 BDSG nach deutschem Recht (Anbahnung eines Beschäftigungsverhältnisses), Art. 6 Abs. 1 lit. b DSGVO (allgemeine Vertragsanbahnung)."}),c.jsx("h4",{children:"Aufbewahrungsdauer der Daten"}),c.jsx("p",{children:"Sofern wir Ihnen kein Stellenangebot machen können, Sie ein Stellenangebot ablehnen oder Ihre Bewerbung zurückziehen, behalten wir uns das Recht vor, die von Ihnen übermittelten Daten auf Grundlage unserer berechtigten Interessen (Art. 6 Abs. 1 lit. f DSGVO) bis zu 6 Monate ab der Beendigung des Bewerbungsverfahrens bei uns aufzubewahren."}),c.jsx("h4",{children:"Aufnahme in den Bewerber-Pool"}),c.jsx("p",{children:"Sofern wir Ihnen kein Stellenangebot machen, besteht ggf. die Möglichkeit, Sie in unseren Bewerber-Pool aufzunehmen. Die Aufnahme in den Bewerber-Pool geschieht ausschlieÃlich auf Grundlage Ihrer ausdrücklichen Einwilligung (Art. 6 Abs. 1 lit. a DSGVO). Die Daten aus dem Bewerber-Pool werden spätestens zwei Jahre nach Erteilung der Einwilligung unwiderruflich gelöscht."})]})]})]}),PF=E.createContext({});function LF(t){const e=E.useRef(null);return e.current===null&&(e.current=t()),e.current}const qZ=typeof window<"u",XZ=qZ?E.useLayoutEffect:E.useEffect,I5=E.createContext(null);function IF(t,e){t.indexOf(e)===-1&&t.push(e)}function iT(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const kh=(t,e,n)=>n>e?e:n<t?t:n;let D5=()=>{},Vb=()=>{};const Pf={},YZ=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function JZ(t){return typeof t=="object"&&t!==null}const ZZ=t=>/^0[^.\s]+$/u.test(t);function QZ(t){let e;return()=>(e===void 0&&(e=t()),e)}const gu=t=>t,Hbe=(t,e)=>n=>e(t(n)),JS=(...t)=>t.reduce(Hbe),J2=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class DF{constructor(){this.subscriptions=[]}add(e){return IF(this.subscriptions,e),()=>iT(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xu=t=>t*1e3,hu=t=>t/1e3;function eQ(t,e){return e?t*(1e3/e):0}const tQ=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Gbe=1e-7,Vbe=12;function Wbe(t,e,n,r,i){let s,a,o=0;do a=e+(n-e)/2,s=tQ(a,r,i)-t,s>0?n=a:e=a;while(Math.abs(s)>Gbe&&++o<Vbe);return a}function ZS(t,e,n,r){if(t===e&&n===r)return gu;const i=s=>Wbe(s,0,1,t,n);return s=>s===0||s===1?s:tQ(i(s),e,r)}const nQ=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rQ=t=>e=>1-t(1-e),iQ=ZS(.33,1.53,.69,.99),BF=rQ(iQ),sQ=nQ(BF),aQ=t=>(t*=2)<1?.5*BF(t):.5*(2-Math.pow(2,-10*(t-1))),FF=t=>1-Math.sin(Math.acos(t)),oQ=rQ(FF),lQ=nQ(FF),$be=ZS(.42,0,1,1),Kbe=ZS(0,0,.58,1),cQ=ZS(.42,0,.58,1),qbe=t=>Array.isArray(t)&&typeof t[0]!="number",uQ=t=>Array.isArray(t)&&typeof t[0]=="number",p9={linear:gu,easeIn:$be,easeInOut:cQ,easeOut:Kbe,circIn:FF,circInOut:lQ,circOut:oQ,backIn:BF,backInOut:sQ,backOut:iQ,anticipate:aQ},Xbe=t=>typeof t=="string",m9=t=>{if(uQ(t)){Vb(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,i]=t;return ZS(e,n,r,i)}else if(Xbe(t))return Vb(p9[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),p9[t];return t},zE=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],g9={value:null,addProjectionMetrics:null};function Ybe(t,e){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(h){a.has(h)&&(d.schedule(h),t()),l++,h(o)}const d={schedule:(h,p=!1,f=!1)=>{const x=f&&i?n:r;return p&&a.add(h),x.has(h)||x.add(h),h},cancel:h=>{r.delete(h),a.delete(h)},process:h=>{if(o=h,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),e&&g9.value&&g9.value.frameloop[e].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(h))}};return d}const Jbe=40;function dQ(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=zE.reduce((y,S)=>(y[S]=Ybe(s,e?S:void 0),y),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:d,update:h,preRender:p,render:f,postRender:m}=a,x=()=>{const y=Pf.useManualTiming?i.timestamp:performance.now();n=!1,Pf.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,Jbe),1)),i.timestamp=y,i.isProcessing=!0,o.process(i),l.process(i),u.process(i),d.process(i),h.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(x))},v=()=>{n=!0,r=!0,i.isProcessing||t(x)};return{schedule:zE.reduce((y,S)=>{const A=a[S];return y[S]=(k,M=!1,T=!1)=>(n||v(),A.schedule(k,M,T)),y},{}),cancel:y=>{for(let S=0;S<zE.length;S++)a[zE[S]].cancel(y)},state:i,steps:a}}const{schedule:Vi,cancel:Im,state:po,steps:oR}=dQ(typeof requestAnimationFrame<"u"?requestAnimationFrame:gu,!0);let BC;function Zbe(){BC=void 0}const dl={now:()=>(BC===void 0&&dl.set(po.isProcessing||Pf.useManualTiming?po.timestamp:performance.now()),BC),set:t=>{BC=t,queueMicrotask(Zbe)}},hQ=t=>e=>typeof e=="string"&&e.startsWith(t),fQ=hQ("--"),Qbe=hQ("var(--"),OF=t=>Qbe(t)?e1e.test(t.split("/*")[0].trim()):!1,e1e=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function x9(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const T1={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Z2={...T1,transform:t=>kh(0,1,t)},UE={...T1,default:1},Y_=t=>Math.round(t*1e5)/1e5,zF=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function t1e(t){return t==null}const n1e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,UF=(t,e)=>n=>!!(typeof n=="string"&&n1e.test(n)&&n.startsWith(t)||e&&!t1e(n)&&Object.prototype.hasOwnProperty.call(n,e)),pQ=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(zF);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},r1e=t=>kh(0,255,t),lR={...T1,transform:t=>Math.round(r1e(t))},m0={test:UF("rgb","red"),parse:pQ("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+lR.transform(t)+", "+lR.transform(e)+", "+lR.transform(n)+", "+Y_(Z2.transform(r))+")"};function i1e(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alph
vendor: 17,315 bytes, line 550
550a:i?parseInt(i,16)/255:1}}const TI={test:UF("#"),parse:i1e,transform:m0.transform},QS=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Tp=QS("deg"),gh=QS("%"),Sn=QS("px"),s1e=QS("vh"),a1e=QS("vw"),v9={...gh,parse:t=>gh.parse(t)/100,transform:t=>gh.transform(t*100)},Py={test:UF("hsl","hue"),parse:pQ("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+gh.transform(Y_(e))+", "+gh.transform(Y_(n))+", "+Y_(Z2.transform(r))+")"},da={test:t=>m0.test(t)||TI.test(t)||Py.test(t),parse:t=>m0.test(t)?m0.parse(t):Py.test(t)?Py.parse(t):TI.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?m0.transform(t):Py.transform(t),getAnimatableNone:t=>{const e=da.parse(t);return e.alpha=0,da.transform(e)}},o1e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function l1e(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(zF))==null?void 0:e.length)||0)+(((n=t.match(o1e))==null?void 0:n.length)||0)>0}const mQ="number",gQ="color",c1e="var",u1e="var(",y9="${}",d1e=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Q2(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=e.replace(d1e,l=>(da.test(l)?(r.color.push(s),i.push(gQ),n.push(da.parse(l))):l.startsWith(u1e)?(r.var.push(s),i.push(c1e),n.push(l)):(r.number.push(s),i.push(mQ),n.push(parseFloat(l))),++s,y9)).split(y9);return{values:n,split:o,indexes:r,types:i}}function xQ(t){return Q2(t).values}function vQ(t){const{split:e,types:n}=Q2(t),r=e.length;return i=>{let s="";for(let a=0;a<r;a++)if(s+=e[a],i[a]!==void 0){const o=n[a];o===mQ?s+=Y_(i[a]):o===gQ?s+=da.transform(i[a]):s+=i[a]}return s}}const h1e=t=>typeof t=="number"?0:da.test(t)?da.getAnimatableNone(t):t;function f1e(t){const e=xQ(t);return vQ(t)(e.map(h1e))}const gd={test:l1e,parse:xQ,createTransformer:vQ,getAnimatableNone:f1e};function cR(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function p1e({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,a=0;if(!e)i=s=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=cR(l,o,t+1/3),s=cR(l,o,t),a=cR(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function sT(t,e){return n=>n>0?e:t}const _s=(t,e,n)=>t+(e-t)*n,uR=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},m1e=[TI,m0,Py],g1e=t=>m1e.find(e=>e.test(t));function b9(t){const e=g1e(t);if(D5(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===Py&&(n=p1e(n)),n}const w9=(t,e)=>{const n=b9(t),r=b9(e);if(!n||!r)return sT(t,e);const i={...n};return s=>(i.red=uR(n.red,r.red,s),i.green=uR(n.green,r.green,s),i.blue=uR(n.blue,r.blue,s),i.alpha=_s(n.alpha,r.alpha,s),m0.transform(i))},MI=new Set(["none","hidden"]);function x1e(t,e){return MI.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function v1e(t,e){return n=>_s(t,e,n)}function HF(t){return typeof t=="number"?v1e:typeof t=="string"?OF(t)?sT:da.test(t)?w9:w1e:Array.isArray(t)?yQ:typeof t=="object"?da.test(t)?w9:y1e:sT}function yQ(t,e){const n=[...t],r=n.length,i=t.map((s,a)=>HF(s)(s,e[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function y1e(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=HF(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function b1e(t,e){const n=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],a=t.indexes[s][r[s]],o=t.values[a]??0;n[i]=o,r[s]++}return n}const w1e=(t,e)=>{const n=gd.createTransformer(e),r=Q2(t),i=Q2(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?MI.has(t)&&!i.values.length||MI.has(e)&&!r.values.length?x1e(t,e):JS(yQ(b1e(r,i),i.values),n):(D5(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),sT(t,e))};function bQ(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?_s(t,e,n):HF(t)(t,e)}const _1e=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Vi.update(e,n),stop:()=>Im(e),now:()=>po.isProcessing?po.timestamp:dl.now()}},wQ=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=Math.round(t(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},aT=2e4;function GF(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<aT;)e+=n,r=t.next(e);return e>=aT?1/0:e}function S1e(t,e=100,n){const r=n({...t,keyframes:[0,e]}),i=Math.min(GF(r),aT);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:hu(i)}}const A1e=5;function _Q(t,e,n){const r=Math.max(e-A1e,0);return eQ(n-t(r),e-r)}const vs={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},dR=.001;function E1e({duration:t=vs.duration,bounce:e=vs.bounce,velocity:n=vs.velocity,mass:r=vs.mass}){let i,s;D5(t<=xu(vs.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=kh(vs.minDamping,vs.maxDamping,a),t=kh(vs.minDuration,vs.maxDuration,hu(t)),a<1?(i=u=>{const d=u*a,h=d*t,p=d-n,f=RI(u,a),m=Math.exp(-h);return dR-p/f*m},s=u=>{const h=u*a*t,p=h*n+n,f=Math.pow(a,2)*Math.pow(u,2)*t,m=Math.exp(-h),x=RI(Math.pow(u,2),a);return(-i(u)+dR>0?-1:1)*((p-f)*m)/x}):(i=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-dR+d*h},s=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const o=5/t,l=C1e(i,s,o);if(t=xu(t),isNaN(l))return{stiffness:vs.stiffness,damping:vs.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:t}}}const k1e=12;function C1e(t,e,n){let r=n;for(let i=1;i<k1e;i++)r=r-t(r)/e(r);return r}function RI(t,e){return t*Math.sqrt(1-e*e)}const N1e=["duration","bounce"],T1e=["stiffness","damping","mass"];function _9(t,e){return e.some(n=>t[n]!==void 0)}function M1e(t){let e={velocity:vs.velocity,stiffness:vs.stiffness,damping:vs.damping,mass:vs.mass,isResolvedFromDuration:!1,...t};if(!_9(t,T1e)&&_9(t,N1e))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*kh(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:vs.mass,stiffness:i,damping:s}}else{const n=E1e({...t,velocity:0});e={...e,...n,mass:vs.mass},e.isResolvedFromDuration=!0}return e}function oT(t=vs.visualDuration,e=vs.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:h,velocity:p,isResolvedFromDuration:f}=M1e({...n,velocity:-hu(n.velocity||0)}),m=p||0,x=u/(2*Math.sqrt(l*d)),v=a-s,g=hu(Math.sqrt(l/d)),b=Math.abs(v)<5;r||(r=b?vs.restSpeed.granular:vs.restSpeed.default),i||(i=b?vs.restDelta.granular:vs.restDelta.default);let y;if(x<1){const A=RI(g,x);y=k=>{const M=Math.exp(-x*g*k);return a-M*((m+x*g*v)/A*Math.sin(A*k)+v*Math.cos(A*k))}}else if(x===1)y=A=>a-Math.exp(-g*A)*(v+(m+g*v)*A);else{const A=g*Math.sqrt(x*x-1);y=k=>{const M=Math.exp(-x*g*k),T=Math.min(A*k,300);return a-M*((m+x*g*v)*Math.sinh(T)+A*v*Math.cosh(T))/A}}const S={calculatedDuration:f&&h||null,next:A=>{const k=y(A);if(f)o.done=A>=h;else{let M=A===0?m:0;x<1&&(M=A===0?xu(m):_Q(y,A,k));const T=Math.abs(M)<=r,C=Math.abs(a-k)<=i;o.done=T&&C}return o.value=o.done?a:k,o},toString:()=>{const A=Math.min(GF(S),aT),k=wQ(M=>S.next(A*M).value,A,30);return A+"ms "+k},toTransition:()=>{}};return S}oT.applyToOptions=t=>{const e=S1e(t,100,oT);return t.ease=e.ease,t.duration=xu(e.duration),t.type="keyframes",t};function jI({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const h=t[0],p={done:!1,value:h},f=T=>o!==void 0&&T<o||l!==void 0&&T>l,m=T=>o===void 0?l:l===void 0||Math.abs(o-T)<Math.abs(l-T)?o:l;let x=n*e;const v=h+x,g=a===void 0?v:a(v);g!==v&&(x=g-h);const b=T=>-x*Math.exp(-T/r),y=T=>g+b(T),S=T=>{const C=b(T),R=y(T);p.done=Math.abs(C)<=u,p.value=p.done?g:R};let A,k;const M=T=>{f(p.value)&&(A=T,k=oT({keyframes:[p.value,m(p.value)],velocity:_Q(y,T,p.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return M(0),{calculatedDuration:null,next:T=>{let C=!1;return!k&&A===void 0&&(C=!0,S(T),M(T)),A!==void 0&&T>=A?k.next(T-A):(!C&&S(T),p)}}}function R1e(t,e,n){const r=[],i=n||Pf.mix||bQ,s=t.length-1;for(let a=0;a<s;a++){let o=i(t[a],t[a+1]);if(e){const l=Array.isArray(e)?e[a]||gu:e;o=JS(l,o)}r.push(o)}return r}function j1e(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Vb(s===e.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=R1e(e,r,i),l=o.length,u=d=>{if(a&&d<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(d<t[h+1]);h++);const p=J2(t[h],t[h+1],d);return o[h](p)};return n?d=>u(kh(t[0],t[s-1],d)):u}function P1e(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=J2(0,e,r);t.push(_s(n,1,i))}}function L1e(t){const e=[0];return P1e(e,t.length-1),e}function I1e(t,e){return t.map(n=>n*e)}function D1e(t,e){return t.map(()=>e||cQ).splice(0,t.length-1)}function J_({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=qbe(r)?r.map(m9):m9(r),s={done:!1,value:e[0]},a=I1e(n&&n.length===e.length?n:L1e(e),t),o=j1e(a,e,{ease:Array.isArray(i)?i:D1e(e,i)});return{calculatedDuration:t,next:l=>(s.value=o(l),s.done=l>=t,s)}}const B1e=t=>t!==null;function VF(t,{repeat:e,repeatType:n="loop"},r,i=1){const s=t.filter(B1e),o=i<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const F1e={decay:jI,inertia:jI,tween:J_,keyframes:J_,spring:oT};function SQ(t){typeof t.type=="string"&&(t.type=F1e[t.type])}class WF{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const O1e=t=>t/100;class $F extends WF{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==dl.now()&&this.tick(dl.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;SQ(e);const{type:n=J_,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=e;let{keyframes:o}=e;const l=n||J_;l!==J_&&typeof o[0]!="number"&&(this.mixKeyframes=JS(O1e,bQ(o[0],o[1])),o=[0,100]);const u=l({...e,keyframes:o});s==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=GF(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:p,repeatDelay:f,type:m,onUpdate:x,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,S=r;if(h){const T=Math.min(this.currentTime,i)/o;let C=Math.floor(T),R=T%1;!R&&T>=1&&(R=1),R===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(p==="reverse"?(R=1-R,f&&(R-=f/o)):p==="mirror"&&(S=a)),y=kh(0,1,R)*o}const A=b?{done:!1,value:d[0]}:S.next(y);s&&(A.value=s(A.value));let{done:k}=A;!b&&l!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return M&&m!==jI&&(A.value=VF(d,this.options,v,this.speed)),x&&x(A.value),M&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return hu(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hu(e)}get time(){return hu(this.currentTime)}set time(e){var n;e=xu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(dl.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=hu(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=_1e,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dl.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function z1e(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const g0=t=>t*180/Math.PI,PI=t=>{const e=g0(Math.atan2(t[1],t[0]));return LI(e)},U1e={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:PI,rotateZ:PI,skewX:t=>g0(Math.atan(t[1])),skewY:t=>g0(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},LI=t=>(t=t%360,t<0&&(t+=360),t),S9=PI,A9=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),E9=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),H1e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:A9,scaleY:E9,scale:t=>(A9(t)+E9(t))/2,rotateX:t=>LI(g0(Math.atan2(t[6],t[5]))),rotateY:t=>LI(g0(Math.atan2(-t[2],t[0]))),rotateZ:S9,rotate:S9,skewX:t=>g0(Math.atan(t[4])),skewY:t=>g0(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function II(t){return t.includes("scale")?1:0}function DI(t,e){if(!t||t==="none")return II(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=H1e,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=U1e,i=o}if(!i)return II(e);const s=r[e],a=i[1].split(",").map(V1e);return typeof s=="function"?s(a):a[s]}const G1e=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return DI(n,e)};function V1e(t){return parseFloat(t.trim())}const M1=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],R1=new Set(M1),k9=t=>t===T1||t===Sn,W1e=new Set(["x","y","z"]),$1e=M1.filter(t=>!W1e.has(t));function K1e(t){const e=[];return $1e.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const sm={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>DI(e,"x"),y:(t,{transform:e})=>DI(e,"y")};sm.translateX=sm.x;sm.translateY=sm.y;const z0=new Set;let BI=!1,FI=!1,OI=!1;function AQ(){if(FI){const t=Array.from(z0).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=K1e(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);
vendor: 1,618 bytes, line 550
550i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))==null||o.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}FI=!1,BI=!1,z0.forEach(t=>t.complete(OI)),z0.clear()}function EQ(){z0.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(FI=!0)})}function q1e(){OI=!0,EQ(),AQ(),OI=!1}class KF{constructor(e,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(z0.add(this),BI||(BI=!0,Vi.read(EQ),Vi.resolveKeyframes(AQ))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),a=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&n){const o=r.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&s===void 0&&i.set(e[0])}z1e(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),z0.delete(this)}cancel(){this.state==="scheduled"&&(z0.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const X1e=t=>t.startsWith("--");function Y1e(t,e,n){X1e(e)?t.style.setProperty(e,n):t.style[e]=n}const J1e={};function kQ(t,e){const n=QZ(t);return()=>J1e[e]??n()}const Z1e=kQ(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),CQ=kQ(()=>{try{document.createElement("div").animate({opacity:0}
vendor: 9,726 bytes, line 550
550,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),E_=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,C9={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:E_([0,.65,.55,1]),circOut:E_([.55,0,1,.45]),backIn:E_([.31,.01,.66,-.59]),backOut:E_([.33,1.53,.69,.99])};function NQ(t,e){if(t)return typeof t=="function"?CQ()?wQ(t,e):"ease-out":uQ(t)?E_(t):Array.isArray(t)?t.map(n=>NQ(n,e)||C9.easeOut):C9[t]}function Q1e(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const h=NQ(o,i);Array.isArray(h)&&(d.easing=h);const p={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),t.animate(d,p)}function TQ(t){return typeof t=="function"&&"applyToOptions"in t}function ewe({type:t,...e}){return TQ(t)&&CQ()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class MQ extends WF{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=e,Vb(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ewe(e);this.animation=Q1e(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=VF(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):Y1e(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return hu(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+hu(e)}get time(){return hu(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xu(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Z1e()?(this.animation.timeline=e,gu):n(this)}}const RQ={anticipate:aQ,backInOut:sQ,circInOut:lQ};function twe(t){return t in RQ}function nwe(t){typeof t.ease=="string"&&twe(t.ease)&&(t.ease=RQ[t.ease])}const hR=10;class rwe extends MQ{constructor(e){nwe(e),SQ(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new $F({...a,autoplay:!1}),l=Math.max(hR,dl.now()-this.startTime),u=kh(0,hR,l-hR);n.setWithVelocity(o.sample(Math.max(0,l-u)).value,o.sample(l).value,u),o.stop()}}const N9=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gd.test(t)||t==="0")&&!t.startsWith("url("));function iwe(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function swe(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],a=N9(i,e),o=N9(s,e);return D5(a===o,`You are trying to animate ${e} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:iwe(t)||(n==="spring"||TQ(n))&&r}function zI(t){t.duration=0,t.type="keyframes"}const awe=new Set(["opacity","clipPath","filter","transform"]),owe=QZ(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lwe(t){var d;const{motionValue:e,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return owe()&&n&&awe.has(n)&&(n!=="transform"||!u)&&!l&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const cwe=40;class uwe extends WF{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:l,motionValue:u,element:d,...h}){var m;super(),this.stop=()=>{var x,v;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=dl.now();const p={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:l,motionValue:u,element:d,...h},f=(d==null?void 0:d.KeyframeResolver)||KF;this.keyframeResolver=new f(o,(x,v,g)=>this.onKeyframesResolved(x,v,p,!g),l,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,i){var v,g;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=dl.now(),swe(e,s,a,o)||((Pf.instantAnimations||!l)&&(d==null||d(VF(e,r,n))),e[0]=e[e.length-1],zI(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>cwe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},f=!u&&lwe(p),m=(g=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:g.current,x=f?new rwe({...p,element:m}):new $F(p);x.finished.then(()=>{this.notifyFinished()}).catch(gu),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),q1e()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function jQ(t,e,n,r=0,i=1){const s=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),a=t.size,o=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:o-s*r}const dwe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hwe(t){const e=dwe.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}const fwe=4;function PQ(t,e,n=1){Vb(n<=fwe,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=hwe(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const a=s.trim();return YZ(a)?parseFloat(a):a}return OF(i)?PQ(i,e,n+1):i}const pwe={type:"spring",stiffness:500,damping:25,restSpeed:10},mwe=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),gwe={type:"keyframes",duration:.8},xwe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vwe=(t,{keyframes:e})=>e.length>2?gwe:R1.has(t)?t.startsWith("scale")?mwe(e[1]):pwe:xwe,ywe=t=>t!==null;function bwe(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(ywe),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function LQ(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function qF(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?LQ(n,t):n}function wwe({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const XF=(t,e,n,r={},i,s)=>a=>{const o=qF(r,t)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-xu(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:p=>{e.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:s?void 0:i};wwe(o)||Object.assign(d,vwe(t,d)),d.duration&&(d.duration=xu(d.duration)),d.repeatDelay&&(d.repeatDelay=xu(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(zI(d),d.delay===0&&(h=!0)),(Pf.instantAnimations||Pf.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,zI(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,h&&!s&&e.get()!==void 0){const p=bwe(d.keyframes,o);if(p!==void 0){Vi.update(()=>{d.onUpdate(p),d.onComplete()});return}}return o.isSync?new $F(d):new uwe(d)};function T9(t){const e=[{},{}];
vendor: 8,057 bytes, line 550
550return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function YF(t,e,n,r){if(typeof e=="function"){const[i,s]=T9(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=T9(r);e=e(n!==void 0?n:t.custom,i,s)}return e}function nb(t,e,n){const r=t.getProps();return YF(r,e,n!==void 0?n:r.custom,t)}const IQ=new Set(["width","height","top","left","right","bottom",...M1]),M9=30,_we=t=>!isNaN(parseFloat(t));class Swe{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=dl.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=dl.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_we(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new DF);const r=this.events[e].add(n);return e==="change"?()=>{r(),Vi.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=dl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>M9)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,M9);return eQ(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wb(t,e){return new Swe(t,e)}const UI=t=>Array.isArray(t);function Awe(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wb(n))}function Ewe(t){return UI(t)?t[t.length-1]||0:t}function kwe(t,e){const n=nb(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=Ewe(s[a]);Awe(t,a,o)}}const Wo=t=>!!(t&&t.getVelocity);function Cwe(t){return!!(Wo(t)&&t.add)}function HI(t,e){const n=t.getValue("willChange");if(Cwe(n))return n.add(e);if(!n&&Pf.WillChange){const r=new Pf.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function JF(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Nwe="framerAppearId",DQ="data-"+JF(Nwe);function BQ(t){return t.props[DQ]}function Twe({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function FQ(t,e,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();s=s?LQ(s,l):l;const u=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const p in o){const f=t.getValue(p,t.latestValues[p]??null),m=o[p];if(m===void 0||h&&Twe(h,p))continue;const x={delay:n,...qF(s||{},p)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(m)&&m===v&&!x.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const S=BQ(t);if(S){const A=window.MotionHandoffAnimation(S,p,Vi);A!==null&&(x.startTime=A,g=!0)}}HI(t,p);const b=u??t.shouldReduceMotion;f.start(XF(p,f,m,b&&IQ.has(p)?{type:!1}:x,t,g));const y=f.animation;y&&d.push(y)}if(a){const p=()=>Vi.update(()=>{a&&kwe(t,a)});d.length?Promise.all(d).then(p):p()}return d}function GI(t,e,n={}){var l;const r=nb(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(FQ(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:p}=i;return Mwe(t,e,u,d,h,p,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[u,d]=o==="beforeChildren"?[s,a]:[a,s];return u().then(()=>d())}else return Promise.all([s(),a(n.delay)])}function Mwe(t,e,n=0,r=0,i=0,s=1,a){const o=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),o.push(GI(l,e,{...a,delay:n+(typeof r=="function"?0:r)+jQ(t.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function Rwe(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>GI(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=GI(t,e,n);else{const i=typeof e=="function"?nb(t,e,n.custom):e;r=Promise.all(FQ(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const jwe={test:t=>t==="auto",parse:t=>t},OQ=t=>e=>e.test(t),zQ=[T1,Sn,gh,Tp,a1e,s1e,jwe],R9=t=>zQ.find(OQ(t));function Pwe(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ZZ(t):!0}const Lwe=new Set(["brightness","contrast","saturate","opacity"]);function Iwe(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(zF)||[];if(!r)return t;const i=n.replace(r,"");let s=Lwe.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const Dwe=/\b([a-z-]*)\(.*?\)/gu,VI={...gd,getAnimatableNone:t=>{const e=t.match(Dwe);return e?e.map(Iwe).join(" "):t}},WI={...gd,getAnimatableNone:t=>{const e=gd.parse(t);return gd.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},j9={...T1,transform:Math.round},Bwe={rotate:Tp,rotateX:Tp,rotateY:Tp,rotateZ:Tp,scale:UE,scaleX:UE,scaleY:UE,scaleZ:UE,skew:Tp,skewX:Tp,skewY:Tp,distance:Sn,translateX:Sn,translateY:Sn,translateZ:Sn,x:Sn,y:Sn,z:Sn,perspective:Sn,transformPerspective:Sn,opacity:Z2,originX:v9,originY:v9,originZ:Sn},ZF={borderWidth:Sn,borderTopWidth:Sn,borderRightWidth:Sn,borderBottomWidth:Sn,borderLeftWidth:Sn,borderRadius:Sn,borderTopLeftRadius:Sn,borderTopRightRadius:Sn,borderBottomRightRadius:Sn,borderBottomLeftRadius:Sn,width:Sn,maxWidth:Sn,height:Sn,maxHeight:Sn,top:Sn,right:Sn,bottom:Sn,left:Sn,inset:Sn,insetBlock:Sn,insetBlockStart:Sn,insetBlockEnd:Sn,insetInline:Sn,insetInlineStart:Sn,insetInlineEnd:Sn,padding:Sn,paddingTop:Sn,paddingRight:Sn,paddingBottom:Sn,paddingLeft:Sn,paddingBlock:Sn,paddingBlockStart:Sn,paddingBlockEnd:Sn,paddingInline:Sn,paddingInlineStart:Sn,paddingInlineEnd:Sn,margin:Sn,marginTop:Sn,marginRight:Sn,marginBottom:Sn,marginLeft:Sn,marginBlock:Sn,marginBlockStart:Sn,marginBlockEnd:Sn,marginInline:Sn,marginInlineStart:Sn,marginInlineEnd:Sn,fontSize:Sn,backgroundPositionX:Sn,backgroundPositionY:Sn,...Bwe,zIndex:j9,fillOpacity:Z2,strokeOpacity:Z2,numOctaves:j9},Fwe={...ZF,color:da,backgroundColor:da,outlineColor:da,fill:da,stroke:da,borderColor:da,borderTopColor:da,borderRightColor:da,borderBottomColor:da,borderLeftColor:da,filter:VI,WebkitFilter:VI,mask:WI,WebkitMask:WI},UQ=t=>Fwe[t],Owe=new Set([VI,WI]);function HQ(t,e){let n=UQ(t);return Owe.has(n)||(n=gd),n.getAnimatableNone?n.getAnimatableNone(e):void 0}
vendor: 1,723 bytes, line 550
550const zwe=new Set(["auto","none","0"]);function Uwe(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!zwe.has(s)&&Q2(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=HQ(n,i)}class Hwe extends KF{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let h=e[d];if(typeof h=="string"&&(h=h.trim(),OF(h))){const p=PQ(h,n.current);p!==void 0&&(e[d]=p),d===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!IQ.has(r)||e.length!==2)return;const[i,s]=e,a=R9(i),o=R9(s),l=x9(i),u=x9(s);if(l!==u&&sm[r]){this.needsMeasurement=!0;return}if(a!==o)if(k9(a)&&k9(o))for(let d=0;d<e.length;d++){const h=e[d];typeof h=="string"&&(e[d]=parseFloat(h))}else sm[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||Pwe(e[i]))&&r.push(i);r.length&&Uwe(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=sm[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var o;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=sm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEac
vendor: 17,150 bytes, line 550
550h(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Gwe=new Set(["opacity","clipPath","filter","transform"]);function GQ(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(r=>r!=null)}const VQ=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function $I(t){return JZ(t)&&"offsetHeight"in t}const{schedule:QF,cancel:lqe}=dQ(queueMicrotask,!1),ed={x:!1,y:!1};function WQ(){return ed.x||ed.y}function Vwe(t){return t==="x"||t==="y"?ed[t]?null:(ed[t]=!0,()=>{ed[t]=!1}):ed.x||ed.y?null:(ed.x=ed.y=!0,()=>{ed.x=ed.y=!1})}function $Q(t,e){const n=GQ(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Wwe(t){return!(t.pointerType==="touch"||WQ())}function $we(t,e,n={}){const[r,i,s]=$Q(t,n);return r.forEach(a=>{let o=!1,l=!1,u;const d=()=>{a.removeEventListener("pointerleave",m)},h=v=>{u&&(u(v),u=void 0),d()},p=v=>{o=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,h(v))},f=()=>{o=!0,window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",p,i)},m=v=>{if(v.pointerType!=="touch"){if(o){l=!0;return}h(v)}},x=v=>{if(!Wwe(v))return;l=!1;const g=e(a,v);typeof g=="function"&&(u=g,a.addEventListener("pointerleave",m,i))};a.addEventListener("pointerenter",x,i),a.addEventListener("pointerdown",f,i)}),s}const KQ=(t,e)=>e?t===e?!0:KQ(t,e.parentElement):!1,eO=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Kwe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qwe(t){return Kwe.has(t.tagName)||t.isContentEditable===!0}const Xwe=new Set(["INPUT","SELECT","TEXTAREA"]);function Ywe(t){return Xwe.has(t.tagName)||t.isContentEditable===!0}const FC=new WeakSet;function P9(t){return e=>{e.key==="Enter"&&t(e)}}function fR(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Jwe=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=P9(()=>{if(FC.has(n))return;fR(n,"down");const i=P9(()=>{fR(n,"up")}),s=()=>fR(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function L9(t){return eO(t)&&!WQ()}const I9=new WeakSet;function Zwe(t,e,n={}){const[r,i,s]=$Q(t,n),a=o=>{const l=o.currentTarget;if(!L9(o)||I9.has(o))return;FC.add(l),n.stopPropagation&&I9.add(o);const u=e(l,o),d=(f,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),FC.has(l)&&FC.delete(l),L9(f)&&typeof u=="function"&&u(f,{success:m})},h=f=>{d(f,l===window||l===document||n.useGlobalTarget||KQ(l,f.target))},p=f=>{d(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",p,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),$I(o)&&(o.addEventListener("focus",u=>Jwe(u,i)),!qwe(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function tO(t){return JZ(t)&&"ownerSVGElement"in t}const OC=new WeakMap;let Mp;const qQ=(t,e,n)=>(r,i)=>i&&i[0]?i[0][t+"Size"]:tO(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Qwe=qQ("inline","width","offsetWidth"),e_e=qQ("block","height","offsetHeight");function t_e({target:t,borderBoxSize:e}){var n;(n=OC.get(t))==null||n.forEach(r=>{r(t,{get width(){return Qwe(t,e)},get height(){return e_e(t,e)}})})}function n_e(t){t.forEach(t_e)}function r_e(){typeof ResizeObserver>"u"||(Mp=new ResizeObserver(n_e))}function i_e(t,e){Mp||r_e();const n=GQ(t);return n.forEach(r=>{let i=OC.get(r);i||(i=new Set,OC.set(r,i)),i.add(e),Mp==null||Mp.observe(r)}),()=>{n.forEach(r=>{const i=OC.get(r);i==null||i.delete(e),i!=null&&i.size||Mp==null||Mp.unobserve(r)})}}const zC=new Set;let Ly;function s_e(){Ly=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};zC.forEach(e=>e(t))},window.addEventListener("resize",Ly)}function a_e(t){return zC.add(t),Ly||s_e(),()=>{zC.delete(t),!zC.size&&typeof Ly=="function"&&(window.removeEventListener("resize",Ly),Ly=void 0)}}function D9(t,e){return typeof t=="function"?a_e(t):i_e(t,e)}function o_e(t){return tO(t)&&t.tagName==="svg"}const l_e=[...zQ,da,gd],c_e=t=>l_e.find(OQ(t)),B9=()=>({translate:0,scale:1,origin:0,originPoint:0}),Iy=()=>({x:B9(),y:B9()}),F9=()=>({min:0,max:0}),Ea=()=>({x:F9(),y:F9()}),u_e=new WeakMap;function B5(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function eS(t){return typeof t=="string"||Array.isArray(t)}const nO=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rO=["initial",...nO];function F5(t){return B5(t.animate)||rO.some(e=>eS(t[e]))}function XQ(t){return!!(F5(t)||t.variants)}function d_e(t,e,n){for(const r in e){const i=e[r],s=n[r];if(Wo(i))t.addValue(r,i);else if(Wo(s))t.addValue(r,Wb(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(r);t.addValue(r,Wb(a!==void 0?a:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const KI={current:null},YQ={current:!1},h_e=typeof window<"u";function f_e(){if(YQ.current=!0,!!h_e)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>KI.current=t.matches;t.addEventListener("change",e),e()}else KI.current=!1}const O9=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let lT={};function JQ(t){lT=t}function p_e(){return lT}class m_e{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=KF,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=dl.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Vi.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=F5(n),this.isVariantNode=XQ(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in p){const m=p[f];u[f]!==void 0&&Wo(m)&&m.set(u[f])}}mount(e){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,u_e.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(YQ.current||f_e(),this.shouldReduceMotion=KI.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Im(this.notifyUpdate),Im(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Gwe.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:u,duration:d}=n.accelerate,h=new MQ({element:this.current,name:e,keyframes:o,times:l,ease:u,duration:xu(d)}),p=a(h);this.valueSubscriptions.set(e,()=>{p(),h.cancel()});return}const r=R1.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Vi.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in lT){const n=lT[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ea()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<O9.length;r++){const i=O9[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=e[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=d_e(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Wb(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(YZ(r)||ZZ(r))?r=parseFloat(r):!c_e(r)&&gd.test(n)&&(r=HQ(e,n)),this.setBaseTarget(e,Wo(r)?r.get():r)),Wo(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=YF(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Wo(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new DF),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){QF.render(this.render)}}class ZQ extends m_e{constructor(){super(...arguments),this.KeyframeResolver=Hwe}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Wo(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ag{constructor(e){this.isMounted=!1,this.node=e}update(){}}function QQ({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function g_e({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function x_e(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pR(t){return t===void 0||t===1}function qI({scale:t,scaleX:e,scaleY:n}){return!pR(t)||!pR(e)||!pR(n)}function Qg(t){return qI(t)||eee(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eee(t){return z9(t.x)||z9(t.y)}function z9(t){return t&&t!=="0%"}function cT(t,e,n){const r=t-n,i=e*r;return n+i}function U9(t,e,n,r,i){return i!==void 0&&(t=cT(t,i,r)),cT(t,n,r)+e}function XI(t,e=0,n=1,r,i){t.min=U9(t.min,e,n,r,i),t.max=U9(t.max,e,n,r,i)}function tee(t,{x:e,y:n}){XI(t.x,e.translate,e.scale,e.originPoint),XI(t.y,n.translate,n.scale,n.originPoint)}const H9=.999999999999,G9=1.0000000000001;function v_e(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,a;for(let o=0;o<i;o++){s=n[o],a=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&By(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,tee(t,a)),r&&Qg(s.latestValues)&&By(t,s.latestValues))}e.x<G9&&e.x>H9&&(e.x=1),e.y<G9&&e.y>H9&&(e.y=1)}function Dy(t,e){t.min=t.min+e,t.max=t.max+e}function V9(t,e,n,r,i=.5){const s=_s(t.min,t.max,i);XI(t,e,n,s,r)}function By(t,e){V9(t.x,e.x,e.scaleX,e.scale,e.originX),V9(t.y,e.y,e.scaleY,e.scale,e.originY)}function nee(t,e){return QQ(x_e(t.getBoundingClientRect(),e))}function y_e(t,e,n){const r=nee(t,n),{scroll:i}=e;return i&&(Dy(r.x,i.offset.x),Dy(r.y,i.offset.y)),r}const b_e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},w_e=M1.length;function __e(t,e,n){let r="",i=!0;for(let s=0;s<w_e;s++){const a=M1[s],o=t[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);l=a.startsWith("scale")?u===1:u===0}if(!l||n){const u=VQ(o,ZF[a]);if(!l){i=!1;const d=b_e[a]||a;r+=`${d}(${u}) `}n&&(e[a]=u)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function iO(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let a=!1,o=!1;for(const l in e){const u=e[l];if(R1.has(l)){a=!0;continue}else if(fQ(l)){i[l]=u;continue}else{const d=VQ(u,ZF[l]);l.startsWith("origin")?(o=!0,s[l]=d):r[l]=d}}if(e.transform||(a||n?r.transform=__e(e,t.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}function ree(t,{style:e,vars:n},r,i){const s=t.style;let a;for(a in e)s[a]=e[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function W9(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Hw={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Sn.test(t))t=parseFloat(t);else return t;const n=W9(t,e.target.x),r=W9(t,e.target.y);return`${n}% ${r}%`}},S_e={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=gd.parse(t);if(i.length>5)return r;const s=gd.createTransformer(t),a=typeof i[0]!="number"?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=_s(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}},YI={borderRadius:{...Hw,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Hw,borderTopRightRadius:Hw,borderBottomLeftRadius:Hw,borderBottomRightRadius:Hw,boxShadow:S_e};function iee(t,{layout:e,layoutId:n}){return R1.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!YI[t]||t==="opacity")}function sO(t,e,n){var a;const r=t.style,i=e==null?void 0:e.style,s={};if(!r)return s;for(const o in r)(Wo(r[o])||i&&Wo(i[o])||iee(o,t)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function A_e(t){return window.getComputedStyle(t)}
vendor: 4,877 bytes, line 550
550class E_e extends ZQ{constructor(){super(...arguments),this.type="html",this.renderInstance=ree}readValueFromInstance(e,n){var r;if(R1.has(n))return(r=this.projection)!=null&&r.isProjecting?II(n):G1e(e,n);{const i=A_e(e),s=(fQ(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return nee(e,n)}build(e,n,r){iO(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return sO(e,n,r)}}const k_e={offset:"stroke-dashoffset",array:"stroke-dasharray"},C_e={offset:"strokeDashoffset",array:"strokeDasharray"};function N_e(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?k_e:C_e;t[s.offset]=`${-r}`,t[s.array]=`${e} ${n}`}const T_e=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function see(t,{attrX:e,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},l,u,d){if(iO(t,o,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p}=t;h.transform&&(p.transform=h.transform,delete h.transform),(p.transform||h.transformOrigin)&&(p.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),p.transform&&(p.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const f of T_e)h[f]!==void 0&&(p[f]=h[f],delete h[f]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&N_e(h,i,s,a,!1)}const aee=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),oee=t=>typeof t=="string"&&t.toLowerCase()==="svg";function M_e(t,e,n,r){ree(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(aee.has(i)?i:JF(i),e.attrs[i])}function lee(t,e,n){const r=sO(t,e,n);for(const i in t)if(Wo(t[i])||Wo(e[i])){const s=M1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}class R_e extends ZQ{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ea}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(R1.has(n)){const r=UQ(n);return r&&r.default||0}return n=aee.has(n)?n:JF(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return lee(e,n,r)}build(e,n,r){see(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,i){M_e(e,n,r,i)}mount(e){this.isSVGTag=oee(e.tagName),super.mount(e)}}const j_e=rO.length;function cee(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?cee(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<j_e;n++){const r=rO[n],i=t.props[r];(eS(i)||i===!1)&&(e[r]=i)}return e}function uee(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const P_e=[...nO].reverse(),L_e=nO.length;function I_e(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Rwe(t,n,r)))}function D_e(t){let e=I_e(t),n=$9(),r=!0;const i=l=>(u,d)=>{var p;const h=nb(t,d,l==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:f,transitionEnd:m,...x}=h;u={...u,...x,...m}}return u};function s(l){e=l(t)}function a(l){const{props:u}=t,d=cee(t.parent)||{},h=[],p=new Set;let f={},m=1/0;for(let v=0;v<L_e;v++){const g=P_e[v],b=n[g],y=u[g]!==void 0?u[g]:d[g],S=eS(y),A=g===l?b.isActive:null;A===!1&&(m=v);let k=y===d[g]&&y!==u[g]&&S;if(k&&r&&t.manuallyAnimateOnMount&&(k=!1),b.protectedKeys={...f},!b.isActive&&A===null||!y&&!b.prevProp||B5(y)||typeof y=="boolean")continue;if(g==="exit"&&b.isActive&&A!==!0){b.prevResolvedValues&&(f={...f,...b.prevResolvedValues});continue}const M=B_e(b.prevProp,y);let T=M||g===l&&b.isActive&&!k&&S||v>m&&S,C=!1;const R=Array.isArray(y)?y:[y];let P=R.reduce(i(g),{});A===!1&&(P={});const{prevResolvedValues:j={}}=b,G={...j,...P},B=Z=>{T=!0,p.has(Z)&&(C=!0,p.delete(Z)),b.needsAnimating[Z]=!0;const V=t.getValue(Z);V&&(V.liveStyle=!1)};for(const Z in G){const V=P[Z],W=j[Z];if(f.hasOwnProperty(Z))continue;let O=!1;UI(V)&&UI(W)?O=!uee(V,W):O=V!==W,O?V!=null?B(Z):p.add(Z):V!==void 0&&p.has(Z)?B(Z):b.protectedKeys[Z]=!0}b.prevProp=y,b.prevResolvedValues=P,b.isActive&&(f={...f,...P}),r&&t.blockInitialAnimation&&(T=!1);const $=k&&M;T&&(!$||C)&&h.push(...R.map(Z=>{const V={type:g};if(typeof Z=="string"&&r&&!$&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,O=nb(W,Z);if(W.enteringChildren&&O){const{delayChildren:Y}=O.transition||{};V.delay=jQ(W.enteringChildren,t,Y)}}return{animation:Z,options:V}}))}if(p.size){const v={};if(typeof u.initial!="boolean"){const g=nb(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(v.transition=g.transition)}
vendor: 4,605 bytes, line 550
550p.forEach(g=>{const b=t.getBaseTarget(g),y=t.getValue(g);y&&(y.liveStyle=!0),v[g]=b??null}),h.push({animation:v})}let x=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,x?e(h):Promise.resolve()}function o(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(p=>{var f;return(f=p.animationState)==null?void 0:f.setActive(l,u)}),n[l].isActive=u;const d=a(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=$9()}}}function B_e(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!uee(e,t):!1}function Tg(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $9(){return{animate:Tg(!0),whileInView:Tg(),whileHover:Tg(),whileTap:Tg(),whileDrag:Tg(),whileFocus:Tg(),exit:Tg()}}function K9(t,e){t.min=e.min,t.max=e.max}function Ku(t,e){K9(t.x,e.x),K9(t.y,e.y)}function q9(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const dee=1e-4,F_e=1-dee,O_e=1+dee,hee=.01,z_e=0-hee,U_e=0+hee;function hl(t){return t.max-t.min}function H_e(t,e,n){return Math.abs(t-e)<=n}function X9(t,e,n,r=.5){t.origin=r,t.originPoint=_s(e.min,e.max,t.origin),t.scale=hl(n)/hl(e),t.translate=_s(n.min,n.max,t.origin)-t.originPoint,(t.scale>=F_e&&t.scale<=O_e||isNaN(t.scale))&&(t.scale=1),(t.translate>=z_e&&t.translate<=U_e||isNaN(t.translate))&&(t.translate=0)}function Z_(t,e,n,r){X9(t.x,e.x,n.x,r?r.originX:void 0),X9(t.y,e.y,n.y,r?r.originY:void 0)}function Y9(t,e,n){t.min=n.min+e.min,t.max=t.min+hl(e)}function G_e(t,e,n){Y9(t.x,e.x,n.x),Y9(t.y,e.y,n.y)}function J9(t,e,n){t.min=e.min-n.min,t.max=t.min+hl(e)}function uT(t,e,n){J9(t.x,e.x,n.x),J9(t.y,e.y,n.y)}function Z9(t,e,n,r,i){return t-=e,t=cT(t,1/n,r),i!==void 0&&(t=cT(t,1/i,r)),t}function V_e(t,e=0,n=1,r=.5,i,s=t,a=t){if(gh.test(e)&&(e=parseFloat(e),e=_s(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=_s(s.min,s.max,r);t===s&&(o-=e),t.min=Z9(t.min,e,n,o,i),t.max=Z9(t.max,e,n,o,i)}function Q9(t,e,[n,r,i],s,a){V_e(t,e[n],e[r],e[i],e.scale,s,a)}const W_e=["x","scaleX","originX"],$_e=["y","scaleY","originY"];function e7(t,e,n,r){Q9(t.x,e,W_e,n?n.x:void 0,r?r.x:void 0),Q9(t.y,e,$_e,n?n.y:void 0,r?r.y:void 0)}function t7(t){return t.translate===0&&t.scale===1}function fee(t){return t7(t.x)&&t7(t.y)}function n7(t,e){return t.min===e.min&&t.max===e.max}function K_e(t,e){return n7(t.x,e.x)&&n7(t.y,e.y)}function r7(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pee(t,e){return r7(t.x,e.x)&&r7(t.y,e.y)}function i7(t){return hl(t.x)/hl(t.y)}function s7(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Qd(t){return[t("x"),t("y")]}function q_e(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:p,skewX:f,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),f&&(r+=`skewX(${f}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const mee=["TopLeft","TopRight","BottomLeft","BottomRight"],X_e=mee.length,a7=t=>typeof t=="string"?parseFloat(t):t,o7=t=>typeof t=="number"||Sn.test(t);function Y_e(t,e,n,r,i,s){i?(t.opacity=_s(0,n.opacity??1,J_e(r)),t.opacityExit=_s(e.opacity??1,0,Z_e(r))):s&&(t.opacity=_s(e.opacity??1,n.opacity??1,r));for(let a=0;a<X_e;a++){const o=`border${mee[a]}Radius`;let l=l7(e,o),u=l7(n,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||o7(l)===o7(u)?(t[o]=Math.max(_s(a7(l),a7(u),r),0),(gh.test(u)||gh.test(l))&&(t[o]+="%")):t[o]=u}(e.rotate||n.rotate)&&(t.rotate=_s(e.rotate||0,n.rotate||0,r))}function l7(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const J_e=gee(0,.5,oQ),Z_e=gee(.5,.95,gu);function gee(t,e,n){return r=>r<t?0:r>e?1:n(J2(t,e,r))}function Q_e(t,e,n){const r=Wo(t)?t:Wb(t);return r.start(XF("",r,e,n)),r.animation}function tS(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const e2e=(t,e)=>t.depth-e.depth;class t2e{constructor(){this.children=[],this.isDirty=!1}add(e){IF(this.children,e),this.isDirty=!0}remove(e){iT(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(e2e),this.isDirty=!1,this.children.forEac
550h(e)}}function n2e(t,e){const n=dl.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Im(r),t(s-e))};return Vi.setup(r,!0),()=>Im(r)}function UC(t){return Wo(t)?t.get():t}class r2e{constructor(){this.members=[]}add(e){IF(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const i=r.instance;i&&i.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&iT(this.members,r)}e.scheduleRender()}remove(e){if(iT(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i],a=s.instance;if(s.isPresent!==!1&&(!a||a.isConnected!==!1)){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender();const i=r.options.layoutDependency,s=e.options.layoutDependency;if(!(i!==void 0&&s!==void 0&&i===s)){const l=r.instance;l&&l.isConnected===!1&&!r.snapshot||(e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:o}=e.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const HC={hasAnimatedSinceResize:!0,hasEverUpdated:!1},mR=["","X","Y","Z"],i2e=1e3;let s2e=0;function gR(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function xee(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=BQ(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Vi,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&xee(r)}function vee({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=e==null?void 0:e()){this.id=s2e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(l2e),this.nodes.forEach(h2e),this.nodes.forEach(f2e),this.nodes.forEach(c2e)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new t2e)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new DF),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const l=this.eventHandlers.get(a);l&&l.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=tO(a)&&!o_e(a),this.instance=a;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),t){let d,h=0;const p=()=>this.root.updateBlockedByResize=!1;Vi.read(()=>{h=window.innerWidth}),t(a,()=>{const f=window.innerWidth;
vendor: 9,412 bytes, line 550
550f!==h&&(h=f,this.root.updateBlockedByResize=!0,d&&d(),d=n2e(p,250),HC.hasAnimatedSinceResize&&(HC.hasAnimatedSinceResize=!1,this.nodes.forEach(d7)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||v2e,{onLayoutAnimationStart:x,onLayoutAnimationComplete:v}=u.getProps(),g=!this.targetLayout||!pee(this.targetLayout,f),b=!h&&p;if(this.options.layoutRoot||this.resumeFrom||b||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...qF(m,"layout"),onPlay:x,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,b)}else h||d7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Im(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(p2e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xee(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(c7);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(u7);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(d2e),this.nodes.forEach(a2e),this.nodes.forEach(o2e)):this.nodes.forEach(u7),this.clearAllSnapshots();const o=dl.now();po.delta=kh(0,1e3/60,o-po.timestamp),po.timestamp=o,po.isProcessing=!0,oR.update.process(po),oR.preRender.process(po),oR.render.process(po),po.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,QF.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(u2e),this.sharedNodes.forEach(m2e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Vi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Vi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hl(this.snapshot.measuredBox.x)&&!hl(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Ea(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!fee(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||Qg(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),y2e(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Ea();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(b2e))){const{scroll:d}=this.root;d&&(Dy(o.x,d.offset.x),Dy(o.y,d.offset.y))}return o}removeElementScroll(a){var l;const o=Ea();if(Ku(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:p}=d;d!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&Ku(o,a),Dy(o.x,h.offset.x),Dy(o.y,h.offset.y))}return o}applyTransform(a,o=!1){const l=Ea();Ku(l,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&By(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Qg(d.latestValues)&&By(l,d.latestValues)}return Qg(this.latestValues)&&By(l,this.latestValues),l}removeTransform(a){const o=Ea();Ku(o,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Qg(u.latestValues))continue;qI(u.latestValues)&&u.updateSnapshot();const d=Ea(),h=u.measurePageBox();Ku(d,h),e7(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Qg(this.latestValues)&&e7(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==po.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==o;if(!(a||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=po.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ea(),this.targetWithTransforms=Ea()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),G_e(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ku(this.target,this.layout.layoutBox),tee(this.target,this.targetDelta)):Ku(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||qI(this.parent.latestValues)||eee(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,l){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ea(),this.relativeTargetOrigin=Ea(),uT(this.relativeTargetOrigin,o,l),Ku(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&
vendor: 5,308 bytes, line 550
550(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===po.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Ku(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;v_e(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ea());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(q9(this.prevProjectionDelta.x,this.projectionDelta.x),q9(this.prevProjectionDelta.y,this.projectionDelta.y)),Z_(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!s7(this.projectionDelta.x,this.prevProjectionDelta.x)||!s7(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Iy(),this.projectionDelta=Iy(),this.projectionDeltaWithTransform=Iy()}setAnimationOrigin(a,o=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},h=Iy();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const p=Ea(),f=l?l.source:void 0,m=this.layout?this.layout.source:void 0,x=f!==m,v=this.getStack(),g=!v||v.members.length<=1,b=!!(x&&!g&&this.options.crossfade===!0&&!this.path.some(x2e));this.animationProgress=0;let y;this.mixTargetDelta=S=>{const A=S/1e3;h7(h.x,a.x,A),h7(h.y,a.y,A),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uT(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),g2e(this.relativeTarget,this.relativeTargetOrigin,p,A),y&&K_e(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Ea()),Ku(y,this.relativeTarget)),x&&(this.animationValues=d,Y_e(d,u,this.latestValues,A,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Im(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vi.update(()=>{HC.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wb(0)),this.motionValue.jump(0,!1),this.currentAnimation=Q_e(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(i2e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&yee(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ea();const h=hl(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const p=hl(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+p}Ku(o,l),By(o,d),Z_(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new r2e),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}
vendor: 18,641 bytes, lines 550-558
550resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&gR("z",a,u,this.animationValues);for(let d=0;d<mR.length;d++)gR(`rotate${mR[d]}`,a,u,this.animationValues),gR(`skew${mR[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=UC(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=UC(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Qg(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=q_e(this.projectionDeltaWithTransform,this.treeScale,d);l&&(h=l(d,h)),a.transform=h;const{x:p,y:f}=this.projectionDelta;a.transformOrigin=`${p.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in YI){if(d[m]===void 0)continue;const{correct:x,applyTo:v,isCSSVariable:g}=YI[m],b=h==="none"?d[m]:x(d[m],u);if(v){const y=v.length;for(let S=0;S<y;S++)a[v[S]]=b}else g?this.options.visualElement.renderState.vars[m]=b:a[m]=b}this.options.layoutId&&(a.pointerEvents=u===this?UC(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(c7),this.root.sharedNodes.clear()}}}function a2e(t){t.updateLayout()}function o2e(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,a=e.source!==t.layout.source;s==="size"?Qd(h=>{const p=a?e.measuredBox[h]:e.layoutBox[h],f=hl(p);p.min=r[h].min,p.max=p.min+f}):yee(s,e.layoutBox,r)&&Qd(h=>{const p=a?e.measuredBox[h]:e.layoutBox[h],f=hl(r[h]);p.max=p.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const o=Iy();Z_(o,r,e.layoutBox);const l=Iy();a?Z_(l,t.applyTransform(i,!0),e.measuredBox):Z_(l,r,e.layoutBox);const u=!fee(o);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:f}=h;if(p&&f){const m=Ea();uT(m,e.layoutBox,p.layoutBox);const x=Ea();uT(x,r,f.layoutBox),pee(m,x)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function l2e(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function c2e(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function u2e(t){t.clearSnapshot()}function c7(t){t.clearMeasurements()}function u7(t){t.isLayoutDirty=!1}function d2e(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function d7(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function h2e(t){t.resolveTargetDelta()}function f2e(t){t.calcProjection()}function p2e(t){t.resetSkewAndRotation()}function m2e(t){t.removeLeadSnapshot()}function h7(t,e,n){t.translate=_s(e.translate,0,n),t.scale=_s(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function f7(t,e,n,r){t.min=_s(e.min,n.min,r),t.max=_s(e.max,n.max,r)}function g2e(t,e,n,r){f7(t.x,e.x,n.x,r),f7(t.y,e.y,n.y,r)}function x2e(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const v2e={duration:.45,ease:[.4,0,.1,1]},p7=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),m7=p7("applewebkit/")&&!p7("chrome/")?Math.round:gu;function g7(t){t.min=m7(t.min),t.max=m7(t.max)}function y2e(t){g7(t.x),g7(t.y)}function yee(t,e,n){return t==="position"||t==="preserve-aspect"&&!H_e(i7(e),i7(n),.2)}function b2e(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const w2e=vee({attachResizeListener:(t,e)=>tS(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),xR={current:void 0},bee=vee({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xR.current){const t=new w2e({});t.mount(window),t.setOptions({layoutScroll:!0}),xR.current=t}return xR.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),aO=E.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function x7(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function _2e(...t){return e=>{let n=!1;const r=t.map(i=>{const s=x7(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():x7(t[i],null)}}}}function S2e(...t){return E.useCallback(_2e(...t),t)}class A2e extends E.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=$I(r)&&r.offsetWidth||0,s=$I(r)&&r.offsetHeight||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function E2e({children:t,isPresent:e,anchorX:n,anchorY:r,root:i,pop:s}){var p;const a=E.useId(),o=E.useRef(null),l=E.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=E.useContext(aO),d=((p=t.props)==null?void 0:p.ref)??(t==null?void 0:t.ref),h=S2e(o,d);return E.useInsertionEffect(()=>{const{width:f,height:m,top:x,left:v,right:g,bottom:b}=l.current;if(e||s===!1||!o.current||!f||!m)return;const y=n==="left"?`left: ${v}`:`right: ${g}`,S=r==="bottom"?`bottom: ${b}`:`top: ${x}`;o.current.dataset.motionPopId=a;const A=document.createElement("style");u&&(A.nonce=u);const k=i??document.head;return k.appendChild(A),A.sheet&&A.sheet.insertRule(` 551 [data-motion-pop-id="${a}"] { 552 position: absolute !important; 553 width: ${f}px !important; 554 height: ${m}px !important; 555 ${y}px !important; 556 ${S}px !important; 557 } 558 `),()=>{k.contains(A)&&k.removeChild(A)}},[e]),c.jsx(A2e,{isPresent:e,childRef:o,sizeRef:l,pop:s,children:s===!1?t:E.cloneElement(t,{ref:h})})}const k2e=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:l,root:u})=>{const d=LF(C2e),h=E.useId();let p=!0,f=E.useMemo(()=>(p=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:m=>{d.set(m,!0);for(const x of d.values())if(!x)return;r&&r()},register:m=>(d.set(m,!1),()=>d.delete(m))}),[n,d,r]);return s&&p&&(f={...f}),E.useMemo(()=>{d.forEach((m,x)=>d.set(x,!1))},[n]),E.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=c.jsx(E2e,{pop:a==="popLayout",isPresent:n,anchorX:o,anchorY:l,root:u,children:t}),c.jsx(I5.Provider,{value:f,children:t})};function C2e(){return new Map}function wee(t=!0){const e=E.useContext(I5);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=E.useId();E.useEffect(()=>{if(t)return i(s)},[t]);const a=E.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,a]:[!0]}const HE=t=>t.key||"";function v7(t){const e=[];return E.Children.forEach(t,n=>{E.isValidElement(n)&&e.push(n)}),e}const bo=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[d,h]=wee(a),p=E.useMemo(()=>v7(t),[t]),f=a&&!d?[]:p.map(HE),m=E.useRef(!0),x=E.useRef(p),v=LF(()=>new Map),g=E.useRef(new Set),[b,y]=E.useState(p),[S,A]=E.useState(p);XZ(()=>{m.current=!1,x.current=p;for(let T=0;T<S.length;T++){const C=HE(S[T]);f.includes(C)?(v.delete(C),g.current.delete(C)):v.get(C)!==!0&&v.set(C,!1)}},[S,f.length,f.join("-")]);const k=[];if(p!==b){let T=[...p];for(let C=0;C<S.length;C++){const R=S[C],P=HE(R);f.includes(P)||(T.splice(C,0,R),k.push(R))}return s==="wait"&&k.length&&(T=k),A(v7(T)),y(p),null}const{forceRender:M}=E.useContext(PF);return c.jsx(c.Fragment,{children:S.map(T=>{const C=HE(T),R=a&&!d?!1:p===S||f.includes(C),P=()=>{if(g.current.has(C))return;if(g.current.add(C),v.has(C))v.set(C,!0);else return;let j=!0;v.forEach(G=>{G||(j=!1)}),j&&(M==null||M(),A(x.current),a&&(h==null||h()),r&&r())};return c.jsx(k2e,{isPresent:R,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:R?void 0:P,anchorX:o,anchorY:l,children:T},C)})})},_ee=E.createContext({strict:!1}),y7={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let b7=!1;function N2e(){if(b7)return;const t={};for(const e in y7)t[e]={isEnabled:n=>y7[e].some(r=>!!n[r])};JQ(t),b7=!0}function See(){return N2e(),p_e()}function T2e(t){const e=See();for(const n in t)e[n]={...e[n],...t[n]};JQ(e)}const M2e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function dT(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||M2e.has(t)}let Aee=t=>!dT(t);function R2e(t){typeof t=="function"&&(Aee=e=>e.startsWith("on")?!dT(e):t(e))}try{R2e(require("@emotion/is-prop-valid").default)}catch{}function j2e(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(Aee(i)||n===!0&&dT(i)||!e&&!dT(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const O5=E.createContext({});function P2e(t,e){if(F5(t)){const{initial:n,animate:r}=t;return{initial:n===!1||eS(n)?n:void 0,animate:eS(r)?r:void 0}}return t.inherit!==!1?e:{}}function L2e(t){const{initial:e,animate:n}=P2e(t,E.useContext(O5));return E.useMemo(()=>({initial:e,animate:n}),[w7(e),w7(n)])}function w7(t){return Array.isArray(t)?t.join(" "):t}const oO=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Eee(t,e,n){for(const r in e)!Wo(e[r])&&!iee(r,n)&&(t[r]=e[r])}function I2e({transformTemplate:t},e){return E.useMemo(()=>{const n=oO();return iO(n,e,t),Object.assign({},n.vars,n.style)},[e])}function D2e(t,e){const n=t.style||{},r={};return Eee(r,n,t),Object.assign(r,I2e(t,e)),r}function B2e(t,e){const n={},r=D2e(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const kee=()=>({...oO(),attrs:{}});function F2e(t,e,n,r){const i=E.useMemo(()=>{const s=kee();return see(s,e,oee(r),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Eee(s,t.style,t),i.style={...s,...i.style}}return i}const O2e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lO(t){return typeof t!="string"||t.includes("-")?!1:!!(O2e.indexOf(t)>-1||/[A-Z]/u.test(t))}function z2e(t,e,n,{latestValues:r},i,s=!1,a){const l=(a??lO(t)?F2e:B2e)(e,r,i,t),u=j2e(e,typeof t=="string",s),d=t!==E.Fragment?{...u,...l,ref:n}:{},{children:h}=e,p=E.useMemo(()=>Wo(h)?h.get():h,[h]);return E.createElement(t,{...d,children:p})}function U2e({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,i){return{latestValues:H2e(n,r,i,t),renderState:e()}}function H2e(t,e,n,r){const i={},s=r(t,{});for(const p in s)i[p]=UC(s[p]);let{initial:a,animate:o}=t;const l=F5(t),u=XQ(t);e&&u&&!l&&t.inherit!==!1&&(a===void 0&&(a=e.initial),o===void 0&&(o=e.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?o:a;if(h&&typeof h!="boolean"&&!B5(h)){const p=Array.isArray(h)?h:[h];for(let f=0;f<p.length;f++){const m=YF(t,p[f]);if(m){const{transitionEnd:x,transition:v,...g}=m;for(const b in g){let y=g[b];if(Array.isArray(y)){const S=d?y.length-1:0;y=y[S]}y!==null&&(i[b]=y)}for(const b in x)i[b]=x[b]}}}return i}const Cee=t=>(e,n)=>{const r=E.useContext(O5),i=E.useContext(I5),s=()=>U2e(t,e,r,i);return n?s():LF(s)},G2e=Cee({scrapeMotionValuesFromProps:sO,createRenderState:oO}),V2e=Cee({scrapeMotionValuesFromProps:lee,createRenderState:kee}),W2e=Symbol.for("motionComponentSymbol");function $2e(t,e,n){const r=E.useRef(n);E.useInsertionEffect(()=>{r.current=n});const i=E.useRef(null);return E.useCallback(s=>{var o;s&&((o=t.onMount)==null||o.call(t,s)),e&&(s?e.mount(s):e.unmount());const a=r.current;if(typeof a=="function")if(s){const l=a(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s)},[e])}const Nee=E.createContext({});function ly(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function K2e(t,e,n,r,i,s){var y,S;const{visualElement:a}=E.useContext(O5),o=E.useContext(_ee),l=E.useContext(I5),u=E.useContext(aO),d=u.reducedMotion,h=u.skipAnimations,p=E.useRef(null),f=E.useRef(!1);r=r||o.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:s}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,x=E.useContext(Nee);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&q2e(p.current,n,i,x);const v=E.useRef(!1);E.useInsertionEffect(()=>{m&&v.current&&m.update(n,l)});const g=n[DQ],b=E.useRef(!!g&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,g))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,g)));return XZ(()=>{f.current=!0,m&&(v.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),b.current&&m.animationState&&m.animationState.animateChanges())}),E.useEffect(()=>{m&&(!b.current&&m.animationState&&m.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,g)}),b.current=!1),m.enteringChildren=void 0)}),m}function q2e(t,e,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Tee(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&ly(o),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function Tee(t){if(t)return t.options.allowProjection!==!1?t.projection:Tee(t.parent)}function vR(t,{forwardMotionProps:e=!1,type:n}={},r,i){r&&T2e(r);const s=n?n==="svg":lO(t),a=s?V2e:G2e;function o(u,d){let h;const p={...E.useContext(aO),...u,layoutId:X2e(u)},{isStatic:f}=p,m=L2e(u),x=a(u,f);if(!f&&qZ){Y2e();const v=J2e(p);h=v.MeasureLayout,m.visualElement=K2e(t,x,p,i,v.ProjectionNode,s)}return c.jsxs(O5.Provider,{value:m,children:[h&&m.visualElement?c.jsx(h,{visualElement:m.visualElement,...p}):null,z2e(t,u,$2e(x,m.visualElement,d),x,f,e,s)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=E.forwardRef(o);return l[W2e]=t,l}function X2e({layoutId:t}){const e=E.useContext(PF).id;return e&&t!==void 0?e+"-"+t:t}function Y2e(t,e){E.useContext(_ee).strict}function J2e(t){const e=See(),{drag:n,layout:r}=e;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Z2e(t,e){if(typeof Proxy>"u")return vR;const n=new Map,r=(s,a)=>vR(s,a,t,e),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,vR(a,void 0,t,e)),n.get(a))})}const Q2e=(t,e)=>e.isSVG??lO(t)?new R_e(e):new E_e(e,{allowProjection:t!==E.Fragment});class eSe extends ag{constructor(e){super(e),e.animationState||(e.animationState=D_e(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();B5(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let tSe=0;class nSe extends ag{constructor(){super(...arguments),this.id=tSe++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};
vendor: 18,473 bytes, line 558
558n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const rSe={animation:{Feature:eSe},exit:{Feature:nSe}};function eA(t){return{point:{x:t.pageX,y:t.pageY}}}const iSe=t=>e=>eO(e)&&t(e,eA(e));function Q_(t,e,n,r){return tS(t,e,iSe(n),r)}const Mee=({current:t})=>t?t.ownerDocument.defaultView:null,_7=(t,e)=>Math.abs(t-e);function sSe(t,e){const n=_7(t.x,e.x),r=_7(t.y,e.y);return Math.sqrt(n**2+r**2)}const S7=new Set(["auto","scroll"]);class Ree{constructor(e,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=bR(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,x=sSe(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!x)return;const{point:v}=f,{timestamp:g}=po;this.history.push({...v,timestamp:g});const{onStart:b,onMove:y}=this.handlers;m||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,m)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yR(m,this.transformPagePoint),Vi.update(this.updatePoint,!0)},this.handlePointerUp=(f,m)=>{this.end();const{onEnd:x,onSessionEnd:v,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=bR(f.type==="pointercancel"?this.lastMoveEventInfo:yR(m,this.transformPagePoint),this.history);this.startEvent&&x&&x(f,b),v&&v(f,b)},!eO(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const l=eA(e),u=yR(l,this.transformPagePoint),{point:d}=u,{timestamp:h}=po;this.history=[{...d,timestamp:h}];const{onSessionStart:p}=n;p&&p(e,bR(u,this.history)),this.removeListeners=JS(Q_(this.contextWindow,"pointermove",this.handlePointerMove),Q_(this.contextWindow,"pointerup",this.handlePointerUp),Q_(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(S7.has(r.overflowX)||S7.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,i),Vi.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Im(this.updatePoint)}}function yR(t,e){return e?{point:e(t.point)}:t}function A7(t,e){return{x:t.x-e.x,y:t.y-e.y}}function bR({point:t},e){return{point:t,delta:A7(t,jee(e)),offset:A7(t,aSe(e)),velocity:oSe(e,.1)}}function aSe(t){return t[0]}function jee(t){return t[t.length-1]}function oSe(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=jee(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>xu(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&i.timestamp-r.timestamp>xu(e)*2&&(r=t[1]);const s=hu(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function lSe(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?_s(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?_s(n,t,r.max):Math.min(t,n)),t}function E7(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function cSe(t,{top:e,left:n,bottom:r,right:i}){return{x:E7(t.x,n,i),y:E7(t.y,e,r)}}function k7(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function uSe(t,e){return{x:k7(t.x,e.x),y:k7(t.y,e.y)}}function dSe(t,e){let n=.5;const r=hl(t),i=hl(e);return i>r?n=J2(e.min,e.max-r,t.min):r>i&&(n=J2(t.min,t.max-i,e.min)),kh(0,1,n)}function hSe(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const JI=.35;function fSe(t=JI){return t===!1?t=0:t===!0&&(t=JI),{x:C7(t,"left","right"),y:C7(t,"top","bottom")}}function C7(t,e,n){return{min:N7(t,e),max:N7(t,n)}}function N7(t,e){return typeof t=="number"?t:t[e]||0}const pSe=new WeakMap;class mSe{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ea(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(eA(h).point),this.stopAnimation()},a=(h,p)=>{const{drag:f,dragPropagation:m,onDragStart:x}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vwe(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qd(g=>{let b=this.getAxisMotionValue(g).get()||0;if(gh.test(b)){const{projection:y}=this.visualElement;if(y&&y.layout){const S=y.layout.layoutBox[g];S&&(b=hl(S)*(parseFloat(b)/100))}}this.originPoint[g]=b}),x&&Vi.update(()=>x(h,p),!1,!0),HI(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:x,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=p;if(m&&this.currentDirection===null){this.currentDirection=xSe(g),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",p.point,g),this.updateAxis("y",p.point,g),this.visualElement.render(),v&&Vi.update(()=>v(h,p),!1,!0)},l=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ree(e,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Mee(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&Vi.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!GE(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=lSe(a,this.constraints[e],this.elastic[e])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&ly(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=cSe(r.layoutBox,e):this.constraints=!1,this.elastic=fSe(n),i!==this.constraints&&!ly(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Qd(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=hSe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ly(e))return!1;const r=e.current;Vb(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=y_e(r,i.root,this.visualElement.getTransformPagePoint());let a=uSe(i.layout.layoutBox,s);if(n){const o=n(g_e(a));this.hasMutatedConstraints=!!o,o&&(a=QQ(o))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Qd(d=>{if(!GE(d,n,this.currentDirection))return;let h=l&&l[d]||{};a&&(h={min:0,max:0});const p=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:r?e[d]:0,bounceStiffness:p,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return HI(this.visualElement,e),r.start(XF(e,r,0,n,this.visualElement,!1))}stopAnimation(){Qd(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Qd(n=>{const{drag:r}=this.getProps();if(!GE(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n],l=s.get()||0;s.set(e[n]-_s(a,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ly(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Qd(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();i[a]=dSe({min:l,max:l},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Qd(a=>{if(!GE(a,e,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(_s(l,u,i[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;pSe.set(this.visualElement,this);const e=this.visualElement.current,n=Q_(e,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),p=u.target,f=p!==e&&Ywe(p);d&&h&&!f&&this.start(u)});let r;const i=()=>{const{dragConstraints:u}=this.getProps();ly(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=gSe(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Vi.read(i);const o=tS(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Qd(h=>{const p=this.getAxisMotionValue(h);p&&(this.originPoint[h]+=u[h].translate,p.set(p.get()+u[h].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=JI,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function T7(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function gSe(t,e,n){const r=D9(t,T7(n)),i=D9(e,T7(n));return()=>{r(),i()}}function GE(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function xSe(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class vSe extends ag{constructor(e){super(e),this.removeGroupControls=gu,this.removeListeners=gu,this.controls=new mSe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gu}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const wR=t=>(e,n)=>{t&&Vi.update(()=>t(e,n),!1,!0)};class ySe extends ag{constructor(){super(...arguments),this.removePointerDownListener=gu}onPointerDown(e){this.session=new Ree(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mee(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:wR(e),onStart:wR(n),onMove:wR(r),onEnd:(s,a)=>{delete this.session,i&&Vi.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Q_(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let _R=!1;class bSe extends E.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),_R&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),HC.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),_R=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==s?a.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?a.promote():a.relegate()||Vi.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),QF.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;_R=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Pee(t){const[e,n]=wee(),r=E.useContext(PF);return c.jsx(bSe,{...t,layoutGroup:r,switchLayoutGroup:E.useContext(Nee),isPresent:e,safeToRemove:n})}const wSe={pan:{Feature:ySe},drag:{Feature:vSe,ProjectionNode:bee,MeasureLayout:Pee}};function M7(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Vi.postRender(()=>s(e,eA(e)))}class _Se extends ag{mount(){const{current:e}=this.node;e&&(this.unmount=$we(e,(n,r)=>(M7(this.node,r,"Start"),i=>M7(this.node,i,"End"))))}unmount(){}}class SSe extends ag{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=JS(tS(this.node.current,"focus",()=>this.onFocus()),tS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function R7(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Vi.postRender(()=>s(e,eA(e)))}class ASe extends ag{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Zwe(e,(i,s)=>(R7(this.node,s,"Start"),(a,{success:o})=>R7(this.node,a,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ZI=new WeakMap,SR=new WeakMap,ESe=t=>{const e=ZI.get(t.target);e&&e(t)},kSe=t=>{t.forEach(ESe)};function CSe({root:t,...e}){const n=t||document;SR.has(n)||SR.set(n,{});const r=SR.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(kSe,{root:t,...e})),r[i]}function NSe(t,e,n){const r=CSe(e);return ZI.set(t,n),r.observe(t),()=>{ZI.delete(t),r.unobserve(t)}}const TSe={some:0,all:1};class MSe extends ag{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:TSe[i]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(l)};return NSe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(RSe(e,n))&&this.startObserver()}unmount(){}}function RSe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const jSe={inView:{Feature:MSe},tap:{Feature:ASe},focus:{Feature:SSe},hover:{Feature:_Se}},PSe={layout:{ProjectionNode:bee,MeasureLayout:Pee}},LSe={...rSe,...jSe,...wSe,...PSe},tn=Z2e(LSe,Q2e),U0={wandregal:"Wandregal",gondelregal:"Gondelregal",anbauregal:"Anbauregal","wandregal-anbau"
558:"Wandregal Anbaumodul","gondelregal-anbau":"Gondelregal Anbaumodul",paneelwandregal:"Paneelwandregal","paneelwandregal-anbau":"Paneelwandregal Anbaumodul",eckregal:"Eckregal"},ISe={wandregal:"WR",gondelregal:"GR",anbauregal:"AR","wandregal-anbau":"WRA","gondelregal-anbau":"GRA",paneelwandregal:"PW","paneelwandregal-anbau":"PWA",eckregal:"ER"},DSe=[{label:"66,5 cm",breite:.665,breitePlus3:.695,field:"anzahl_0665"},{label:"100 cm",breite:1,breitePlus3:1.03,field:"anzahl_1000"},{label:"125 cm",breite:1.25,breitePlus3:1.28,field:"anzahl_1250"},{label:"133 cm",breite:1.33,breitePlus3:1.36,field:"anzahl_1330"}],BSe=[47,57],FSe=[{value:"GL",label:"Glatt",icon:"â¬"},{value:"RL",label:"Rundlochung",icon:"â ¿"}],hT=[{winkel:90,bauform:"inneneck",label:"Inneneckmodul",description:"1à 90°-Modul",moduleCount:1,moduleType:"90°"},{winkel:90,bauform:"eckig",label:"Eckig",description:"2à 45°-Module",moduleCount:2,moduleType:"45°"},{winkel:90,bauform:"rund",label:"Rund",description:"2à 45°-Rundmodule",moduleCount:2,moduleType:"45° rund"},{winkel:45,bauform:"eckig",label:"Eckig",description:"1à 45°-Modul",moduleCount:1,moduleType:"45°"},{winkel:45,bauform:"rund",label:"Rund",description:"1à 45°-Rundmodul",moduleCount:1,moduleType:"45° rund"}],cO=[{value:"freistehend",label:"Freistehend",description:"Eckregal ohne Anbindung an ein bestehendes Regal"},{value:"ein-regal",label:"An einem Regal",description:"Eine Seite teilt sich eine Säule mit einem bestehenden Regal"},{value:"zwei-regale",label:"An zwei Regalen",description:"Beide Seiten teilen sich Säulen mit bestehenden Regalen"}];function OSe(){return{regaltyp:"eckregal",eckwinkel:90,bauform:"inneneck",anbindung:"freistehend",hoehe:221,tiefe:47,anzahlFachboeden:4,sockelblende:!0,rueckwandtyp:"GL",farbe:"Lichtgrau",saeulentyp:"6x3"}}function zSe(){return{regaltyp:"wandregal",hoehe:221,breite:null,tiefe:47,anzahlFachboeden:4,sockelblende:!0,scannerschiene:!0,rueckwandtyp:"GL",rueckwandTypen:null,farbe:"Lichtgrau",fachbodenTiefen:null,sockelbodenTiefe:null,saeulentyp:"6x3",anbauart:"einseitig"}}function USe(){return{regaltyp:"gondelregal",hoehe:221,breite:null,tiefe:47,anzahlFachboeden:4,sockelblende:!0,scannerschiene:!0,rueckwandtyp:"GL",rueckwandTypen:null,farbe:"Lichtgrau",fachbodenTiefen:null,sockelbodenTiefe:null,saeulentyp:"6x3",anbauart:"einseitig",beidseitig:!0,mittelwandHoehe:null}}function HSe(){return{regaltyp:"wandregal-anbau",hoehe:221,breite:1.03,tiefe:47,anzahlFachboeden:4,sockelblende:!0,scannerschiene:!0,rueckwandtyp:"GL",rueckwandTypen:null,farbe:"Lichtgrau",fachbodenTiefen:null,sockelbodenTiefe:null,saeulentyp:"6x3",anbauart:"einseitig"}}function GSe(){return{regaltyp:"gondelregal-anbau",hoehe:221,breite:1.03,tiefe:47,anzahlFachboeden:4,sockelblende:!0,scannerschiene:!0,rueckwandtyp:"GL",rueckwandTypen:null,farbe:"Lichtgrau",fachbodenTiefen:null,sockelbodenTiefe:null,saeulentyp:"6x3",anbauart:"einseitig",beidseitig:!0,mittelwandHoehe:null}}const VSe=[121,141,161,181,201,221],Hp=[{name:"Nussbaum",displayName:"Nussbaum",hex:"#6B4226"},{name:"Anthrazit",displayName:"Anthrazit",hex:"#383E42"},{name:"Grau",displayName:"Grau",hex:"#A0A0A0"},{name:"Weiss",displayName:"WeiÃ",hex:"#F5F5F5"}];function WSe(){return{regaltyp:"paneelwandregal",hoehe:221,breite:null,tiefe:47,saeulentyp:"6x3",farbe:"Lichtgrau",rueckwandfarbe:"Nussbaum"}}const $Se={7016:"#383E42",7035:"#C5C7C4",9001:"#EFEBDA",9006:"#A1A1A0"},xi=[{name:"Anthrazitgrau",ral:"RAL 7016",code:7016,hex:"#383E42"},{name:"Lichtgrau",ral:"RAL 7035",code:7035,hex:"#C5C7C4"},{name:"JuraweiÃ",ral:"RAL 9001",code:9001,hex:"#EFEBDA"},{name:"WeiÃaluminium",ral:"RAL 9006",code:9006,hex:"#A1A1A0"}],tA=[121,141,161,181,201,221,241,261,281,301],z5=[30,37,47,57,67,77],Lf=[37,47,57,67,77];function ox(t){return t===121?57:1/0}function U5(t,e){const n=ox(e),r={hoehe:e};return t.tiefe>n&&(r.tiefe=n),t.sockelbodenTiefe!=null&&t.sockelbodenTiefe>n&&(r.sockelbodenTiefe=n),t.fachbodenTiefen&&(r.fachbodenTiefen=t.fachbodenTiefen.map(i=>Math.min(i,n))),n<67&&(r.saeulentyp="6x3"),r}const j7=[{value:"GL",label:"Glatt",icon:"â¬"},{value:"RL",label:"Rundlochung",icon:"â ¿"},{value:"SL",label:"Schlüsselloch",icon:"â"}];let Lee=0;const QI=new Set;function KSe(t){return QI.add(t),()=>QI.delete(t)}function P7(){return Lee}
558function nA(){Lee=Date.now(),QI.forEach(t=>t())}function rA(){const t=E.useSyncExternalStore(KSe,P7,P7);return t?`?v=${t}`:""}function xv(t){const e=new Date().toISOString().slice(0,10);return`${t}?d=${e}`}const iA="https://ntxxmvyoiatxvggtjtfg.supabase.co";function sA(t,e=1200,n=.82){return new Promise((r,i)=>{const s=new Image,a=URL.createObjectURL(t);s.onload=()=>{URL.revokeObjectURL(a);const o=document.createElement("canvas");let l=s.width,u=s.height;l>e&&(u=Math.round(u*e/l),l=e),o.width=l,o.height=u;const d=o.getContext("2d");if(!d)return i(new Error("Canvas context not available"));d.drawImage(s,0,0,l,u),o.toBlob(h=>{h?r(h):i(new Error("WebP conversion failed"))},"image/webp",n)},s.onerror=()=>{URL.revokeObjectURL(a),i(new Error("Image loading failed"))},s.src=a})}function Gp(t,e,n,r="wandregal"){const i=Math.max(1,Math.min(10,Math.round(e))),s=Math.max(0,Math.min(7,n));return`${r==="gondelregal"?"gondel":"regal"}_${t}_${i}m_${s}fb.webp`}function Fy(t,e,n,r="wandregal"){const i=xi.find(o=>o.name===t),s=(i==null?void 0:i.code)??7035,a=Gp(s,e,n,r);return`${iA}/storage/v1/object/public/shelf-images/${a}`}function qSe(t,e,n,r="wandregal"){const i=xi.find(l=>l.name===t),s=(i==null?void 0:i.code)??7035,a=[],o=(l,u,d)=>`${iA}/storage/v1/object/public/shelf-images/${Gp(l,u,d,r)}`;a.push(o(s,e,n));for(let l=1;l<=6;l++)n+l<=7&&a.push(o(s,e,n+l)),n-l>=0&&a.push(o(s,e,n-l));for(let l=1;l<=9;l++)for(const u of[e+l,e-l])if(!(u<1||u>10)){a.push(o(s,u,n));for(let d=1;d<=6;d++)n+d<=7&&a.push(o(s,u,n+d)),n-d>=0&&a.push(o(s,u,n-d))}
558return[...new Set(a)]}async function XSe(t,e,n,r,i="wandregal"){try{const s=await sA(r),a=Gp(t,e,n,i),{error:o}=await Ot.storage.from("shelf-images").upload(a,s,{contentType:"image/webp",upsert:!0});return o?{error:o.message}:(nA(),{error:null})}catch(s){return{error:s.message??"Upload failed"}}}function Oy(t,e){return`paneel_${t}_${e.toLowerCase()}.webp`}function fT(t,e){const n=xi.find(s=>s.name===t),r=(n==null?void 0:n.code)??7035,i=Oy(r,e);return`${iA}/storage/v1/object/public/shelf-images/${i}`}async function YSe(t,e,n){try{const r=await sA(n),i=Oy(t,e),{error:s}=await Ot.storage.from("shelf-images").upload(i,r,{contentType:"image/webp",upsert:!0});return s?{error:s.message}:(nA(),{error:null})}catch(r){return{error:r.message??"Upload failed"}}}async function Iee(){const t=[];let n=0,r=!0;for(;r;){const{data:i,error:s}=await Ot.storage.from("shelf-images").list("",{limit:1e3,offset:n});s||!i||i.length===0?r=!1:(t.push(...i.map(a=>a.name)),n+=i.length,i.length<1e3&&(r=!1))}return t}const qh=[{value:"ie90",label:"IE90 â 90° Inneneck"},{value:"ie45",label:"IE45 â 45° Eckig"},{value:"ier45",label:"IER45 â 45° Rund"},{value:"2xie45",label:"2ÃIE45 â 90° Eckig"},{value:"2xier45",label:"2ÃIER45 â 90° Rund"}];function Vp(t,e,n){const r=Math.max(0,Math.min(6,e));return`eck_${n}_${t}_${r}fb.webp`}function uO(t,e,n){const r=xi.find(s=>s.name===t),i=(r==null?void 0:r.code)??7035;return`${iA}/storage/v1/object/public/shelf-images/${Vp(i,e,n)}`}function JSe(t,e,n){const r=xi.find(o=>o.name===t),i=(r==null?void 0:r.code)??7035,s=[],a=(o,l)=>`${iA}/storage/v1/object/public/shelf-images/${Vp(o,l,n)}`;s.push(a(i,e));for(let o=1;o<=6;o++)e+o<=6&&s.push(a(i,e+o)),e-o>=0&&s.push(a(i,e-o));for(const o of xi)if(o.code!==i){s.push(a(o.code,e));for(let l=1;l<=6;l++)e+l<=6&&s.push(a(o.code,e+l)),e-l>=0&&s.push(a(o.code,e-l))}return[...new Set(s)]}async function ZSe(t,e,n,r){try{const i=await sA(r),s=Vp(t,e,n),{error:a}=await Ot.storage.from("shelf-images").upload(s,i,{contentType:"image/webp",upsert:!0});return a?{error:a.message}:(nA(),{error:null})}catch(i){return{error:i.message??"Upload failed"}}}function L7(t,e){return t===90&&e==="inneneck"?"ie90":t===90&&e==="eckig"?"2xie45":t===90&&e==="rund"?"2xier45":t===45&&e==="rund"?"ier45":"ie45"}var AR="focusScope.autoFocusOnMount",ER="focusScope.autoFocusOnUnmount",I7={bubbles:!1,cancelable:!0},QSe="FocusScope",H5=E.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[o,l]=E.useState(null),u=_u(i),d=_u(s),h=E.useRef(null),p=ur(e,x=>l(x)),f=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let x=function(y){if(f.paused||!o)return;const S=y.target;o.contains(S)?h.current=S:Rp(h.current,{select:!0})},v=function(y){if(f.paused||!o)return;const S=y.relatedTarget;S!==null&&(o.contains(S)||Rp(h.current,{select:!0}))},g=function(y){if(document.activeElement===document.body)for(const A of y)A.removedNodes.length>0&&Rp(o)};document.addEventListener("focusin",x),document.addEventListener("focusout",v);const b=new MutationObserver(g);return o&&b.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",v),b.disconnect()}}},[r,o,f.paused]),E.useEffect(()=>{if(o){B7.add(f);const x=document.activeElement;if(!o.contains(x)){const g=new CustomEvent(AR,I7);o.addEventListener(AR,u),o.dispatchEvent(g),g.defaultPrevented||(eAe(sAe(Dee(o)),{select:!0}),document.activeElement===x&&Rp(o))}return()=>{o.removeEventListener(AR,u),setTimeout(()=>{const g=new CustomEvent(ER,I7);o.addEventListener(ER,d),o.dispatchEvent(g),g.defaultPrevented||Rp(x??document.body,{select:!0}),o.removeEventListener(ER,d),B7.remove(f)},0)}}},[o,u,d,f]);const m=E.useCallback(x=>{if(!n&&!r||f.paused)return;const v=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,g=document.activeElement;if(v&&g){const b=x.currentTarget,[y,S]=tAe(b);y&&S?!x.shiftKey&&g===S?(x.preventDefault(),n&&Rp(y,{select:!0})):x.shiftKey&&g===y&&(x.preventDefault(),n&&Rp(S,{select:!0})):g===b&&x.preventDefault()}},[n,r,f.paused]);return c.jsx(vn.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});H5.displayName=QSe;function eAe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Rp(r,{select:e}),document.activeElement!==n)return}function tAe(t){const e=Dee(t),n=D7(e,t),r=D7(e.reverse(),t);return[n,r]}function Dee(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function D7(t,e){for(const n of t)if(!nAe(n,{upTo:e}))return n}function nAe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function rAe(t){return t instanceof HTMLInputElement&&"select"in t}function Rp(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&rAe(t)&&e&&t.select()}}var B7=iAe();function iAe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=F7(t,e),t.unshift(e)},remove(e){var n;t=F7(t,e),(n=t[0])==null||n.resume()}}}function F7(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function sAe(t){return t.filter(e=>e.tagName!=="A")}var kR=0;function dO(){E.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??O7()),document.body.insertAdjacentElement("beforeend",t[1]??O7()),kR++,()=>{kR===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,133 bytes, lines 558-573
558=>e.remove()),kR--}},[])}function O7(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var GC="right-scroll-bar-position",VC="width-before-scroll-bar",aAe="with-scroll-bars-hidden",oAe="--removed-body-scroll-bar-size";function CR(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function lAe(t,e){var n=E.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var cAe=typeof window<"u"?E.useLayoutEffect:E.useEffect,z7=new WeakMap;function uAe(t,e){var n=lAe(null,function(r){return t.forEach(function(i){return CR(i,r)})});return cAe(function(){var r=z7.get(n);if(r){var i=new Set(r),s=new Set(t),a=n.current;i.forEach(function(o){s.has(o)||CR(o,null)}),s.forEach(function(o){i.has(o)||CR(o,a)})}z7.set(n,t)},[t]),n}function dAe(t){return t}function hAe(t,e){e===void 0&&(e=dAe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var a=e(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function fAe(t){t===void 0&&(t={});var e=hAe(null);return e.options=ah({async:!0,ssr:!1},t),e}var Bee=function(t){var e=t.sideCar,n=C1(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,ah({},n))};Bee.isSideCarExport=!0;function pAe(t,e){return t.useMedium(e),Bee}var Fee=fAe(),NR=function(){},G5=E.forwardRef(function(t,e){var n=E.useRef(null),r=E.useState({onScrollCapture:NR,onWheelCapture:NR,onTouchMoveCapture:NR}),i=r[0],s=r[1],a=t.forwardProps,o=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,p=t.sideCar,f=t.noRelative,m=t.noIsolation,x=t.inert,v=t.allowPinchZoom,g=t.as,b=g===void 0?"div":g,y=t.gapMode,S=C1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=p,k=uAe([n,e]),M=ah(ah({},S),i);return E.createElement(E.Fragment,null,d&&E.createElement(A,{sideCar:Fee,removeScrollBar:u,shards:h,noRelative:f,noIsolation:m,inert:x,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:y}),a?E.cloneElement(E.Children.only(o),ah(ah({},M),{ref:k})):E.createElement(b,ah({},M,{className:l,ref:k}),o))});G5.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};G5.classNames={fullWidth:VC,zeroRight:GC};var mAe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gAe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=mAe();return e&&t.setAttribute("nonce",e),t}function xAe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function vAe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var yAe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=gAe())&&(xAe(e,n),vAe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},bAe=function(){var t=yAe();return function(e,n){E.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Oee=function(){var t=bAe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},wAe={left:0,top:0,right:0,gap:0},TR=function(t){return parseInt(t||"",10)||0},_Ae=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[TR(n),TR(r),TR(i)]},SAe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return wAe;var e=_Ae(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},AAe=Oee(),rb="data-scroll-locked",EAe=function(t,e,n,r){var i=t.left,s=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),` 559 .`.concat(aAe,` { 560 overflow: hidden `).concat(r,`; 561 padding-right: `).concat(o,"px ").concat(r,`; 562 } 563 body[`).concat(rb,`] { 564 overflow: hidden `).concat(r,`; 565 overscroll-behavior: contain; 566 `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` 567 padding-left: `.concat(i,`px; 568 padding-top: `).concat(s,`px; 569 padding-right: `).concat(a,`px; 570 margin-left:0; 571 margin-top:0; 572 margin-right: `).concat(o,"px ").concat(r,`; 573 `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";
573")].filter(Boolean).join(""),` 574 } 575 576 .`).concat(GC,` { 577 right: `).concat(o,"px ").concat(r,`; 578 } 579 580 .`).concat(VC,` { 581 margin-right: `).concat(o,"px ").concat(r,`; 582 } 583 584 .`).concat(GC," .").concat(GC,` { 585 right: 0 `).concat(r,`; 586 } 587 588 .`).concat(VC," .").concat(VC,` { 589 margin-right: 0 `).concat(r,`; 590 } 591 592 body[`).concat(rb,`] { 593 `).concat(oAe,": ").concat(o,`px; 594 } 595`)},U7=function(){var t=parseInt(document.body.getAttribute(rb)||"0",10);return isFinite(t)?t:0},kAe=function(){E.useEffect(function(){return document.body.setAttribute(rb,(U7()+1).toString()),function(){var t=U7()-1;t<=0?document.body.removeAttribute(rb):document.body.setAttribute(rb,t.toString())}},[])},CAe=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;kAe();var s=E.useMemo(function(){return SAe(i)},[i]);return E.createElement(AAe,{styles:EAe(s,!e,i,n?"":"!important")})},e4=!1;if(typeof window<"u")try{var VE=Object.defineProperty({},"passive",{get:function(){return e4=!0,!0}});window.addEventListener("test",VE,VE),window.removeEventListener("test",VE,VE)}catch{e4=!1}var vv=e4?{passive:!1}:!1,NAe=function(t){return t.tagName==="TEXTAREA"},zee=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!NAe(t)&&n[e]==="visible")},TAe=function(t){return zee(t,"overflowY")},MAe=function(t){return zee(t,"overflowX")},H7=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Uee(t,r);if(i){var s=Hee(t,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},RAe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},jAe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Uee=function(t,e){return t==="v"?TAe(e):MAe(e)},Hee=function(t,e){return t==="v"?RAe(e):jAe(e)},PAe=function(t,e){return t==="h"&&e==="rtl"?-1:1},LAe=function(t,e,n,r,i){var s=PAe(t,window.getComputedStyle(e).direction),a=s*r,o=n.target,l=e.contains(o),u=!1,d=a>0,h=0,p=0;do{if(!o)break;var f=Hee(t,o),m=f[0],x=f[1],v=f[2],g=x-v-s*m;(m||g)&&Uee(t,o)&&(h+=g,p+=m);var b=o.parentNode;o=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(p)<1||!i))&&(u=!0),u},WE=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},G7=function(t){return[t.deltaX,t.deltaY]},V7=function(t){return t&&"current"in t?t.current:t},IAe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},DAe=function(t){return` 596 .block-interactivity-`.concat(t,` {pointer-events: none;} 597 .allow-interactivity-`).concat(t,` {pointer-events: all;} 598`)},BAe=0,yv=[];function FAe(t){var e=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(BAe++)[0],s=E.useState(Oee)[0],a=E.useRef(t);E.useEffect(function(){a.current=t},[t]),E.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=nve([t.lockRef.current],(t.shards||[]).map(V7),!0).filter(Boolean);return x.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var o=E.useCallback(function(x,v){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var g=WE(x),b=n.current,y="deltaX"in x?x.deltaX:b[0]-g[0],S="deltaY"in x?x.deltaY:b[1]-g[1],A,k=x.target,M=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in x&&M==="h"&&k.type==="range")return!1;var T=H7(M,k);if(!T)return!0;if(T?A=M:(A=M==="v"?"h":"v",T=H7(M,k)),!T)return!1;if(!r.current&&"changedTouches"in x&&(y||S)&&(r.current=A),!A)return!0;var C=r.current||A;return LAe(C,v,x,C==="h"?y:S,!0)},[]),l=E.useCallback(function(x){var v=x;if(!(!yv.length||yv[yv.length-1]!==s)){var g="deltaY"in v?G7(v):WE(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&IAe(A.delta,g)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}
vendor: 4,526 bytes, line 598
598if(!b){var y=(a.current.shards||[]).map(V7).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=y.length>0?o(v,y[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=E.useCallback(function(x,v,g,b){var y={name:x,delta:v,target:g,should:b,shadowParent:OAe(g)};e.current.push(y),setTimeout(function(){e.current=e.current.filter(function(S){return S!==y})},1)},[]),d=E.useCallback(function(x){n.current=WE(x),r.current=void 0},[]),h=E.useCallback(function(x){u(x.type,G7(x),x.target,o(x,t.lockRef.current))},[]),p=E.useCallback(function(x){u(x.type,WE(x),x.target,o(x,t.lockRef.current))},[]);E.useEffect(function(){return yv.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,vv),document.addEventListener("touchmove",l,vv),document.addEventListener("touchstart",d,vv),function(){yv=yv.filter(function(x){return x!==s}),document.removeEventListener("wheel",l,vv),document.removeEventListener("touchmove",l,vv),document.removeEventListener("touchstart",d,vv)}},[]);var f=t.removeScrollBar,m=t.inert;return E.createElement(E.Fragment,null,m?E.createElement(s,{styles:DAe(i)}):null,f?E.createElement(CAe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function OAe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const zAe=pAe(Fee,FAe);var V5=E.forwardRef(function(t,e){return E.createElement(G5,ah({},t,{ref:e,sideCar:zAe}))});V5.classNames=G5.classNames;var UAe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},bv=new WeakMap,$E=new WeakMap,KE={},MR=0,Gee=function(t){return t&&(t.host||Gee(t.parentNode))},HAe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Gee(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},GAe=function(t,e,n,r){var i=HAe(e,Array.isArray(t)?t:[t]);KE[n]||(KE[n]=new WeakMap);var s=KE[n],a=[],o=new Set,l=new Set(i),u=function(h){!h||o.has(h)||(o.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(o.has(p))d(p);else try{var f=p.getAttribute(r),m=f!==null&&f!=="false",x=(bv.get(p)||0)+1,v=(s.get(p)||0)+1;bv.set(p,x),s.set(p,v),a.push(p),x===1&&m&&$E.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(e),o.clear(),MR++,function(){a.forEach(function(h){var p=bv.get(h)-1,f=s.get(h)-1;bv.set(h,p),s.set(h,f),p||($E.has(h)||h.removeAttribute(r),$E.delete(h)),f||h.removeAttribute(n)}),MR--,MR||(bv=new WeakMap,bv=new WeakMap,$E=new WeakMap,KE={})}},hO=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=UAe(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),GAe(r,i,n,"aria-hidden")):function(){return null}},W5="Dialog",[Vee,Wee]=ja(W5),[VAe,Sd]=Vee(W5),$ee=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,o=E.useRef(null),l=E.useRef(null),[u,d]=Ja({prop:r,defaultProp:i??!1,onChange:s,caller:W5});return c.jsx(VAe,{scope:e,triggerRef:o,contentRef:l,contentId:mu(),titleId:mu(),descriptionId:mu(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(h=>!h),[d]),modal:a,children:n})};$ee.displayName=W5;var Kee="DialogTrigger",qee=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sd(Kee,n),s=ur(e,i.triggerRef);return c.jsx(vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mO(i.open),...r,ref:s,onClick:cn(t.onClick,i.onOpenToggle)})});qee.displayName=Kee;var fO="DialogPortal",[WAe,Xee]=Vee(fO,{forceMount:void 0}),Yee=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Sd(fO,e);return c.jsx(WAe,{scope:e,forceMount:n,children:E.Children.map(r,a=>c.jsx(Cu,{present:n||s.open,children:c.jsx(VS,{asChild:!0,container:i,children:a})}))})};Yee.displayName=fO;var pT="DialogOverlay",Jee=E.forwardRef((t,e)=>{const n=Xee(pT,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Sd(pT,t.__scopeDialog);return s.modal?c.jsx(Cu,{present:r||s.open,children:c.jsx(KAe,{...i,ref:e})}):null});Jee.displayName=pT;var $Ae=tx("DialogOverlay.RemoveScroll"),KAe=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sd(pT,n);return c.jsx(V5,{as:$Ae,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(vn.div,{"data-state":mO(i.open
vendor: 3,568 bytes, lines 598-602
598),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),lx="DialogContent",Zee=E.forwardRef((t,e)=>{const n=Xee(lx,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Sd(lx,t.__scopeDialog);return c.jsx(Cu,{present:r||s.open,children:s.modal?c.jsx(qAe,{...i,ref:e}):c.jsx(XAe,{...i,ref:e})})});Zee.displayName=lx;var qAe=E.forwardRef((t,e)=>{const n=Sd(lx,t.__scopeDialog),r=E.useRef(null),i=ur(e,n.contentRef,r);return E.useEffect(()=>{const s=r.current;if(s)return hO(s)},[]),c.jsx(Qee,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cn(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:cn(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:cn(t.onFocusOutside,s=>s.preventDefault())})}),XAe=E.forwardRef((t,e)=>{const n=Sd(lx,t.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return c.jsx(Qee,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Qee=E.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,o=Sd(lx,n),l=E.useRef(null),u=ur(e,l);return dO(),c.jsxs(c.Fragment,{children:[c.jsx(H5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(p1,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":mO(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(JAe,{titleId:o.titleId}),c.jsx(QAe,{contentRef:l,descriptionId:o.descriptionId})]})]})}),pO="DialogTitle",ete=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sd(pO,n);return c.jsx(vn.h2,{id:i.titleId,...r,ref:e})});ete.displayName=pO;var tte="DialogDescription",nte=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sd(tte,n);return c.jsx(vn.p,{id:i.descriptionId,...r,ref:e})});nte.displayName=tte;var rte="DialogClose",ite=E.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sd(rte,n);return c.jsx(vn.button,{type:"button",...r,ref:e,onClick:cn(t.onClick,()=>i.onOpenChange(!1))})});ite.displayName=rte;function mO(t){return t?"open":"closed"}var ste="DialogTitleWarning",[YAe,ate]=qhe(ste,{contentName:lx,titleName:pO,docsSlug:"dialog"}),JAe=({titleId:t})=>{const e=ate(ste),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 599 600If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 601 602For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},ZAe="DialogDescriptionWarning",QAe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ate(ZAe).contentName}}.`;return E.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null}
602,$5=$ee,ote=qee,K5=Yee,j1=Jee,P1=Zee,L1=ete,I1=nte,q5=ite;const qf=$5,eEe=K5,lte=E.forwardRef(({className:t,...e},n)=>c.jsx(j1,{ref:n,className:rn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));lte.displayName=j1.displayName;const jh=E.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(eEe,{children:[c.jsx(lte,{}),c.jsxs(P1,{ref:r,className:rn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,c.jsxs(q5,{className:"absolute right-4 top-4 roun
602ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(Bc,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jh.displayName=P1.displayName;const Xf=({className:t,...e})=>c.jsx("div",{className:rn("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Xf.displayName="DialogHeader";const X5=({className:t,...e})=>c.jsx("div",{className:rn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});X5.displayName="DialogFooter";const Yf=E.forwardRef(({className:t,...e},n)=>c.jsx(L1,{ref:n,className:rn("text-lg font-semibold leading-none tracking-tight",t),...e}));Yf.displayName=L1.displayName;const D1=E.forwardRef(({className:t,...e},n)=>c.jsx(I1,{ref:n,className:rn("text-sm text-muted-foreground",t),...e}));D1.displayName=I1.displayName;async function cte(t,e,n=1,r){const{data:i,error:s}=await Ot.functions.invoke("save-konfiguration",{body:{konfigurator:t,konfiguration:e,schemaVersion:n,regalTyp:r??void 0}});if(s)throw new Error(s.message??"Speichern fehlgeschlagen");const a=i;if(!(a!=null&&a.kurzCode))throw new Error((a==null?void 0:a.error)??"Speichern fehlgeschlagen");return{kurzCode:a.kurzCode,expiresAt:a.expiresAt??""}}async function ute(t){const e=t.trim().toUpperCase().replace(/[-\s]/g,""),r=`https://ntxxmvyoiatxvggtjtfg.supabase.co/functions/v1/load-konfiguration?code=${encodeURIComponent(e)}`,i="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50eHhtdnlvaWF0eHZnZ3RqdGZnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE4NDgyNjgsImV4cCI6MjA4NzQyNDI2OH0.35kO11-oFUIEhCT5iqxnjPGFOhiJWhYbgk2zVQUsDXI",s=await fetch(r,{headers:{apikey:i,Authorization:`Bearer ${i}`}});if(!s.ok){const a=await s.json().catch(()=>({}));throw new Error((a==null?void 0:a.error)??`Laden fehlgeschlagen (${s.status})`)}return await s.json()}function mT(t){const e=t.toUpperCase();return e.length===8?`${e.slice(0,4)}-${e.slice(4)}`:e}const WC={regal:"Tegometall-Regal",boden:"Boden",spacewall:"Spacewall",easycubes:"EasyCubes",standonfloor:"StandOnFloor",messestand:"Messestand"},tEe={regal:"/konfigurator",boden:"/boden",spacewall:"/spacewall",easycubes:"/easycubes",standonfloor:"/standonfloor-wuerfel",messestand:"/messestand"},W7={wandregal:"Wandregal","wandregal-anbau":"Wandregal Anbau",gondelregal:"Gondelregal","gondelregal-anbau":"Gondelregal Anbau",paneelwandregal:"Paneelwandregal","paneelwandregal-anbau":"Paneelwandregal Anbau",eckregal:"Eckregal",anbauregal:"Anbauregal (Legacy)"};function nEe(t){switch(t){case"wandregal":return"/wandregal";case"wandregal-anbau":case"anbauregal":return"/wandregal-anbau";case"gondelregal":return"/gondelregal";case"gondelregal-anbau":return"/gondelregal-anbau";case"paneelwandregal":case"paneelwandregal-anbau":return"/paneelwandregal";case"eckregal":return"/eckregal";default:return"/konfigurator"}}function nS(t,e,n){return`${t==="regal"?nEe(e):tEe[t]}?code=${encodeURIComponent(n)}`}function rEe({open:t,onOpenChange:e,erwarteterKonfigurator:n,onGeladen:r}){const i=Tx(),[s,a]=E.useState(""),[o,l]=E.useState(!1);async function u(d){d.preventDefault();const h=s.trim().toUpperCase().replace(/[-\s]/g,"");if(h.length!==8){dn({title:"Ungültiger Code",description:"Der Code besteht aus 8 Zeichen.",variant:"destructive"});return}l(!0);try{const p=await ute(h);if(n&&p.konfigurator!==n){dn({title:"Anderer Konfigurator",description:`Dieser Code gehört zum ${WC[p.konfigurator]}-Konfigurator.`}),i(nS(p.konfigurator,p.regalTyp??null,h)),e(!1,{loaded:!0});return}r?r(p.konfiguration,p.konfigurator):i(nS(p.konfigurator,p.regalTyp??null,h)),e(!1,{loaded:!0})}catch(p){dn({title:"Code unbekannt oder abgelaufen",description:p instanceof Error?p.message:"Bitte prüfen Sie den Code.",variant:"destructive"})}finally{l(!1)}}return c.jsx(qf,{open:t,onOpenChange:d=>e(d),children:c.jsxs(jh,{className:"max-w-md",children:[c.jsxs(Xf,{children:[c.jsx(Yf,{children:"Konfiguration fortsetzen"}),c.jsx(D1,{children:"Geben Sie Ihren 8-stelligen Code ein, um eine zuvor gespeicherte Konfiguration erneut zu laden."})]}),c.jsxs("form",{onSubmit:u,className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm",children:"Code"}),c.jsx(yr,{autoFocus:!0,value:s,onChange:d=>
602a(d.target.value),placeholder:"ABCD-EFGH",maxLength:10,className:"font-mono tracking-widest text-center text-lg uppercase"})]}),c.jsx(Pt,{type:"submit",disabled:o,className:"w-full",size:"lg",children:o?"Wird geladenâ¦":"Konfiguration laden"})]})]})})}function B1({konfigurator:t,disabled:e,onGeladen:n}){const[r,i]=E.useState(!e),[s,a]=E.useState(!1),[o,l]=E.useState(!1);return E.useEffect(()=>{e&&i(!1)},[e]),c.jsxs(c.Fragment,{children:[c.jsx($5,{open:r&&!o,onOpenChange:u=>{u&&!o&&i(!0)},children:c.jsxs(K5,{children:[c.jsx(j1,{className:rn("fixed inset-0 z-50 bg-black/80","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0")}),c.jsxs(P1,{onEscapeKeyDown:u=>u.preventDefault(),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),className:rn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-md translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[c.jsxs("div",{className:"flex flex-col space-y-1.5 text-left",children:[c.jsx(L1,{className:"text-lg font-semibold leading-none tracking-tight",children:"Wie möchten Sie starten?"}),c.jsx(I1,{className:"text-sm text-muted-foreground",children:"Beginnen Sie eine neue Konfiguration oder setzen Sie eine zuvor gespeicherte fort."})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-2 pt-2",children:[c.jsxs(Pt,{size:"lg",onClick:()=>i(!1),className:"justify-start bg-[hsl(var(--konfig-primary,var(--primary)))] hover:bg-[hsl(var(--konfig-primary-hover,var(--primary)))]",children:[c.jsx(bJ,{className:"w-4 h-4 mr-2"}),"Neue Konfiguration starten"]}),c.jsxs(Pt,{size:"lg",variant:"outline",onClick:()=>{i(!1),a(!0)},className:"justify-start",children:[c.jsx(tpe,{className:"w-4 h-4 mr-2"}),"Mit Code fortsetzen"]})]})]})]})}),c.jsx(rEe,{open:s&&!o,onOpenChange:(u,d)=>{if(d!=null&&d.loaded){l(!0),a(!1),i(!1);return}a(u),!u&&!e&&i(!0)},erwarteterKonfigurator:t,...n?{onGeladen:(u,d)=>{l(!0),a(!1),i(!1),n(u,d)}}:{}})]})}const iEe=[{key:"wandregal",title:"Wandregal",description:"Klassisches Wandregal zur Wandmontage â ideal für Verkaufsräume.",path:"/wandregal",imageUrl:xv(Fy("RAL 9006 WeiÃaluminium",2,4,"wandregal"))},{key:"wandregal-anbau",title:"Wandregal Anbau",description:"Anbaufeld für bestehende Wandregale â entweder von einer Seite oder zum SchlieÃen einer Lücke eines bestehenden Regals.",path:"/wandregal-anbau",imageUrl:xv(Fy("RAL 9006 WeiÃaluminium",1,4,"wandregal"))},{key:"gondelregal",title:"Gondelregal",description:"Freistehendes Gondelregal mit beidseitiger Bestückung.",path:"/gondelregal",imageUrl:xv(Fy("RAL 9006 WeiÃaluminium",2,4,"gondelregal"))},{key:"gondelregal-anbau",title:"Gondelregal Anbau",description:"Anbaufeld für bestehende Gondelregale â entweder von einer Seite oder zum SchlieÃen einer Lücke eines bestehenden Regals.",path:"/gondelregal-anbau",imageUrl:xv(Fy("RAL 9006 WeiÃaluminium",1,4,"gondelregal"))},{key:"paneelwandregal",title:"Paneelwandregal",description:"Wandregal mit Paneelrückwand für Haken und Zubehör.",path:"/paneelwandregal",imageUrl:xv(fT("RAL 9006 WeiÃaluminium","Nussbaum"))},{key:"eckregal",title:"Eckregal",description:"Ecklösungen für 45° und 90° â als Inneneck, eckig oder rund.",path:"/eckregal",imageUrl:xv(uO("RAL 9006 WeiÃaluminium",4,"ie90"))}],sEe={hidden:{opacity:0,y:20},visible:t=>({opacity:1,y:0,transition:{delay:t*.08,duration:.4}})};function aEe({src:t,alt:e}){const[n,r]=E.useState(!1);return n?c.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted text-muted-foreground text-xs",children:"Vorschau nicht verfügbar"}):c.jsx("img",{src:t,alt:e,className:"w-full h-full object-contain",onError:()=>r(!0)})}const oEe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Tx(),r=i=>{n(e?`${i}?embed=true`:i)};return c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[!e&&c.jsx("header",{className:"border-b border-border bg-background",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Regal-Konfigurator"})})]})}),c.jsxs("main",{className:"container mx-auto px-4 py-10 max-w-5xl",children:[c.jsxs(tn.div,{initial:{opacity:0,y:-10}
602,animate:{opacity:1,y:0},transition:{duration:.4},className:"text-center mb-10",children:[c.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-foreground",children:"Welches Tegometall-Regal möchten Sie konfigurieren?"}),c.jsx("p",{className:"text-muted-foreground mt-2 text-base",children:"Wählen Sie den gewünschten Regaltyp, um mit der Konfiguration zu starten."})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:iEe.map((i,s)=>c.jsxs(tn.button,{custom:s,variants:sEe,initial:"hidden",animate:"visible",onClick:()=>r(i.path),className:"group text-left rounded-xl border-2 border-border bg-card overflow-hidden transition-all hover:border-primary hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[c.jsx("div",{className:"aspect-[4/3] bg-muted/30 p-4",children:c.jsx(aEe,{src:i.imageUrl,alt:i.title})}),c.jsxs("div",{className:"p-5",children:[c.jsx("h3",{className:"text-lg font-semibold text-card-foreground group-hover:text-primary transition-colors",children:i.title}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 leading-relaxed",children:i.description}),c.jsxs("div",{className:"mt-3 flex items-center gap-1 text-sm font-medium text-primary opacity-0 group-hover:opacity-100 transition-opacity",children:["Konfigurieren ",c.jsx(Hfe,{className:"w-4 h-4"})]})]})]},i.key))})]}),c.jsx(Kf,{isEmbed:e}),c.jsx(B1,{konfigurator:"regal"})]})};function RR(t){return!t||t.trim()===""?0:parseFloat(t.replace(",","."))}function lEe(t,e){const r=t.replace(/^\uFEFF/,"").trim().split(` 603`);if(r.length<2)return[];const i=r[0].split(";").map(s=>s.trim().replace(/\r$/,""));return r.slice(1).filter(s=>s.trim().length>0).map(s=>{const a=s.split(";"),o={};return i.forEach((l,u)=>{o[l]=(a[u]||"").trim()}),e(o)})}function H0(t){return t.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" â¬"}function Gw(t){return t.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" m"}let $C=null,cy=null;async function gO(t=!1){return!t&&$C?$C:(!t&&cy||(cy=(async()=>{const n=[];let r=0;for(let s=0;s<100;s++){const{data:a,error:o}=await Ot.rpc("get_tier_prices_page",{p_offset:r,p_limit:1e3});if(o){console.error("loadTierPrices error",o);break}const l=a??[];if(n.push(...l),l.length<1e3)break;r+=1e3}const i=new Map;for(const s of n){const a=s.artikelnummer.trim().toLowerCase();i.has(a)||i.set(a,[]),i.get(a).push(s)}return $C=i,cy=null,i})()),cy)}function cEe(){$C=null,cy=null}function dte(t,e,n=new Date){if(!t||t.length===0||e<=0)return null;const r=n.toISOString().slice(0,10);let i=null;for(const s of t)s.gueltig_ab&&s.gueltig_ab>r||s.gueltig_bis&&s.gueltig_bis<r||s.menge_ab>e||(!i||s.menge_ab>i.menge_ab)&&(i={netto_preis:Number(s.netto_preis),menge_ab:Number(s.menge_ab),staffel_index:s.staffel_index});return i}function uEe(t,e,n=new Date){const r=new Map;for(const o of t){if(!o.sku||o.anzahl<=0)continue;const l=o.sku.trim().toLowerCase();r.set(l,(r.get(l)??0)+o.anzahl)}const i=new Map;for(const[o,l]of r){const u=e.get(o);i.set(o,dte(u,l,n))}let s=0;return{positionen:t.map(o=>{if(!o.sku||o.anzahl<=0)return s+=o.gesamt,o;const l=o.sku.trim().toLowerCase(),u=i.get(l);if(!u)return s+=o.gesamt,o;const d=o.einzelpreis,h=u.netto_preis;if(h===d)return s+=o.gesamt,{...o,staffel_index:u.staffel_index,staffel_menge_ab:u.menge_ab,basis_einzelpreis:d};const p=Math.round(o.anzahl*h*100)/100;return s+=p,{...o,einzelpreis:h,gesamt:p,staffel_index:u.staffel_index,staffel_menge_ab:u.menge_ab,basis_einzelpreis:d}}),gesamt:Math.round(s*100)/100}}const dEe=t=>({artikelname:t.artikelname,schluessel:t.schluessel,sku:t.sku,preis:Number(t.preis),produkt_url:null,bild_url:null}),hEe=t=>({gesamtbreite_module:Number(t.gesamtbreite_module),gesamtbreite_plus3:Number(t.gesamtbreite_plus3),anzahl_0665:t.anzahl_0665,anzahl_1000:t.anzahl_1000,anzahl_1250:t.anzahl_1250,anzahl_1330:t.anzahl_1330,modulanzahl:t.modulanzahl,schluessel:t.schluessel}),fEe=t=>({rueckwandtyp:t.rueckwandtyp,regalhoehe:t.regalhoehe,untere_hoehe:t.untere_hoehe,schluessel:t.schluessel}),pEe=t=>({farbe_name:t.farbe_name,ral_code:t.ral_code});async function qE(t,e,n,r){const{data:i}=await Ot.from(t).select("*").limit(1);if(i&&i.length>0){const{data:o}=await Ot.from(t).select("*").limit(5e3);return(o==null?void 0:o.map(n))??[]}const a=await(await fetch(e)).text();return lEe(a,r)}function F1(t="wandregal"){const[e,n]=E.useState([]),[r,i]=E.useState([]),[s,a]=E.useState([]),[o,l]=E.useState([]),[u,d]=E.useState(new Map),[h,p]=E.useState(!0),[f,m]=E.useState(null);return E.useEffect(()=>{async function x(){try{const[v,g,b,y,S]=await Promise.all([qE("preisliste","/data/preisliste.csv",dEe,A=>({artikelname:A.Artikelname,schluessel:A.Schluessel,sku:A.SKU,preis:RR(A.Preis),produkt_url:A.ProduktURL||null,bild_url:A.BildURL||null})),qE("breiten_module","/data/breiten_module.csv",hEe,A=>({gesamtbreite_module:RR(A.Gesamtbreite_module),gesamtbreite_plus3:RR(A.Gesamtbreite_plus3),anzahl_0665:parseInt(A.Anzahl0665),anzahl_1000:parseInt(A.Anzahl1000),anzahl_1250:parseInt(A.Anzahl1250),anzahl_1330:parseInt(A.Anzahl1330),modulanzahl:parseInt(A.Modulanzahl),schluessel:A.Schluessel}
603)),qE("rueckwand_logik","/data/rueckwand_logik.csv",fEe,A=>({rueckwandtyp:A.Rueckwandtyp,regalhoehe:parseInt(A.Regalhoehe),untere_hoehe:parseInt(A.Untere_Hoehe),schluessel:A.Schluessel})),qE("farblogik","/data/farblogik.csv",pEe,A=>({farbe_name:A.Farbe_Name,ral_code:parseInt(A.RAL_Code)})),gO().catch(()=>new Map)]);n(v),i(g),a(b),l(y),d(S),p(!1)}catch(v){console.error("Data loading error:",v),m("Fehler beim Laden der Produktdaten"),p(!1)}}x()},[t]),{preisliste:e,breitenModule:r,rueckwandLogik:s,farblogik:o,tierPrices:u,isLoading:h,error:f}}function O1(t){return new Map(t.map(e=>[e.schluessel,e]))}function z1(t,e){const n=e.find(r=>r.farbe_name===t);return(n==null?void 0:n.ral_code)??null}function $7(t,e,n){const r=`${t}|${e}`;return n.find(i=>i.schluessel===r)??null}function Y5(t,e){if(t.rueckwandTypen){const i=$7("GL",t.hoehe,e);return i?{untereHoehe:i.untere_hoehe,oberwandAnzahlProModul:t.rueckwandTypen.length}:null}const n=$7(t.rueckwandtyp,t.hoehe,e);if(!n)return null;const r=t.hoehe-n.untere_hoehe-10;return{untereHoehe:n.untere_hoehe,oberwandAnzahlProModul:Math.floor(r/40)}}function J5(t,e,n,r,i,s,a=1){if(t.rueckwandTypen){const o=new Map;for(const l of t.rueckwandTypen)o.set(l,(o.get(l)||0)+1);for(const{n:l,b:u}of r)if(l>0)for(const[d,h]of o)Dm(i,s,`Oberwand|${e}|${u}|${d}`,h*l*a,"Oberwand")}else for(const{n:o,b:l}of r)o>0&&Dm(i,s,`Oberwand|${e}|${l}|${t.rueckwandtyp}`,n*o*a,"Oberwand")}function Dm(t,e,n,r,i){if(r<=0)return;const s=e.get(n);s?t.push({schluessel:n,typ:i,artikelname:s.artikelname,sku:s.sku,anzahl:r,einzelpreis:s.preis,gesamt:Math.round(r*s.preis*100)/100,produkt_url:s.produkt_url,bild_url:s.bild_url}):t.push({schluessel:n,typ:i,artikelname:"Nicht gefunden",sku:"",anzahl:r,einzelpreis:0,gesamt:0,produkt_url:null,bild_url:null,warnung:`Artikel "${n}" nicht in Preisliste`})}function aA(t){return[{n:t.anzahl_0665,b:"66,5"},{n:t.anzahl_1000,b:"100"},{n:t.anzahl_1250,b:"125"},{n:t.anzahl_1330,b:"133"}]}function oA(t){return t.anzahl_0665+t.anzahl_1000+t.anzahl_1250+t.anzahl_1330}function lA(t){const e=[];return t.anzahl_0665>0&&e.push(`${t.anzahl_0665}à 66,5 cm`),t.anzahl_1000>0&&e.push(`${t.anzahl_1000}à 100 cm`),t.anzahl_1250>0&&e.push(`${t.anzahl_1250}à 125 cm`),t.anzahl_1330>0&&e.push(`${t.anzahl_1330}à 133 cm`),e.join(" + ")}function U1(t){return Math.round(t.reduce((e,n)=>e+n.gesamt,0)*100)/100}function Z5(t,e,n,r,i,s){const a={7016:"716",7035:"735",9001:"901",9006:"906"},o={121:"12",141:"14",161:"16",181:"18",201:"20",221:"22",241:"24",261:"26",281:"28",301:"30"},l=ISe[t],u=e.rueckwandTypen?"ind":e.rueckwandtyp,d=a[n]||n.toString(),h=Math.round(r*100).toString(),p=o[e.hoehe]||e.hoehe.toString(),f=e.fachbodenTiefen?"ind":e.tiefe.toString(),m=`${i.anzahl_0665}-${i.anzahl_1000}-${i.anzahl_1250}-${i.anzahl_1330}`;return`TEGO-${l}-${u}-${d}-${h}-${m}-${p}-${f}-${s}`}function cA(t){let e;return t.fachbodenTiefen&&t.fachbodenTiefen.length>0?e=t.fachbodenTiefen.reduce((n,r)=>n+r,0)/t.fachbodenTiefen.length:t.fachbodenTiefen&&t.fachbodenTiefen.length===0?e=0:e=t.tiefe,e>=67?{empfohlen:"8x3",pflicht8x3:!0,mittlereTiefe:e}:e>=57?{empfohlen:"8x3",pflicht8x3:!1,mittlereTiefe:e}:{empfohlen:null,pflicht8x3:!1,mittlereTiefe:e}}function uA(t){return t.saeulentyp==="8x3"?8:6}function mEe(t,e){if(!e.length||t<=0)return[];const n=[...e].sort((o,l)=>o.gesamtbreite_plus3-l.gesamtbreite_plus3),r=n.find(o=>Math.abs(o.gesamtbreite_plus3-t)<.005);if(r)return[{breite:r.gesamtbreite_plus3,differenzCm:0,richtung:"exakt",modul:r}];let i=null,s=null;for(const o of n)o.gesamtbreite_plus3<t&&(i=o),o.gesamtbreite_plus3>t&&!s&&(s=o);const a=[];return i&&a.push({breite:i.gesamtbreite_plus3,differenzCm:Math.round((t-i.gesamtbreite_plus3)*100),richtung:"kleiner",modul:i}),s&&a.push({breite:s.gesamtbreite_plus3,differenzCm:Math.round((s.gesamtbreite_plus3-t)*100),richtung:"groesser",modul:s}),a}function gEe(t){return t.sockelblende&&t.scannerschiene?"SOWSC":t.sockelblende?"SOW":t.scannerschiene?"WSC":"W"}function t4(t,e,n,r,i){const s=oA(e),a=aA(e),o=z1(t.farbe,i);if(o===null)return null;const l=t.hoehe-1,u=Y5(t,r);if(!u)return null;const{untereHoehe:d,oberwandAnzahlProModul:h}=u,p=O1(n),f=[],m=(v,g,b)=>Dm(f,p,v,g,b),x=uA(t);if(m(`Säule|${o}|${x}|${l}`,s+1,"Säule"),m("Befestigung|||",s+1,"Befestigung"),m(`Fussteil|${o}||${t.tiefe}`,s+1,"Fussteil"),t.sockelblende)for(const{n:v,b:g}of a)v>0&&m(`Blende|${o}|${g}|`,v,"Blende");if(t.fachbodenTiefen){const v=t.sockelbodenTiefe??t.tiefe;for(const{n:g,b}of a){if(g<=0)continue;m(`Fachboden|${o}|${b}|${v}`,g,"Fachboden");const y=new Map;for(const S of t.fachbodenTiefen)y.set(S,(y.get(S)||0)+1);for(const[S,A]of y)m(`Fachboden|${o}|${b}|${S}`,g*A,"Fachboden")}}else for(const{n:v,b:g}of a)v>0&&m(`Fachboden|${o}|${g}|${t.tiefe}`,v*(1+t.anzahlFachboeden),"Fachboden");if(t.scannerschiene)for(const{n:v,b:g}of a)v>0&&m(`Schiene|7016|${g}|`,v*(1+t.anzahlFachboeden),"Schiene");J5(t,o,h,a,f,p);for(const{n:v,b:g}of a)v>0&&m(`Unterwand|${o}|${g}|${d}`,v,"Unterwand");if(t.fachbodenTiefen){const v=new Map;for(const g of t.fachbodenTiefen)v.set(g,(v.get(g)||0)+1);for(const[g,b]of v)m(`Konsole|${o}||${g}`,s*b,"Konsole")}else m(`Konsole|${o}||${t.tiefe}`,s*t.anzahlFachboeden,"Konsole");return{positionen:f,gesamtpreis:U1(f),setSku:Z5("wandregal",t,o,e.gesamtbreite_plus3,e,gEe(t)),modulSchluessel:e.schluessel,modulDetails:lA(e),gesamtbreite:e.gesamtbreite_plus3}}function xEe(t){return t.sockelblende&&t.scannerschiene?"SOWSC":t.sockelblende?"SOW":t.scannerschiene?"WSC":"W"}function n4(t,e,n,r,i){const s=oA(e),a=aA(e),o=z1(t.farbe,i);if(o===null)return null;const l=t.hoehe-1,u=Y5(t,r);if(!u)return null;const{untereHoehe:d,oberwandAnzahlProModul:h}=u,p=O1(n),f=[],m=(v,g,b)=>Dm(f,p,v,g,b),x=uA(t);if(m(`Säule|${o}|${x}|${l}`,s+1,"Säule"),m(`Fussteil|${o}||${t.tiefe}`,(s+1)*2,"Fussteil"),t.sockelblende)for(const{n:v,b:g}of a)v>0&&m(`Blende|${o}|${g}|`,v*2,"Blende");if(t.fachbodenTiefen){const v=t.sockelbodenTiefe??t.tiefe;for(const{n:g,b}of a){if(g<=0)continue;m(`Fachboden|${o}|${b}|${v}`,g*2,"Fachboden");const y=new Map;for(const S of t.fachbodenTiefen)y.set(S,(y.get(S)||0)+1);for(const[S,A]of y)m(`Fachboden|${o}|${b}|${S}`,g*A*2,"Fachboden")}}else for(const{n:v,b:g}of a)v>0&&m(`Fachboden|${o}|${g}|${t.tiefe}`,v*(1+t.anzahlFachboeden)*2,"Fachboden");if(t.scannerschiene)for(const{n:v,b:g}of a)v>0&&m(`Schiene|7016|${g}|`,v*(1+t.anzahlFachboeden)*2,"Schiene");J5(t,o,h,a,f,p,2);for(const{n:v,b:g}of a)v>0&&m(`Unterwand|${o}|${g}|${d}`,v*2,"Unterwand");if(t.fachbodenTiefen){const v=new Map;for(const g of t.fachbodenTiefen)v.set(g,(v.get(g)||0)+1);for(const[g,b]of v)m(`Konsole|${o}||${g}`,s*b*2,"Konsole")}else m(`Konsole|${o}||${t.tiefe}`,s*t.anzahlFachboeden*2,"Konsole");for(const{n:v,b:g}of a)v>0&&m(`Abdeckung|${o}|${x}|${g}`,v,"Abdeckung");return m(`Endkappe|${o}|${x}|`,1,"Endkappe"),{positionen:f,gesamtpreis:U1(f),setSku:Z5("gondelregal",t,o,e.gesamtbreite_plus3,e,xEe(t)),modulSchluessel:e.schluessel,modulDetails:lA(e),gesamtbreite:e.gesamtbreite_plus3}}function vEe(t){return t.sockelblende&&t.scannerschiene?"SOWSC":t.sockelblende?"SOW":t.scannerschiene?"WSC":"W"}function yEe(t,e,n,r,i){const s=oA(e),a=aA(e),o=z1(t.farbe,i);if(o===null)return null;const l=t.hoehe-1,u=Y5(t,r);if(!u)return null;const{untereHoehe:d,oberwandAnzahlProModul:h}=u,p=O1(n),f=[],m=(g,b,y)=>Dm(f,p,g,b,y),x=uA(t);if(t.anbauart==="beidseitig"||(m(`Säule|${o}|${x}|${l}`,s,"Säule"),m("Befestigung|||",s,"Befestigung"),m(`Fussteil|${o}||${t.tiefe}`,s,"Fussteil")),t.sockelblende)for(const{n:g,b}of a)g>0&&m(`Blende|${o}|${b}|`,g,"Blende");if(t.fachbodenTiefen){const g=t.sockelbodenTiefe??t.tiefe;for(const{n:b,b:y}of a){if(b<=0)continue;m(`Fachboden|${o}|${y}|${g}`,b,"Fachboden");const S=new Map;for(const A of t.fachbodenTiefen)S.set(A,(S.get(A)||0)+1);for(const[A,k]of S)m(`Fachboden|${o}|${y}|${A}`,b*k,"Fachboden")}}else for(const{n:g,b}of a)g>0&&m(`Fachboden|${o}|${b}|${t.tiefe}`,g*(1+t.anzahlFachboeden),"Fachboden");if(t.scannerschiene)for(const{n:g,b}of a)g>0&&m(`Schiene|7016|${b}|`,g*(1+t.anzahlFachboeden),"Schiene");J5(t,o,h,a,f,p);for(const{n:g,b}of a)g>0&&m(`Unterwand|${o}|${b}|${d}`,g,"Unterwand");if(t.fachbodenTiefen){const g=new Map;
603for(const b of t.fachbodenTiefen)g.set(b,(g.get(b)||0)+1);for(const[b,y]of g)m(`Konsole|${o}||${b}`,s*y,"Konsole")}else m(`Konsole|${o}||${t.tiefe}`,s*t.anzahlFachboeden,"Konsole");return{positionen:f,gesamtpreis:U1(f),setSku:Z5("wandregal-anbau",t,o,e.gesamtbreite_plus3,e,vEe(t)),modulSchluessel:e.schluessel,modulDetails:lA(e),gesamtbreite:e.gesamtbreite_plus3}}function bEe(t){return t.sockelblende&&t.scannerschiene?"SOWSC":t.sockelblende?"SOW":t.scannerschiene?"WSC":"W"}function wEe(t,e,n,r,i){const s=oA(e),a=aA(e),o=z1(t.farbe,i);if(o===null)return null;const l=t.hoehe-1,u=Y5(t,r);if(!u)return null;const{untereHoehe:d,oberwandAnzahlProModul:h}=u,p=O1(n),f=[],m=(g,b,y)=>Dm(f,p,g,b,y),x=uA(t),v=t.anbauart==="beidseitig";if(v||(m(`Säule|${o}|${x}|${l}`,s,"Säule"),m(`Fussteil|${o}||${t.tiefe}`,s*2,"Fussteil")),t.sockelblende)for(const{n:g,b}of a)g>0&&m(`Blende|${o}|${b}|`,g*2,"Blende");if(t.fachbodenTiefen){const g=t.sockelbodenTiefe??t.tiefe;for(const{n:b,b:y}of a){if(b<=0)continue;m(`Fachboden|${o}|${y}|${g}`,b*2,"Fachboden");const S=new Map;for(const A of t.fachbodenTiefen)S.set(A,(S.get(A)||0)+1);for(const[A,k]of S)m(`Fachboden|${o}|${y}|${A}`,b*k*2,"Fachboden")}}else for(const{n:g,b}of a)g>0&&m(`Fachboden|${o}|${b}|${t.tiefe}`,g*(1+t.anzahlFachboeden)*2,"Fachboden");if(t.scannerschiene)for(const{n:g,b}of a)g>0&&m(`Schiene|7016|${b}|`,g*(1+t.anzahlFachboeden)*2,"Schiene");J5(t,o,h,a,f,p,2);for(const{n:g,b}of a)g>0&&m(`Unterwand|${o}|${b}|${d}`,g*2,"Unterwand");if(t.fachbodenTiefen){const g=new Map;for(const b of t.fachbodenTiefen)g.set(b,(g.get(b)||0)+1);for(const[b,y]of g)m(`Konsole|${o}||${b}`,s*y*2,"Konsole")}else m(`Konsole|${o}||${t.tiefe}`,s*t.anzahlFachboeden*2,"Konsole");for(const{n:g,b}of a)g>0&&m(`Abdeckung|${o}|${x}|${b}`,g,"Abdeckung");return v||m(`Endkappe|${o}|${x}|`,1,"Endkappe"),{positionen:f,gesamtpreis:U1(f),setSku:Z5("gondelregal-anbau",t,o,e.gesamtbreite_plus3,e,bEe(t)),modulSchluessel:e.schluessel,modulDetails:lA(e),gesamtbreite:e.gesamtbreite_plus3}}function r4(t,e,n,r){const i=oA(e),s=aA(e),a=z1(t.farbe,r);if(a===null)return null;const o=t.hoehe-1,l=t.hoehe-11,u=t.saeulentyp==="8x3"?8:6,d=O1(n),h=[],p=(S,A,k)=>Dm(h,d,S,A,k);p(`Säule|${a}|${u}|${o}`,i+1,"Säule"),p("Befestigung|||",i+1,"Befestigung"),p(`Fussteil|${a}||${t.tiefe}`,i+1,"Fussteil");for(const{n:S,b:A}of s)S>0&&p(`Blende|${a}|${A}|`,S,"Blende");for(const{n:S,b:A}of s)S>0&&p(`Fachboden|${a}|${A}|${t.tiefe}`,S,"Fachboden");for(const{n:S,b:A}of s)S>0&&p(`${t.rueckwandfarbe}|${A}|${l}`,S,"Paneel");const f={7016:"716",7035:"735",9001:"901",9006:"906"},m={181:"18",201:"20",221:"22",241:"24",261:"26",281:"28",301:"30"},x=f[a]||a.toString(),v=Math.round(e.gesamtbreite_plus3*100).toString(),g=m[t.hoehe]||t.hoehe.toString(),b=`${e.anzahl_0665}-${e.anzahl_1000}-${e.anzahl_1250}-${e.anzahl_1330}`,y=`TEGO-PW-${x}-${v}-${b}-${g}-${t.tiefe}-${t.rueckwandfarbe}`;return{positionen:h,gesamtpreis:U1(h),setSku:y,modulSchluessel:e.schluessel,modulDetails:lA(e),gesamtbreite:e.gesamtbreite_plus3}}function _Ee(t){const{eckwinkel:e,bauform:n}=t;return e===90&&n==="inneneck"?{prefix:"IE90",multiplier:1}:e===90&&n==="eckig"?{prefix:"IE45",multiplier:2}:e===90&&n==="rund"?{prefix:"IER45",multiplier:2}:e===45&&n==="eckig"?{prefix:"IE45",multiplier:1}:e===45&&n==="rund"?{prefix:"IER45",multiplier:1}:{prefix:"IE90",multiplier:1}}function SEe(t){switch(t.anbindung){case"freistehend":return{saeulen:3,fussteile:3,wandbefestigung:2};case"ein-regal":return{saeulen:2,fussteile:2,wandbefestigung:1};case"zwei-regale":return{saeulen:1,fussteile:1,wandbefestigung:0}}}function AEe(t){const n=t.hoehe-1-10-30,r=Math.floor(n/40);return{rw30GL:1,rw20GL:n%40!==0?1:0,rw40:r,rw40Typ:t.rueckwandtyp}}function EEe(t,e,n){const r=z1(t.farbe,n);if(r===null)return null;const i=O1(e),s=[],a=(m,x,v)=>Dm(s,i,m,x,v),o=_Ee(t),l=SEe(t),u=t.hoehe-1,d=uA(t);if(a(`Säule|${r}|${d}|${u}`,l.saeulen,"Säule"),a(`Fussteil|${r}||${t.tiefe}`,l.fussteile,"Fussteil"),l.wandbefestigung>0&&a("Befestigung|||",l.wandbefestigung,"Befestigung"),t.anzahlFachboeden>0){const m=o.prefix==="IE90"?Math.ceil(t.anzahlFachboeden*1.5):t.anzahlFachboeden*o.multiplier;a(`Konsole|${r}||${t.tiefe}`,m,"Konsole")}t.sockelblende&&a(`Blende|${r}|${t.tiefe}|${o.prefix}`,o.multiplier,`Sockelblende (Eck) · Tiefe ${t.tiefe} cm · ${o.prefix}`),a(`Fachboden|${r}|${t.tiefe}|${o.prefix}`,o.multiplier,`Sockelboden (Eck) · Tiefe ${t.tiefe} cm · ${o.prefix}`),t.anzahlFachboeden>0&&a(`Fachboden|${r}|${t.tiefe}|${o.prefix}`,o.multiplier*t.anzahlFachboeden,`Fachboden (Eck) · Tiefe ${t.tiefe} cm · ${o.prefix}`);const h=AEe(t);if(o.prefix==="IE90"){for(const m of["IE90L","IE90R"])if(a(`Rückwand|${r}|30|${m}`,h.rw30GL,`Rückwand 30cm GL · ${m}`),h.rw20GL>0&&a(`Rückwand|${r}|20|${m}
603`,h.rw20GL,`Rückwand 20cm GL · ${m}`),h.rw40>0){const x=h.rw40Typ==="RL"?`Rückwand|${r}|40|${m}|RL`:`Rückwand|${r}|40|${m}`;a(x,h.rw40,`Rückwand 40cm ${h.rw40Typ} · ${m}`)}}else if(a(`Rückwand|${r}|30|${o.prefix}`,h.rw30GL*o.multiplier,`Rückwand 30cm GL · ${o.prefix}`),h.rw20GL>0&&a(`Rückwand|${r}|20|${o.prefix}`,h.rw20GL*o.multiplier,`Rückwand 20cm GL · ${o.prefix}`),h.rw40>0){const m=h.rw40Typ==="RL"?`Rückwand|${r}|40|${o.prefix}|RL`:`Rückwand|${r}|40|${o.prefix}`;a(m,h.rw40*o.multiplier,`Rückwand 40cm ${h.rw40Typ} · ${o.prefix}`)}const p=t.bauform==="inneneck"?"Inneneck":t.bauform==="eckig"?"Eckig":"Rund",f=`${t.eckwinkel}° ${p} (${o.multiplier}à ${o.prefix})`;return{positionen:s,gesamtpreis:U1(s),setSku:`TEGO-ER-${t.rueckwandtyp}-${r}-${t.eckwinkel}-${o.prefix}-${u}-${t.tiefe}`,modulSchluessel:`${t.eckwinkel}-${t.bauform}`,modulDetails:f,gesamtbreite:0}}function H1(t,e){if(!t||e.size===0)return t;const{positionen:n,gesamt:r}=uEe(t.positionen,e);return{...t,positionen:n,gesamtpreis:r}}function hte(t,e,n={totalField:"gesamt"}){const r=l=>l.anzahl??l.menge??0;if(e.size===0){const l=t.map(u=>u.reduce((d,h)=>d+(h[n.totalField]??0),0));return{groups:t,totalsPerGroup:l}}const i=new Map;for(const l of t)for(const u of l){const d=r(u);if(!u.sku||d<=0)continue;const h=u.sku.trim().toLowerCase();i.set(h,(i.get(h)??0)+d)}const s=new Map;for(const[l,u]of i)s.set(l,dte(e.get(l),u));const a=[];return{groups:t.map(l=>{let u=0;const d=l.map(h=>{const p=r(h),f=h[n.totalField]??h.einzelpreis*p;if(!h.sku||p<=0)return u+=f,h;const m=s.get(h.sku.trim().toLowerCase());if(!m)return u+=f,h;const x=m.netto_preis,v=Math.round(p*x*100)/100;return u+=v,{...h,einzelpreis:x,[n.totalField]:v,staffel_index:m.staffel_index,staffel_menge_ab:m.menge_ab,basis_einzelpreis:h.einzelpreis}});return a.push(Math.round(u*100)/100),d}),totalsPerGroup:a}}function dA(t,e,n){const r=t-.03,i=.665,s=1,a=1.25,o=1.33,l=new Set((n==null?void 0:n.map(y=>y.toString()))??[]),u=[],d=new Set,h=e.find(y=>Math.abs(y.gesamtbreite_plus3-t)<.005),p=15,f=.005,m=l.has(i.toString())?0:Math.min(p,Math.floor(r/i+f)),x=l.has(s.toString()),v=l.has(a.toString()),g=l.has(o.toString());for(let y=0;y<=m;y++){const S=r-y*i;if(S<-f)break;const A=x?0:Math.min(p-y,Math.floor(S/s+f));for(let k=0;k<=A;k++){const M=S-k*s;if(M<-f)break;const T=v?0:Math.min(p-y-k,Math.floor(M/a+f));for(let C=0;C<=T;C++){const R=M-C*a;if(!(R<-f))if(g){if(Math.abs(R)<f&&y+k+C>0){const P=`${y}|${k}|${C}|0`;if(d.has(P))continue;d.add(P);const j=y+k+C,G=y*i+k*s+C*a,B=Math.round((G+.03)*1e3)/1e3;if(Math.abs(B-t)>f)continue;const $=`${G.toFixed(3)}|${y}|${k}|${C}|0`;u.push({gesamtbreite_module:Math.round(G*1e3)/1e3,gesamtbreite_plus3:B,anzahl_0665:y,anzahl_1000:k,anzahl_1250:C,anzahl_1330:0,modulanzahl:j,schluessel:$})}}else{const P=R/o,j=Math.round(P);if(j>=0&&Math.abs(P-j)<f&&y+k+C+j>0){const G=`${y}|${k}|${C}|${j}`;if(d.has(G))continue;d.add(G);const B=y+k+C+j,$=y*i+k*s+C*a+j*o,U=Math.round(($+.03)*1e3)/1e3;if(Math.abs(U-t)>f)continue;const Z=`${$.toFixed(3)}|${y}|${k}|${C}|${j}`;u.push({gesamtbreite_module:Math.round($*1e3)/1e3,gesamtbreite_plus3:U,anzahl_0665:y,anzahl_1000:k,anzahl_1250:C,anzahl_1330:j,modulanzahl:B,schluessel:Z})}}}}}const b=h&&l.size>0&&(l.has(i.toString())&&h.anzahl_0665>0||l.has(s.toString())&&h.anzahl_1000>0||l.has(a.toString())&&h.anzahl_1250>0||l.has(o.toString())&&h.anzahl_1330>0);return h&&!b&&!u.some(y=>y.anzahl_0665===h.anzahl_0665&&y.anzahl_1000===h.anzahl_1000&&y.anzahl_1250===h.anzahl_1250&&y.anzahl_1330===h.anzahl_1330)&&u.push(h),u}function fte(t,e,n){if(!n.length)return t;const r=new Set(t.map(a=>Math.round(a.gesamtbreite_plus3*1e3))),i=new Set;for(const a of e){const o=Math.round(a.gesamtbreite_plus3*1e3);r.has(o)||i.add(a.gesamtbreite_plus3)}const s=[...t];for(const a of i){const o=dA(a,e,n);if(o.length>0){const l=o[0];s.some(d=>Math.abs(d.gesamtbreite_plus3-l.gesamtbreite_plus3)<.005&&d.anzahl_0665===l.anzahl_0665&&d.anzahl_1000===l.anzahl_1000&&d.anzahl_1250===l.anzahl_1250&&d.anzahl_1330===l.anzahl_1330)||s.push(l)}}return s}function K7(t){const n=[{n:t.anzahl_0665,label:"66,5 cm"},{n:t.anzahl_1000,label:"100 cm"},{n:t.anzahl_1250,label:"125 cm"},{n:t.anzahl_1330,label:"133 cm"}].filter(r=>r.n>0);return n.length===1?{einheitlich:!0,breite:n[0].label}:{einheitlich:!1}}function q7(t){const e=[];return t.anzahl_0665>0&&e.push(`${t.anzahl_0665}à 66,5 cm`),t.anzahl_1000>0&&e.push(`${t.anzahl_1000}à 100 cm`),t.anzahl_1250>0&&e.push(`${t.anzahl_1250}à 125 cm`),t.anzahl_1330>0&&e.push(`${t.anzahl_1330}à 133 cm`),e.join(" + ")}function kEe(t,e){const n=t-.03,r=new Set((e==null?void 0:e.map(a=>a.toString()))??[]),i=[{w:.665,label:"66,5 cm",key0665:!0},{w:1,label:"100 cm",key1000:!0},{w:1.25,label:"125 cm",key1250:!0},{w:1.33,label:"133 cm",key1330:!0}].filter(a=>!r.has(a.w.toString())),s=[];for(const{w:a,key0665:o,key1000:l,key1250:u,key1330:d}of i){const h=Math.round(n/a);let p=null,f=1/0;for(const m of[h-1,h,h+1]){if(m<1)continue;
vendor: 5,249 bytes, line 603
603const x=m*a,v=Math.round((x+.03)*1e3)/1e3,g=Math.abs(v-t);g>1||g<f&&(f=g,p={gesamtbreite_module:Math.round(x*1e3)/1e3,gesamtbreite_plus3:v,anzahl_0665:o?m:0,anzahl_1000:l?m:0,anzahl_1250:u?m:0,anzahl_1330:d?m:0,modulanzahl:m,schluessel:`${x.toFixed(3)}|${o?m:0}|${l?m:0}|${u?m:0}|${d?m:0}`})}p&&s.push(p)}return s}function hA(t){const e=E.useRef({value:t,previous:t});return E.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Q5="Switch",[CEe,uqe]=ja(Q5),[NEe,TEe]=CEe(Q5),pte=E.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:u,form:d,...h}=t,[p,f]=E.useState(null),m=ur(e,y=>f(y)),x=E.useRef(!1),v=p?d||!!p.closest("form"):!0,[g,b]=Ja({prop:i,defaultProp:s??!1,onChange:u,caller:Q5});return c.jsxs(NEe,{scope:n,checked:g,disabled:o,children:[c.jsx(vn.button,{type:"button",role:"switch","aria-checked":g,"aria-required":a,"data-state":vte(g),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:m,onClick:cn(t.onClick,y=>{b(S=>!S),v&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})}),v&&c.jsx(xte,{control:p,bubbles:!x.current,name:r,value:l,checked:g,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});pte.displayName=Q5;var mte="SwitchThumb",gte=E.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=TEe(mte,n);return c.jsx(vn.span,{"data-state":vte(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});gte.displayName=mte;var MEe="SwitchBubbleInput",xte=E.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},s)=>{const a=E.useRef(null),o=ur(a,s),l=hA(n),u=qS(e);return E.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&f){const m=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(m)}},[l,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xte.displayName=MEe;function vte(t){return t?"checked":"unchecked"}var yte=pte,REe=gte;const $o=E.forwardRef(({className:t,...e},n)=>c.jsx(yte,{className:rn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:n,children:c.jsx(REe,{className:rn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$o.displayName=yte.displayName;function gT(t,[e,n]){return Math.min(n,Math.max(e,t))}var jEe=E.createContext(void 0);function Mx(t){const e=E.useContext(jEe);return t||e||"ltr"}var PEe=[" ","Enter","ArrowUp","ArrowDown"],LEe=[" ","Enter"],cx="Select",[eM,tM,IEe]=GS(cx),[G1,dqe]=ja(cx,[IEe,A1]),nM=A1(),[DEe,og]=G1(cx),[BEe,FEe]=G1(cx),bte=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:p,required:f,form:m}=t,x=nM(e),[v,g]=E.useState(null),[b,y]=E.useState(null),[S,A]=E.useState(!1),k=Mx(u),[M,T]=Ja({prop:r,defaultProp:i??!1,onChange:s,caller:cx}),[C,R]=Ja({prop:a,defaultProp:o,onChange:l,caller:cx}),P=E.useRef(null),j=v?m||!!v.closest("form"):!0,[G,B]=E.useState(new Set),$=Array.from(G).map(U=>U.props.value).join(";");return c.jsx(bF,{...x,children:c.jsxs(DEe,{required:f,scope:e,trigger:v,onTriggerChange:g,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:A,contentId:mu(),value:C,onValueChange:R,open:M,onOpenChange:T,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[c.jsx(eM.Provider,{scope:e,children:c.jsx(BEe,{scope:t.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{B(Z=>new Set(Z).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{B(Z=>{const V=new Set(Z);return V.delete(U),V})},[]),children:n})}),j?c.jsxs(Vte,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:C,onChange:U=>R(U.target.value),disabled:p,form:m,children:[C===void 0?c.jsx("option",{value:""}):null,Array.from(G)]},$):null]})})};bte.displayName=cx;var wte="SelectTrigger",_te=E.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,s=nM(n),a=og(wte,n),o=a.disabled||r,l=ur(e,a.onTriggerChange),u=tM(n),d=E.useRef("touch"),[h,p,f]=$te(x=>{const v=u().filter(y=>!y.disabled),g=v.find(y=>y.value===a.value),b=Kte(v,x,g);b!==void 0&&a.onValueChange(b.value)}),m=x=>{o||(a.onOpenChange(!0),f()),x&&(a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return c.jsx(A5,{asChild:!0,...s,children:c.jsx(vn.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Wte(a.value)?"":void 0,...i,ref:l,onClick:cn(i.onClick,x=>
vendor: 16,210 bytes, line 603
603{x.currentTarget.focus(),d.current!=="mouse"&&m(x)}),onPointerDown:cn(i.onPointerDown,x=>{d.current=x.pointerType;const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(m(x),x.preventDefault())}),onKeyDown:cn(i.onKeyDown,x=>{const v=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(v&&x.key===" ")&&PEe.includes(x.key)&&(m(),x.preventDefault())})})})});_te.displayName=wte;var Ste="SelectValue",Ate=E.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=t,l=og(Ste,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,h=ur(e,l.onValueNodeChange);return Ya(()=>{u(d)},[u,d]),c.jsx(vn.span,{...o,ref:h,style:{pointerEvents:"none"},children:Wte(l.value)?c.jsx(c.Fragment,{children:a}):s})});Ate.displayName=Ste;var OEe="SelectIcon",Ete=E.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return c.jsx(vn.span,{"aria-hidden":!0,...i,ref:e,children:r||"â¼"})});Ete.displayName=OEe;var zEe="SelectPortal",kte=t=>c.jsx(VS,{asChild:!0,...t});kte.displayName=zEe;var ux="SelectContent",Cte=E.forwardRef((t,e)=>{const n=og(ux,t.__scopeSelect),[r,i]=E.useState();if(Ya(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Nx.createPortal(c.jsx(Nte,{scope:t.__scopeSelect,children:c.jsx(eM.Slot,{scope:t.__scopeSelect,children:c.jsx("div",{children:t.children})})}),s):null}return c.jsx(Tte,{...t,ref:e})});Cte.displayName=ux;var td=10,[Nte,lg]=G1(ux),UEe="SelectContentImpl",HEe=tx("SelectContent.RemoveScroll"),Tte=E.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:m,hideWhenDetached:x,avoidCollisions:v,...g}=t,b=og(ux,n),[y,S]=E.useState(null),[A,k]=E.useState(null),M=ur(e,ie=>S(ie)),[T,C]=E.useState(null),[R,P]=E.useState(null),j=tM(n),[G,B]=E.useState(!1),$=E.useRef(!1);E.useEffect(()=>{if(y)return hO(y)},[y]),dO();const U=E.useCallback(ie=>{const[le,...xe]=j().map(Q=>Q.ref.current),[Ee]=xe.slice(-1),ae=document.activeElement;for(const Q of ie)if(Q===ae||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===le&&A&&(A.scrollTop=0),Q===Ee&&A&&(A.scrollTop=A.scrollHeight),Q==null||Q.focus(),document.activeElement!==ae))return},[j,A]),Z=E.useCallback(()=>U([T,y]),[U,T,y]);E.useEffect(()=>{G&&Z()},[G,Z]);const{onOpenChange:V,triggerPointerDownPosRef:W}=b;E.useEffect(()=>{if(y){let ie={x:0,y:0};const le=Ee=>{var ae,Q;ie={x:Math.abs(Math.round(Ee.pageX)-(((ae=W.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(Ee.pageY)-(((Q=W.current)==null?void 0:Q.y)??0))}},xe=Ee=>{ie.x<=10&&ie.y<=10?Ee.preventDefault():y.contains(Ee.target)||V(!1),document.removeEventListener("pointermove",le),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",xe,{capture:!0})}}},[y,V,W]),E.useEffect(()=>{const ie=()=>V(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[V]);const[O,Y]=$te(ie=>{const le=j().filter(ae=>!ae.disabled),xe=le.find(ae=>ae.ref.current===document.activeElement),Ee=Kte(le,ie,xe);Ee&&setTimeout(()=>Ee.ref.current.focus())}),z=E.useCallback((ie,le,xe)=>{const Ee=!$.current&&!xe;(b.value!==void 0&&b.value===le||Ee)&&(C(ie),Ee&&($.current=!0))},[b.value]),I=E.useCallback(()=>y==null?void 0:y.focus(),[y]),q=E.useCallback((ie,le,xe)=>{const Ee=!$.current&&!xe;(b.value!==void 0&&b.value===le||Ee)&&P(ie)},[b.value]),te=r==="popper"?i4:Mte,se=te===i4?{side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:m,hideWhenDetached:x,avoidCollisions:v}:{};return c.jsx(Nte,{scope:n,content:y,viewport:A,onViewportChange:k,itemRefCallback:z,selectedItem:T,onItemLeave:I,itemTextRefCallback:q,focusSelectedItem:Z,selectedItemText:R,position:r,isPositioned:G,searchRef:O,children:c.jsx(V5,{as:HEe,allowPinchZoom:!0,children:c.jsx(H5,{asChild:!0,trapped:b.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:cn(i,ie=>{var le;(le=b.trigger)==null||le.focus({preventScroll:!0}),ie.preventDefault()}),children:c.jsx(p1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:c.jsx(te,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ie=>ie.preventDefault(),...g,...se,onPlaced:()=>B(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:cn(g.onKeyDown,ie=>{const le=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!le&&ie.key.length===1&&Y(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Ee=j().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ae=ie.target,Q=Ee.indexOf(ae);Ee=Ee.slice(Q+1)}setTimeout(()=>U(Ee)),ie.preventDefault()}})})})})})})});Tte.displayName=UEe;var GEe="SelectItemAlignedPosition",Mte=E.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,s=og(ux,n),a=lg(ux,n),[o,l]=E.useState(null),[u,d]=E.useState(null),h=ur(e,M=>d(M)),p=tM(n),f=E.useRef(!1),m=E.useRef(!0),{viewport:x,selectedItem:v,selectedItemText:g,focusSelectedItem:b}=a,y=E.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&x&&v&&g){const M=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),C=s.valueNode.getBoundingClientRect(),R=g.getBoundingClientRect();if(s.dir!=="rtl"){const ae=R.left-T.left,Q=C.left-ae,we=M.left-Q,Ae=M.width+we,K=Math.max(Ae,T.width),pe=window.innerWidth-td,ye=gT(Q,[td,Math.max(td,pe-K)]);o.style.minWidth=Ae+"px",o.style.left=ye+"px"}else{const ae=T.right-R.right,Q=window.innerWidth-C.right-ae,we=window.innerWidth-M.right-Q,Ae=M.width+we,K=Math.max(Ae,T.width),pe=window.innerWidth-td,ye=gT(Q,[td,Math.max(td,pe-K)]);o.style.minWidth=Ae+"px",o.style.right=ye+"px"}const P=p(),j=window.innerHeight-td*2,G=x.scrollHeight,B=window.getComputedStyle(u),$=parseInt(B.borderTopWidth,10),U=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),V=parseInt(B.paddingBottom,10),W=$+U+G+V+Z,O=Math.min(v.offsetHeight*5,W),Y=window.getComputedStyle(x),z=parseInt(Y.paddingTop,10),I=parseInt(Y.paddingBottom,10),q=M.top+M.height/2-td,te=j-q,se=v.offsetHeight/2,ie=v.offsetTop+se,le=$+U+ie,xe=W-le;if(le<=q){const ae=P.length>0&&v===P[P.length-1].ref.current;o.style.bottom="0px";const Q=u.clientHeight-x.offsetTop-x.offsetHeight,we=Math.max(te,se+(ae?I:0)+Q+Z),Ae=le+we;o.style.height=Ae+"px"}else{const ae=P.length>0&&v===P[0].ref.current;o.style.top="0px";const we=Math.max(q,$+x.offsetTop+(ae?z:0)+se)+xe;o.style.height=we+"px",x.scrollTop=le-q+x.offsetTop}o.style.margin=`${td}px 0`,o.style.minHeight=O+"px",o.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[p,s.trigger,s.valueNode,o,u,x,v,g,s.dir,r]);Ya(()=>y(),[y]);const[S,A]=E.useState();Ya(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const k=E.useCallback(M=>{M&&m.current===!0&&(y(),b==null||b(),m.current=!1)},[y,b]);return c.jsx(WEe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(vn.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Mte.displayName=GEe;var VEe="SelectPopperPosition",i4=E.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=td,...s}=t,a=nM(n);return c.jsx(wF,{...a,...s,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});i4.displayName=VEe;var[WEe,xO]=G1(ux,{}),s4="SelectViewport",Rte=E.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,s=lg(s4,n),a=xO(s4,n),o=ur(e,s.onViewportChange),l=E.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(eM.Slot,{scope:n,children:c.jsx(vn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:cn(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&h){const f=Math.abs(l.current-d.scrollTop);if(f>0){const m=window.innerHeight-td*2,x=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),g=Math.max(x,v);if(g<m){const b=g+f,y=Math.min(m,b),S=b-y;h.style.height=y+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Rte.displayName=s4;var jte="SelectGroup",[$Ee,KEe]=G1(jte),qEe=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=mu();return c.jsx($Ee,{scope:n,id:i,children:c.jsx(vn.div,{role:"group","aria-labelledby":i,...r,ref:e})})});qEe.displayName=jte;var Pte="SelectLabel",Lte=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=KEe(Pte,n);return c.jsx(vn.div,{id:i.id,...r,ref:e})});Lte.displayName=Pte;var xT="SelectItem",[XEe,Ite]=G1(xT),Dte=E.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=t,o=og(xT,n),l=lg(xT,n),u=o.value===r,[d,h]=E.useState(s??""),[p,f]=E.useState(!1),m=ur(e,b=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,b,r,i)}),x=mu(),v=E.useRef("touch"),g=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(XEe,{scope:n,value:r,disabled:i,textId:x,isSelected:u,onItemTextChange:E.useCallback(b=>{h(y=>y||((b==null?void 0:b.textContent)??"").trim())},[]),children:c.jsx(eM.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:c.jsx(vn.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:cn(a.onFocus,()=>f(!0)),onBlur:cn(a.onBlur,()=>f(!1)),onClick:cn(a.onClick,()=>{v.current!=="mouse"&&g()}),onPointerUp:cn(a.onPointerUp,()=>{v.current==="mouse"&&g()}),onPointerDown:cn(a.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:cn(a.onPointerMove,b=>{var y;v.current=b.pointerType,i?(y=l.onItemLeave)==null||y.call(l):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:cn(a.onPointerLeave,b=>{var y;b.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:cn(a.onKeyDown,b=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(LEe.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});Dte.displayName=xT;var k_="SelectItemText",Bte=E.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...s}=t,a=og(k_,n),o=lg(k_,n),l=Ite(k_,n),u=FEe(k_,n),[d,h]=E.useState(null),p=ur(e,g=>h(g),l.onItemTextChange,g=>{var b;return(b=o.itemTextRefCallback)==null?void 0:b.call(o,g,l.value,l.disabled)}),f=d==null?void 0:d.textContent,m=E.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:x,onNativeOptionRemove:v}=u;return Ya(()=>(x(m),()=>v(m)),[x,v,m]),c.jsxs(c.Fragment,{children:[c.jsx(vn.span,{id:l.textId,...s,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Nx.createPortal(s.children,a.valueNode):null]})});Bte.displayName=k_;var Fte="SelectItemIndicator",Ote=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return Ite(Fte,n).isSelected?c.jsx(vn.span,{"aria-hidden":!0,...r,ref:e}):null});Ote.displayName=Fte;var a4="SelectScrollUpButton",zte=E.forwardRef((t,e)=>{const n=lg(a4,t.__scopeSelect),r=xO(a4,t.__scopeSelect),[i,s]=E.useState(!1),a=ur(e,r.onScrollButtonChange);return Ya(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(Hte,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});zte.displayName=a4;var o4="SelectScrollDownButton",Ute=E.forwardRef((t,e)=>{const n=lg(o4,t.__scopeSelect),r=xO(o4,t.__scopeSelect),[i,s]=E.useState(!1),a=ur(e,r.onScrollButtonChange);return Ya(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?c.jsx(Hte,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});Ute.displayName=o4;var Hte=E.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,s=lg("SelectScrollButton",n),a=E.useRef(null),o=tM(n),l=E.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),Ya(()=>{var d;const u=o().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),c.jsx(vn.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:cn(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:cn(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:cn(i.onPointerLeave,()=>{l()})})}),YEe="SelectSeparator",Gte=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return c.jsx(vn.div,{"aria-hidden":!0,...r,ref:e})});Gte.displayName=YEe;var l4="SelectArrow",JEe=E.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=nM(n),s=og(l4,n),a=lg(l4,n);return s.open&&a.position==="popper"?c.jsx(_F,{...i,...r,ref:e}):null});JEe.displayName=l4;var ZEe="SelectBubbleInput",Vte=E.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=E.useRef(null),s=ur(r,i),a=hA(e);return E.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&d){const h=new Event("change",{bubbles:!0});d.call(o,e),o.dispatchEvent(h)}},[a,e]),c.jsx(vn.select,{...n,style:{...UY,...n.style},ref:s,defaultValue:e})});Vte.displayName=ZEe;function Wte(t){return t===""||t===void 0}function $te(t){const e=_u(t),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(a=>{const o=n.current+a;e(o),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[e]),s=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function Kte(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=QEe(t,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function QEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var eke=bte,qte=_te,tke=Ate,nke=Ete,rke=kte,Xte=Cte,ike=Rte,Yte=Lte,Jte=Dte,ske=Bte,ake=Ote,Zte=zte,Qte=Ute,ene=Gte;const vl=eke,yl=tke,qo=E.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(qte,{ref:r,className:rn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
603ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,c.jsx(nke,{asChild:!0,children:c.jsx(Su,{className:"h-4 w-4 opacity-50"})})]}));qo.displayName=qte.displayName;const tne=E.forwardRef(({className:t,...e},n)=>c.jsx(Zte,{ref:n,className:rn("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(g1,{className:"h-4 w-4"})}));tne.displayName=Zte.displayName;const nne=E.forwardRef(({className:t,...e},n)=>c.jsx(Qte,{ref:n,className:rn("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(Su,{className:"h-4 w-4"})}));nne.displayName=Qte.displayName;const Xo=E.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>c.jsx(rke,{children:c.jsxs(Xte,{ref:i,className:rn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[c.jsx(tne,{}),c.jsx(ike,{className:rn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),c.jsx(nne,{})]})}));Xo.displayName=Xte.displayName;const oke=E.forwardRef(({className:t,...e},n)=>c.jsx(Yte,{ref:n,className:rn("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));oke.displayName=Yte.displayName;const Us=E.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(Jte,{ref:r,className:rn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(ake,{children:c.jsx(ti,{className:"h-4 w-4"})})}),c.jsx(ske,{children:e})]}));Us.displayName=Jte.displayName;const lke=E.forwardRef(({className:t,...e},n)=>c.jsx(ene,{ref:n,className:rn("-mx-1 my-1 h-px bg-muted",t),...e}));lke.displayName=ene.displayName;function vO({config:t,onChange:e,breitenModule:n,activeModul:r,excludeWidths:i}){const[s,a]=E.useState("5.03"),o=parseFloat(s)||0,l=E.useMemo(()=>{if(!(i!=null&&i.length))return n;const x=n.filter(v=>{for(const g of i)if(Math.abs(g-1.33)<.01&&v.anzahl_1330>0||Math.abs(g-1.25)<.01&&v.anzahl_1250>0||Math.abs(g-1)<.01&&v.anzahl_1000>0||Math.abs(g-.665)<.01&&v.anzahl_0665>0)return!1;return!0});return fte(x,n,i)},[n,i]),u=E.useMemo(()=>mEe(o,l),[o,l]),d=E.useCallback(e,[]);E.useEffect(()=>{t.breite===null&&u.length===1&&u[0].richtung==="exakt"&&d({breite:u[0].breite})},[u,t.breite,d]);const h=E.useMemo(()=>t.breite?l.find(x=>Math.abs(x.gesamtbreite_plus3-t.breite)<.005):null,[t.breite,l]),p=x=>{e({breite:x.breite})},f=r??h,m=E.useMemo(()=>{if(!f)return"";const x=[];return f.anzahl_0665>0&&x.push(`${f.anzahl_0665}à 66,5 cm`),f.anzahl_1000>0&&x.push(`${f.anzahl_1000}à 100 cm`),f.anzahl_1250>0&&x.push(`${f.anzahl_1250}à 125 cm`),f.anzahl_1330>0&&x.push(`${f.anzahl_1330}à 133 cm`),x.join(" + ")},[f]);return c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Hf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Breite wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Gewünschte Regalbreite in Metern"})]})]})}),c.jsxs(Bn,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"breite",children:"Gewünschte Regalbreite in Metern"}),c.jsx(yr,{id:"breite",type:"number",step:"0.01",min:"0.70",max:"20.03",value:s,onChange:x=>{a(x.target.value),e({breite:null})},className:"mt-1.5",placeholder:"z.B. 5,03"})]}),o>0&&u.length>0&&c.jsx("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3",children:u.map(x=>{const v=t.breite!==null&&Math.abs(t.breite-x.breite)<.005;return c.jsx("button",{onClick:()=>p(x),className:`width-suggestion ${v?"width-suggestion-selected":""}`,children:x.richtung==="exakt"?c.jsxs(c.Fragment,{children:[c.jsx(ti,{className:"w-5 h-5 mx-auto mb-1 text-primary"}),c.jsx("div",{className:"font-semibold text-sm",children:"Exakt verfügbar"}),c.jsx("div",{className:"text-lg font-bold",children:Gw(x.breite)})]}):x.richtung==="kleiner"?c.jsxs(c.Fragment,{children:[c.jsx(Ufe,{className:"w-5 h-5 mx-auto mb-1 text-muted-foreground"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"Nächstkleinere"}),c.jsx("div",{className:"text-lg font-bold",children:Gw(x.breite)}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[x.differenzCm," cm schmaler"]})]}):c.jsxs(c.Fragment,{children:[c.jsx(Gfe,{className:"w-5 h-5 mx-auto mb-1 text-muted-foreground"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"NächstgröÃere"}),c.jsx("div",{className:"text-lg font-bold",children:Gw(x.breite)}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[x.differenzCm," cm breiter"]})]})},x.breite)})}),f&&m&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Modulkombination: ",m]}
603),r&&t.breite&&Math.abs(r.gesamtbreite_plus3-t.breite)>.005&&c.jsxs("p",{className:"text-sm text-amber-700 bg-amber-50 rounded-md px-2 py-1",children:[c.jsx("span",{className:"font-medium",children:"Einheitliche Alternative ausgewählt"})," â ",r.gesamtbreite_plus3>t.breite?"breiter":"schmaler"," als Wunschbreite"," ","(",Gw(r.gesamtbreite_plus3)," statt ",Gw(t.breite),")"]})]})]})]})}const cke=m1("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function fl({className:t,variant:e,...n}){return c.jsx("div",{className:rn(cke({variant:e}),t),...n})}function jR(t,e){return t.anzahl_0665===e.anzahl_0665&&t.anzahl_1000===e.anzahl_1000&&t.anzahl_1250===e.anzahl_1250&&t.anzahl_1330===e.anzahl_1330}function yO({config:t,selectedModul:e,onSelectModul:n,onSelectUniform:r,activeUniform:i,breitenModule:s,preisliste:a,rueckwandLogik:o,farblogik:l,berechne:u,excludeWidths:d}){var y,S;const h=u??t4,p=E.useMemo(()=>{if(t.breite===null)return[];const A=dA(t.breite,s,d);if(A.length===0)return[];const k=s.find(T=>Math.abs(T.gesamtbreite_plus3-t.breite)<.005);return A.map(T=>{const C=h(t,T,a,o,l),R=K7(T),P=k?jR(T,k):!1,j=C?C.positionen.reduce((G,B)=>G+B.anzahl,0):0;return{modul:T,gesamtpreis:(C==null?void 0:C.gesamtpreis)??0,anzahlTeile:j,isEinheitlich:R.einheitlich,einheitlichBreite:R.breite,isCsvOriginal:P,label:q7(T)}}).filter(T=>T.gesamtpreis>0).sort((T,C)=>T.gesamtpreis-C.gesamtpreis).slice(0,4)},[t,s,a,o,l,d]),f=E.useMemo(()=>t.breite===null?[]:kEe(t.breite,d).map(k=>{const M=Math.round((k.gesamtbreite_plus3-t.breite)*100),T=h({...t,breite:k.gesamtbreite_plus3},k,a,o,l);if(!T||T.gesamtpreis<=0)return null;const C=K7(k);return{modul:k,gesamtbreitePlus3:k.gesamtbreite_plus3,abweichungCm:M,modulBreiteLabel:C.breite??q7(k),gesamtpreis:T.gesamtpreis}}).filter(k=>k!==null).sort((k,M)=>Math.abs(k.abweichungCm)-Math.abs(M.abweichungCm)),[t,a,o,l,d]),m=p.length>0,x=f.length>0;if(!m&&!x)return null;const v=p.length>0?p[0].gesamtpreis:0,g=A=>!i&&e&&jR(A.modul,e),b=A=>i&&jR(A.modul,i);return c.jsx(bo,{children:c.jsxs(tn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:[m&&c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(ipe,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Modulvariante wählen"}),c.jsxs("span",{className:"text-xs text-muted-foreground font-normal",children:[p.length," Kombination",p.length!==1?"en":""," für ",(y=t.breite)==null?void 0:y.toFixed(2).replace(".",",")," m"]})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:p.map((A,k)=>{const M=g(A),T=k===0,C=A.gesamtpreis-v;return c.jsxs(tn.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:k*.05},onClick:()=>n(A.modul),className:`variant-card ${M?"variant-card-selected":""}`,children:[c.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[T&&c.jsxs(fl,{className:"bg-[hsl(var(--success))] text-[hsl(var(--success-foreground))] text-[10px] px-2 py-0.5 gap-1",children:[c.jsx(fpe,{className:"w-3 h-3"}),"Bester Preis"]}),A.isEinheitlich&&c.jsxs(fl,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:["Einheitlich ",A.einheitlichBreite]})]}),c.jsx("p",{className:"text-sm font-medium text-foreground text-left mb-1.5",children:A.label}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsxs("span",{className:"text-lg font-bold tabular-nums text-foreground",children:[A.gesamtpreis.toLocaleStr
603ing("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})," ","â¬"]}),!T&&C>0&&c.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",C.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})," ","â¬"]})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground mt-1",children:[A.anzahlTeile," Einzelteile"]}),M&&c.jsx("div",{className:"absolute top-3 right-3",children:c.jsx("div",{className:"w-6 h-6 rounded-full bg-primary flex items-center justify-center",children:c.jsx(ti,{className:"w-3.5 h-3.5 text-primary-foreground"})})})]},A.label)})})})]}),x&&c.jsxs(Dn,{className:"config-card mt-4",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Hf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Einheitliche Alternativen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Gleiche Modulbreite â leicht abweichende Gesamtbreite"})]})]})}),c.jsxs(Bn,{children:[c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:f.map((A,k)=>{const M=b(A),T=A.abweichungCm>0?`+${A.abweichungCm} cm`:A.abweichungCm<0?`${A.abweichungCm} cm`:"exakt";return c.jsxs(tn.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:k*.05},onClick:()=>r(A.modul),className:`variant-card ${M?"variant-card-selected":""}`,children:[c.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[c.jsxs(fl,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:["Einheitlich ",A.modulBreiteLabel]}),c.jsx(fl,{variant:"outline",className:"text-[10px] px-2 py-0.5",children:T})]}),c.jsxs("p",{className:"text-xs text-muted-foreground text-left mb-0.5",children:["Gesamtbreite: ",A.gesamtbreitePlus3.toFixed(2).replace(".",",")," m"]}),c.jsxs("p",{className:"text-sm font-medium text-foreground text-left mb-1.5",children:[A.modul.modulanzahl,"à ",A.modulBreiteLabel]}),c.jsx("div",{className:"flex items-baseline gap-2",children:c.jsxs("span",{className:"text-lg font-bold tabular-nums text-foreground",children:[A.gesamtpreis.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})," ","â¬"]})}),M&&c.jsx("div",{className:"absolute top-3 right-3",children:c.jsx("div",{className:"w-6 h-6 rounded-full bg-primary flex items-center justify-center",children:c.jsx(ti,{className:"w-3.5 h-3.5 text-primary-foreground"})})})]},A.modulBreiteLabel)})}),c.jsxs("div",{className:"mt-3 flex items-start gap-2 p-2.5 rounded-lg bg-muted/60 border border-border",children:[c.jsx(Ah,{className:"w-4 h-4 text-muted-foreground shrink-0 mt-0.5"}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Achtung: Die einheitlichen Varianten können von Ihrer ausgewählten Wunschbreite (",(S=t.breite)==null?void 0:S.toFixed(2).replace(".",",")," m) etwas abweichen."]})]})]})]})]})})}function rM({config:t,rueckwandLogik:e,onChange:n}){const r=E.useMemo(()=>{const i=e.find(a=>a.rueckwandtyp==="GL"&&a.regalhoehe===t.hoehe);if(!i)return 0;const s=t.hoehe-i.untere_hoehe-10;return Math.floor(s/40)},[t.hoehe,e]);return c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"grid grid-cols-3 gap-3",children:j7.map(i=>{const s=t.rueckwandtyp===i.value&&!t.rueckwandTypen;return c.jsxs("button",{onClick:()=>n({rueckwandtyp:i.value,rueckwandTypen:null}),className:`flex flex-col items-center gap-2 py-4 rounded-lg border-2 transition-all ${s?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center text-2xl transition-colors ${s?"bg-primary/10":"bg-muted"}`,children:i.icon}),c.jsx("span",{className:"text-sm font-medium",children:i.label})]},i.value)})}),r>0&&c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"individuelle-rueckwand",className:"cursor-pointer font-medium text-sm",children:"Individuelle Rückwandgestaltung"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Rückwände einzeln konfigurieren"})]}),c.jsx($o,{id:"individuelle-rueckwand",checked:t.rueckwandTypen!==null,onCheckedChange:i=>{n(i?{rueckwandTypen:Array(r).fill(t.rueckwandtyp)}:{rueckwandTypen:null})}})]}),c.jsx(bo,{children:t.rueckwandTypen&&c.jsx(tn.div,{initial:{opacity:0,height:0}
603,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25},className:"overflow-hidden",children:c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 rounded-lg bg-muted/50",children:[c.jsx("span",{className:"text-xs font-medium",children:"Rückwand 1 (unten)"}),c.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"⬠Glatt"})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground italic px-3 flex items-start gap-1.5",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0 mt-0.5"}),"Die unterste Rückwand ist immer glatt und kann nicht verändert werden."]}),t.rueckwandTypen.map((i,s)=>{const a=i!==t.rueckwandtyp;return c.jsxs("div",{className:`flex items-center justify-between py-1.5 px-3 rounded-lg transition-colors ${a?"bg-primary/5":""}`,children:[c.jsxs("span",{className:"text-xs font-medium",children:["Rückwand ",s+2," ",s===t.rueckwandTypen.length-1?"(oben)":""]}),c.jsx("div",{className:"flex gap-1",children:j7.map(o=>c.jsx("button",{onClick:()=>{const l=[...t.rueckwandTypen];l[s]=o.value,n({rueckwandTypen:l})},className:`px-2.5 py-1 rounded text-[11px] font-medium border transition-all ${i===o.value?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/40 text-muted-foreground"}`,title:o.label,children:o.icon},o.value))})]},s)})]})})})]})]})}const Mg={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})};function Vw({icon:t,title:e,subtitle:n}){return c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(t,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:e}),n&&c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:n})]})]})})}function uke({config:t,onChange:e,breitenModule:n,selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,preisliste:o,rueckwandLogik:l,farblogik:u}){return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{custom:0,variants:Mg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Vw,{icon:Hf,title:"Höhe wählen",subtitle:"Regalhöhe in cm"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:tA.map(d=>c.jsx("button",{onClick:()=>e(U5(t,d)),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.hoehe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:d},d))})})]})}),c.jsx(tn.div,{custom:1,variants:Mg,initial:"hidden",animate:"visible",children:c.jsx(vO,{config:t,onChange:e,breitenModule:n,activeModul:a??r})}),t.breite!==null&&c.jsx(tn.div,{custom:1.5,variants:Mg,initial:"hidden",animate:"visible",children:c.jsx(yO,{config:t,selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,breitenModule:n,preisliste:o,rueckwandLogik:l,farblogik:u})}),c.jsx(tn.div,{custom:2,variants:Mg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Vw,{icon:sg,title:"Tiefe wählen",subtitle:"Sockel- und Fachbodentiefe festlegen"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{children:c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Lf.filter(d=>d<=ox(t.hoehe)).map(d=>c.jsxs("button",{onClick:()=>e({tiefe:d,...d>=67?{saeulentyp:"8x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.tiefe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[d," cm"]},d))})}),c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"fachboeden",className:"text-sm font-medium",children:"Anzahl Fachböden"}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.max(0,t.anzahlFachboeden-1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"â"}),c.jsx("span",{className:"w-12 text-center text-xl font-bold tabular-nums",children:t.anzahlFachboeden}),c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.min(7,t.anzahlFachboeden+1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"+"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"+ 1 Sockelboden ist immer enthalten"})]}),(()=>{const d=cA(t);return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(h=>c.jsx("button",{onClick:()=>{d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3"||e({saeulentyp:h})},disabled:d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3",className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.saeulentyp===h?"border-primary bg-primary/5 text-primary shadow-sm":d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3"?"border-border bg-muted text-muted-foreground cursor-not-allowed opacity-50":"border-border hover:border-primary/40"}`,children:h},h))}),d.pflicht8x3&&c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}
603),"8x3 bei dieser Tiefe erforderlich"]}),!d.pflicht8x3&&d.empfohlen==="8x3"&&t.hoehe!==121&&c.jsxs("p",{className:"text-xs text-blue-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 empfohlen bei dieser Tiefe"]})]})})(),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"individuelle-tiefen",className:"cursor-pointer font-medium text-sm",children:"Individuelle Bodentiefen"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Jeder Boden kann eine eigene Tiefe haben"})]}),c.jsx($o,{id:"individuelle-tiefen",checked:t.fachbodenTiefen!==null,onCheckedChange:d=>{e(d?{fachbodenTiefen:Array(t.anzahlFachboeden).fill(t.tiefe),sockelbodenTiefe:t.tiefe}:{fachbodenTiefen:null,sockelbodenTiefe:null})}})]}),c.jsx(bo,{children:t.fachbodenTiefen&&c.jsx(tn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25},className:"overflow-hidden",children:c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 rounded-lg bg-muted/50",children:[c.jsx("span",{className:"text-xs font-medium",children:"Sockelboden"}),c.jsxs(vl,{value:(t.sockelbodenTiefe??t.tiefe).toString(),onValueChange:d=>{const h=Number(d),p={sockelbodenTiefe:h};if(p.tiefe=h,t.fachbodenTiefen){const f=t.fachbodenTiefen.map(m=>Math.min(m,h));for(let m=1;m<f.length;m++)f[m]=Math.min(f[m],f[m-1]);p.fachbodenTiefen=f}e(p)},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:Lf.filter(d=>d<=ox(t.hoehe)).map(d=>c.jsxs(Us,{value:d.toString(),children:[d," cm"]},d))})]})]}),t.fachbodenTiefen.map((d,h)=>{const p=h===0?t.sockelbodenTiefe??t.tiefe:t.fachbodenTiefen[h-1],f=z5.filter(x=>x<=p),m=d<t.tiefe;return c.jsxs("div",{className:`flex items-center justify-between py-1.5 px-3 rounded-lg transition-colors ${m?"bg-primary/5":""}`,children:[c.jsxs("span",{className:"text-xs font-medium",children:["Boden ",h+1," ",h===t.fachbodenTiefen.length-1?"(oben)":""]}),c.jsxs(vl,{value:d.toString(),onValueChange:x=>{const v=Number(x),g=[...t.fachbodenTiefen];g[h]=v;for(let b=h+1;b<g.length;b++)g[b]=Math.min(g[b],g[b-1]);e({fachbodenTiefen:g})},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:f.map(x=>c.jsxs(Us,{value:x.toString(),children:[x," cm"]},x))})]})]},h)}),t.fachbodenTiefen&&t.fachbodenTiefen.length>0&&(()=>{const d=t.sockelbodenTiefe??t.tiefe,h=Math.max(...t.fachbodenTiefen);return d-h<10?c.jsxs("p",{className:"text-xs text-amber-600 mt-3 flex items-start gap-1.5 px-1",children:[c.jsx(pa,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),c.jsx("span",{children:"Tipp: Für optimale Standsicherheit sollte der Sockelboden mindestens 10 cm tiefer als die hängenden Fachböden sein."})]}):null})()]})})})]})]})]})}),c.jsx(tn.div,{custom:3,variants:Mg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Vw,{icon:$S,title:"Ausstattung wählen",subtitle:"Zusätzliche Optionen"}),c.jsxs(Bn,{className:"space-y-0",children:[c.jsxs("div",{className:"flex items-center justify-between py-3.5 border-b border-border",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"sockelblende",className:"cursor-pointer font-medium text-sm",children:"Sockelblende"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Verkleidung im Sockelbereich"})]}),c.jsx($o,{id:"sockelblende",checked:t.sockelblende,onCheckedChange:d=>e({sockelblende:d})})]}),c.jsxs("div",{className:"flex items-center justify-between py-3.5",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"scannerschiene",className:"cursor-pointer font-medium text-sm",children:"Scannerschiene"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Preisauszeichnung an jedem Boden"})]}),c.jsx($o,{id:"scannerschiene",checked:t.scannerschiene,onCheckedChange:d=>e({scannerschiene:d})})]})]})]})}),c.jsx(tn.div,{custom:4,variants:Mg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Vw,{icon:x1,title:"Rückwand wählen",subtitle:"Rückwandtyp auswählen"}),c.jsx(Bn,{children:c.jsx(rM,{config:t,rueckwandLogik:l,onChange:e})})]})}),c.jsx(tn.div,{custom:5,variants:Mg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Vw,{icon:Uf,title:"Farbe wählen",subtitle:"Oberfläche der Metallteile"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(d=>c.jsxs("button",{onClick:()=>e({farbe:d.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.farbe===d.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:d.hex,borderColor:t.farbe===d.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.farbe===d.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:d.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:d.ral})]}),t.farbe===d.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},d.name))})})]})})]})}const PR=768;function Ph(){const[t,e]=E.useState(void 0);return E.useEffect(()=>{const n=window.matchMedia(`(max-width: ${PR-1}px)`),r=()=>{e(window.innerWidth<PR)};return n.addEventListener("change",r),e(window.innerWidth<PR),()=>n.removeEventListener("change",r)},[]),!!t}var iM="Collapsible",[dke,rne]=ja(iM),[hke,bO]=dke(iM),ine=E.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...o}=t,[l,u]=Ja({prop:r,defaultProp:i??!1,onChange:a,caller:iM});return c.jsx(hke,{scope:n,disabled:s,contentId:mu(),open:l,onOpenToggle:E.useCallback(()=>u(d=>!d),[u]),children:c.jsx(vn.div,{"data-state":_O(l),"data-disabled":s?"":void 0,...o,ref:e})})});ine.displayName=iM;var sne="CollapsibleTrigger",ane=E.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=bO(sne,n);return c.jsx(vn.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":_O(i.open
vendor: 4,209 bytes, line 603
603),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:cn(t.onClick,i.onOpenToggle)})});ane.displayName=sne;var wO="CollapsibleContent",one=E.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=bO(wO,t.__scopeCollapsible);return c.jsx(Cu,{present:n||i.open,children:({present:s})=>c.jsx(fke,{...r,ref:e,present:s})})});one.displayName=wO;var fke=E.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=t,a=bO(wO,n),[o,l]=E.useState(r),u=E.useRef(null),d=ur(e,u),h=E.useRef(0),p=h.current,f=E.useRef(0),m=f.current,x=a.open||o,v=E.useRef(x),g=E.useRef(void 0);return E.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),Ya(()=>{const b=u.current;if(b){g.current=g.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const y=b.getBoundingClientRect();h.current=y.height,f.current=y.width,v.current||(b.style.transitionDuration=g.current.transitionDuration,b.style.animationName=g.current.animationName),l(r)}},[a.open,r]),c.jsx(vn.div,{"data-state":_O(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!x,...s,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:x&&i})});function _O(t){return t?"open":"closed"}var pke=ine,mke=ane,gke=one,Ad="Accordion",xke=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[SO,vke,yke]=GS(Ad),[sM,hqe]=ja(Ad,[yke,rne]),AO=rne(),lne=Bt.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,s=r;return c.jsx(SO.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?c.jsx(Ske,{...s,ref:e}):c.jsx(_ke,{...i,ref:e})})});lne.displayName=Ad;var[cne,bke]=sM(Ad),[une,wke]=sM(Ad,{collapsible:!1}),_ke=Bt.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=t,[o,l]=Ja({prop:n,defaultProp:r??"",onChange:i,caller:Ad});return c.jsx(cne,{scope:t.__scopeAccordion,value:Bt.useMemo(()=>o?[o]:[],[o]),onItemOpen:l,onItemClose:Bt.useCallback(()=>s&&l(""),[s,l]),children:c.jsx(une,{scope:t.__scopeAccordion,collapsible:s,children:c.jsx(dne,{...a,ref:e})})})}),Ske=Bt.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[a,o]=Ja({prop:n,defaultProp:r??[],onChange:i,caller:Ad}),l=Bt.useCallback(d=>o((h=[])=>[...h,d]),[o]),u=Bt.useCallback(d=>o((h=[])=>h.filter(p=>p!==d)),[o]);return c.jsx(cne,{scope:t.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u,children:c.jsx(une,{scope:t.__scopeAccordion,collapsible:!0,children:c.jsx(dne,{...s,ref:e})})})}),[Ake,aM]=sM(Ad),dne=Bt.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...a}=t,o=Bt.useRef(null),l=ur(o,e),u=vke(n),h=Mx(i)==="ltr",p=cn(t.onKeyDown,f=>{var T;if(!xke.includes(f.key))return;const m=f.target,x=u().filter(C=>{var R;return!((R=C.ref.current)!=null&&R.disabled)}),v=x.findIndex(C=>C.ref.current===m),g=x.length;if(v===-1)return;f.preventDefault();let b=v;const y=0,S=g-1,A=()=>{b=v+1,b>S&&(b=y)},k=()=>{b=v-1,b<y&&(b=S)};switch(f.key){case"Home":b=y;break;case"End":b=S;break;case"ArrowRight":s==="horizontal"&&(h?A():k());break;case"ArrowDown":s==="vertical"&&A();break;case"ArrowLeft":s==="horizontal"&&(h?k():A());break;case"ArrowUp":s==="vertical"&&k();break}const M=b%g;(T=x[M].ref.current)==null||T.focus()});return c.jsx(Ake,{scope:n,disabled:r,direction:i,orientation:s,children:c.jsx(SO.Slot,{scope:n,children:c.jsx(vn.div,{...a,"data-orientation":s,ref:l,onKeyDown:r?void 0:p})})})}),vT="AccordionItem",[Eke,EO]=sM(vT),hne=Bt.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,s=aM(vT,n),a=bke(vT,n),o=AO(n),l=mu(),u=r&&a.value.includes(r)||!1,d=s.disabled||t.disabled;return c.jsx(Eke,{scope:n,open:u,disabled:d,triggerId:l,children:c.jsx(pke,{"data-orientation":s.orientation,"data-state":vne(u),...o,...i,ref:e,disabled:d,open:u,onOpenChange:h=>{h?a.onItemOpen(r):a.onItemClose(r)}})})});hne.displayName=vT;var fne="AccordionHeader",pne=Bt.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=aM(Ad,n),s=EO(fne,n);return c.jsx(vn.h3,{"data-orientation":i.orientation,"data-state":vne(s.open
vendor: 3,665 bytes, line 603
603),"data-disabled":s.disabled?"":void 0,...r,ref:e})});pne.displayName=fne;var c4="AccordionTrigger",mne=Bt.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=aM(Ad,n),s=EO(c4,n),a=wke(c4,n),o=AO(n);return c.jsx(SO.ItemSlot,{scope:n,children:c.jsx(mke,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...r,ref:e})})});mne.displayName=c4;var gne="AccordionContent",xne=Bt.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=aM(Ad,n),s=EO(gne,n),a=AO(n);return c.jsx(gke,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});xne.displayName=gne;function vne(t){return t?"open":"closed"}var kke=lne,Cke=hne,Nke=pne,yne=mne,bne=xne;const wne=kke,kO=E.forwardRef(({className:t,...e},n)=>c.jsx(Cke,{ref:n,className:rn("border-b",t),...e}));kO.displayName="AccordionItem";const CO=E.forwardRef(({className:t,children:e,...n},r)=>c.jsx(Nke,{className:"flex",children:c.jsxs(yne,{ref:r,className:rn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,c.jsx(Su,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));CO.displayName=yne.displayName;const NO=E.forwardRef(({className:t,children:e,...n},r)=>c.jsx(bne,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:c.jsx("div",{className:rn("pb-4 pt-0",t),children:e})}));NO.displayName=bne.displayName;var LR="rovingFocusGroup.onEntryFocus",Tke={bubbles:!1,cancelable:!0},fA="RovingFocusGroup",[u4,_ne,Mke]=GS(fA),[Rke,V1]=ja(fA,[Mke]),[jke,Pke]=Rke(fA),Sne=E.forwardRef((t,e)=>c.jsx(u4.Provider,{scope:t.__scopeRovingFocusGroup,children:c.jsx(u4.Slot,{scope:t.__scopeRovingFocusGroup,children:c.jsx(Lke,{...t,ref:e})})}));Sne.displayName=fA;var Lke=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,p=E.useRef(null),f=ur(e,p),m=Mx(s),[x,v]=Ja({prop:a,defaultProp:o??null,onChange:l,caller:fA}),[g,b]=E.useState(!1),y=_u(u),S=_ne(n),A=E.useRef(!1),[k,M]=E.useState(0);return E.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(LR,y),()=>T.removeEventListener(LR,y)},[y]),c.jsx(jke,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:x,onItemFocus:E.useCallback(T=>v(T),[v]),onItemShiftTab:E.useCallback(()=>b(!0),[]),onFocusableItemAdd:E.useCallback(()=>M(T=>T+1),[]),onFocusableItemRemove:E.useCallback(()=>M(T=>T-1),[]),children:c.jsx(vn.div,{tabIndex:g||k===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...t.style},onMouseDown:cn(t.onMouseDown,()=>{A.current=!0}),onFocus:cn(t.onFocus,T=>{const C=!A.current;if(T.target===T.currentTarget&&C&&!g){const R=new CustomEvent(LR,Tke);if(T.currentTarget.dispatchEvent(R),!R.defaultPrevented){const P=S().filter(U=>U.focusable),j=P.find(U=>U.active),G=P.find(U=>U.id===x),$=[j,G,...P].filter(Boolean).map(U=>U.ref.current);kne($,d)}}A.current=!1}),onBlur:cn(t.onBlur,()=>b(!1))})})}),Ane="RovingFocusGroupItem",Ene=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...o}=t,l=mu(),u=s||l,d=Pke(Ane,n),h=d.currentTabStopId===u,p=_ne(n),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:x}=d;return E.useEffect(()=>{if(r)return f(),()=>m()}
vendor: 5,502 bytes, line 603
603,[r,f,m]),c.jsx(u4.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(vn.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:cn(t.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:cn(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:cn(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const g=Bke(v,d.orientation,d.dir);if(g!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const S=y.indexOf(v.currentTarget);y=d.loop?Fke(y,S+1):y.slice(S+1)}setTimeout(()=>kne(y))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:x!=null}):a})})});Ene.displayName=Ane;var Ike={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dke(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Bke(t,e,n){const r=Dke(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ike[r]}function kne(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Fke(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var TO=Sne,MO=Ene,oM="Tabs",[Oke,fqe]=ja(oM,[V1]),Cne=V1(),[zke,RO]=Oke(oM),Nne=E.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...u}=t,d=Mx(o),[h,p]=Ja({prop:r,onChange:i,defaultProp:s??"",caller:oM});return c.jsx(zke,{scope:n,baseId:mu(),value:h,onValueChange:p,orientation:a,dir:d,activationMode:l,children:c.jsx(vn.div,{dir:d,"data-orientation":a,...u,ref:e})})});Nne.displayName=oM;var Tne="TabsList",Mne=E.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=RO(Tne,n),a=Cne(n);return c.jsx(TO,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(vn.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});Mne.displayName=Tne;var Rne="TabsTrigger",jne=E.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,a=RO(Rne,n),o=Cne(n),l=Ine(a.baseId,r),u=Dne(a.baseId,r),d=r===a.value;return c.jsx(MO,{asChild:!0,...o,focusable:!i,active:d,children:c.jsx(vn.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:e,onMouseDown:cn(t.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:cn(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:cn(t.onFocus,()=>{const h=a.activationMode!=="manual";!d&&!i&&h&&a.onValueChange(r)})})})});jne.displayName=Rne;var Pne="TabsContent",Lne=E.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=t,o=RO(Pne,n),l=Ine(o.baseId,r),u=Dne(o.baseId,r),d=r===o.value,h=E.useRef(d);return E.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(Cu,{present:i||d,children:({present:p})=>c.jsx(vn.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:p&&s})})});Lne.displayName=Pne;function Ine(t,e){return`${t}-trigger-${e}`}function Dne(t,e){return`${t}-content-${e}`}var Uke=Nne,Bne=Mne,Fne=jne,One=Lne;const $b=Uke,dx=E.forwardRef(({className:t,...e},n)=>c.jsx(Bne,{ref:n,className:rn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));dx.displayName=Bne.displayName;const Xl=E.forwardRef(({className:t,...e},n)=>c.jsx(Fne,{ref:n,className:rn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...e}));Xl.displayName=Fne.displayName;const vu=E.forwardRef(({className:t,...e},n)=>c.jsx(One,{ref:n,className:rn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));vu.displayName=One.displayName;function rS(t,e){const n=Math.max(0,Math.min(255,parseInt(t.slice(1,3),16)+e)),r=Math.max(0,Math.min(255,parseInt(t.slice(3,5),16)+e)),i=Math.max(0,Math.min(255,parseInt(t.slice(5,7),16)+e));return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function jO({className:t,...e}){return c.jsx("div",{className:rn("animate-pulse rounded-md bg-muted",t),...e})}function zne({config:t,modul:e}){const[n,r]=E.useState(0),[i,s]=E.useState(!0),[a,o]=E.useState(!1),l=rA(),u=t.regaltyp==="paneelwandregal"||t.regaltyp==="paneelwandregal-anbau",d=t.regaltyp==="wandregal-anbau"||t.regaltyp==="gondelregal-anbau",h=t.regaltyp==="eckregal",p=e?d?Math.round(e.gesamtbreite_plus3):e.gesamtbreite_plus3:0,f=t.anzahlFachboeden??1,m=e?Math.round(p):0,x=t.regaltyp==="gondelregal"||t.regaltyp==="gondelregal-anbau"?"gondelregal":"wandregal",v=E.useMemo(()=>
603{if(h){const A=t,k=L7(A.eckwinkel,A.bauform);return JSe(t.farbe,f,k)}if(!e)return[];if(u){const A=t.rueckwandfarbe??"Nussbaum";return[fT(t.farbe,A)]}return m===0?[]:qSe(t.farbe,p,f,x)},[t.farbe,t.rueckwandfarbe,p,f,x,u,h,t.eckwinkel,t.bauform]);E.useMemo(()=>{if(h){const A=t,k=L7(A.eckwinkel,A.bauform);return uO(t.farbe,f,k)}if(u){const A=t.rueckwandfarbe??"Nussbaum";return fT(t.farbe,A)}return!e||m===0?"":Fy(t.farbe,p,f,x)},[t.farbe,t.rueckwandfarbe,p,f,x,u,h,t.eckwinkel,t.bauform]);const g=!a&&!i&&v.length>0&&n>0;E.useEffect(()=>{r(0),s(!0),o(!1)},[v]);const b=E.useCallback(()=>{const A=n+1;A<v.length?(r(A),s(!0)):(s(!1),o(!0))},[n,v.length]);if(!e&&!h)return null;const y=v[n]?v[n]+l:"",S=h?"Näherungsdarstellung â Farbe und Fachbodenzahl entsprechen der Konfiguration. Tiefe, Höhe, Rückwand und Anbindung können abweichen.":u?"Näherungsdarstellung â Farb- und Paneelkombination entsprechen der Konfiguration. Höhe, Breite und Sockeltiefe können abweichen.":d?"Näherungsdarstellung â Da ein Anbaumodul an ein bestehendes Regal gebaut wird, sind linke und/oder rechte Säule und FuÃteil bereits vorhanden und somit nicht im Lieferumfang enthalten. Höhe, Fachbodentiefe, Rückwand und Zubehör können abweichen.":"Näherungsdarstellung â Farbe und Fachbodenzahl entsprechen der Konfiguration. Die Breite wird näherungsweise durch einheitliche 1,00 m Module dargestellt. Höhe, Fachbodentiefe, Rückwand und Zubehör können abweichen.";return c.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c.jsxs("div",{className:"relative w-full aspect-[16/10] bg-muted/30 rounded-lg overflow-hidden flex items-center justify-center",children:[i&&!a&&c.jsx(jO,{className:"absolute inset-0 w-full h-full rounded-lg"}),a?c.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[c.jsx(v1,{className:"w-10 h-10"}),c.jsx("p",{className:"text-sm font-medium",children:"Kein Beispielbild vorhanden"})]}):c.jsx(tn.img,{src:y,alt:u?`Paneelwandregal ${t.farbe} ${t.rueckwandfarbe}`:`Regal ${t.farbe} ${Math.ceil(p)}m ${f} Fachböden`,className:"max-w-full max-h-full object-contain",initial:{opacity:0}
603,animate:{opacity:i?0:1},transition:{duration:.3},onLoad:()=>{s(!1),o(!1)},onError:b},y),g&&c.jsxs("div",{className:"absolute top-2 left-2 bg-accent text-accent-foreground text-[10px] font-medium px-2 py-1 rounded-md flex items-center gap-1 border border-border",children:[c.jsx(Ah,{className:"w-3 h-3"}),"Ersatzbild"]})]}),c.jsx("p",{className:"text-xs text-muted-foreground text-center italic",children:S})]})}const Hke={Nussbaum:"#6B4226",Anthrazit:"#383E42",Grau:"#A0A0A0",Weiss:"#ECECEC",WeiÃ:"#ECECEC"};function Gke({config:t,modul:e,color:n,colorDark:r,colorLight:i,untereHoehe:s}){const a=t.regaltyp==="paneelwandregal"||t.regaltyp==="paneelwandregal-anbau",o=E.useMemo(()=>{const B=[];for(let z=0;z<e.anzahl_0665;z++)B.push(66.5);for(let z=0;z<e.anzahl_1000;z++)B.push(100);for(let z=0;z<e.anzahl_1250;z++)B.push(125);for(let z=0;z<e.anzahl_1330;z++)B.push(133);const $=B.reduce((z,I)=>z+I,0),U=3,Z=B.length+1,V=$+Z*U,W=t.hoehe,O=new Map;B.forEach(z=>O.set(z,(O.get(z)||0)+1));const Y=Array.from(O.entries()).map(([z,I])=>`${I}à ${z} cm`).join(", ");return{moduleWidths:B,totalWidth:V,totalHeight:W,saeulenWidth:U,modulLabel:Y}},[e,t.hoehe]),{moduleWidths:l,totalWidth:u,totalHeight:d,saeulenWidth:h,modulLabel:p}=o,f=10,x=u+f+10,v=d+f*2,g=s??0,b=40,y=d-g,S=Math.floor(y/b),A=a?Hke[t.rueckwandfarbe]||"#A0A0A0":"",k=a&&(A==="#ECECEC"||A==="#A0A0A0"),M=a?rS(A,k?-25:40):"",T=k?"#D0D0D0":"none",C=10,R=Math.floor(d/C)-1,P=a?Math.max(0,R-3):R,j=t.rueckwandTypen,G=a?`Spacewall-Paneel: ${t.rueckwandfarbe||"Grau"}`:j?"Individuelle Rückwandgestaltung":t.rueckwandtyp==="GL"?"Glatt":t.rueckwandtyp==="RL"?"Rundlochung (Rückwand 1 immer glatt)":"Schlüsselloch (Rückwand 1 immer glatt)";return c.jsxs("div",{children:[c.jsxs("svg",{viewBox:`0 0 ${x} ${v}`,className:"w-full h-auto",style:{maxHeight:380},children:[c.jsxs("defs",{children:[c.jsx("pattern",{id:"dots",x:"0",y:"0",width:"3",height:"2.5",patternUnits:"userSpaceOnUse",children:c.jsx("circle",{cx:"1.5",cy:"1.25",r:"0.7",fill:r,opacity:"0.45"})}),c.jsxs("pattern",{id:"slots",x:"0",y:"0",width:"8",height:"16",patternUnits:"userSpaceOnUse",children:[c.jsx("circle",{cx:"4",cy:"4",r:"1.8",fill:r,opacity:"0.45"}),c.jsx("circle",{cx:"4",cy:"12",r:"1.8",fill:r,opacity:"0.45"}),c.jsx("rect",{x:"3.4",y:"12",width:"1.2",height:"3.5",rx:"0.3",fill:r,opacity:"0.45"})]}),c.jsxs("linearGradient",{id:"shelfGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:n}),c.jsx("stop",{offset:"100%",stopColor:r,stopOpacity:"0.6"})]})]}),(()=>{let B=f+h;return l.map(($,U)=>{const Z=a?c.jsxs("g",{children:[c.jsx("rect",{x:B,y:f,width:$,height:d,fill:A,rx:1,stroke:T,strokeWidth:k?1:0}),Array.from({length:P}).map((V,W)=>{const O=f+(W+2)*C;return c.jsx("line",{x1:B,y1:O,x2:B+$,y2:O,stroke:M,strokeWidth:1.2,opacity:.7},`groove-${U}-${W}`)})]},`panel-${U}`):c.jsx("g",{children:(()=>{const V=rS(i,-15);if(j&&j.length>0){const Y=j.length,z=Y>0?y/Y:y;return c.jsxs(c.Fragment,{children:[j.map((I,q)=>{const te=Y-1-q,se=f+te*z,ie=I==="GL"?i:I==="RL"?"url(#dots)":"url(#slots)",le=I!=="GL";return c.jsxs("g",{children:[le&&c.jsx("rect",{x:B,y:se,width:$,height:z,fill:i}),c.jsx("rect",{x:B,y:se,width:$,height:z,fill:ie})]},`seg-${q}`)}),g>0&&c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:B,y:f+y,width:$,height:g,fill:V,rx:0}),c.jsx("line",{x1:B,y1:f+y,x2:B+$,y2:f+y,stroke:r,strokeWidth:1,strokeDasharray:"4,3"})]}),Array.from({length:Y-1}).map((I,q)=>{const te=f+(q+1)*z;return c.jsx("line",{x1:B,y1:te,x2:B+$,y2:te,stroke:r,strokeWidth:.5,opacity:.3},`ow-${U}-${q}`)})]})}const W=t.rueckwandtyp==="GL"?i:t.rueckwandtyp==="RL"?"url(#dots)":"url(#slots)",O=t.rueckwandtyp!=="GL"?i:void 0;return c.jsxs(c.Fragment,{children:[O&&c.jsx("rect",{x:B,y:f,width:$,height:y,fill:O,rx:2}),c.jsx("rect",{x:B,y:f,width:$,height:y,fill:W,rx:2}),g>0&&c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:B,y:f+y,width:$,height:g,fill:V,rx:0}),c.jsx("line",{x1:B,y1:f+y,x2:B+$,y2:f+y,stroke:r,strokeWidth:1,strokeDasharray:"4,3"})]}),Array.from({length:S-1}).map((Y,z)=>{const I=f+(z+1)*b;return c.jsx("line",{x1:B,y1:I,x2:B+$,y2:I,stroke:r,strokeWidth:.5,opacity:.3},`ow-${U}-${z}`)})]})})()},`panel-${U}`);return B+=$+h,Z})})(),(()=>{let B=f;const $=[];for(let U=0;U<=l.length;U++)$.push(c.jsx("rect",{x:B,y:f,width:h,height:d,fill:r,rx:1},`col-${U}`)),B+=h+(l[U]||0);return $})(),"sockelblende"in t&&t.sockelblende&&c.jsx("rect",{x:f,y:f+d,width:u,height:5,fill:r,rx:1}),c.jsx("rect",{x:f,y:f,width:u,height:d,fill:"none",stroke:r,strokeWidth:1.5,rx:2})]}),c.jsxs("p",{className:"text-xs text-muted-foreground italic mt-2 leading-relaxed",children:["Gesamtbreite ",e.gesamtbreite_plus3.toLocaleStr
603ing("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" m"," | Höhe ",t.hoehe," cm",!a&&g>0&&c.jsxs(c.Fragment,{children:[" | Rückwand 1: ",g," cm | Rückwände 2â",S+1,": je 40 cm"]}),c.jsx("br",{}),G," | ",l.length," Module (",p,")"]})]})}function Vke({config:t,color:e,colorDark:n,colorLight:r}){const i=t.regaltyp==="gondelregal"||t.regaltyp==="gondelregal-anbau",s=t.regaltyp==="paneelwandregal"||t.regaltyp==="paneelwandregal-anbau",a=E.useMemo(()=>{const C=t.sockelbodenTiefe??t.tiefe,R=t.fachbodenTiefen??Array(t.anzahlFachboeden).fill(C),P=Math.max(t.tiefe,C),j=t.hoehe;return{hauptTiefe:C,tiefen:R,maxTiefe:P,totalHeight:j,sockelH:16,minGap:20}},[t]),{hauptTiefe:o,tiefen:l,maxTiefe:u,totalHeight:d,sockelH:h,minGap:p}=a,f=50,m=70,x=4,v=rS(e,-50),g=i?u*2+f+m+x:u+f+m,b=d+f*2+30,y=i?f+u:f,S=E.useMemo(()=>{const C=f+d-h-p,P=C-f,j=l.length;return l.map((G,B)=>j===1?C-P/2:C-B/(j-1)*P*((j-1)/j))},[l,d,h,p]),A=f+d-h,k=A,M=C=>c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:C===1?y+x:y-o,y:k,width:o,height:3.5,fill:"url(#sideShelfGrad)",stroke:n,strokeWidth:.5,rx:.5}),C===1&&c.jsxs("text",{x:y+x+o+6,y:k+2,fill:"hsl(var(--muted-foreground))",fontSize:"9",fontFamily:"DM Sans, sans-serif",dominantBaseline:"middle",children:["Sockelboden aufliegend ",o," cm"]}),!s&&l.map((R,P)=>{const j=S[P],G=R<o,B=G?v:"url(#sideShelfGrad)",$=G?v:n;return c.jsxs("g",{children:[c.jsx("rect",{x:C===1?y+x:y-R,y:j,width:R,height:3.5,fill:B,stroke:$,strokeWidth:.5,rx:.5,opacity:G?.75:1}),C===1&&c.jsxs("text",{x:y+x+R+6,y:j+2,fill:G?v:"hsl(var(--muted-foreground))",fontSize:"9",fontFamily:"DM Sans, sans-serif",dominantBaseline:"middle",fontWeight:G?600:400,children:[R," cm"]})]},`shelf-${C}-${P}`)})]}),T=C=>{const R=C===1?y+x:y-o;return c.jsxs("g",{children:[c.jsx("rect",{x:R,y:A,width:o,height:h,fill:r,stroke:n,strokeWidth:.5,rx:.5}),c.jsx("rect",{x:R,y:A,width:o,height:h,fill:"url(#hatchPattern)",rx:.5}),"sockelblende"in t&&t.sockelblende&&c.jsx("g",{children:c.jsx("line",{x1:C===1?R+o:R,y1:A,x2:C===1?R+o:R,y2:A+h,stroke:n,strokeWidth:2.5})})]})};return c.jsxs("svg",{viewBox:`0 0 ${g} ${b}`,className:"w-full h-auto",style:{maxHeight:380},children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"sideShelfGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:e}),c.jsx("stop",{offset:"100%",stopColor:n,stopOpacity:"0.6"})]}),c.jsx("pattern",{id:"hatchPattern",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:n,strokeWidth:"1",strokeOpacity:"0.5"})})]}),c.jsxs("text",{x:f-22,y:f+d/2,textAnchor:"middle",transform:`rotate(-90, ${f-22}, ${f+d/2})`,fill:"hsl(var(--foreground))",fontSize:"13",fontWeight:"600",fontFamily:"DM Sans, sans-serif",children:["â ",t.hoehe," cm"]}),i?c.jsxs("text",{x:y,y:f-12,textAnchor:"middle",fill:"hsl(var(--foreground))",fontSize:"13",fontWeight:"600",fontFamily:"DM Sans, sans-serif",children:["â ",o," cm je Seite (Tiefe)"]}):c.jsxs("text",{x:f+u/2,y:f-12,textAnchor:"middle",fill:"hsl(var(--foreground))",fontSize:"13",fontWeight:"600",fontFamily:"DM Sans, sans-serif",children:["â ",o," cm (Tiefe)"]}),c.jsx("rect",{x:y,y:f,width:x,height:d,fill:n,rx:1}),M(1),T(1),i&&M(-1),i&&T(-1),c.jsxs("text",{x:i?y+x/2:f+o/2,y:A+h+16,textAnchor:"middle",fill:"hsl(var(--foreground))",fontSize:"9",fontWeight:"600",fontFamily:"DM Sans, sans-serif",dominantBaseline:"auto",children:["FuÃteil ",o," cm",i?" je Seite":""]}),"sockelblende"in t&&t.sockelblende&&c.jsxs("text",{x:i?y+x/2:f+o/2,y:A+h+28,textAnchor:"middle",fill:"hsl(var(--muted-foreground))",fontSize:"9",fontFamily:"DM Sans, sans-serif",dominantBaseline:"auto",fontWeight:600,children:["Sockelblende",i?" (beidseitig)":" vorne"]}),c.jsx("line",{x1:y,y1:f,x2:y,y2:f+d,stroke:n,strokeWidth:1.5})]})}function Wke({config:t,modul:e,untereHoehe:n}){var d;const[r,i]=E.useState("photo"),s=h=>{i(h)},a=((d=xi.find(h=>h.name===t.farbe))==null?void 0:d.code)||7035,o=$Se[a]||"#C5C7C4",l=rS(o,-30),u=rS(o,30);return e?c.jsx(tn.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.35},className:"bg-card rounded-xl border border-border p-4 shadow-sm",children:c.jsxs($b,{value:r,onValueChange:s,children:[c.jsxs(dx,{className:"mb-3 w-full grid grid-cols-3",children:[c.jsx(Xl,{value:"photo",className:"text-xs",children:"Beispielbild"}),c.jsx(Xl,{value:"front",className:"text-xs",children:"Frontansicht"}),c.jsx(Xl,{value:"side",className:"text-xs",children:"Seitenansicht"})]}),c.jsx(vu,{value:"photo",children:c.jsx(zne,{config:t,modul:e})}),c.jsx(vu,{value:"front",children:c.jsx(Gke,{config:t,modul:e,color:o,colorDark:l,colorLight:u,untereHoehe:n})}),c.jsx(vu,{value:"side",children:c.jsx(Vke,{config:t,color:o,colorDark:l,colorLight:u})})]})}):c.jsx(tn.div,{initial:{opacity:0}
603,animate:{opacity:1},className:"flex items-center justify-center h-52 bg-muted/50 rounded-xl border border-border",children:c.jsxs("div",{className:"text-center space-y-2",children:[c.jsx("div",{className:"w-16 h-12 mx-auto rounded bg-muted border-2 border-dashed border-border"}),c.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Regalvorschau"})]})})}function $ke(){var e;return typeof document>"u"?"ladenbau":(document.documentElement.getAttribute("data-konfig-theme")??((e=document.querySelector("[data-konfig-theme]"))==null?void 0:e.getAttribute("data-konfig-theme")))==="messebau"?"messebau":"ladenbau"}const Kke={markAnfrage:()=>{},markGespeichert:()=>{}},Une=E.createContext(Kke);function qke(){var n,r;if((n=globalThis.crypto)!=null&&n.randomUUID)return globalThis.crypto.randomUUID();const t=new Uint8Array(16);(r=globalThis.crypto)==null||r.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20)}`}const Hne=()=>E.useContext(Une);function Ed({slug:t,regaltyp:e=null,children:n}){const r=E.useRef(qke()),i=E.useRef(!1),s=E.useRef(!1),a=E.useRef(!1),o=E.useRef({anfrage:!1,gespeichert:!1}),l=E.useRef(null),u=E.useCallback(async()=>{if(i.current)return!0;if(s.current)return!1;s.current=!0;try{const{data:f,error:m}=await Ot.rpc("analytics_start_session",{p_slug:t,p_regaltyp:e,p_session_id:r.current});return m?(console.warn("[analytics] session start failed",m,"slug=",t),!1):(typeof f=="string"&&(r.current=f),i.current=!0,!0)}catch(f){return console.warn("[analytics] session tracker error",f),!1}finally{s.current=!1}},[e,t]),d=E.useCallback(f=>{l.current||(l.current=setTimeout(()=>{l.current=null,f()},1e3))},[]),h=E.useCallback(async()=>{if(a.current)return;const f=o.current;if(!f.anfrage&&!f.gespeichert)return;if(!i.current&&!await u()){d(()=>void h());return}const m=f.anfrage,x=f.gespeichert||f.anfrage;a.current=!0;try{const{error:v}=await Ot.rpc("analytics_mark_session",{p_session_id:r.current,p_anfrage:m,p_gespeichert:x});if(v){console.warn("[analytics] session update failed",v),d(()=>void h());return}x&&(o.current.gespeichert=!1),m&&(o.current.anfrage=!1)}catch(v){console.warn("[analytics] session update error",v),d(()=>void h())}finally{a.current=!1}(o.current.anfrage||o.current.gespeichert)&&h()},[u,d]);E.useEffect(()=>(u(),()=>{l.current&&(clearTimeout(l.current),l.current=null)}),[u]);const p=E.useMemo(()=>({markAnfrage:()=>{o.current.anfrage=!0,o.current.gespeichert=!0,h()},markGespeichert:()=>{o.current.gespeichert=!0,h()}}),[h]);return c.jsx(Une.Provider,{value:p,children:n})}var oi;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.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},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.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)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(oi||(oi={}));var X7;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(X7||(X7={}));const En=oi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ip=t=>{switch(typeof t){case"undefined":return En.undefined;case"string":return En.string;case"number":return Number.isNaN(t)?En.nan:En.number;case"boolean":return En.boolean;case"function":return En.function;case"bigint":return En.bigint;case"symbol":return En.symbol;case"object":return Array.isArray(t)?En.array:t===null?En.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?En.promise:typeof Map<"u"&&t instanceof Map?En.map:typeof Set<"u"&&t instanceof Set?En.set:typeof Date<"u"&&t instanceof Date?En.date:En.object;default:return En.unknown}}
vendor: 4,707 bytes, line 603
603,qt=oi.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 If 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 n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=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(n(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(n(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof If))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}If.create=t=>new If(t);const d4=(t,e)=>{let n;switch(t.code){case qt.invalid_type:t.received===En.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case qt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,oi.jsonStringifyReplacer)}`;break;case qt.unrecognized_keys:n=`Unrecognized key(s) in object: ${oi.joinValues(t.keys,", ")}`;break;case qt.invalid_union:n="Invalid input";break;case qt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${oi.joinValues(t.options)}`;break;case qt.invalid_enum_value:n=`Invalid enum value. Expected ${oi.joinValues(t.options)}, received '${t.received}'`;break;case qt.invalid_arguments:n="Invalid function arguments";break;case qt.invalid_return_type:n="Invalid function return type";break;case qt.invalid_date:n="Invalid date";break;case qt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:oi.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case qt.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case qt.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case qt.custom:n="Invalid input";break;case qt.invalid_intersection_types:n="Intersection results could not be merged";break;case qt.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case qt.not_finite:n="Number must be finite";break;default:n=e.defaultError,oi.assertNever(t)}return{message:n}};let Xke=d4;function Yke(){return Xke}const Jke=t=>
vendor: 29,305 bytes, line 603
603{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...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 un(t,e){const n=Yke(),r=Jke({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===d4?void 0:d4].filter(i=>!!i)});t.common.issues.push(r)}class jc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return fr;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return jc.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return fr;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 fr=Object.freeze({status:"aborted"}),C_=t=>({status:"dirty",value:t}),Nu=t=>({status:"valid",value:t}),Y7=t=>t.status==="aborted",J7=t=>t.status==="dirty",Kb=t=>t.status==="valid",yT=t=>typeof Promise<"u"&&t instanceof Promise;var Nn;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Nn||(Nn={}));class Bm{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,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 Z7=(t,e)=>{if(Kb(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new If(t.common.issues);return this._error=n,this._error}}};function Dr(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||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}=t;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??n??o.defaultError}},description:i}}class ni{get description(){return this._def.description}_getType(e){return Ip(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ip(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new jc,ctx:{common:e.parent.common,data:e.data,parsedType:Ip(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yT(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ip(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Z7(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ip(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Kb(s)?{value:s.value}:{issues:n.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),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Kb(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ip(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(yT(i)?i:Promise.resolve(i));return Z7(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:qt.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Xb({schema:this,typeName:pr.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:n=>this["~validate"](n)}}optional(){return wm.create(this,this._def)}nullable(){return Yb.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xh.create(this)}promise(){return ST.create(this,this._def)}or(e){return wT.create([this,e],this._def)}and(e){return _T.create(this,e,this._def)}transform(e){return new Xb({...Dr(this._def),schema:this,typeName:pr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new p4({...Dr(this._def),innerType:this,defaultValue:n,typeName:pr.ZodDefault})}brand(){return new bCe({typeName:pr.ZodBranded,type:this,...Dr(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new m4({...Dr(this._def),innerType:this,catchValue:n,typeName:pr.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return PO.create(this,e)}readonly(){return g4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zke=/^c[^\s-]{8,}$/i,Qke=/^[0-9a-z]+$/,eCe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tCe=/^[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,nCe=/^[a-z0-9_-]{21}$/i,rCe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iCe=/^[-+]?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)?)??$/,sCe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aCe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let IR;const oCe=/^(?:(?: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])$/,lCe=/^(?:(?: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])$/,cCe=/^(([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]))$/,uCe=/^(([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])$/,dCe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hCe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gne="((\\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])))",fCe=new RegExp(`^${Gne}$`);function Vne(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function pCe(t){return new RegExp(`^${Vne(t)}$`)}function mCe(t){let e=`${Gne}T${Vne(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function gCe(t,e){return!!((e==="v4"||!e)&&oCe.test(t)||(e==="v6"||!e)&&cCe.test(t))}function xCe(t,e){if(!rCe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.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 vCe(t,e){return!!((e==="v4"||!e)&&lCe.test(t)||(e==="v6"||!e)&&uCe.test(t))}class am extends ni{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==En.string){const s=this._getOrReturnCtx(e);return un(s,{code:qt.invalid_type,expected:En.string,received:s.parsedType}),fr}const r=new jc;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:qt.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),un(i,{code:qt.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?un(i,{code:qt.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&un(i,{code:qt.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")sCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"email",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")IR||(IR=new RegExp(aCe,"u")),IR.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"emoji",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")tCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"uuid",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")nCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"nanoid",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Zke.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"cuid",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Qke.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"cuid2",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")eCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"ulid",code:qt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),un(i,{validation:"url",code:qt.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),un(i,{validation:"regex",code:qt.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),un(i,{code:qt.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),un(i,{code:qt.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),un(i,{code:qt.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?mCe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{code:qt.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?fCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{code:qt.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?pCe(s).test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{code:qt.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?iCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"duration",code:qt.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?gCe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"ip",code:qt.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?xCe(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"jwt",code:qt.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?vCe(e.data,s.version)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"cidr",code:qt.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?dCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"base64",code:qt.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?hCe.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"base64url",code:qt.invalid_string,message:s.message}),r.dirty()):oi.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:qt.invalid_string,...Nn.errToObj(r)})}_addCheck(e){return new am({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Nn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Nn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Nn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Nn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Nn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Nn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Nn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Nn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Nn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Nn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Nn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Nn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Nn.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,...Nn.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,...Nn.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Nn.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Nn.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Nn.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Nn.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Nn.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Nn.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Nn.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Nn.errToObj(n)})}nonempty(e){return this.min(1,Nn.errToObj(e))}trim(){return new am({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new am({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new am({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}am.create=t=>new am({checks:[],typeName:pr.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Dr(t)});function yCe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return s%a/10**i}class iS extends ni{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)!==En.number){const s=this._getOrReturnCtx(e);return un(s,{code:qt.invalid_type,expected:En.number,received:s.parsedType}),fr}let r;const i=new jc;for(const s of this._def.checks)s.kind==="int"?oi.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:qt.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),un(r,{code:qt.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),un(r,{code:qt.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?yCe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),un(r,{code:qt.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:qt.not_finite,message:s.message}),i.dirty()):oi.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Nn.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Nn.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Nn.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Nn.toString(n))}setLimit(e,n,r,i){return new iS({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Nn.toString(i)}]})}_addCheck(e){return new iS({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Nn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nn.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Nn.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Nn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nn.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&oi.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}iS.create=t=>new iS({checks:[],typeName:pr.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Dr(t)});class sS extends ni{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)!==En.bigint)return this._getInvalidInput(e);let r;const i=new jc;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),un(r,{code:qt.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),un(r,{code:qt.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),un(r,{code:qt.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):oi.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return un(n,{code:qt.invalid_type,expected:En.bigint,received:n.parsedType}),fr}gte(e,n){return this.setLimit("min",e,!0,Nn.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Nn.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Nn.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Nn.toString(n))}setLimit(e,n,r,i){return new sS({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Nn.toString(i)}]})}_addCheck(e){return new sS({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nn.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Nn.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}sS.create=t=>new sS({checks:[],typeName:pr.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Dr(t)});class Q7 extends ni{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==En.boolean){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.boolean,received:r.parsedType}),fr}return Nu(e.data)}}Q7.create=t=>new Q7({typeName:pr.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Dr(t)});class bT extends ni{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==En.date){const s=this._getOrReturnCtx(e);return un(s,{code:qt.invalid_type,expected:En.date,received:s.parsedType}),fr}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return un(s,{code:qt.invalid_date}),fr}const r=new jc;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:qt.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),un(i,{code:qt.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):oi.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bT({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Nn.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Nn.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}bT.create=t=>new bT({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:pr.ZodDate,...Dr(t)});class eH extends ni{_parse(e){if(this._getType(e)!==En.symbol){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.symbol,received:r.parsedType}),fr}return Nu(e.data)}}eH.create=t=>new eH({typeName:pr.ZodSymbol,...Dr(t)});class tH extends ni{_parse(e){if(this._getType(e)!==En.undefined){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.undefined,received:r.parsedType}),fr}return Nu(e.data)}}tH.create=t=>new tH({typeName:pr.ZodUndefined,...Dr(t)});class nH extends ni{_parse(e){if(this._getType(e)!==En.null){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.null,received:r.parsedType}),fr}return Nu(e.data)}}nH.create=t=>new nH({typeName:pr.ZodNull,...Dr(t)});class rH extends ni{constructor(){super(...arguments),this._any=!0}_parse(e){return Nu(e.data)}}rH.create=t=>new rH({typeName:pr.ZodAny,...Dr(t)});class iH extends ni{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nu(e.data)}}iH.create=t=>new iH({typeName:pr.ZodUnknown,...Dr(t)});class Fm extends ni{_parse(e){const n=this._getOrReturnCtx(e);return un(n,{code:qt.invalid_type,expected:En.never,received:n.parsedType}),fr}}Fm.create=t=>new Fm({typeName:pr.ZodNever,...Dr(t)});class sH extends ni{_parse(e){if(this._getType(e)!==En.undefined){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.void,received:r.parsedType}),fr}return Nu(e.data)}}sH.create=t=>new sH({typeName:pr.ZodVoid,...Dr(t)});class xh extends ni{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==En.array)return un(n,{code:qt.invalid_type,expected:En.array,received:n.parsedType}),fr;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(un(n,{code:a?qt.too_big:qt.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&&n.data.length<i.minLength.value&&(un(n,{code:qt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(un(n,{code:qt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new Bm(n,a,n.path,o)))).then(a=>jc.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new Bm(n,a,n.path,o)));return jc.mergeArray(r,s)}
vendor: 5,089 bytes, line 603
603get element(){return this._def.type}min(e,n){return new xh({...this._def,minLength:{value:e,message:Nn.toString(n)}})}max(e,n){return new xh({...this._def,maxLength:{value:e,message:Nn.toString(n)}})}length(e,n){return new xh({...this._def,exactLength:{value:e,message:Nn.toString(n)}})}nonempty(e){return this.min(1,e)}}xh.create=(t,e)=>new xh({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pr.ZodArray,...Dr(e)});function uy(t){if(t instanceof Is){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=wm.create(uy(r))}return new Is({...t._def,shape:()=>e})}else return t instanceof xh?new xh({...t._def,type:uy(t.element)}):t instanceof wm?wm.create(uy(t.unwrap())):t instanceof Yb?Yb.create(uy(t.unwrap())):t instanceof hx?hx.create(t.items.map(e=>uy(e))):t}class Is extends ni{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(),n=oi.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==En.object){const u=this._getOrReturnCtx(e);return un(u,{code:qt.invalid_type,expected:En.object,received:u.parsedType}),fr}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Fm&&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 Bm(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Fm){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&&(un(i,{code:qt.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 Bm(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,p=await d.value;u.push({key:h,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>jc.mergeObjectSync(r,u)):jc.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Nn.errToObj,new Is({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Nn.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Is({...this._def,unknownKeys:"strip"})}passthrough(){return new Is({...this._def,unknownKeys:"passthrough"})}extend(e){return new Is({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Is({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:pr.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Is({...this._def,catchall:e})}pick(e){const n={};for(const r of oi.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Is({...this._def,shape:()=>n})}omit(e){const n={};for(const r of oi.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Is({...this._def,shape:()=>n})}deepPartial(){return uy(this)}partial(e){const n={};for(const r of oi.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new Is({...this._def,shape:()=>n})}required(e){const n={};for(const r of oi.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof wm;)s=s._def.innerType;n[r]=s}return new Is({...this._def,shape:()=>n})}keyof(){return Wne(oi.objectKeys(this.shape))}}Is.create=(t,e)=>new Is({shape:()=>t,unknownKeys:"strip",catchall:Fm.create(),typeName:pr.ZodObject,...Dr(e)});Is.strictCreate=(t,e)=>new Is({shape:()=>t,unknownKeys:"strict",catchall:Fm.create(),typeName:pr.ZodObject,...Dr(e)});Is.lazycreate=(t,e)=>new Is({shape:t,unknownKeys:"strip",catchall:Fm.create(),typeName:pr.ZodObject,...Dr(e)});class wT extends ni{_parse(e){const{ctx:n}=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 n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new If(o.ctx.common.issues));return un(n,{code:qt.invalid_union,unionErrors:a}),fr}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.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 n.common.issues.push(...s.ctx.common.issues),s.result;
vendor: 5,044 bytes, line 603
603const o=a.map(l=>new If(l));return un(n,{code:qt.invalid_union,unionErrors:o}),fr}}get options(){return this._def.options}}wT.create=(t,e)=>new wT({options:t,typeName:pr.ZodUnion,...Dr(e)});function h4(t,e){const n=Ip(t),r=Ip(e);if(t===e)return{valid:!0,data:t};if(n===En.object&&r===En.object){const i=oi.objectKeys(e),s=oi.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=h4(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===En.array&&r===En.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=h4(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===En.date&&r===En.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _T extends ni{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(Y7(s)||Y7(a))return fr;const o=h4(s.value,a.value);return o.valid?((J7(s)||J7(a))&&n.dirty(),{status:n.value,value:o.data}):(un(r,{code:qt.invalid_intersection_types}),fr)};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}))}}_T.create=(t,e,n)=>new _T({left:t,right:e,typeName:pr.ZodIntersection,...Dr(n)});class hx extends ni{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==En.array)return un(r,{code:qt.invalid_type,expected:En.array,received:r.parsedType}),fr;if(r.data.length<this._def.items.length)return un(r,{code:qt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),fr;!this._def.rest&&r.data.length>this._def.items.length&&(un(r,{code:qt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Bm(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>jc.mergeArray(n,a)):jc.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new hx({...this._def,rest:e})}}hx.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hx({items:t,typeName:pr.ZodTuple,rest:null,...Dr(e)})};class aH extends ni{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==En.map)return un(r,{code:qt.invalid_type,expected:En.map,received:r.parsedType}),fr;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new Bm(r,o,r.path,[u,"key"])),value:s._parse(new Bm(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 fr;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.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 fr;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}}}}aH.create=(t,e,n)=>new aH({valueType:e,keyType:t,typeName:pr.ZodMap,...Dr(n)});class aS extends ni{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==En.set)return un(r,{code:qt.invalid_type,expected:En.set,received:r.parsedType}),fr;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(un(r,{code:qt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(un(r,{code:qt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return fr;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new Bm(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new aS({...this._def,minSize:{value:e,message:Nn.toString(n)}})}max(e,n){return new aS({...this._def,maxSize:{value:e,message:Nn.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}aS.create=(t,e)=>new aS({valueType:t,minSize:null,maxSize:null,typeName:pr.ZodSet,...Dr(e)});class oH extends ni{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}oH.create=(t,e)=>new oH({getter:t,typeName:pr.ZodLazy,...Dr(e)});class f4 extends ni{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return un(n,{received:n.data,code:qt.invalid_literal,expected:this._def.value}),fr}
vendor: 5,063 bytes, line 603
603return{status:"valid",value:e.data}}get value(){return this._def.value}}f4.create=(t,e)=>new f4({value:t,typeName:pr.ZodLiteral,...Dr(e)});function Wne(t,e){return new qb({values:t,typeName:pr.ZodEnum,...Dr(e)})}class qb extends ni{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return un(n,{expected:oi.joinValues(r),received:n.parsedType,code:qt.invalid_type}),fr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return un(n,{received:n.data,code:qt.invalid_enum_value,options:r}),fr}return Nu(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return qb.create(e,{...this._def,...n})}exclude(e,n=this._def){return qb.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}qb.create=Wne;class lH extends ni{_parse(e){const n=oi.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==En.string&&r.parsedType!==En.number){const i=oi.objectValues(n);return un(r,{expected:oi.joinValues(i),received:r.parsedType,code:qt.invalid_type}),fr}if(this._cache||(this._cache=new Set(oi.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=oi.objectValues(n);return un(r,{received:r.data,code:qt.invalid_enum_value,options:i}),fr}return Nu(e.data)}get enum(){return this._def.values}}lH.create=(t,e)=>new lH({values:t,typeName:pr.ZodNativeEnum,...Dr(e)});class ST extends ni{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==En.promise&&n.common.async===!1)return un(n,{code:qt.invalid_type,expected:En.promise,received:n.parsedType}),fr;const r=n.parsedType===En.promise?n.data:Promise.resolve(n.data);return Nu(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ST.create=(t,e)=>new ST({type:t,typeName:pr.ZodPromise,...Dr(e)});class Xb extends ni{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{un(r,a),a.fatal?n.abort():n.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(n.value==="aborted")return fr;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?fr:l.status==="dirty"||n.value==="dirty"?C_(l.value):l});{if(n.value==="aborted")return fr;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?fr:o.status==="dirty"||n.value==="dirty"?C_(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"?fr:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?fr:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.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(!Kb(a))return fr;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:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Kb(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):fr);oi.assertNever(i)}}Xb.create=(t,e,n)=>new Xb({schema:t,typeName:pr.ZodEffects,effect:e,...Dr(n)});Xb.createWithPreprocess=(t,e,n)=>new Xb({schema:e,effect:{type:"preprocess",transform:t},typeName:pr.ZodEffects,...Dr(n)});class wm extends ni{_parse(e){return this._getType(e)===En.undefined?Nu(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wm.create=(t,e)=>new wm({innerType:t,typeName:pr.ZodOptional,...Dr(e)});class Yb extends ni{_parse(e){return this._getType(e)===En.null?Nu(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yb.create=(t,e)=>new Yb({innerType:t,typeName:pr.ZodNullable,...Dr(e)});class p4 extends ni{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===En.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}p4.create=(t,e)=>
vendor: 3,350 bytes, line 603
603new p4({innerType:t,typeName:pr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Dr(e)});class m4 extends ni{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return yT(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new If(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new If(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}m4.create=(t,e)=>new m4({innerType:t,typeName:pr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Dr(e)});class cH extends ni{_parse(e){if(this._getType(e)!==En.nan){const r=this._getOrReturnCtx(e);return un(r,{code:qt.invalid_type,expected:En.nan,received:r.parsedType}),fr}return{status:"valid",value:e.data}}}cH.create=t=>new cH({typeName:pr.ZodNaN,...Dr(t)});class bCe extends ni{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class PO extends ni{_parse(e){const{status:n,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"?fr:s.status==="dirty"?(n.dirty(),C_(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"?fr:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new PO({in:e,out:n,typeName:pr.ZodPipeline})}}class g4 extends ni{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Kb(i)&&(i.value=Object.freeze(i.value)),i);return yT(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}g4.create=(t,e)=>new g4({innerType:t,typeName:pr.ZodReadonly,...Dr(e)});Is.lazycreate;var pr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(pr||(pr={}));const Xh=am.create;Fm.create;xh.create;const wCe=Is.create;Is.strictCreate;wT.create;_T.create;hx.create;const uH=f4.create;qb.create;ST.create;wm.create;Yb.create;const pA=E.forwardRef(({className:t,...e},n)=>c.jsx("textarea",{className:rn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
603ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));pA.displayName="Textarea";var lM="Checkbox",[_Ce,pqe]=ja(lM),[SCe,LO]=_Ce(lM);function ACe(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:h}=t,[p,f]=Ja({prop:n,defaultProp:i??!1,onChange:l,caller:lM}),[m,x]=E.useState(null),[v,g]=E.useState(null),b=E.useRef(!1),y=m?!!a||!!m.closest("form"):!0,S={checked:p,disabled:s,setChecked:f,control:m,setControl:x,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:_m(i)?!1:i,isFormControl:y,bubbleInput:v,setBubbleInput:g};return c.jsx(SCe,{scope:e,...S,children:ECe(h)?h(S):r})}var $ne="CheckboxTrigger",Kne=E.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:s,value:a,disabled:o,checked:l,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:f,bubbleInput:m}=LO($ne,t),x=ur(i,d),v=E.useRef(l);return E.useEffect(()=>{const g=s==null?void 0:s.form;if(g){const b=()=>h(v.current);return g.addEventListener("reset",b),()=>g.removeEventListener("reset",b)}},[s,h]),c.jsx(vn.button,{type:"button",role:"checkbox","aria-checked":_m(l)?"mixed":l,"aria-required":u,"data-state":Zne(l),"data-disabled":o?"":void 0,disabled:o,value:a,...r,ref:x,onKeyDown:cn(e,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:cn(n,g=>{h(b=>_m(b)?!0:!b),m&&f&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})})});Kne.displayName=$ne;var IO=E.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l,onCheckedChange:u,form:d,...h}=t;return c.jsx(ACe,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>c.jsxs(c.Fragment,{children:[c.jsx(Kne,{...h,ref:e,__scopeCheckbox:n}),p&&c.jsx(Jne,{__scopeCheckbox:n})]})})});IO.displayName=lM;var qne="CheckboxIndicator",Xne=E.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,s=LO(qne,n);return c.jsx(Cu,{present:r||_m(s.checked)||s.checked===!0,children:c.jsx(vn.span,{"data-state":Zne(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});Xne.displayName=qne;var Yne="CheckboxBubbleInput",Jne=E.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:l,name:u,value:d,form:h,bubbleInput:p,setBubbleInput:f}=LO(Yne,t),m=ur(n,f),x=hA(s),v=qS(r);E.useEffect(()=>{const b=p;if(!b)return;const y=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(y,"checked").set,k=!i.current;if(x!==s&&A){const M=new Event("click",{bubbles:k});b.indeterminate=_m(s),A.call(b,_m(s)?!1:s),b.dispatchEvent(M)}},[p,x,s,i]);const g=E.useRef(_m(s)?!1:s);return c.jsx(vn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??g.current,required:o,disabled:l,name:u,value:d,form:h,...e,tabIndex:-1,ref:m,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Jne.displayName=Yne;function ECe(t){return typeof t=="function"}function _m(t){return t==="indeterminate"}function Zne(t){return _m(t)?"indeterminate":t?"checked":"unchecked"}const G0=E.forwardRef(({className:t,...e},n)=>c.jsx(IO,{ref:n,className:rn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Xne,{className:rn("flex items-center justify-center text-current"),children:c.jsx(ti,{className:"h-4 w-4"})})}));G0.displayName=IO.displayName;const kCe="modulepreload",CCe=function(t){return"/"+t},dH={},KC=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=CCe(l),l in dH)return;dH[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");
vendor: 4,610 bytes, line 603
603if(h.rel=u?"stylesheet":kCe,u||(h.as="script"),h.crossOrigin="",h.href=l,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((p,f)=>{h.addEventListener("load",p),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}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)})};function Si(t){"@babel/helpers - typeof";return Si=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},Si(t)}var wd=Uint8Array,Sc=Uint16Array,DO=Int32Array,BO=new wd([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),FO=new wd([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),hH=new wd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qne=function(t,e){for(var n=new Sc(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new DO(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},ere=Qne(BO,2),NCe=ere.b,x4=ere.r;NCe[28]=258,x4[258]=28;var TCe=Qne(FO,0),fH=TCe.r,v4=new Sc(32768);for(var Yi=0;Yi<32768;++Yi){var pp=(Yi&43690)>>1|(Yi&21845)<<1;pp=(pp&52428)>>2|(pp&13107)<<2,pp=(pp&61680)>>4|(pp&3855)<<4,v4[Yi]=((pp&65280)>>8|(pp&255)<<8)>>1}var e2=function(t,e,n){for(var r=t.length,i=0,s=new Sc(e);i<r;++i)t[i]&&++s[t[i]-1];var a=new Sc(e);for(i=1;i<e;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new Sc(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],d=e-t[i],h=a[t[i]-1]++<<d,p=h|(1<<d)-1;h<=p;++h)o[v4[h]>>l]=u}else for(o=new Sc(r),i=0;i<r;++i)t[i]&&(o[i]=v4[a[t[i]-1]++]>>15-t[i]);return o},fx=new wd(288);for(var Yi=0;Yi<144;++Yi)fx[Yi]=8;for(var Yi=144;Yi<256;++Yi)fx[Yi]=9;for(var Yi=256;Yi<280;++Yi)fx[Yi]=7;for(var Yi=280;Yi<288;++Yi)fx[Yi]=8;var AT=new wd(32);for(var Yi=0;Yi<32;++Yi)AT[Yi]=5;var MCe=e2(fx,9,0),RCe=e2(AT,5,0),tre=function(t){return(t+7)/8|0},jCe=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new wd(t.subarray(e,n))},Yh=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},Ww=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},DR=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return{t:rre,l:0};if(i==1){var a=new wd(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(A,k){return A.f-k.f}),n.push({s:-1,f:25001});var o=n[0],l=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};d!=i-1;)o=n[n[u].f<n[h].f?u++:h++],l=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:o.f+l.f,l:o,r:l};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var f=new Sc(p+1),m=y4(n[d-1],f,0);if(m>e){var r=0,x=0,v=m-e,g=1<<v;for(s.sort(function(k,M){return f[M.s]-f[k.s]||k.f-M.f});r<i;++r){var b=s[r].s;if(f[b]>e)x+=g-(1<<m-f[b]),f[b]=e;else break}for(x>>=v;x>0;){var y=s[r].s;f[y]<e?x-=1<<e-f[y]++-1:++r}for(;r>=0&&x;--r){var S=s[r].s;f[S]==e&&(--f[S],++x)}m=e}return{t:new wd(f),l:m}},y4=function(t,e,n){return t.s==-1?Math.max(y4(t.l,e,n+1),y4(t.r,e,n+1)):e[t.s]=n},pH=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Sc(++e),r=0,i=t[0],s=1,a=function(l){n[r++]=l},o=1;o<=e;++o)if(t[o]==i&&o!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=t[o]}return{c:n.subarray(0,r),n:e}},$w=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},nre=function(t,e,n){var r=n.length,i=tre(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var s=0;s<r;++s)t[i+s+4]=n[s];return(i+4+r)*8},mH=function(t,e,n,r,i,s,a,o,l,u,d){Yh(e,d++,n),++i[256];for(var h=DR(i,15),p=h.t,f=h.l,m=DR(s,15),x=m.t,v=m.l,g=pH(p),b=g.c,y=g.n,S=pH(x),A=S.c,k=S.n,M=new Sc(19),T=0;T<b.length;++T)++M[b[T]&31];for(var T=0;T<A.length;++T)++M[A[T]&31];for(var C=DR(M,7),R=C.t,P=C.l,j=19;j>4&&!R[hH[j-1]];--j);var G=u+5<<3,B=$w(i,fx)+$w(s,AT)+a,$=$w(i,p)+$w(s,x)+a+14+3*j+$w(M,R)+2*M[16]+3*M[17]+7*M[18];if(l>=0&&G<=B&&G<=$)return nre(e,d,t.subarray(l,l+u));var U,Z,V,W;if(Yh(e,d,1+($<B)),d+=2,$<B){U=e2(p,f,0),Z=p,V=e2(x,v,0),W=x;var O=e2(R,P,0);Yh(e,d,y-257),Yh(e,d+5,k-1),Yh(e,d+10,j-4),d+=14;for(var T=0;T<j;++T)Yh(e,d+3*T,R[hH[T]]);d+=3*j;for(var Y=[b,A],z=0;z<2;++z)for(var I=Y[z],T=0;T<I.length;++T){var q=I[T]&31;Yh(e,d,O[q]),d+=R[q],q>15&&(Yh(e,d,I[T]>>5&127),d+=I[T]>>12)}}else U=MCe,Z=fx,V=RCe,W=AT;for(var T=0;T<o;++T){var te=r[T];
vendor: 1,109 bytes, line 603
603if(te>255){var q=te>>18&31;Ww(e,d,U[q+257]),d+=Z[q+257],q>7&&(Yh(e,d,te>>23&31),d+=BO[q]);var se=te&31;Ww(e,d,V[se]),d+=W[se],se>3&&(Ww(e,d,te>>5&8191),d+=FO[se])}else Ww(e,d,U[te]),d+=Z[te]}return Ww(e,d,U[256]),d+Z[256]},PCe=new DO([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rre=new wd(0),LCe=function(t,e,n,r,i,s){var a=s.z||t.length,o=new wd(r+a+5*(1+Math.ceil(a/7e3))+i),l=o.subarray(r,o.length-i),u=s.l,d=(s.r||0)&7;if(e){d&&(l[0]=s.r>>3);for(var h=PCe[e-1],p=h>>13,f=h&8191,m=(1<<n)-1,x=s.p||new Sc(32768),v=s.h||new Sc(m+1),g=Math.ceil(n/3),b=2*g,y=function(Ae){return(t[Ae]^t[Ae+1]<<g^t[Ae+2]<<b)&m},S=new DO(25e3),A=new Sc(288),k=new Sc(32),M=0,T=0,C=s.i||0,R=0,P=s.w||0,j=0;C+2<a;++C){var G=y(C),B=C&32767,$=v[G];if(x[B]=$,v[G]=B,P<=C){var U=a-C;if((M>7e3||R>24576)&&(U>423||!u)){d=mH(t,l,0,S,A,k,T,R,j,C-j,d),R=M=T=0,j=C;for(var Z=0;Z<286;++Z)A[Z]=0;for(var Z=0;Z<30;++Z)k[Z]=0}var V=2,W=0,O=f,Y=B-$&32767;if(U>2&&G==y(C-Y))for(var z=Math.min(p,U)-1,I=Math.min(32767,C),q=Math.min(258,U);Y<=I&&--O&&B!=$;){if(t[C+V]==t[C+V-Y]){for(var te=0;te<q&&t[C+te]==t[C+te-Y];++te);
vendor: 8,970 bytes, lines 603-604
603if(te>V){if(V=te,W=Y,te>z)break;for(var se=Math.min(Y,te-2),ie=0,Z=0;Z<se;++Z){var le=C-Y+Z&32767,xe=x[le],Ee=le-xe&32767;Ee>ie&&(ie=Ee,$=le)}}}B=$,$=x[B],Y+=B-$&32767}if(W){S[R++]=268435456|x4[V]<<18|fH[W];var ae=x4[V]&31,Q=fH[W]&31;T+=BO[ae]+FO[Q],++A[257+ae],++k[Q],P=C+V,++M}else S[R++]=t[C],++A[t[C]]}}for(C=Math.max(C,P);C<a;++C)S[R++]=t[C],++A[t[C]];d=mH(t,l,u,S,A,k,T,R,j,C-j,d),u||(s.r=d&7|l[d/8|0]<<3,d-=7,s.h=v,s.p=x,s.i=C,s.w=P)}else{for(var C=s.w||0;C<a+u;C+=65535){var we=C+65535;we>=a&&(l[d/8|0]=u,we=a),d=nre(l,d+1,t.subarray(C,we))}s.i=a}return jCe(o,0,r+tre(d)+i)},ire=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,s=n.length|0,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},ICe=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),a=new wd(s.length+t.length);a.set(s),a.set(t,s.length),t=a,i.w=s.length}return LCe(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},sre=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},DCe=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=ire();i.p(e.dictionary),sre(t,2,i.d())}};function b4(t,e){e||(e={});var n=ire();n.p(t);var r=ICe(t,e,e.dictionary?6:2,4);return DCe(r,e),sre(r,r.length-4,n.d()),r}var BCe=typeof TextDecoder<"u"&&new TextDecoder,FCe=0;try{BCe.decode(rre,{stream:!0}),FCe=1}catch{}function OCe(t){if(Array.isArray(t))return t}function zCe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function gH(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function UCe(t,e){if(t){if(typeof t=="string")return gH(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gH(t,e):void 0}}function HCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 604In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xH(t,e){return OCe(t)||zCe(t,e)||UCe(t,e)||HCe()}function vH(t,e="utf8"){return new TextDecoder(e).decode(t)}const GCe=new TextEncoder;function VCe(t){return GCe.encode(t)}const WCe=1024*8,$Ce=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),BR={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class OO{constructor(e=WCe,n={}){$n(this,"buffer");$n(this,"byteLength");$n(this,"byteOffset");$n(this,"length");$n(this,"offset");$n(this,"lastWrittenByte");$n(this,"littleEndian");$n(this,"_data");$n(this,"_mark");$n(this,"_marks");let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=n.offset?n.offset>>>0:0,s=e.byteLength-i;let a=i;(ArrayBuffer.isView(e)||e instanceof OO)&&(e.byteLength!==e.buffer.byteLength&&(a=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=e,this.length=s,this.byteLength=s,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,s),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=BR[n].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+r);if(this.littleEndian===$Ce&&n!=="uint8"&&n!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+r));o.reverse();const l=new BR[n](o.buffer);return this.offset+=r,l.reverse(),l}const a=new BR[n](s);return this.offset+=r,a}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return vH(this.readBytes(e))}decodeText(e=1,n="utf8"){return vH(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(VCe(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const KCe=4,yH=0,bH=1,qCe=2;function W1(t){let e=t.length;for(;--e>=0;)t[e]=0}const XCe=0,are=1,YCe=2,JCe=3,ZCe=258,zO=29,mA=256,oS=mA+1+zO,ib=30,UO=19,ore=2*oS+1,x0=15,FR=16,QCe=7,HO=256,lre=16,cre=17,ure=18,w4=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),qC=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),eNe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),dre=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t
vendor: 27,592 bytes, line 604
604Ne=512,df=new Array((oS+2)*2);W1(df);const t2=new Array(ib*2);W1(t2);const lS=new Array(tNe);W1(lS);const cS=new Array(ZCe-JCe+1);W1(cS);const GO=new Array(zO);W1(GO);const ET=new Array(ib);W1(ET);function OR(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let hre,fre,pre;function zR(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const mre=t=>t<256?lS[t]:lS[256+(t>>>7)],uS=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},Wl=(t,e,n)=>{t.bi_valid>FR-n?(t.bi_buf|=e<<t.bi_valid&65535,uS(t,t.bi_buf),t.bi_buf=e>>FR-t.bi_valid,t.bi_valid+=n-FR):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},oh=(t,e,n)=>{Wl(t,n[e*2],n[e*2+1])},gre=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},nNe=t=>{t.bi_valid===16?(uS(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},rNe=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,d,h,p,f,m,x=0;for(p=0;p<=x0;p++)t.bl_count[p]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;u<ore;u++)d=t.heap[u],p=n[n[d*2+1]*2+1]+1,p>l&&(p=l,x++),n[d*2+1]=p,!(d>r)&&(t.bl_count[p]++,f=0,d>=o&&(f=a[d-o]),m=n[d*2],t.opt_len+=m*(p+f),s&&(t.static_len+=m*(i[d*2+1]+f)));if(x!==0){do{for(p=l-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[l]--,x-=2}while(x>0);for(p=l;p!==0;p--)for(d=t.bl_count[p];d!==0;)h=t.heap[--u],!(h>r)&&(n[h*2+1]!==p&&(t.opt_len+=(p-n[h*2+1])*n[h*2],n[h*2+1]=p),d--)}},xre=(t,e,n)=>{const r=new Array(x0+1);let i=0,s,a;for(s=1;s<=x0;s++)i=i+n[s-1]<<1,r[s]=i;for(a=0;a<=e;a++){let o=t[a*2+1];o!==0&&(t[a*2]=gre(r[o]++,o))}},iNe=()=>{let t,e,n,r,i;const s=new Array(x0+1);for(n=0,r=0;r<zO-1;r++)for(GO[r]=n,t=0;t<1<<w4[r];t++)cS[n++]=r;for(cS[n-1]=r,i=0,r=0;r<16;r++)for(ET[r]=i,t=0;t<1<<qC[r];t++)lS[i++]=r;for(i>>=7;r<ib;r++)for(ET[r]=i<<7,t=0;t<1<<qC[r]-7;t++)lS[256+i++]=r;for(e=0;e<=x0;e++)s[e]=0;for(t=0;t<=143;)df[t*2+1]=8,t++,s[8]++;for(;t<=255;)df[t*2+1]=9,t++,s[9]++;for(;t<=279;)df[t*2+1]=7,t++,s[7]++;for(;t<=287;)df[t*2+1]=8,t++,s[8]++;for(xre(df,oS+1,s),t=0;t<ib;t++)t2[t*2+1]=5,t2[t*2]=gre(t,5);hre=new OR(df,w4,mA+1,oS,x0),fre=new OR(t2,qC,0,ib,x0),pre=new OR(new Array(0),eNe,0,UO,QCe)},vre=t=>{let e;for(e=0;e<oS;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ib;e++)t.dyn_dtree[e*2]=0;for(e=0;e<UO;e++)t.bl_tree[e*2]=0;t.dyn_ltree[HO*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},yre=t=>{t.bi_valid>8?uS(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},wH=(t,e,n,r)=>{const i=e*2,s=n*2;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},UR=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&wH(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!wH(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},_H=(t,e,n)=>{let r,i,s=0,a,o;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+s++]&255,r+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],r===0?oh(t,i,e):(a=cS[i],oh(t,a+mA+1,e),o=w4[a],o!==0&&(i-=GO[a],Wl(t,i,o)),r--,a=mre(r),oh(t,a,n),o=qC[a],o!==0&&(r-=ET[a],Wl(t,r,o)));while(s<t.sym_next);oh(t,HO,e)},_4=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let a,o,l=-1,u;for(t.heap_len=0,t.heap_max=ore,a=0;a<s;a++)n[a*2]!==0?(t.heap[++t.heap_len]=l=a,t.depth[a]=0):n[a*2+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=l<2?++l:0,n[u*2]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[u*2+1]);for(e.max_code=l,a=t.heap_len>>1;a>=1;a--)UR(t,n,a);u=s;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],UR(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,n[u*2]=n[a*2]+n[o*2],t.depth[u]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,n[a*2+1]=n[o*2+1]=u,t.heap[1]=u++,UR(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],rNe(t,e),xre(n,l,t.bl_count)},SH=(t,e,n)=>{let r,i=-1,s,a=e[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)s=a,a=e[(r+1)*2+1],!(++o<l&&s===a)&&(o<u?t.bl_tree[s*2]+=o:s!==0?(s!==i&&t.bl_tree[s*2]++,t.bl_tree[lre*2]++):o<=10?t.bl_tree[cre*2]++:t.bl_tree[ure*2]++,o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4))},AH=(t,e,n)=>{let r,i=-1,s,a=e[0*2+1],o=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=n;r++)if(s=a,a=e[(r+1)*2+1],!(++o<l&&s===a)){if(o<u)do oh(t,s,t.bl_tree);while(--o!==0);else s!==0?(s!==i&&(oh(t,s,t.bl_tree),o--),oh(t,lre,t.bl_tree),Wl(t,o-3,2)):o<=10?(oh(t,cre,t.bl_tree),Wl(t,o-3,3)):(oh(t,ure,t.bl_tree),Wl(t,o-11,7));o=0,i=s,a===0?(l=138,u=3):s===a?(l=6,u=3):(l=7,u=4)}},sNe=t=>{let e;for(SH(t,t.dyn_ltree,t.l_desc.max_code),SH(t,t.dyn_dtree,t.d_desc.max_code),_4(t,t.bl_desc),e=UO-1;e>=3&&t.bl_tree[dre[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},aNe=(t,e,n,r)=>{let i;for(Wl(t,e-257,5),Wl(t,n-1,5),Wl(t,r-4,4),i=0;i<r;i++)Wl(t,t.bl_tree[dre[i]*2+1],3);AH(t,t.dyn_ltree,e-1),AH(t,t.dyn_dtree,n-1)},oNe=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return yH;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return bH;for(n=32;n<mA;n++)if(t.dyn_ltree[n*2]!==0)return bH;return yH};let EH=!1;const lNe=t=>{EH||(iNe(),EH=!0),t.l_desc=new zR(t.dyn_ltree,hre),t.d_desc=new zR(t.dyn_dtree,fre),t.bl_desc=new zR(t.bl_tree,pre),t.bi_buf=0,t.bi_valid=0,vre(t)},bre=(t,e,n,r)=>{Wl(t,(XCe<<1)+(r?1:0),3),yre(t),uS(t,n),uS(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},cNe=t=>{Wl(t,are<<1,3),oh(t,HO,df),nNe(t)},uNe=(t,e,n,r)=>{let i,s,a=0;t.level>0?(t.strm.data_type===qCe&&(t.strm.data_type=oNe(t)),_4(t,t.l_desc),_4(t,t.d_desc),a=sNe(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&e!==-1?bre(t,e,n,r):t.strategy===KCe||s===i?(Wl(t,(are<<1)+(r?1:0),3),_H(t,df,t2)):(Wl(t,(YCe<<1)+(r?1:0),3),aNe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),_H(t,t.dyn_ltree,t.dyn_dtree)),vre(t),r&&yre(t)},dNe=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(cS[n]+mA+1)*2]++,t.dyn_dtree[mre(e)*2]++),t.sym_next===t.sym_end);var hNe=lNe,fNe=bre,pNe=uNe,mNe=dNe,gNe=cNe,xNe={_tr_init:hNe,_tr_stored_block:fNe,_tr_flush_block:pNe,_tr_tally:mNe,_tr_align:gNe};const vNe=(t,e,n,r)=>{let i=t&65535|0,s=t>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+e[r++]|0,s=s+i|0;while(--a);i%=65521,s%=65521}return i|s<<16|0};var dS=vNe;const yNe=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},bNe=new Uint32Array(yNe()),wNe=(t,e,n,r)=>{const i=bNe,s=r+n;t^=-1;for(let a=r;a<s;a++)t=t>>>8^i[(t^e[a])&255];return t^-1};var Va=wNe,Jb={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},gA={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:_Ne,_tr_stored_block:S4,_tr_flush_block:SNe,_tr_tally:Sm,_tr_align:ANe}=xNe,{Z_NO_FLUSH:Am,Z_PARTIAL_FLUSH:ENe,Z_FULL_FLUSH:kNe,Z_FINISH:cu,Z_BLOCK:kH,Z_OK:fo,Z_STREAM_END:CH,Z_STREAM_ERROR:vh,Z_DATA_ERROR:CNe,Z_BUF_ERROR:HR,Z_DEFAULT_COMPRESSION:NNe,Z_FILTERED:TNe,Z_HUFFMAN_ONLY:XE,Z_RLE:MNe,Z_FIXED:RNe,Z_DEFAULT_STRATEGY:jNe,Z_UNKNOWN:PNe,Z_DEFLATED:cM}=gA,LNe=9,INe=15,DNe=8,BNe=29,FNe=256,A4=FNe+1+BNe,ONe=30,zNe=19,UNe=2*A4+1,HNe=15,$r=3,om=258,yh=om+$r+1,GNe=32,Zb=42,VO=57,E4=69,k4=73,C4=91,N4=103,v0=113,N_=666,pl=1,$1=2,px=3,K1=4,VNe=3,y0=(t,e)=>(t.msg=Jb[e],e),NH=t=>t*2-(t>4?9:0),Wp=t=>{let e=t.length;for(;--e>=0;)t[e]=0},WNe=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let $Ne=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,Em=$Ne;const mc=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},Ac=(t,e)=>{SNe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mc(t.strm)},pi=(t,e)=>{t.pending_buf[t.pending++]=e},Kw=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},T4=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=dS(t.adler,e,i,n):t.state.wrap===2&&(t.adler=Va(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},wre=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,s,a=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-yh?t.strstart-(t.w_size-yh):0,u=t.window,d=t.w_mask,h=t.prev,p=t.strstart+om;let f=u[r+a-1],m=u[r+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(i=e,!(u[i+a]!==m||u[i+a-1]!==f||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<p);if(s=om-(p-r),r=p-om,s>a){if(t.match_start=e,a=s,s>=o)break;f=u[r+a-1],m=u[r+a]}}while((e=h[e&d])>l&&--n!==0);return a<=t.lookahead?a:t.lookahead},Qb=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-yh)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),WNe(t),r+=e),t.strm.avail_in===0)break;if(n=T4(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=$r)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Em(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Em(t,t.ins_h,t.window[i+$r-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<$r)););}while(t.lookahead<yh&&t.strm.avail_in!==0)},_re=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,s,a=0,o=t.strm.avail_in;do{if(r=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>s&&(r=s),r<n&&(r===0&&e!==cu||e===Am||r!==i+t.strm.avail_in)))break;a=e===cu&&r===i+t.strm.avail_in?1:0,S4(t,0,0,a),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,mc(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(T4(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(a===0);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?K1:e!==Am&&e!==cu&&t.strm.avail_in===0&&t.strstart===t.block_start?$1:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(T4(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,n=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=n||(i||e===cu)&&e!==Am&&t.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,a=e===cu&&t.strm.avail_in===0&&r===i?1:0,S4(t,t.block_start,r,a),t.block_start+=r,mc(t.strm)),a?px:pl)},GR=(t,e)=>{let n,r;for(;;){if(t.lookahead<yh){if(Qb(t),t.lookahead<yh&&e===Am)return pl;if(t.lookahead===0)break}if(n=0,t.lookahead>=$r&&(t.ins_h=Em(t,t.ins_h,t.window[t.strstart+$r-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-yh&&(t.match_length=wre(t,n)),t.match_length>=$r)if(r=Sm(t,t.strstart-t.match_start,t.match_length-$r),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=$r){t.match_length--;do t.strstart++,t.ins_h=Em(t,t.ins_h,t.window[t.strstart+$r-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Em(t,t.ins_h,t.window[t.strstart+1]);else r=Sm(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Ac(t,!1),t.strm.avail_out===0))return pl}return t.insert=t.strstart<$r-1?t.strstart:$r-1,e===cu?(Ac(t,!0),t.strm.avail_out===0?px:K1):t.sym_next&&(Ac(t,!1),t.strm.avail_out===0)?pl:$1},wv=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<yh){if(Qb(t),t.lookahead<yh&&e===Am)return pl;if(t.lookahead===0)break}if(n=0,t.lookahead>=$r&&(t.ins_h=Em(t,t.ins_h,t.window[t.strstart+$r-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=$r-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-yh&&(t.match_length=wre(t,n),t.match_length<=5&&(t.strategy===TNe||t.match_length===$r&&t.strstart-t.match_start>4096)&&(t.match_length=$r-1)),t.prev_length>=$r&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-$r,r=Sm(t,t.strstart-1-t.prev_match,t.prev_length-$r),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Em(t,t.ins_h,t.window[t.strstart+$r-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=$r-1,t.strstart++,r&&(Ac(t,!1),t.strm.avail_out===0))return pl}else if(t.match_available){if(r=Sm(t,0,t.window[t.strstart-1]),r&&Ac(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return pl}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Sm(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<$r-1?t.strstart:$r-1,e===cu?(Ac(t,!0),t.strm.avail_out===0?px:K1):t.sym_next&&(Ac(t,!1),t.strm.avail_out===0)?pl:$1},KNe=(t,e)=>{let n,r,i,s;const a=t.window;for(;;){if(t.lookahead<=om){if(Qb(t),t.lookahead<=om&&e===Am)return pl;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=$r&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){s=t.strstart+om;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);t.match_length=om-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=$r?(n=Sm(t,1,t.match_length-$r),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Sm(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(Ac(t,!1),t.strm.avail_out===0))return pl}return t.insert=0,e===cu?(Ac(t,!0),t.strm.avail_out===0?px:K1):t.sym_next&&(Ac(t,!1),t.strm.avail_out===0)?pl:$1},qNe=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(Qb(t),t.lookahead===0)){if(e===Am)return pl;break}if(t.match_length=0,n=Sm(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(Ac(t,!1),t.strm.avail_out===0))return pl}return t.insert=0,e===cu?(Ac(t,!0),t.strm.avail_out===0?px:K1):t.sym_next&&(Ac(t,!1),t.strm.avail_out===0)?pl:$1};function Kd(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const T_=[new Kd(0,0,0,0,_re),new Kd(4,4,8,4,GR),new Kd(4,5,16,8,GR),new Kd(4,6,32,32,GR),new Kd(4,4,16,16,wv),new Kd(8,16,32,32,wv),new Kd(8,16,128,128,wv),new Kd(8,32,128,256,wv),new Kd(32,128,258,1024,wv),new Kd(32,258,258,4096,wv)],XNe=t=>{t.window_size=2*t.w_size,Wp(t.head),t.max_lazy_match=T_[t.level].max_lazy,t.good_match=T_[t.level].good_length,t.nice_match=T_[t.level].nice_length,t.max_chain_length=T_[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=$r-1,t.match_available=0,t.ins_h=0};function YNe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=cM,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(UNe*2),this.dyn_dtree=new Uint16Array((2*ONe+1)*2),this.bl_tree=new Uint16Array((2*zNe+1)*2),Wp(this.dyn_ltree),Wp(this.dyn_dtree),Wp(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(HNe+1),this.heap=new Uint16Array(2*A4+1),Wp(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*A4+1),Wp(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xA=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Zb&&e.status!==VO&&e.status!==E4&&e.status!==k4&&e.status!==C4&&e.status!==N4&&e.status!==v0&&e.status!==N_?1:0},Sre=t=>{if(xA(t))return y0(t,vh);t.total_in=t.total_out=0,t.data_type=PNe;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?VO:e.wrap?Zb:v0,t.adler=e.wrap===2?0:1,e.last_flush=-2,_Ne(e),fo},Are=t=>{const e=Sre(t);return e===fo&&XNe(t.state),e},JNe=(t,e)=>xA(t)||t.state.wrap!==2?vh:(t.state.gzhead=e,fo),Ere=(t,e,n,r,i,s)=>{if(!t)return vh;let a=1;if(e===NNe&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>LNe||n!==cM||r<8||r>15||e<0||e>9||s<0||s>RNe||r===8&&a!==1)return y0(t,vh);r===8&&(r=9);const o=new YNe;return t.state=o,o.strm=t,o.status=Zb,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+$r-1)/$r),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=s,o.method=n,Are(t)},ZNe=(t,e)=>Ere(t,e,cM,INe,DNe,jNe),QNe=(t,e)=>{if(xA(t)||e>kH||e<0)return t?y0(t,vh):vh;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===N_&&e!==cu)return y0(t,t.avail_out===0?HR:vh);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(mc(t),t.avail_out===0)return n.last_flush=-1,fo}else if(t.avail_in===0&&NH(e)<=NH(r)&&e!==cu)return y0(t,HR);if(n.status===N_&&t.avail_in!==0)return y0(t,HR);if(n.status===Zb&&n.wrap===0&&(n.status=v0),n.status===Zb){let i=cM+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=XE||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=GNe),i+=31-i%31,Kw(n,i),n.strstart!==0&&(Kw(n,t.adler>>>16),Kw(n,t.adler&65535)),t.adler=1,n.status=v0,mc(t),n.pending!==0)return n.last_flush=-1,fo}if(n.status===VO){if(t.adler=0,pi(n,31),pi(n,139),pi(n,8),n.gzhead)pi(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),pi(n,n.gzhead.time&255),pi(n,n.gzhead.time>>8&255),pi(n,n.gzhead.time>>16&255),pi(n,n.gzhead.time>>24&255),pi(n,n.level===9?2:n.strategy>=XE||n.level<2?4:0),pi(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(pi(n,n.gzhead.extra.length&255),pi(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Va(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=E4;else if(pi(n,0),pi(n,0),pi(n,0),pi(n,0),pi(n,0),pi(n,n.level===9?2:n.strategy>=XE||n.level<2?4:0),pi(n,VNe),n.status=v0,mc(t),n.pending!==0)return n.last_flush=-1,fo}if(n.status===E4){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=o,mc(t),n.pending!==0)return n.last_flush=-1,fo;i=0,s-=o}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=k4}if(n.status===k4){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i)),mc(t),n.pending!==0)return n.last_flush=-1,fo;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,pi(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=C4}if(n.status===C4){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i)),mc(t),n.pending!==0)return n.last_flush=-1,fo;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,pi(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Va(t.adler,n.pending_buf,n.pending-i,i))}n.status=N4}if(n.status===N4){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(mc(t),n.pending!==0))return n.last_flush=-1,fo;pi(n,t.adler&255),pi(n,t.adler>>8&255),t.adler=0}if(n.status=v0,mc(t),n.pending!==0)return n.last_flush=-1,fo}if(t.avail_in!==0||n.lookahead!==0||e!==Am&&n.status!==N_){let i=n.level===0?_re(n,e):n.strategy===XE?qNe(n,e):n.strategy===MNe?KNe(n,e):T_[n.level].func(n,e);if((i===px||i===K1)&&(n.status=N_),i===pl||i===px)return t.avail_out===0&&(n.last_flush=-1),fo;if(i===$1&&(e===ENe?ANe(n):e!==kH&&(S4(n,0,0,!1),e===kNe&&(Wp(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),mc(t),t.avail_out===0))return n.last_flush=-1,fo}return e!==cu?fo:n.wrap<=0?CH:(n.wrap===2?(pi(n,t.adler&255),pi(n,t.adler>>8&255),pi(n,t.adler>>16&255),pi(n,t.adler>>24&255),pi(n,t.total_in&255),pi(n,t.total_in>>8&255),pi(n,t.total_in>>16&255),pi(n,t.total_in>>24&255)):(Kw(n,t.adler>>>16),Kw(n,t.adler&65535)),mc(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?fo:CH)},eTe=t=>{if(xA(t))return vh;const e=t.state.status;return t.state=null,e===v0?y0(t,CNe):fo},tTe=(t,e)=>{let n=e.length;if(xA(t))return vh;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==Zb||r.lookahead)return vh;if(i===1&&(t.adler=dS(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Wp(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(n-r.w_size,n),0),e=l,n=r.w_size}const s=t.avail_in,a=t.next_in,o=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Qb(r);r.lookahead>=$r;){let l=r.strstart,u=r.lookahead-($r-1);do r.ins_h=Em(r,r.ins_h,r.window[l+$r-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=$r-1,Qb(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=$r-1,r.match_available=0,t.next_in=a,t.input=o,t.avail_in=s,r.wrap=i,fo};var nTe=ZNe,rTe=Ere,iTe=Are,sTe=Sre,aTe=JNe,oTe=QNe,lTe=eTe,cTe=tTe,uTe="pako deflate (from Nodeca project)",n2={deflateInit:nTe,deflateInit2:rTe,deflateReset:iTe,deflateResetKeep:sTe,deflateSetHeader:aTe,deflate:oTe,deflateEnd:lTe,deflateSetDictionary:cTe,deflateInfo:uTe};const dTe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var hTe=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)dTe(n,r)&&(t[r]=n[r])}}return t},fTe=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,s=t.length;r<s;r++){let a=t[r];n.set(a,i),i+=a.length}return n},uM={assign:hTe,flattenChunks:fTe};let kre=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{kre=!1}const hS=new Uint8Array(256);for(let t=0;t<256;t++)hS[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;hS[254]=hS[254]=1;var pTe=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,s,a=t.length,o=0;for(i=0;i<a;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(o),s=0,i=0;s<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const mTe=(t,e)=>{if(e<65534&&t.subarray&&kre)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var gTe=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const s=new Array(n*2);for(i=0,r=0;r<n;){let a=t[r++];if(a<128){s[i++]=a;continue}let o=hS[a];if(o>4){s[i++]=65533,r+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&r<n;)a=a<<6|t[r++]&63,o--;if(o>1){s[i++]=65533;continue}a<65536?s[i++]=a:(a-=65536,s[i++]=55296|a>>10&1023,s[i++]=56320|a&1023)}return mTe(s,i)},xTe=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+hS[t[n]]>e?n:e},fS={string2buf:pTe,buf2string:gTe,utf8border:xTe};function vTe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Cre=vTe;const Nre=Object.prototype.toString,{Z_NO_FLUSH:yTe,Z_SYNC_FLUSH:bTe,Z_FULL_FLUSH:wTe,Z_FINISH:_Te,Z_OK:kT,Z_STREAM_END:STe,Z_DEFAULT_COMPRESSION:ATe,Z_DEFAULT_STRATEGY:ETe,Z_DEFLATED:kTe}=gA;function WO(t){this.options=uM.assign({level:ATe,method:kTe,chunkSize:16384,windowBits:15,memLevel:8,strategy:ETe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Cre,this.strm.avail_out=0;let n=n2.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==kT)throw new Error(Jb[n]);if(e.header&&n2.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=fS.string2buf(e.dictionary):Nre.call(e.dictionary)==="[object ArrayBuffer]"?r=new
vendor: 4,175 bytes, line 604
604Uint8Array(e.dictionary):r=e.dictionary,n=n2.deflateSetDictionary(this.strm,r),n!==kT)throw new Error(Jb[n]);this._dict_set=!0}}WO.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?_Te:yTe,typeof t=="string"?n.input=fS.string2buf(t):Nre.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===bTe||s===wTe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=n2.deflate(n,s),i===STe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=n2.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===kT;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};WO.prototype.onData=function(t){this.chunks.push(t)};WO.prototype.onEnd=function(t){t===kT&&(this.result=uM.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const YE=16209,CTe=16191;var NTe=function(e,n){let r,i,s,a,o,l,u,d,h,p,f,m,x,v,g,b,y,S,A,k,M,T,C,R;const P=e.state;r=e.next_in,C=e.input,i=r+(e.avail_in-5),s=e.next_out,R=e.output,a=s-(n-e.avail_out),o=s+(e.avail_out-257),l=P.dmax,u=P.wsize,d=P.whave,h=P.wnext,p=P.window,f=P.hold,m=P.bits,x=P.lencode,v=P.distcode,g=(1<<P.lenbits)-1,b=(1<<P.distbits)-1;e:do{m<15&&(f+=C[r++]<<m,m+=8,f+=C[r++]<<m,m+=8),y=x[f&g];t:for(;;){if(S=y>>>24,f>>>=S,m-=S,S=y>>>16&255,S===0)R[s++]=y&65535;else if(S&16){A=y&65535,S&=15,S&&(m<S&&(f+=C[r++]<<m,m+=8),A+=f&(1<<S)-1,f>>>=S,m-=S),m<15&&(f+=C[r++]<<m,m+=8,f+=C[r++]<<m,m+=8),y=v[f&b];n:for(;;){if(S=y>>>24,f>>>=S,m-=S,S=y>>>16&255,S&16){if(k=y&65535,S&=15,m<S&&(f+=C[r++]<<m,m+=8,m<S&&(f+=C[r++]<<m,m+=8)),k+=f&(1<<S)-1,k>l){e.msg="invalid distance too far back",P.mode=YE;break e}if(f>>>=S,m-=S,S=s-a,k>S){if(S=k-S,S>d&&P.sane){e.msg="invalid distance too far back",P.mode=YE;break e}if(M=0,T=p,h===0){if(M+=u-S,S<A){A-=S;do R[s++]=p[M++];while(--S);M=s-k,T=R}}else if(h<S){if(M+=u+h-S,S-=h,S<A){A-=S;do R[s++]=p[M++];while(--S);if(M=0,h<A){S=h,A-=S;do R[s++]=p[M++];while(--S);M=s-k,T=R}}}else if(M+=h-S,S<A){A-=S;do R[s++]=p[M++];while(--S);M=s-k,T=R}for(;A>2;)R[s++]=T[M++],R[s++]=T[M++],R[s++]=T[M++],A-=3;A&&(R[s++]=T[M++],A>1&&(R[s++]=T[M++]))}else{M=s-k;do R[s++]=R[M++],R[s++]=R[M++],R[s++]=R[M++],A-=3;while(A>2);A&&(R[s++]=R[M++],A>1&&(R[s++]=R[M++]))}}else if(S&64){e.msg="invalid distance code",P.mode=YE;break e}else{y=v[(y&65535)+(f&(1<<S)-1)];continue n}break}}else if(S&64)if(S&32){P.mode=CTe;break e}else{e.msg="invalid literal/length code",P.mode=YE;break e}else{y=x[(y&65535)+(f&(1<<S)-1)];continue t}break}}while(r<i&&s<o);A=m>>3,r-=A,m-=A<<3,f&=(1<<m)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=s<o?257+(o-s):257-(s-o),P.hold=f,P.bits=m};const _v=15,TH=852,MH=592,RH=0,VR=1,jH=2,TTe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),MTe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),RTe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),jTe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),PTe=(t,e,n,r,i,s,a,o)=>{const l=o.bits;let u=0,d=0,h=0,p=0,f=0,m=0,x=0,v=0,g=0,b=0,y,S,A,k,M,T=null,C;const R=new Uint16Array(_v+1),P=new Uint16Array(_v+1);let j=null,G,B,$;for(u=0;u<=_v;u++)R[u]=0;for(d=0;d<r;d++)R[e[n+d]]++;for(f=l,p=_v;p>=1&&R[p]===0;p--);if(f>p&&(f=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<p&&R[h]===0;h++);for(f<h&&(f=h),v=1,u=1;u<=_v;u++)if(v<<=1,v-=R[u],v<0)return-1;if(v>0&&(t===RH||p!==1))return-1;for(P[1]=0,u=1;u<_v;u++)P[u+1]=P[u]+R[u];for(d=0;d<r;d++)e[n+d]!==0&&(a[P[e[n+d]]++]=d);if(t===RH?(T=j=a,C=20):t===VR?(T=TTe,j=MTe,C=257):(T=RTe,j=jTe,C=0),b=0,d=0,u=h,M=s,m=f,x=0,A=-1,g=1<<f,k=g-1,t===VR&&g>TH||t===jH&&g>MH)return 1;for(;;
vendor: 10,438 bytes, line 604
604){G=u-x,a[d]+1<C?(B=0,$=a[d]):a[d]>=C?(B=j[a[d]-C],$=T[a[d]-C]):(B=96,$=0),y=1<<u-x,S=1<<m,h=S;do S-=y,i[M+(b>>x)+S]=G<<24|B<<16|$|0;while(S!==0);for(y=1<<u-1;b&y;)y>>=1;if(y!==0?(b&=y-1,b+=y):b=0,d++,--R[u]===0){if(u===p)break;u=e[n+a[d]]}if(u>f&&(b&k)!==A){for(x===0&&(x=f),M+=h,m=u-x,v=1<<m;m+x<p&&(v-=R[m+x],!(v<=0));)m++,v<<=1;if(g+=1<<m,t===VR&&g>TH||t===jH&&g>MH)return 1;A=b&k,i[A]=f<<24|m<<16|M-s|0}}return b!==0&&(i[M+b]=u-x<<24|64<<16|0),o.bits=f,0};var r2=PTe;const LTe=0,Tre=1,Mre=2,{Z_FINISH:PH,Z_BLOCK:ITe,Z_TREES:JE,Z_OK:mx,Z_STREAM_END:DTe,Z_NEED_DICT:BTe,Z_STREAM_ERROR:Au,Z_DATA_ERROR:Rre,Z_MEM_ERROR:jre,Z_BUF_ERROR:FTe,Z_DEFLATED:LH}=gA,dM=16180,IH=16181,DH=16182,BH=16183,FH=16184,OH=16185,zH=16186,UH=16187,HH=16188,GH=16189,CT=16190,Jh=16191,WR=16192,VH=16193,$R=16194,WH=16195,$H=16196,KH=16197,qH=16198,ZE=16199,QE=16200,XH=16201,YH=16202,JH=16203,ZH=16204,QH=16205,KR=16206,eG=16207,tG=16208,as=16209,Pre=16210,Lre=16211,OTe=852,zTe=592,UTe=15,HTe=UTe,nG=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function GTe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Rx=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<dM||e.mode>Lre?1:0},Ire=t=>{if(Rx(t))return Au;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=dM,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(OTe),e.distcode=e.distdyn=new Int32Array(zTe),e.sane=1,e.back=-1,mx},Dre=t=>{if(Rx(t))return Au;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ire(t)},Bre=(t,e)=>{let n;if(Rx(t))return Au;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Au:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,Dre(t))},Fre=(t,e)=>{if(!t)return Au;const n=new GTe;t.state=n,n.strm=t,n.window=null,n.mode=dM;const r=Bre(t,e);return r!==mx&&(t.state=null),r},VTe=t=>Fre(t,HTe);let rG=!0,qR,XR;const WTe=t=>{if(rG){qR=new Int32Array(512),XR=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(r2(Tre,t.lens,0,288,qR,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;r2(Mre,t.lens,0,32,XR,0,t.work,{bits:5}),rG=!1}t.lencode=qR,t.lenbits=9,t.distcode=XR,t.distbits=5},Ore=(t,e,n,r)=>{let i;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},$Te=(t,e)=>{let n,r,i,s,a,o,l,u,d,h,p,f,m,x,v=0,g,b,y,S,A,k,M,T;const C=new Uint8Array(4);let R,P;const j=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Rx(t)||!t.output||!t.input&&t.avail_in!==0)return Au;n=t.state,n.mode===Jh&&(n.mode=WR),a=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,o=t.avail_in,u=n.hold,d=n.bits,h=o,p=l,T=mx;e:for(;;)switch(n.mode){case dM:if(n.wrap===0){n.mode=WR;break}for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,C[0]=u&255,C[1]=u>>>8&255,n.check=Va(n.check,C,2,0),u=0,d=0,n.mode=IH;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=as;break}if((u&15)!==LH){t.msg="unknown compression method",n.mode=as;break}if(u>>>=4,d-=4,M=(u&15)+8,n.wbits===0&&(n.wbits=M),M>15||M>n.wbits){t.msg="invalid window size",n.mode=as;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=u&512?GH:Jh,u=0,d=0;break;case IH:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==LH){t.msg="unknown compression method",n.mode=as;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=as;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(C[0]=u&255,C[1]=u>>>8&255,n.check=Va(n.check,C,2,0)),u=0,d=0,n.mode=DH;case DH:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(C[0]=u&255,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,n.check=Va(n.check,C,4,0)),u=0,d=0,n.mode=BH;case BH:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(C[0]=u&255,C[1]=u>>>8&255,n.check=Va(n.check,C,2,0)),u=0,d=0,n.mode=FH;case FH:if(n.flags&1024){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(C[0]=u&255,C[1]=u>>>8&255,n.check=Va(n.check,C,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=OH;case OH:if(n.flags&1024&&(f=n.length,f>o&&(f=o),f&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+f),M)),n.flags&512&&n.wrap&4&&(n.check=Va(n.check,r,f,s)),o-=f,s+=f,n.length-=f),n.length))break e;n.length=0,n.mode=zH;case zH:if(n.flags&2048){if(o===0)break e;f=0;do M=r[s+f++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M));while(M&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=Va(n.check,r,f,s)),o-=f,s+=f,M)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=UH;case UH:if(n.flags&4096){if(o===0)break e;f=0;do M=r[s+f++],n.head&&M&&n.length<65536&&(n.head.comment+=String.fromCharCode(M));while(M&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=Va(n.check,r,f,s)),o-=f,s+=f,M)break e}else n.head&&(n.head.comment=null);n.mode=HH;case HH:if(n.flags&512){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){t.msg="header crc mismatch",n.mode=as;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Jh;break;case GH:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}t.adler=n.check=nG(u),u=0,d=0,n.mode=CT;case CT:if(n.havedict===0)return t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,n.hold=u,n.bits=d,BTe;t.adler=n.check=1,n.mode=Jh;case Jh:if(e===ITe||e===JE)break e;case WR:if(n.last){u>>>=d&7,d-=d&7,n.mode=KR;break}for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=VH;break;case 1:if(WTe(n),n.mode=ZE,e===JE){u>>>=2,d-=2;break e}break;case 2:n.mode=$H;break;case 3:t.msg="invalid block type",n.mode=as}u>>>=2,d-=2;break;case VH:for(u>>>=d&7,d-=d&7;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=as;break}if(n.length=u&65535,u=0,d=0,n.mode=$R,e===JE)break e;case $R:n.mode=WH;case WH:if(f=n.length,f){if(f>o&&(f=o),f>l&&(f=l),f===0)break e;i.set(r.subarray(s,s+f),a),o-=f,s+=f,l-=f,a+=f,n.length-=f;break}n.mode=Jh;break;case $H:for(;d<14;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=as;break}n.have=0,n.mode=KH;case KH:for(;n.have<n.ncode;){for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.lens[j[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[j[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,R={bits:n.lenbits},T=r2(LTe,n.lens,0,19,n.lencode,0,n.work,R),n.lenbits=R.bits,T){t.msg="invalid code lengths set",n.mode=as;break}n.have=0,n.mode=qH;case qH:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[u&(1<<n.lenbits)-1],g=v>>>24,b=v>>>16&255,y=v&65535,!(g<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(y<16)u>>>=g,d-=g,n.lens[n.have++]=y;else{if(y===16){for(P=g+2;d<P;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(u>>>=g,d-=g,n.have===0){t.msg="invalid bit length repeat",n.mode=as;break}M=n.lens[n.have-1],f=3+(u&3),u>>>=2,d-=2}else if(y===17){for(P=g+3;d<P;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=g,d-=g,M=0,f=3+(u&7),u>>>=3,d-=3}else{for(P=g+7;d<P;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=g,d-=g,M=0,f=11+(u&127),u>>>=7,d-=7}if(n.have+f>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=as;break}for(;f--;)n.lens[n.have++]=M}}if(n.mode===as)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=as;break}if(n.lenbits=9,R={bits:n.lenbits},T=r2(Tre,n.lens,0,n.nlen,n.lencode,0,n.work,R),n.lenbits=R.bits,T){t.msg="invalid literal/lengths set",n.mode=as;break}if(n.distbits=6,n.distcode=n.distdyn,R={bits:n.distbits},T=r2(Mre,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,R),n.distbits=R.bits,T){t.msg="invalid distances set",n.mode=as;break}if(n.mode=ZE,e===JE)break e;case ZE:n.mode=QE;case QE:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,n.hold=u,n.bits=d,NTe(t,p),a=t.next_out,i=t.output,l=t.avail_out,s=t.next_in,r=t.input,o=t.avail_in,u=n.hold,d=n.bits,n.mode===Jh&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<<n.lenbits)-1],g=v>>>24,b=v>>>16&255,y=v&65535,!(g<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(b&&!(b&240)){for(S=g,A=b,k=y;v=n.lencode[k+((u&(1<<S+A)-1)>>S)],g=v>>>24,b=v>>>16&255,y=v&65535,!(S+g<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=S,d-=S,n.back+=S}if(u>>>=g,d-=g,n.back+=g,n.length=y,b===0){n.mode=QH;break}if(b&32){n.back=-1,n.mode=Jh;break}if(b&64){t.msg="invalid literal/length code",n.mode=as;break}n.extra=b&15,n.mode=XH;case XH:if(n.extra){for(P=n.extra;d<P;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=YH;case YH:for(;v=n.distcode[u&(1<<n.distbits)-1],g=v>>>24,b=v>>>16&255,y=v&65535,!(g<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(!(b&240)){for(S=g,A=b,k=y;v=n.distcode[k+((u&(1<<S+A)-1)>>S)],g=v>>>24,b=v>>>16&255,y=v&65535,!(S+g<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=S,d-=S,n.back+=S}if(u>>>=g,d-=g,n.back+=g,b&64){t.msg="invalid distance code",n.mode=as;break}n.offset=y,n.extra=b&15,n.mode=JH;case JH:if(n.extra){for(P=n.extra;d<P;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>
vendor: 13,753 bytes, line 604
604n.dmax){t.msg="invalid distance too far back",n.mode=as;break}n.mode=ZH;case ZH:if(l===0)break e;if(f=p-l,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=as;break}f>n.wnext?(f-=n.wnext,m=n.wsize-f):m=n.wnext-f,f>n.length&&(f=n.length),x=n.window}else x=i,m=a-n.offset,f=n.length;f>l&&(f=l),l-=f,n.length-=f;do i[a++]=x[m++];while(--f);n.length===0&&(n.mode=QE);break;case QH:if(l===0)break e;i[a++]=n.length,l--,n.mode=QE;break;case KR:if(n.wrap){for(;d<32;){if(o===0)break e;o--,u|=r[s++]<<d,d+=8}if(p-=l,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?Va(n.check,i,p,a-p):dS(n.check,i,p,a-p)),p=l,n.wrap&4&&(n.flags?u:nG(u))!==n.check){t.msg="incorrect data check",n.mode=as;break}u=0,d=0}n.mode=eG;case eG:if(n.wrap&&n.flags){for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=as;break}u=0,d=0}n.mode=tG;case tG:T=DTe;break e;case as:T=Rre;break e;case Pre:return jre;case Lre:default:return Au}return t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,n.hold=u,n.bits=d,(n.wsize||p!==t.avail_out&&n.mode<as&&(n.mode<KR||e!==PH))&&Ore(t,t.output,t.next_out,p-t.avail_out),h-=t.avail_in,p-=t.avail_out,t.total_in+=h,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?Va(n.check,i,p,t.next_out-p):dS(n.check,i,p,t.next_out-p)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Jh?128:0)+(n.mode===ZE||n.mode===$R?256:0),(h===0&&p===0||e===PH)&&T===mx&&(T=FTe),T},KTe=t=>{if(Rx(t))return Au;let e=t.state;return e.window&&(e.window=null),t.state=null,mx},qTe=(t,e)=>{if(Rx(t))return Au;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,mx):Au},XTe=(t,e)=>{const n=e.length;let r,i,s;return Rx(t)||(r=t.state,r.wrap!==0&&r.mode!==CT)?Au:r.mode===CT&&(i=1,i=dS(i,e,n,0),i!==r.check)?Rre:(s=Ore(t,e,n,n),s?(r.mode=Pre,jre):(r.havedict=1,mx))};var YTe=Dre,JTe=Bre,ZTe=Ire,QTe=VTe,e5e=Fre,t5e=$Te,n5e=KTe,r5e=qTe,i5e=XTe,s5e="pako inflate (from Nodeca project)",hf={inflateReset:YTe,inflateReset2:JTe,inflateResetKeep:ZTe,inflateInit:QTe,inflateInit2:e5e,inflate:t5e,inflateEnd:n5e,inflateGetHeader:r5e,inflateSetDictionary:i5e,inflateInfo:s5e};function a5e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var o5e=a5e;const zre=Object.prototype.toString,{Z_NO_FLUSH:l5e,Z_FINISH:c5e,Z_OK:pS,Z_STREAM_END:YR,Z_NEED_DICT:JR,Z_STREAM_ERROR:u5e,Z_DATA_ERROR:iG,Z_MEM_ERROR:d5e}=gA;function vA(t){this.options=uM.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Cre,this.strm.avail_out=0;let n=hf.inflateInit2(this.strm,e.windowBits);if(n!==pS)throw new Error(Jb[n]);if(this.header=new o5e,hf.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=fS.string2buf(e.dictionary):zre.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=hf.inflateSetDictionary(this.strm,e.dictionary),n!==pS)))throw new Error(Jb[n])}vA.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?c5e:l5e,zre.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=hf.inflate(n,a),s===JR&&i&&(s=hf.inflateSetDictionary(n,i),s===pS?s=hf.inflate(n,a):s===iG&&(s=JR));n.avail_in>0&&s===YR&&n.state.wrap>0&&t[n.next_in]!==0;)hf.inflateReset(n),s=hf.inflate(n,a);switch(s){case u5e:case iG:case JR:case d5e:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||s===YR))if(this.options.to==="string"){let l=fS.utf8border(n.output,n.next_out),u=n.next_out-l,d=fS.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===pS&&o===0)){if(s===YR)return s=hf.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};vA.prototype.onData=function(t){this.chunks.push(t)};vA.prototype.onEnd=function(t){t===pS&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=uM.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function $O(t,e){const n=new vA(e);if(n.push(t),n.err)throw n.msg||Jb[n.err];return n.result}function h5e(t,e){return e=e||{},e.raw=!0,$O(t,e)}var f5e=vA,p5e=$O,m5e=h5e,g5e=$O,x5e=gA,v5e={Inflate:f5e,inflate:p5e,inflateRaw:m5e,ungzip:g5e,constants:x5e};const{Inflate:y5e,inflate:b5e,inflateRaw:mqe,ungzip:gqe}=v5e;var sG=y5e,w5e=b5e;const Ure=[];for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;Ure[t]=e}const aG=4294967295;function _5e(t,e,n){let r=t;for(let i=0;i<n;i++)r=Ure[(r^e[i])&255]^r>>>8;return r}function S5e(t,e){return(_5e(aG,t,e)^aG)>>>0}function oG(t,e,n){const r=t.readUint32(),i=S5e(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function Hre(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function Gre(t,e,n,r){let i=0;for(;i<r;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+e[i-r]&255}function Vre(t,e,n,r){let i=0;if(n.length===0)for(;i<r;i++)e[i]=t[i];else for(;i<r;i++)e[i]=t[i]+n[i]&255}function Wre(t,e,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+(e[s-i]>>1)&255}else{for(;s<i;s++)e[s]=t[s]+(n[s]>>1)&255;for(;s<r;s++)e[s]=t[s]+(e[s-i]+n[s]>>1)&255}}function $re(t,e,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+e[s-i]&255}else{for(;s<i;s++)e[s]=t[s]+n[s]&255;for(;s<r;s++)e[s]=t[s]+A5e(e[s-i],n[s],n[s-i])&255}}function A5e(t,e,n){const r=t+e-n,i=Math.abs(r-t),s=Math.abs(r-e),a=Math.abs(r-n);return i<=s&&i<=a?t:s<=a?e:n}function E5e(t,e,n,r,i,s){switch(t){case 0:Hre(e,n,i);break;case 1:Gre(e,n,i,s);break;case 2:Vre(e,n,r,i);break;case 3:Wre(e,n,r,i,s);break;case 4:$re(e,n,r,i,s);break;default:throw new Error(`Unsupported filter: ${t}`)}}const k5e=new Uint16Array([255]),C5e=new Uint8Array(k5e.buffer),N5e=C5e[0]===255;function T5e(t){const{data:e,width:n,height:r,channels:i,depth:s}=t,a=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],o=Math.ceil(s/8)*i,l=new Uint8Array(r*n*o);let u=0;for(let d=0;d<7;d++){const h=a[d],p=Math.ceil((n-h.x)/h.xStep),f=Math.ceil((r-h.y)/h.yStep);if(p<=0||f<=0)continue;const m=p*o,x=new Uint8Array(m);for(let v=0;v<f;v++){const g=e[u++],b=e.subarray(u,u+m);u+=m;const y=new Uint8Array(m);E5e(g,b,y,x,m,o),x.set(y);for(let S=0;S<p;S++){const A=h.x+S*h.xStep,k=h.y+v*h.yStep;if(!(A>=n||k>=r))for(let M=0;M<o;M++)l[(k*n+A)*o+M]=y[S*o+M]}}}if(s===16){const d=new Uint16Array(l.buffer);if(N5e)for(let h=0;h<d.length;h++)d[h]=M5e(d[h]);return d}else return l}function M5e(t){return(t&255)<<8|t>>8&255}const R5e=new Uint16Array([255]),j5e=new Uint8Array(R5e.buffer),P5e=j5e[0]===255,L5e=new Uint8Array(0);function lG(t){const{data:e,width:n,height:r,channels:i,depth:s}=t,a=Math.ceil(s/8)*i,o=Math.ceil(s/8*i*n),l=new Uint8Array(r*o);let u=L5e,d=0,h,p;for(let f=0;f<r;f++){switch(h=e.subarray(d+1,d+1+o),p=l.subarray(f*o,(f+1)*o),e[d]){case 0:Hre(h,p,o);break;case 1:Gre(h,p,o,a);break;case 2:Vre(h,p,u,o);break;case 3:Wre(h,p,u,o,a);break;case 4:$re(h,p,u,o,a);break;default:throw new Error(`Unsupported filter: ${e[d]}`)}u=p,d+=o+1}if(s===16){const f=new Uint16Array(l.buffer);if(P5e)for(let m=0;m<f.length;m++)f[m]=I5e(f[m]);return f}else return l}function I5e(t){return(t&255)<<8|t>>8&255}const XC=Uint8Array.of(137,80,78,71,13,10,26,10);function cG(t){if(!D5e(t.readBytes(XC.length)))throw new Error("wrong PNG signature")}function D5e(t){if(t.length<XC.length)return!1;for(let e=0;e<XC.length;e++)if(t[e]!==XC[e])return!1;return!0}const B5e="tEXt",F5e=0,Kre=new TextDecoder("latin1");function O5e(t){if(U5e(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const z5e=/^[\u0000-\u00FF]*$/;function U5e(t){if(!z5e.test(t))throw new Error("invalid latin1 text")}function H5e(t,e,n){const r=qre(e);t[r]=G5e(e,n-r.length-1)}function qre(t){for(t.mark();t.readByte()!==F5e;);const e=t.offset;t.reset();const n=Kre.decode(t.readBytes(e-t.offset-1));return t.skip(1),O5e(n),n}function G5e(t,e){return Kre.decode(t.readBytes(e))}const cc={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},ZR={UNKNOWN:-1,DEFLATE:0},uG={UNKNOWN:-1,ADAPTIVE:0},QR={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},ek={NONE:0,BACKGROUND:1,PREVIOUS:2},ej={SOURCE:0,OVER:1};class V5e extends OO{constructor(n,r={}){super(n);$n(this,"_checkCrc");$n(this,"_inflator");$n(this,"_png");$n(this,"_apng");$n(this,"_end");$n(this,"_hasPalette");$n(this,"_palette");$n(this,"_hasTransparency");$n(this,"_transparency");$n(this,"_compressionMethod");$n(this,"_filterMethod");$n(this,"_interlaceMethod");$n(this,"_colorType");$n(this,"_isAnimated");$n(this,"_numberOfFrames");$n(this,"_numberOfPlays");$n(this,"_frames");$n(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new sG,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=ZR.UNKNOWN,this._filterMethod=uG.UNKNOWN,this._interlaceMethod=QR.UNKNOWN,this._colorType=cc.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(cG(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(cG(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const i=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case B5e:H5e(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?oG(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const i=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=i+n;break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?oG(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=W5e(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case cc.GREYSCALE:i=1;break;case cc.TRUECOLOUR:i=3;break;case cc.INDEXED_COLOUR:i=1;break;case cc.GREYSCALE_ALPHA:i=2;break;case cc.TRUECOLOUR_ALPHA:i=4;break;case cc.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==ZR.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const n={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const i=[];this._palette=i;for(let s=0;s<r;s++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,i=this.offset+this.byteOffset;if(i+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case cc.GREYSCALE:case cc.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case cc.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alph
604a values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const i=this.readByte();this._palette[r].push(i)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case cc.UNKNOWN:case cc.GREYSCALE_ALPHA:case cc.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=qre(this),i=this.readUint8();if(i!==ZR.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:w5e(s)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),i=this.readByte();this._png.resolution={x:n,y:r,unit:i}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},i=this._frames.at(n);if(i){if(i.data=lG({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||i.xOffset===0&&i.yOffset===0&&i.width===this._png.width&&i.height===this._png.height)r.data=i.data;else{const s=this._apng.frames.at(n-1);this.disposeFrame(i,s,r),this.addFrameDataToCanvas(r,i)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,i){switch(n.disposeOp){case ek.NONE:break;case ek.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let a=0;a<this._png.width;a++){const o=(s*n.width+a)*this._png.channels;for(let l=0;l<this._png.channels;l++)i.data[o+l]=0}break;case ek.PREVIOUS:i.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const i=1<<this._png.depth,s=(a,o)=>{const l=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:l,frameIndex:u}};switch(r.blendOp){case ej.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++)n.data[l+d]=r.data[u+d]}break;case ej.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:l,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++){const h=r.data[u+this._png.channels-1]/i,p=d%(this._png.channels-1)===0?1:r.data[u+d],f=Math.floor(h*p+(1-h)*n.data[l+d]);n.data[l+d]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==uG.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===QR.NO_INTERLACE)this._png.data=lG({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===QR.ADAM7)this._png.data=T5e({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:ek.NONE,blendOp:ej.SOURCE,data:n}),this._inflator=new sG,this._writingDataChunks=!1}}function W5e(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var dG;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(dG||(dG={}));function $5e(t,e){return new V5e(t,e).decode()}var tr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function tj(){tr.console&&typeof tr.console.log=="function"&&tr.console.log.apply(tr.console,arguments)}var ji={log:tj,warn:function(t){tr.console&&(typeof tr.console.warn=="function"?tr.console.warn.apply(tr.console,arguments):tj.call(null,arguments))},error:function(t){tr.console&&(typeof tr.console.error=="function"?tr.console.error.apply(tr.console,arguments):tj(t))}};function nj(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){e0(r.response,e,n)},r.onerror=function(){ji.error("could not download file")},r.send()}function hG(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function tk(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");
vendor: 3,408 bytes, lines 604-609
604e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var e0=tr.saveAs||((typeof window>"u"?"undefined":Si(window))!=="object"||window!==tr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=tr.URL||tr.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin!==location.origin?hG(i.href)?nj(t,e,n):tk(i,i.target="_blank"):tk(i)):(i.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){tk(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(hG(t))nj(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){tk(r)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:Si(s)!=="object"&&(ji.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(t,n),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return nj(t,e,n);var i=t.type==="application/octet-stream",s=/constructor/i.test(tr.HTMLElement)||tr.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":Si(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var d=o.result;d=a?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},o.readAsDataURL(t)}else{var l=tr.URL||tr.webkitURL,u=l.createObjectURL(t);r?r.location=u:location.href=u,r=null,setTimeout(function(){l.revokeObjectURL(u)},4e4)}});/** 605 * A class to parse color values 606 * @author Stoyan Stefanov <[email protected]> 607 * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} 608 * @license Use it if you like it 609 */function Xre(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",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",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",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",lightgrey:"d3d3d3",lightgreen:"90ee9
6090",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,s=n[r].process,a=i.exec(t);a&&(e=s(a),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),l=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),"#"+o+l+u}}var YC=tr.atob.bind(tr),fG=tr.btoa.bind(tr);/** 610 * @license 611 * Joseph Myers does not specify a particular license for his work. 612 * 613 * Author: Joseph Myers 614 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js 615 * 616 * Modified by: Owen Leong 617 */function rj(t,e){var n=t[0],r=t[1],i=t[2],s=t[3];n=Po(n,r,i,s,e[0],7,-680876936),s=Po(s,n,r,i,e[1],12,-389564586),i=Po(i,s,n,r,e[2],17,606105819),r=Po(r,i,s,n,e[3],22,-1044525330),n=Po(n,r,i,s,e[4],7,-176418897),s=Po(s,n,r,i,e[5],12,1200080426),i=Po(i,s,n,r,e[6],17,-1473231341),r=Po(r,i,s,n,e[7],22,-45705983),n=Po(n,r,i,s,e[8],7,1770035416),s=Po(s,n,r,i,e[9],12,-1958414417),i=Po(i,s,n,r,e[10],17,-42063),r=Po(r,i,s,n,e[11],22,-1990404162),n=Po(n,r,i,s,e[12],7,1804603682),s=Po(s,n,r,i,e[13],12,-40341101),i=Po(i,s,n,r,e[14],17,-1502002290),n=Lo(n,r=Po(r,i,s,n,e[15],22,1236535329),i,s,e[1],5,-165796510),s=Lo(s,n,r,i,e[6],9,-1069501632),i=Lo(i,s,n,r,e[11],14,643717713),r=Lo(r,i,s,n,e[0],20,-373897302),n=Lo(n,r,i,s,e[5],5,-701558691),s=Lo(s,n,r,i,e[10],9,38016083),i=Lo(i,s,n,r,e[15],14,-660478335),r=Lo(r,i,s,n,e[4],20,-405537848),n=Lo(n,r,i,s,e[9],5,568446438),s=Lo(s,n,r,i,e[14],9,-1019803690),i=Lo(i,s,n,r,e[3],14,-187363961),r=Lo(r,i,s,n,e[8],20,1163531501),n=Lo(n,r,i,s,e[13],5,-1444681467),s=Lo(s,n,r,i,e[2],9,-51403784),i=Lo(i,s,n,r,e[7],14,1735328473),n=Io(n,r=Lo(r,i,s,n,e[12],20,-1926607734),i,s,e[5],4,-378558),s=Io(s,n,r,i,e[8],11,-2022574463),i=Io(i,s,n,r,e[11],16,1839030562),r=Io(r,i,s,n,e[14],23,-35309556),n=Io(n,r,i,s,e[1],4,-1530992060),s=Io(s,n,r,i,e[4],11,1272893353),i=Io(i,s,n,r,e[7],16,-155497632),r=Io(r,i,s,n,e[10],23,-1094730640),n=Io(n,r,i,s,e[13],4,681279174),s=Io(s,n,r,i,e[0],11,-358537222),i=Io(i,s,n,r,e[3],16,-722521979),r=Io(r,i,s,n,e[6],23,76029189),n=Io(n,r,i,s,e[9],4,
vendor: 8,604 bytes, lines 617-634
617-640364487),s=Io(s,n,r,i,e[12],11,-421815835),i=Io(i,s,n,r,e[15],16,530742520),n=Do(n,r=Io(r,i,s,n,e[2],23,-995338651),i,s,e[0],6,-198630844),s=Do(s,n,r,i,e[7],10,1126891415),i=Do(i,s,n,r,e[14],15,-1416354905),r=Do(r,i,s,n,e[5],21,-57434055),n=Do(n,r,i,s,e[12],6,1700485571),s=Do(s,n,r,i,e[3],10,-1894986606),i=Do(i,s,n,r,e[10],15,-1051523),r=Do(r,i,s,n,e[1],21,-2054922799),n=Do(n,r,i,s,e[8],6,1873313359),s=Do(s,n,r,i,e[15],10,-30611744),i=Do(i,s,n,r,e[6],15,-1560198380),r=Do(r,i,s,n,e[13],21,1309151649),n=Do(n,r,i,s,e[4],6,-145523070),s=Do(s,n,r,i,e[11],10,-1120210379),i=Do(i,s,n,r,e[2],15,718787259),r=Do(r,i,s,n,e[9],21,-343485551),t[0]=lm(n,t[0]),t[1]=lm(r,t[1]),t[2]=lm(i,t[2]),t[3]=lm(s,t[3])}function hM(t,e,n,r,i,s){return e=lm(lm(e,t),lm(r,s)),lm(e<<i|e>>>32-i,n)}function Po(t,e,n,r,i,s,a){return hM(e&n|~e&r,t,e,i,s,a)}function Lo(t,e,n,r,i,s,a){return hM(e&r|n&~r,t,e,i,s,a)}function Io(t,e,n,r,i,s,a){return hM(e^n^r,t,e,i,s,a)}function Do(t,e,n,r,i,s,a){return hM(n^(e|~r),t,e,i,s,a)}function Yre(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)rj(r,K5e(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(rj(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,rj(r,i),r}function K5e(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var pG="0123456789abcdef".split("");function q5e(t){for(var e="",n=0;n<4;n++)e+=pG[t>>8*n+4&15]+pG[t>>8*n&15];return e}function X5e(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function M4(t){return Yre(t).map(X5e).join("")}var Y5e=function(t){for(var e=0;e<t.length;e++)t[e]=q5e(t[e]);return t.join("")}(Yre("hello"))!="5d41402abc4b2a76b9719d911017c592";function lm(t,e){if(Y5e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}/** 618 * @license 619 * FPDF is released under a permissive license: there is no usage restriction. 620 * You may embed it freely in your application (commercial or not), with or 621 * without modifications. 622 * 623 * Reference: http://www.fpdf.org/en/script/script37.php 624 */function R4(t,e){var n,r,i,s;if(t!==n){for(var a=(i=t,s=1+(256/t.length|0),new Array(s+1).join(i)),o=[],l=0;l<256;l++)o[l]=l;var u=0;for(l=0;l<256;l++){var d=o[l];u=(u+d+a.charCodeAt(l))%256,o[l]=o[u],o[u]=d}n=t,r=o}else o=r;var h=e.length,p=0,f=0,m="";for(l=0;l<h;l++)f=(f+(d=o[p=(p+1)%256]))%256,o[p]=o[f],o[f]=d,a=o[(o[p]+o[f])%256],m+=String.fromCharCode(e.charCodeAt(l)^a);return m}/** 625 * @license 626 * Licensed under the MIT License. 627 * http://opensource.org/licenses/mit-license 628 * Author: Owen Leong (@owenl131) 629 * Date: 15 Oct 2020 630 * References: 631 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt 632 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js 633 * http://www.fpdf.org/en/script/script37.php 634 */var mG={print:4,modify:8,copy:16,"annot-forms":32};function dy(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(o){if(mG.perm!==void 0)throw new Error("Invalid permission: "+o);i+=mG[o]}),this.padding="(¿N^NuÂAd\0NVÿú�\b..\0¶Ãh>Â/\f©þdSiz";var s=(e+this.padding).substr(0,32),a=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,a),this.P=-(1+(255^i)),this.encryptionKey=M4(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=R4(this.encryptionKey,this.padding)}function hy(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);e+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function gG(t){if(Si(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(n)||(e[n]={});var s=Math.random().toString(35);return e[n][s]=[r,!!i],s},this.unsubscribe=function(n){for(var r in e)if(e[r][n])return delete e[r][n],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var s in e[n]){var a=e[n][s];try{a[0].apply(t,r)}catch(o){tr.console&&ji.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function NT(t){if(!(this instanceof NT))return new NT(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function Jre(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function o0(t,e,n,r,i){if(!(this instanceof o0))return new o0(t,e,n,r,i);this.type=t==="axial"?2:3,this.coords=e,this.colors=n,Jre.call(this,r,i)}function zy(t,e,n,r,i){if(!(this instanceof zy))return new zy(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,Jre.call(this,r,i)}function Pn(t){var e,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,l=16,u="S",d=null;Si(t=t||{})==="object"&&(n=t.orientation,r=t.unit||r,i=t.format||i,s=t.compress||t.compressPdf||s,(d=t.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),o=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(l=t.floatPrecision),u=t.defaultPathOperation||"S"),a=t.filters||(s===!0?["FlateEncode"]:a),r=r||"mm",n=(""+(n||"P")).toLowerCase();var h=t.putOnlyUsedFonts||!1,p={},f={internal:{},__private__:{}};f.__private__.PubSub=gG;var m="1.3",x=f.__private__.getPdfVersion=function(){return m};f.__private__.setPdfVersion=function(H){m=H};var v={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return v};var g=f.__private__.getPageFormat=function(H){return v[H]};i=i||"a4";var b="compat",y="advanced",S=b;function A(){this.saveGraphicsState(),K(new Mt(je,0,0,-je,0,us()*je).toString()+" cm"),this.setFontSize(this.getFontSize()/je),u="n",S=y}function k(){this.restoreGraphicsState(),u="S",S=b}var M=f.__private__.combineFontStyleAndFontWeight=function(H,he){if(H=="bold"&&he=="normal"||H=="bold"&&he==400||H=="normal"&&he=="italic"||H=="bold"&&he=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return he&&(H=he==400||he==="normal"?H==="italic"?"italic":"normal":he!=700&&he!=="bold"||H!=="normal"?(he==700?"bold":he)+""+H:"bold"),H};f.advancedAPI=function(H){var he=S===b;return he&&A.call(this),typeof H!="function"||(H(this),he&&k.call(this)),this},f.compatAPI=function(H){var he=S===y;return he&&k.call(this),typeof H!="function"||(H(this),he&&A.call(this)),this},f.isAdvancedAPI=function(){return S===y};var T,C=function(H){if(S!==y)throw new Error(H+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},R=f.roundToPrecision=f.__private__.roundToPrecision=function(H,he){var Be=e||he;if(isNaN(H)||isNaN(Be))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return H.toFixed(Be).replace(/0+$/,"")};T=f.hpf=f.__private__.hpf=typeof l=="number"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return R(H,l)}:l==="smart"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return R(H,H>-1&&H<1?16:5)}:function(H){if(isNaN(H))throw new Error("Invalid argument passed to
634jsPDF.hpf");return R(H,16)};var P=f.f2=f.__private__.f2=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f2");return R(H,2)},j=f.__private__.f3=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f3");return R(H,3)},G=f.scale=f.__private__.scale=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.scale");return S===b?H*je:S===y?H:void 0},B=function(H){return G(function(he){return S===b?us()-he:S===y?he:void 0}(H))};f.__private__.setPrecision=f.setPrecision=function(H){typeof parseInt(H,10)=="number"&&(e=parseInt(H,10))};var $,U="00000000000000000000000000000000",Z=f.__private__.getFileId=function(){return U},V=f.__private__.setFileId=function(H){return U=H!==void 0&&/^[a-fA-F0-9]{32}$/.test(H)?H.toUpperCase():U.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(rr=new dy(d.userPermissions,d.userPassword,d.ownerPassword,U)),U};f.setFileId=function(H){return V(H),this},f.getFileId=function(){return Z()};var W=f.__private__.convertDateToPDFDate=function(H){var he=H.getTimezoneOffset(),Be=he<0?"+":"-",tt=Math.floor(Math.abs(he/60)),ot=Math.abs(he%60),St=[Be,q(tt),"'",q(ot),"'"].join("");return["D:",H.getFullYear(),q(H.getMonth()+1),q(H.getDate()),q(H.getHours()),q(H.getMinutes()),q(H.getSeconds()),St].join("")},O=f.__private__.convertPDFDateToDate=function(H){var he=parseInt(H.substr(2,4),10),Be=parseInt(H.substr(6,2),10)-1,tt=parseInt(H.substr(8,2),10),ot=parseInt(H.substr(10,2),10),St=parseInt(H.substr(12,2),10),It=parseInt(H.substr(14,2),10);return new Date(he,Be,tt,ot,St,It,0)},Y=f.__private__.setCreationDate=function(H){var he;if(H===void 0&&(H=new Date),H instanceof Date)he=W(H);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(H))throw new Error("Invalid argument passed to jsPDF.setCreationDate");he=H}return $=he},z=f.__private__.getCreationDate=function(H){var he=$;return H==="jsDate"&&(he=O($)),he};f.setCreationDate=function(H){return Y(H),this},f.getCreationDate=function(H){return z(H)};var I,q=f.__private__.padd2=function(H){return("0"+parseInt(H)).slice(-2)},te=f.__private__.padd2Hex=function(H){return("00"+(H=H.toString())).substr(H.length)},se=0,ie=[],le=[],xe=0,Ee=[],ae=[],Q=!1,we=le;f.__private__.setCustomOutputDestination=function(H){Q=!0,we=H};var Ae=function(H){Q||(we=H)};f.__private__.resetCustomOutputDestination=function(){Q=!1,we=le};var K=f.__private__.out=function(H){return H=H.toString(),xe+=H.length+1,we.pu
vendor: 8,649 bytes, lines 634-635
634sh(H),we},pe=f.__private__.write=function(H){return K(arguments.length===1?H.toString():Array.prototype.join.call(arguments," "))},ye=f.__private__.getArrayBuffer=function(H){for(var he=H.length,Be=new ArrayBuffer(he),tt=new Uint8Array(Be);he--;)tt[he]=H.charCodeAt(he);return Be},Se=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return Se};var ee=t.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(H){return ee=S===y?H/je:H,this};var re,me=f.__private__.getFontSize=f.getFontSize=function(){return S===b?ee:ee*je},Ge=t.R2L||!1;f.__private__.setR2L=f.setR2L=function(H){return Ge=H,this},f.__private__.getR2L=f.getR2L=function(){return Ge};var He,_e=f.__private__.setZoomMode=function(H){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(H))re=H;else if(isNaN(H)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(H)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+H+'" is not recognized.');re=H}else re=parseInt(H,10)};f.__private__.getZoomMode=function(){return re};var Ne,ue=f.__private__.setPageMode=function(H){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(H)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+H+'" is not recognized.');He=H};f.__private__.getPageMode=function(){return He};var Ce=f.__private__.setLayoutMode=function(H){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(H)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+H+'" is not recognized.');Ne=H};f.__private__.getLayoutMode=function(){return Ne},f.__private__.setDisplayMode=f.setDisplayMode=function(H,he,Be){return _e(H),Ce(he),ue(Be),this};var Ke={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(H){if(Object.keys(Ke).indexOf(H)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ke[H]},f.__private__.getDocumentProperties=function(){return Ke},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(H){for(var he in Ke)Ke.hasOwnProperty(he)&&H[he]&&(Ke[he]=H[he]);return this},f.__private__.setDocumentProperty=function(H,he){if(Object.keys(Ke).indexOf(H)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ke[H]=he};var Qe,je,We,xt,et,Je={},Ze={},Me=[],Xe={},ut={},lt={},Fe={},Le=null,bt=0,dt=[],Nt=new gG(f),_t=t.hotfixes||[],Lt={},Dt={},en=[],Mt=function H(he,Be,tt,ot,St,It){if(!(this instanceof H))return new H(he,Be,tt,ot,St,It);isNaN(he)&&(he=1),isNaN(Be)&&(Be=0),isNaN(tt)&&(tt=0),isNaN(ot)&&(ot=1),isNaN(St)&&(St=0),isNaN(It)&&(It=0),this._matrix=[he,Be,tt,ot,St,It]};Object.defineProperty(Mt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Mt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Mt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Mt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Mt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Mt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Mt.prototype,"a",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Mt.prototype,"b",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Mt.prototype,"c",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Mt.prototype,"d",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Mt.prototype,"e",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Mt.prototype,"f",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Mt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Mt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Mt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Mt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Mt.prototype.join=function(H){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(H)},Mt.prototype.multiply=function(H){var he=H.sx*this.sx+H.shy*this.shx,Be=H.sx*this.shy+H.shy*this.sy,tt=H.shx*this.sx+H.sy*this.shx,ot=H.shx*this.shy+H.sy*this.sy,St=H.tx*this.sx+H.ty*this.shx+this.tx,It=H.tx*this.shy+H.ty*this.sy+this.ty;return new Mt(he,Be,tt,ot,St,It)},Mt.prototype.decompose=function(){var H=this.sx,he=this.shy,Be=this.shx,tt=this.sy,ot=this.tx,St=this.ty,It=Math.sqrt(H*H+he*he),fn=(H/=It)*Be+(he/=It)*tt;Be-=H*fn,tt-=he*fn;var mn=Math.sqrt(Be*Be+tt*tt);return fn/=mn,H*(tt/=mn)<he*(Be/=mn)&&(H=-H,he=-he,fn=-fn,It=-It),{scale:new Mt(It,0,0,mn,0,0),translate:new Mt(1,0,0,1,ot,St),rotate:new Mt(H,he,-he,H,0,0),skew:new Mt(1,0,fn,1,0,0)}},Mt.prototype.toString=function(H){return this.join(" ")},Mt.prototype.inversed=function(){var H=this.sx,he=this.shy,Be=this.shx,tt=this.sy,ot=this.tx,St=this.ty,It=1/(H*tt-he*Be),fn=tt*It,mn=-he*It,qn=-Be*It,ir=H*It;return new Mt(fn,mn,qn,ir,-fn*ot-qn*St,-mn*ot-ir*St)},Mt.prototype.applyToPoint=function(H){var he=H.x*this.sx+H.y*this.shx+this.tx,Be=H.x*this.shy+H.y*this.sy+this.ty;return new el(he,Be)},Mt.prototype.applyToRectangle=function(H){var he=this.applyToPoint(H),Be=this.applyToPoint(new el(H.x+H.w,H.y+H.h));return new nc(he.x,he.y,Be.x-he.x,Be.y-he.y)},Mt.prototype.clone=function(){var H=this.sx,he=this.shy,Be=this.shx,tt=this.sy,ot=this.tx,St=this.ty;return new Mt(H,he,Be,tt,ot,St)},f.Matrix=Mt;var nn=f.matrixMult=function(H,he){return he.multiply(H)},Tn=new Mt(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Tn;var Fn=function(H,he){if(!ut[H]){var Be=(he instanceof o0?"Sh":"P")+(Object.keys(Xe).length+1).toString(10);he.id=Be,ut[H]=Be,Xe[Be]=he,Nt.publish("addPattern",he)}};f.ShadingPattern=o0,f.TilingPattern=zy,f.addShadingPattern=function(H,he){return C("addShadingPattern()"),Fn(H,he),this},f.beginTilingPattern=function(H){C("beginTilingPattern()"),Hs(H.boundingBox[0],H.boundingBox[1],H.boundingBox[2]-H.boundingBox[0],H.boundingBox[3]-H.boundingBox[1],H.matrix)},f.endTilingPattern=function(H,he){C("endTilingPattern()"),he.stream=ae[I].join(` 635`),Fn(H,he),Nt.publish("endTilingPattern",he),en.pop().restore()};var lr,mr=f.__private__.newObject=function(){var H=gr();return br(H,!0),H},gr=f.__private__.newObjectDeferred=function(){return se++,ie[se]=function(){return xe},se},br=function(H,he){return he=typeof he=="boolean"&&he,ie[H]=xe,he&&K(H+" 0 obj"),H},sn=f.__private__.newAdditionalObject=function(){var H={objId:gr(),content:""};return Ee.push(H),H},Mr=gr(),yi=gr(),de=f.__private__.decodeColorString=function(H){var he=H.split(" ");if(he.length!==2||he[1]!=="g"&&he[1]!=="G")he.length!==5||he[4]!=="k"&&he[4]!=="K"||(he=[(1-he[0])*(1-he[3]),(1-he[1])*(1-he[3]),(1-he[2])*(1-he[3]),"r"]);else{var Be=parseFloat(he[0]);he=[Be,Be,Be,"r"]}for(var tt="#",ot=0;ot<3;ot++)tt+=("0"+Math.floor(255*parseFloat(he[ot])).toString(16)).slice(-2);return tt},ke=f.__private__.encodeColorString=function(H){var he;typeof H=="string"&&(H={ch1:H});var Be=H.ch1,tt=H.ch2,ot=H.ch3,St=H.ch4,It=H.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Be=="string"&&Be.charAt(0)!=="#"){var fn=new Xre(Be);if(fn.ok)Be=fn.toHex();else if(!/^\d*\.?\d*$/.test(Be))throw new Error('Invalid color "'+Be+'" passed to
635jsPDF.encodeColorString.')}if(typeof Be=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Be)&&(Be="#"+Be[1]+Be[1]+Be[2]+Be[2]+Be[3]+Be[3]),typeof Be=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Be)){var mn=parseInt(Be.substr(1),16);Be=mn>>16&255,tt=mn>>8&255,ot=255&mn}if(tt===void 0||St===void 0&&Be===tt&&tt===ot)he=typeof Be=="string"?Be+" "+It[0]:H.precision===2?P(Be/255)+" "+It[0]:j(Be/255)+" "+It[0];else if(St===void 0||Si(St)==="object"){if(St&&!isNaN(St.a)&&St.a===0)return["1.","1.","1.",It[1]].join(" ");he=typeof Be=="string"?[Be,tt,ot,It[1]].join(" "):H.precision===2?[P(Be/255),P(tt/255),P(ot/255),It[1]].join(" "):[j(Be/255),j(tt/255),j(ot/255),It[1]].join(" ")}else he=typeof Be=="string"?[Be,tt,ot,St,It[2]].join(" "):H.precision===2?[P(Be),P(tt),P(ot),P(St),It[2]].join(" "):[j(Be),j(tt),j(ot),j(St),It[2]].join(" ");return he},Ye=f.__private__.getFilters=function(){return a},ce=f.__private__.putStream=function(H){var he=(H=H||{}).data||"",Be=H.filters||Ye(),tt=H.alreadyAppliedFilters||[],ot=H.addLength1||!1,St=he.length,It=H.objectId,fn=function(Ei){return Ei};if(d!==null&&It===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(fn=rr.encryptor(It,0));var mn={};Be===!0&&(Be=["FlateEncode"]);var qn=H.additionalKeyValues||[],ir=(mn=Pn.API.processDataByFilters!==void 0?Pn.API.processDataByFilters(he,Be):{data:he,reverseChain:[]}).reverseChain+(Array.isArray(tt)?tt.join(" "):tt.toString());if(mn.data.length!==0&&(qn.push({key:"Length",value:mn.data.length}),ot===!0&&qn.push({key:"Length1",value:St})),ir.length!=0)if(ir.split("/").length-1==1)qn.push({key:"Filter",value:ir});else{qn.push({key:"Filter",value:"["+ir+"]"});for(var Br=0;Br<qn.length;Br+=1)if(qn[Br].key==="DecodeParms"){for(var ns=[],ri=0;ri<mn.reverseChain.split("/").length-1;ri+=1)ns.push("null");ns.push(qn[Br].value),qn[Br].value="["+ns.join(" ")+"]"}}K("<<");for(var di=0;di<qn.length;di++)K("/"+qn[di].key+" "+qn[di].value);K(">>"),mn.data.length!==0&&(K("stream"),K(fn(mn.data)),K("endstream"))},Pe=f.__private__.putPage=function(H){var he=H.number,Be=H.data,tt=H.objId,ot=H.contentsObjId;br(tt,!0),K("<</Type /Page"),K("/Parent "+H.rootDictionaryObjId+" 0 R"),K("/Resources "+H.resourceDictionaryObjId+" 0 R"),K("/MediaBox ["+parseFloat(T(H.mediaBox.bottomLeftX))+" "+parseFloat(T(H.mediaBox.bottomLeftY))+" "+T(H.mediaBox.topRightX)+" "+T(H.mediaBox.topRightY)+"]"),H.cropBox!==null&&K("/CropBox ["+T(H.cropBox.bottomLeftX)+" "+T(H.cropBox.bottomLeftY)+" "+T(H.cropBox.topRightX)+" "+T(H.cropBox.topRightY)+"]"),H.bleedBox!==null&&K("/BleedBox ["+T(H.bleedBox.bottomLeftX)+" "+T(H.bleedBox.bottomLeftY)+" "+T(H.bleedBox.topRightX)+" "+T(H.bleedBox.topRightY)+"]"),H.trimBox!==null&&K("/TrimBox ["+T(H.trimBox.bottomLeftX)+" "+T(H.trimBox.bottomLeftY)+" "+T(H.trimBox.topRightX)+" "+T(H.trimBox.topRightY)+"]"),H.artBox!==null&&K("/ArtBox ["+T(H.artBox.bottomLeftX)+" "+T(H.artBox.bottomLeftY)+" "+T(H.artBox.topRightX)+" "+T(H.artBox.topRightY)+"]"),typeof H.userUnit=="number"&&H.userUnit!==1&&K("/UserUnit "+H.userUnit),Nt.publish("putPage",{objId:tt,pageContext:dt[he],pageNumber:he,page:Be}),K("/Contents "+ot+" 0 R"),K(">>"),K("endobj");var St=Be.join(` 636`);return S===y&&(St+=` 637Q`),br(ot,!0),ce({data:St,filters:Ye(),objectId:ot}),K("endobj"),tt},De=f.__private__.putPages=function(){var H,he,Be=[];for(H=1;H<=bt;H++)dt[H].objId=gr(),dt[H].contentsObjId=gr();for(H=1;H<=bt;H++)Be.push(Pe({number:H,data:ae[H],objId:dt[H].objId,contentsObjId:dt[H].contentsObjId,mediaBox:dt[H].mediaBox,cropBox:dt[H].cropBox,bleedBox:dt[H].bleedBox,trimBox:dt[H].trimBox,artBox:dt[H].artBox,userUnit:dt[H].userUnit,rootDictionaryObjId:Mr,resourceDictionaryObjId:yi}));br(Mr,!0),K("<</Type /Pages");var tt="/Kids [";for(he=0;he<bt;he++)tt+=Be[he]+" 0 R ";K(tt+"]"),K("/Count "+bt),K(">>"),K("endobj"),Nt.publish("postPutPages")},qe=function(H){Nt.publish("putFont",{font:H,out:K,newObject:mr,putStream:ce}),H.isAlreadyPutted!==!0&&(H.objectNumber=mr(),K("<<"),K("/Type /Font"),K("/BaseFont /"+hy(H.postScriptName)),K("/Subtype /Type1"),typeof H.encoding=="string"&&K("/Encoding /"+H.encoding),K("/FirstChar 32"),K("/LastChar 255"),K(">>"),K("endobj"))},$e=function(H){H.objectNumber=mr();var he=[];he.push({key:"Type",value:"/XObject"}),he.push({key:"Subtype",value:"/Form"}),he.push({key:"BBox",value:"["+[T(H.x),T(H.y),T(H.x+H.width),T(H.y+H.height)].join(" ")+"]"}),he.push({key:"Matrix",value:"["+H.matrix.toString()+"]"});var Be=H.pages[1].join(` 638`);ce({data:Be,additionalKeyValues:he,objectId:H.objectNumber}),K("endobj")},mt=function(H,he){he||(he=21);var Be=mr(),tt=function(It,fn){var mn,qn=[],ir=1/(fn-1);for(mn=0;mn<1;mn+=ir)qn.push(mn);if(qn.push(1),It[0].offset!=0){var Br={offset:0,color:It[0].color};It.unshift(Br)}if(It[It.length-1].offset!=1){var ns={offset:1,color:It[It.length-1].color};It.push(ns)}for(var ri="",di=0,Ei=0;Ei<qn.length;Ei++){for(mn=qn[Ei];mn>It[di+1].offset;)di++;var Di=It[di].offset,Ti=(mn-Di)/(It[di+1].offset-Di),ds=It[di].color,So=It[di+1].color;ri+=te(Math.round((1-Ti)*ds[0]+Ti*So[0]).toString(16))+te(Math.round((1-Ti)*ds[1]+Ti*So[1]).toString(16))+te(Math.round((1-Ti)*ds[2]+Ti*So[2]).toString(16))}return ri.trim()}(H.colors,he),ot=[];
vendor: 5,552 bytes, line 638
638ot.push({key:"FunctionType",value:"0"}),ot.push({key:"Domain",value:"[0.0 1.0]"}),ot.push({key:"Size",value:"["+he+"]"}),ot.push({key:"BitsPerSample",value:"8"}),ot.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ot.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ce({data:tt,additionalKeyValues:ot,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Be}),K("endobj"),H.objectNumber=mr(),K("<< /ShadingType "+H.type),K("/ColorSpace /DeviceRGB");var St="/Coords ["+T(parseFloat(H.coords[0]))+" "+T(parseFloat(H.coords[1]))+" ";H.type===2?St+=T(parseFloat(H.coords[2]))+" "+T(parseFloat(H.coords[3])):St+=T(parseFloat(H.coords[2]))+" "+T(parseFloat(H.coords[3]))+" "+T(parseFloat(H.coords[4]))+" "+T(parseFloat(H.coords[5])),K(St+="]"),H.matrix&&K("/Matrix ["+H.matrix.toString()+"]"),K("/Function "+Be+" 0 R"),K("/Extend [true true]"),K(">>"),K("endobj")},vt=function(H,he){var Be=gr(),tt=mr();he.push({resourcesOid:Be,objectOid:tt}),H.objectNumber=tt;var ot=[];ot.push({key:"Type",value:"/Pattern"}),ot.push({key:"PatternType",value:"1"}),ot.push({key:"PaintType",value:"1"}),ot.push({key:"TilingType",value:"1"}),ot.push({key:"BBox",value:"["+H.boundingBox.map(T).join(" ")+"]"}),ot.push({key:"XStep",value:T(H.xStep)}),ot.push({key:"YStep",value:T(H.yStep)}),ot.push({key:"Resources",value:Be+" 0 R"}),H.matrix&&ot.push({key:"Matrix",value:"["+H.matrix.toString()+"]"}),ce({data:H.stream,additionalKeyValues:ot,objectId:H.objectNumber}),K("endobj")},wt=function(H){for(var he in H.objectNumber=mr(),K("<<"),H)switch(he){case"opacity":K("/ca "+P(H[he]));break;case"stroke-opacity":K("/CA "+P(H[he]))}K(">>"),K("endobj")},nt=function(H){br(H.resourcesOid,!0),K("<<"),K("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var he in K("/Font <<"),Je)Je.hasOwnProperty(he)&&(h===!1||h===!0&&p.hasOwnProperty(he))&&K("/"+he+" "+Je[he].objectNumber+" 0 R");K(">>")}(),function(){if(Object.keys(Xe).length>0){for(var he in K("/Shading <<"),Xe)Xe.hasOwnProperty(he)&&Xe[he]instanceof o0&&Xe[he].objectNumber>=0&&K("/"+he+" "+Xe[he].objectNumber+" 0 R");Nt.publish("putShadingPatternDict"),K(">>")}}(),function(he){if(Object.keys(Xe).length>0){for(var Be in K("/Pattern <<"),Xe)Xe.hasOwnProperty(Be)&&Xe[Be]instanceof f.TilingPattern&&Xe[Be].objectNumber>=0&&Xe[Be].objectNumber<he&&K("/"+Be+" "+Xe[Be].objectNumber+" 0 R");Nt.publish("putTilingPatternDict"),K(">>")}}(H.objectOid),function(){if(Object.keys(lt).length>0){var he;for(he in K("/ExtGState <<"),lt)lt.hasOwnProperty(he)&<[he].objectNumber>=0&&K("/"+he+" "+lt[he].objectNumber+" 0 R");Nt.publish("putGStateDict"),K(">>")}}(),function(){for(var he in K("/XObject <<"),Lt)Lt.hasOwnProperty(he)&&Lt[he].objectNumber>=0&&K("/"+he+" "+Lt[he].objectNumber+" 0 R");Nt.publish("putXobjectDict"),K(">>")}(),K(">>"),K("endobj")},Xt=function(H){Ze[H.fontName]=Ze[H.fontName]||{},Ze[H.fontName][H.fontStyle]=H.id},ft=function(H,he,Be,tt,ot){var St={id:"F"+(Object.keys(Je).length+1).toString(10),postScriptName:H,fontName:he,fontStyle:Be,encoding:tt,isStandardFont:ot||!1,metadata:{}};return Nt.publish("addFont",{font:St,instance:this}),Je[St.id]=St,Xt(St),St.id},ve=f.__private__.pdfEscape=f.pdfEscape=function(H,he){return function(Be,tt){var ot,St,It,fn,mn,qn,ir,Br,ns;if(It=(tt=tt||{}).sourceEncoding||"Unicode",mn=tt.outputEncoding,(tt.autoencode||mn)&&Je[Qe].metadata&&Je[Qe].metadata[It]&&Je[Qe].metadata[It].encoding&&(fn=Je[Qe].metadata[It].encoding,!mn&&Je[Qe].encoding&&(mn=Je[Qe].encoding),!mn&&fn.codePages&&(mn=fn.codePages[0]),typeof mn=="string"&&(mn=fn[mn]),mn)){for(ir=!1,qn=[],ot=0,St=Be.length;ot<St;ot++)(Br=mn[Be.charCodeAt(ot)])?qn.push(String.fromCharCode(Br)):qn.push(Be[ot]),qn[ot].charCodeAt(0)>>8&&(ir=!0);Be=qn.join("")}for(ot=Be.length;ir===void 0&&ot!==0;)Be.charCodeAt(ot-1)>>8&&(ir=!0),ot--;if(!ir)return Be;for(qn=tt.noBOM?[]:[254,255],ot=0,St=Be.length;ot<St;ot++){if((ns=(Br=Be.charCodeAt(ot))>>8)>>8)throw new Error("Character at position "+ot+" of string '"+Be+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");qn.push(ns),qn.push(Br-(ns<<8))}return String.fromCharCode.apply(void 0,qn)}(H,he).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},rt=f.__private__.beginPage=function(H){ae[++bt]=[],dt[bt]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(H[0]),topRightY:Number(H[1])}},Wt(bt),Ae(ae[I])},At=function(H,he){var Be,tt,ot;switch(n=he||n,typeof H=="string"&&(Be=g(H.toLowerCase()),Array.isArray(Be)&&(tt=Be[0],ot=Be[1])),Array.isArray(H)&&(tt=H[0]*je,ot=H[1]*je),isNaN(tt)&&(tt=i[0],ot=i[1]),(tt>14400||ot>14400)&&(ji.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),tt=Math.min(14400,tt),ot=Math.min(14400,ot)),i=[tt,ot],n.substr(0,1)){case"l":ot>tt&&(i=[ot,tt]);break;case"p":tt>ot&&(i=[ot,tt])}rt(i),Qf(On),K(Oc),Lu!==0&&K(Lu+" J"),Nl!==0&&K(Nl+" j"),Nt.publish("addPage",{pageNumber:bt})},Gt=function(H){H>0&&H<=bt&&(ae.splice(H,1),dt.splice(H,1),bt--,I>bt&&(I=bt),this.setPage(I))},Wt=function(H){H>0&&H<=bt&&(I=H)},zt=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return ae.length-1},Ut=function(H,he,Be){var tt,ot=void 0;return Be=Be||{},H=H!==void 0?H:Je[Qe].fontName,he=he!==void 0?he:Je[Qe].fontStyle,tt=H.toLowerCase(),Ze[tt]!==void 0&&Ze[tt][he]!==void 0?ot=Ze[tt][he]:Ze[H]!==void 0&&Ze[H][he]!==void 0?ot=Ze[H][he]:Be.disableWarning===!1&&ji.warn("Unable to look up font label for font '"+H+"', '"+he+"'. Refer to getFontList(
638) for available fonts."),ot||Be.noFallback||(ot=Ze.times[he])==null&&(ot=Ze.times.normal),ot},pn=f.__private__.putInfo=function(){var H=mr(),he=function(tt){return tt};for(var Be in d!==null&&(he=rr.encryptor(H,0)),K("<<"),K("/Producer ("+ve(he("jsPDF "+Pn.version))+")"),Ke)Ke.hasOwnProperty(Be)&&Ke[Be]&&K("/"+Be.substr(0,1).toUpperCase()+Be.substr(1)+" ("+ve(he(Ke[Be]))+")");K("/CreationDate ("+ve(he($))+")"),K(">>"),K("endobj")},an=f.__private__.putCatalog=function(H){var he=(H=H||{}).rootDictionaryObjId||Mr;switch(mr(),K("<<"),K("/Type /Catalog"),K("/Pages "+he+" 0 R"),re||(re="fullwidth"),re){case"fullwidth":K("/OpenAction [3 0 R /FitH null]");break;case"fullheight":K("/OpenAction [3 0 R /FitV null]");break;case"fullpage":K("/OpenAction [3 0 R /Fit]");break;case"original":K("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Be=""+re;Be.substr(Be.length-1)==="%"&&(re=parseInt(re)/100),typeof re=="number"&&K("/OpenAction [3 0 R /XYZ null null "+P(re)+"]")}switch(Ne||(Ne="continuous"),Ne){case"continuous":K("/PageLayout /OneColumn");break;case"single":K("/PageLayout /SinglePage");break;case"two":case"twoleft":K("/PageLayout /TwoColumnLeft");break;case"tworight":K("/PageLayout /TwoColumnRight")}He&&K("/PageMode /"+He),Nt.publish("putCatalog"),K(">>"),K("endobj")},Cn=f.__private__.putTrailer=function(){K("trailer"),K("<<"),K("/Size "+(se+1)),K("/Root "+se+" 0 R"),K("/Info "+(se-1)+" 0 R"),d!==null&&K("/Encrypt "+rr.oid+" 0 R"),K("/ID [ <"+U+"> <"+U+"> ]"),K(">>")},on=f.__private__.putHeader=function(){K("%PDF-"+m),K("%ºÃˆ ")},Hr=f.__private__.putXRef=function(){var H="0000000000";K("xref"),K("0 "+(se+1)),K("0000000000 65535 f ");for(var he=1;he<=se;he++)typeof ie[he]=="function"?K((H+ie[he]()).slice(-10)+" 00000 n "):ie[he]!==void 0?K((H+ie[he]).slice(-10)+" 00000 n "):K("0000000000 00000 n ")},wr=f.__private__.buildDocument=function(){var H;se=0,xe=0,le=[],ie=[],Ee=[],Mr=gr(),yi=gr(),Ae(le),Nt.publish("buildDocument"),on(),De(),function(){Nt.publish("putAdditionalObjects");for(var Be=0;Be<Ee.length;Be++){var tt=Ee[Be];br(tt.objId,!0),K(tt.content),K("endobj")}Nt.publish("postPutAdditionalObjects")}(),H=[],function(){for(var Be in Je)Je.hasOwnProperty(Be)&&(h===!1||h===!0&&p.hasOwnProperty(Be))&&qe(Je[Be])}(),function(){var Be;for(Be in lt)lt.hasOwnProperty(Be)&&wt(lt[Be])}(),function(){for(var Be in Lt)Lt.hasOwnProperty(Be)&&$e(Lt[Be])}(),function(Be){var tt;for(tt in Xe)Xe.hasOwnProperty(tt)&&(Xe[tt]instanceof o0?mt(Xe[tt]):Xe[tt]instanceof zy&&vt(Xe[tt],Be))}(H),Nt.publish("putResources"),H.forEach(nt),nt({resourcesOid:yi,objectOid:Number.MAX_SAFE_INTEGER}),Nt.publish("postPutResources"),d!==null&&(rr.oid=mr(),K("<<"),K("/Filter /Standard"),K("/V "+rr.v),K("/R "+rr.r),K("/U <"+rr.toHexString(rr.U)+">"),K("/O <"+rr.toHexString(rr.O)+">"),K("/P "+rr.P),K(">>"),K("endobj")),pn(),an();var he=xe;return Hr(),Cn(),K("startxref"),K(""+he),K("%%EOF"),Ae(ae[I]),le.join(` 639`)},Jn=f.__private__.getBlob=function(H){return new Blob([ye(H)],{type:"application/pdf"})},Zn=function(H){for(;H.firstChild;)H.removeChild(H.firstChild)},Sr=function(H){var he,Be=H.document,tt=Be.documentElement,ot=Be.head,St=Be.body;return ot||(ot=Be.createElement("head"),tt.appendChild(ot)),St||(St=Be.createElement("body"),tt.appendChild(St)),Zn(ot),Zn(St),(he=Be.createElement("style")).appendChild(Be.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),ot.appendChild(he),{document:Be,body:St}},zn=f.output=f.__private__.output=(lr=function(H,he){switch(typeof(he=he||{})=="string"?he={filename:he}:he.filename=he.filename||"generated.pdf",H){case void 0:return wr();case"save":f.save(he.filename);break;case"arraybuffer":return ye(wr());case"blob":return Jn(wr());case"bloburi":case"bloburl":if(tr.URL!==void 0&&typeof tr.URL.createObjectURL=="function")return tr.URL&&tr.URL.createObjectURL(Jn(wr()))||void 0;ji.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Be="",tt=wr();try{Be=fG(tt)}catch{Be=fG(unescape(encodeURIComponent(tt)))}return"data:application/pdf;filename="+encodeURIComponent(he.filename)+";base64,"+Be;case"pdfobjectnewwindow":if(Object.prototype.toString.call(tr)==="[object Window]"){var ot="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",St=!he.pdfObjectUrl;St||(ot=he.pdfObjectUrl);var It=tr.open();if(It!==null){var fn=Sr(It),mn=fn.document.createElement("script"),qn=this;mn.src=ot,St&&(mn.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",mn.crossOrigin="anonymous"),mn.onload=function(){It.PDFObject.embed(qn.output("dataurlstring"),he)},fn.body.appendChild(mn)}return It}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(tr)==="[object Window]"){var ir=he.pdfJsUrl||"examples/PDF.js/web/viewer.html",Br=tr.open();if(Br!==null){var ns=Sr(Br),ri=ns.document.createElement("iframe"),di=ir.indexOf("?")===-1?"?":"&";qn=this,ri.id="pdfViewer",ri.width="500px",ri.height="400px",ri.src=ir+di+"file=&downloadName="+encodeURIComponent(he.filename),ri.onload=function(){Br.document.title=he.filename,ri.contentWindow.PDFViewerApplication.open(qn.output("bloburl"))},ns.body.appendChild(ri)}return Br}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(tr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Ei=tr.open();if(Ei!==null){var Di=Sr(Ei),Ti=Di.document.createElement("iframe");Ti.src=this.output("datauristring",he),Di.body.appendChild(Ti),Ei.document.title=he.filename}if(Ei||typeof safari>"u")return Ei;break;case"datauri":case"dataurl":return tr.document.location.href=this.output("datauristring",he);default:return null}},lr.foo=function(){try{return lr.apply(this,arguments)}catch(Be){var H=Be.stack||"";~H.indexOf(" at ")&&(H=H.split(" at ")[1]);var he="Error in function "+H.split(` 640`)[0].split("<")[0]+": "+Be.message;if(!tr.console)throw new Error(he);tr.console.error(he,Be),tr.alert&&alert(he)}},lr.foo.bar=lr,lr.foo),Ln=function(H){return Array.isArray(_t)===!0&&_t.indexOf(H)>-1};switch(r){case"pt":je=1;break;case"mm":je=72/25.4;break;case"cm":je=72/2.54;break;case"in":je=72;break;case"px":je=Ln("px_scaling")==1?.75:96/72;break;case"pc":case"em":je=12;break;case"ex":je=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);je=r}var rr=null;Y(),V();
vendor: 8,277 bytes, lines 640-654
640var Cs=f.__private__.getPageInfo=f.getPageInfo=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:dt[H].objId,pageNumber:H,pageContext:dt[H]}},Wi=f.__private__.getPageInfoByObjId=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var he in dt)if(dt[he].objId===H)break;return Cs(he)},Za=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:dt[I].objId,pageNumber:I,pageContext:dt[I]}};f.addPage=function(){return At.apply(this,arguments),this},f.setPage=function(){return Wt.apply(this,arguments),Ae.call(this,ae[I]),this},f.insertPage=function(H){return this.addPage(),this.movePage(I,H),this},f.movePage=function(H,he){var Be,tt;if(H>he){Be=ae[H],tt=dt[H];for(var ot=H;ot>he;ot--)ae[ot]=ae[ot-1],dt[ot]=dt[ot-1];ae[he]=Be,dt[he]=tt,this.setPage(he)}else if(H<he){Be=ae[H],tt=dt[H];for(var St=H;St<he;St++)ae[St]=ae[St+1],dt[St]=dt[St+1];ae[he]=Be,dt[he]=tt,this.setPage(he)}return this},f.deletePage=function(){return Gt.apply(this,arguments),this},f.__private__.text=f.text=function(H,he,Be,tt,ot){var St,It,fn,mn,qn,ir,Br,ns,ri,di=(tt=tt||{}).scope||this;if(typeof H=="number"&&typeof he=="number"&&(typeof Be=="string"||Array.isArray(Be))){var Ei=Be;Be=he,he=H,H=Ei}if(arguments[3]instanceof Mt==0?(fn=arguments[4],mn=arguments[5],Si(Br=arguments[3])==="object"&&Br!==null||(typeof fn=="string"&&(mn=fn,fn=null),typeof Br=="string"&&(mn=Br,Br=null),typeof Br=="number"&&(fn=Br,Br=null),tt={flags:Br,angle:fn,align:mn})):(C("The transform parameter of text() with a Matrix value"),ri=ot),isNaN(he)||isNaN(Be)||H==null)throw new Error("Invalid arguments passed to jsPDF.text");if(H.length===0)return di;var Di,Ti="",ds=typeof tt.lineHeightFactor=="number"?tt.lineHeightFactor:eo,So=di.internal.scaleFactor;function Ld(Jr){return Jr=Jr.split(" ").join(Array(tt.TabLen||9).join(" ")),ve(Jr,Br)}function zc(Jr){for(var Yn,Lr=Jr.concat(),Ir=[],Pl=Lr.length;Pl--;)typeof(Yn=Lr.shift())=="string"?Ir.push(Yn):Array.isArray(Jr)&&(Yn.length===1||Yn[1]===void 0&&Yn[2]===void 0)?Ir.push(Yn[0]):Ir.push([Yn[0],Yn[1],Yn[2]]);return Ir}function ta(Jr,Yn){var Lr;if(typeof Jr=="string")Lr=Yn(Jr)[0];else if(Array.isArray(Jr)){for(var Ir,Pl,Uu=Jr.concat(),Vc=[],Ux=Uu.length;Ux--;)typeof(Ir=Uu.shift())=="string"?Vc.push(Yn(Ir)[0]):Array.isArray(Ir)&&typeof Ir[0]=="string"&&(Pl=Yn(Ir[0],Ir[1],Ir[2]),Vc.push([Pl[0],Pl[1],Pl[2]]));Lr=Vc}return Lr}var Vs=!1,tl=!0;if(typeof H=="string")Vs=!0;else if(Array.isArray(H)){var Ao=H.concat();It=[];for(var Eo,rs=Ao.length;rs--;)(typeof(Eo=Ao.shift())!="string"||Array.isArray(Eo)&&typeof Eo[0]!="string")&&(tl=!1);Vs=tl}if(Vs===!1)throw new Error('Type of text must be string or Array. "'+H+'" is not recognized.');typeof H=="string"&&(H=H.match(/[\r?\n]/)?H.split(/\r\n|\r|\n/g):[H]);var Id=ee/di.internal.scaleFactor,Bu=Id*(ds-1);switch(tt.baseline){case"bottom":Be-=Bu;break;case"top":Be+=Id-Bu;break;case"hanging":Be+=Id-2*Bu;break;case"middle":Be+=Id/2-Bu}if((ir=tt.maxWidth||0)>0&&(typeof H=="string"?H=di.splitTextToSize(H,ir):Object.prototype.toString.call(H)==="[object Array]"&&(H=H.reduce(function(Jr,Yn){return Jr.concat(di.splitTextToSize(Yn,ir))},[]))),St={text:H,x:he,y:Be,options:tt,mutex:{pdfEscape:ve,activeFontKey:Qe,fonts:Je,activeFontSize:ee}},Nt.publish("preProcessText",St),H=St.text,fn=(tt=St.options).angle,ri instanceof Mt==0&&fn&&typeof fn=="number"){fn*=Math.PI/180,tt.rotationDirection===0&&(fn=-fn),S===y&&(fn=-fn);var Oh=Math.cos(fn),is=Math.sin(fn);ri=new Mt(Oh,is,-is,Oh,0,0)}else fn&&fn instanceof Mt&&(ri=fn);S!==y||ri||(ri=Tn),(qn=tt.charSpace||no)!==void 0&&(Ti+=T(G(qn))+` Tc 641`,this.setCharSpace(this.getCharSpace()||0)),(ns=tt.horizontalScale)!==void 0&&(Ti+=T(100*ns)+` Tz 642`),tt.lang;var bi=-1,wi=tt.renderingMode!==void 0?tt.renderingMode:tt.stroke,Uc=di.internal.getCurrentPageInfo().pageContext;switch(wi){case 0:case!1:case"fill":bi=0;break;case 1:case!0:case"stroke":bi=1;break;case 2:case"fillThenStroke":bi=2;break;case 3:case"invisible":bi=3;break;case 4:case"fillAndAddForClipping":bi=4;break;case 5:case"strokeAndAddPathForClipping":bi=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":bi=6;break;case 7:case"addToPathForClipping":bi=7}var ko=Uc.usedRenderingMode!==void 0?Uc.usedRenderingMode:-1;bi!==-1?Ti+=bi+` Tr 643`:ko!==-1&&(Ti+=`0 Tr 644`),bi!==-1&&(Uc.usedRenderingMode=bi),mn=tt.align||"left";var nl,Dd=ee*ds,zh=di.internal.pageSize.getWidth(),Bd=Je[Qe];qn=tt.charSpace||no,ir=tt.maxWidth||0,Br=Object.assign({autoencode:!0,noBOM:!0},tt.flags);var Fd=[],Fu=function(Jr){return di.getStringUnitWidth(Jr,{font:Bd,charSpace:qn,fontSize:ee,doKerning:!1})*ee/So};if(Object.prototype.toString.call(H)==="[object Array]"){var Ns;It=zc(H),mn!=="left"&&(nl=It.map(Fu));var Ia,Hc=0;if(mn==="right"){he-=nl[0],H=[],rs=It.length;for(var rc=0;rc<rs;rc++)rc===0?(Ia=$i(he),Ns=Qo(Be)):(Ia=G(Hc-nl[rc]),Ns=-Dd),H.push([It[rc],Ia,Ns]),Hc=nl[rc]}else if(mn==="center"){he-=nl[0]/2,H=[],rs=It.length;for(var Ou=0;Ou<rs;Ou++)Ou===0?(Ia=$i(he),Ns=Qo(Be)):(Ia=G((Hc-nl[Ou])/2),Ns=-Dd),H.push([It[Ou],Ia,Ns]),Hc=nl[Ou]}else if(mn==="left"){H=[],rs=It.length;for(var Uh=0;Uh<rs;Uh++)H.push(It[Uh])}else if(mn==="justify"&&Bd.encoding==="Identity-H"){H=[],rs=It.length,ir=ir!==0?ir:zh;for(var Ml=0,hs=0;hs<rs;hs++)if(Ns=hs===0?Qo(Be):-Dd,Ia=hs===0?$i(he):Ml,hs<rs-1){var Hh=G((ir-nl[hs])/(It[hs].split(" ").length-1)),fs=It[hs].split(" ");H.push([fs[0]+" ",Ia,Ns]),Ml=0;for(var ro=1;ro<fs.length;ro++){var Rl=(Fu(fs[ro-1]+" "+fs[ro])-Fu(fs[ro]))*So+Hh;ro==fs.length-1?H.push([fs[ro],Rl,0]):H.push([fs[ro]+" ",Rl,0]),Ml-=Rl}}else H.push([It[hs],Ia,Ns]);H.push(["",Ml,0])}else{if(mn!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(H=[],rs=It.length,ir=ir!==0?ir:zh,hs=0;hs<rs;hs++){Ns=hs===0?Qo(Be):-Dd,Ia=hs===0?$i(he):0;var Co=It[hs].split(" ").length-1,Gh=Co>0?(ir-nl[hs])/Co:0;hs<rs-1?Fd.push(T(G(Gh))):Fd.push(0),H.push([It[hs],Ia,Ns])}}}(typeof tt.R2L=="boolean"?tt.R2L:Ge)===!0&&(H=ta(H,function(Jr,Yn,Lr){return[Jr.split("").reverse().join(""),Yn,Lr]})),St={text:H,x:he,y:Be,options:tt,mutex:{pdfEscape:ve,activeFontKey:Qe,fonts:Je,activeFontSize:ee}},Nt.publish("postProcessText",St),H=St.text,Di=St.mutex.isHex||!1;var ic=Je[Qe].encoding;ic!=="WinAnsiEncoding"&&ic!=="StandardEncoding"||(H=ta(H,function(Jr,Yn,Lr){return[Ld(Jr),Yn,Lr]})),It=zc(H),H=[];for(var Od,zu,ii,jl=Array.isArray(It[0])?1:0,Gc="",zd=function(Jr,Yn,Lr){var Ir="";return Lr instanceof Mt?(Lr=typeof tt.angle=="number"?nn(Lr,new Mt(1,0,0,1,Jr,Yn)):nn(new Mt(1,0,0,1,Jr,Yn),Lr),S===y&&(Lr=nn(new Mt(1,0,0,-1,0,0),Lr)),Ir=Lr.join(" ")+` Tm 645`):Ir=T(Jr)+" "+T(Yn)+` Td 646`,Ir},Ws=0;Ws<It.length;Ws++){switch(Gc="",jl){case 1:ii=(Di?"<":"(")+It[Ws][0]+(Di?">":")"),Od=parseFloat(It[Ws][1]),zu=parseFloat(It[Ws][2]);break;case 0:ii=(Di?"<":"(")+It[Ws]+(Di?">":")"),Od=$i(he),zu=Qo(Be)}Fd!==void 0&&Fd[Ws]!==void 0&&(Gc=Fd[Ws]+` Tw 647`),Ws===0?H.push(Gc+zd(Od,zu,ri)+ii):jl===0?H.push(Gc+ii):jl===1&&H.push(Gc+zd(Od,zu,ri)+ii)}H=jl===0?H.join(` Tj 648T* `):H.join(` Tj 649`),H+=` Tj 650`;var ps=`BT 651/`;return ps+=Qe+" "+ee+` Tf 652`,ps+=T(ee*ds)+` TL 653`,ps+=ts+` 654`,ps+=Ti,ps+=H,K(ps+="ET"),p[Qe]=!0,di};var ec=f.__private__.clip=f.clip=function(H){return K(H==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return ec("evenodd")},f.__private__.discardPath=f.discardPath=function(){return K("n"),this};var Qs=f.__private__.isValidStyle=function(H){var he=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(H)!==-1&&(he=!0),he};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(H){return Qs(H)&&(u=H),this};var El=f.__private__.getStyle=f.getStyle=function(H){var he=u;switch(H){case"D":case"S":he="S";break;case"F":he="f";break;case"FD":case"DF":he="B";break;case"f":case"f*":case"B":case"B*":he=H}return he},kl=f.close=function(){return K("h"),this};f.stroke=function(){return K("S"),this},f.fill=function(H){return Mu("f",H),this},f.fillEvenOdd=function(H){return Mu("f*",H),this},f.fillStroke=function(H){return Mu("B",H),this},f.fillStrokeEvenOdd=function(H){return Mu("B*",H),this};var Mu=function(H,he){Si(he)==="object"?jd(he,H):K(H)},Ru=function(H){H===null||S===y&&H===void 0||(H=El(H),K(H))};
vendor: 1,379 bytes, line 654
654function tc(H,he,Be,tt,ot){var St=new zy(he||this.boundingBox,Be||this.xStep,tt||this.yStep,this.gState,ot||this.matrix);St.stream=this.stream;var It=H+"$$"+this.cloneIndex+++"$$";return Fn(It,St),St}var jd=function(H,he){var Be=ut[H.key],tt=Xe[Be];if(tt instanceof o0)K("q"),K(Cl(he)),tt.gState&&f.setGState(tt.gState),K(H.matrix.toString()+" cm"),K("/"+Be+" sh"),K("Q");else if(tt instanceof zy){var ot=new Mt(1,0,0,-1,0,us());H.matrix&&(ot=ot.multiply(H.matrix||Tn),Be=tc.call(tt,H.key,H.boundingBox,H.xStep,H.yStep,ot).id),K("q"),K("/Pattern cs"),K("/"+Be+" scn"),tt.gState&&f.setGState(tt.gState),K(he),K("Q")}},Cl=function(H){switch(H){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Qa=f.moveTo=function(H,he){return K(T(G(H))+" "+T(B(he))+" m"),this},Zo=f.lineTo=function(H,he){return K(T(G(H))+" "+T(B(he))+" l"),this},er=f.curveTo=function(H,he,Be,tt,ot,St){return K([T(G(H)),T(B(he)),T(G(Be)),T(B(tt)),T(G(ot)),T(B(St)),"c"].join(" ")),this};f.__private__.line=f.line=function(H,he,Be,tt,ot){if(isNaN(H)||isNaN(he)||isNaN(Be)||isNaN(tt)||!Qs(ot))throw new Error("Invalid arguments passed to jsPDF.line");return S===b?this.lines([[Be-H,tt-he]],H,he,[1,1],ot||"S"):this.lines([[Be-H,tt-he]],H,he,[1,1]).stroke()},f.__private__.lines=f.lines=function(H,he,Be,tt,ot,St){var It,fn,mn,qn,ir,Br,ns,ri,di,Ei,Di,Ti;
vendor: 5,148 bytes, line 654
654if(typeof H=="number"&&(Ti=Be,Be=he,he=H,H=Ti),tt=tt||[1,1],St=St||!1,isNaN(he)||isNaN(Be)||!Array.isArray(H)||!Array.isArray(tt)||!Qs(ot)||typeof St!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Qa(he,Be),It=tt[0],fn=tt[1],qn=H.length,Ei=he,Di=Be,mn=0;mn<qn;mn++)(ir=H[mn]).length===2?(Ei=ir[0]*It+Ei,Di=ir[1]*fn+Di,Zo(Ei,Di)):(Br=ir[0]*It+Ei,ns=ir[1]*fn+Di,ri=ir[2]*It+Ei,di=ir[3]*fn+Di,Ei=ir[4]*It+Ei,Di=ir[5]*fn+Di,er(Br,ns,ri,di,Ei,Di));return St&&kl(),Ru(ot),this},f.path=function(H){for(var he=0;he<H.length;he++){var Be=H[he],tt=Be.c;switch(Be.op){case"m":Qa(tt[0],tt[1]);break;case"l":Zo(tt[0],tt[1]);break;case"c":er.apply(this,tt);break;case"h":kl()}}return this},f.__private__.rect=f.rect=function(H,he,Be,tt,ot){if(isNaN(H)||isNaN(he)||isNaN(Be)||isNaN(tt)||!Qs(ot))throw new Error("Invalid arguments passed to jsPDF.rect");return S===b&&(tt=-tt),K([T(G(H)),T(B(he)),T(G(Be)),T(G(tt)),"re"].join(" ")),Ru(ot),this},f.__private__.triangle=f.triangle=function(H,he,Be,tt,ot,St,It){if(isNaN(H)||isNaN(he)||isNaN(Be)||isNaN(tt)||isNaN(ot)||isNaN(St)||!Qs(It))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Be-H,tt-he],[ot-Be,St-tt],[H-ot,he-St]],H,he,[1,1],It,!0),this},f.__private__.roundedRect=f.roundedRect=function(H,he,Be,tt,ot,St,It){if(isNaN(H)||isNaN(he)||isNaN(Be)||isNaN(tt)||isNaN(ot)||isNaN(St)||!Qs(It))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var fn=4/3*(Math.SQRT2-1);return ot=Math.min(ot,.5*Be),St=Math.min(St,.5*tt),this.lines([[Be-2*ot,0],[ot*fn,0,ot,St-St*fn,ot,St],[0,tt-2*St],[0,St*fn,-ot*fn,St,-ot,St],[2*ot-Be,0],[-ot*fn,0,-ot,-St*fn,-ot,-St],[0,2*St-tt],[0,-St*fn,ot*fn,-St,ot,-St]],H+ot,he,[1,1],It,!0),this},f.__private__.ellipse=f.ellipse=function(H,he,Be,tt,ot){if(isNaN(H)||isNaN(he)||isNaN(Be)||isNaN(tt)||!Qs(ot))throw new Error("Invalid arguments passed to jsPDF.ellipse");var St=4/3*(Math.SQRT2-1)*Be,It=4/3*(Math.SQRT2-1)*tt;return Qa(H+Be,he),er(H+Be,he-It,H+St,he-tt,H,he-tt),er(H-St,he-tt,H-Be,he-It,H-Be,he),er(H-Be,he+It,H-St,he+tt,H,he+tt),er(H+St,he+tt,H+Be,he+It,H+Be,he),Ru(ot),this},f.__private__.circle=f.circle=function(H,he,Be,tt){if(isNaN(H)||isNaN(he)||isNaN(Be)||!Qs(tt))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(H,he,Be,Be,tt)},f.setFont=function(H,he,Be){return Be&&(he=M(he,Be)),Qe=Ut(H,he,{disableWarning:!1}),this};var Dh=f.__private__.getFont=f.getFont=function(){return Je[Ut.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var H,he,Be={};for(H in Ze)if(Ze.hasOwnProperty(H))for(he in Be[H]=[],Ze[H])Ze[H].hasOwnProperty(he)&&Be[H].push(he);return Be},f.addFont=function(H,he,Be,tt,ot){var St=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&St.indexOf(arguments[3])!==-1?ot=arguments[3]:arguments[3]&&St.indexOf(arguments[3])==-1&&(Be=M(Be,tt)),ft.call(this,H,he,Be,ot=ot||"Identity-H")};var eo,On=t.lineWidth||.200025,Bh=f.__private__.getLineWidth=f.getLineWidth=function(){return On},Qf=f.__private__.setLineWidth=f.setLineWidth=function(H){return On=H,K(T(G(H))+" w"),this};f.__private__.setLineDash=Pn.API.setLineDash=Pn.API.setLineDashPattern=function(H,he){if(H=H||[],he=he||0,isNaN(he)||!Array.isArray(H))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return H=H.map(function(Be){return T(G(Be))}).join(" "),he=T(G(he)),K("["+H+"] "+he+" d"),this};var Ni=f.__private__.getLineHeight=f.getLineHeight=function(){return ee*eo};f.__private__.getLineHeight=f.getLineHeight=function(){return ee*eo};var ju=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(H){return typeof(H=H||1.15)=="number"&&(eo=H),this},ep=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return eo};ju(t.lineHeight);var $i=f.__private__.getHorizontalCoordinate=function(H){return G(H)},Qo=f.__private__.getVerticalCoordinate=function(H){return S===y?H:dt[I].mediaBox.topRightY-dt[I].mediaBox.bottomLeftY-G(H)},Pu=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(H){return T($i(H))},to=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(H){return T(Qo(H))},Oc=t.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return de(Oc)},f.__private__.setStrokeColor=f.setDrawColor=function(H,he,Be,tt){return Oc=ke({ch1:H,ch2:he,ch3:Be,ch4:tt,pdfColorType:"draw",precision:2}),K(Oc),this};var Pd=t.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return de(Pd)},f.__private__.setFillColor=f.setFillColor=function(H,he,Be,tt){return Pd=ke({ch1:H,ch2:he,ch3:Be,ch4:tt,pdfColorType:"fill",precision:2}),K(Pd),this};var ts=t.textColor||"0 g",xa=f.__private__.getTextColor=f.getTextColor=function(){return de(ts)};f.__private__.setTextColor=f.setTextColor=function(H,he,Be,tt){return ts=ke({ch1:H,ch2:he,ch3:Be,ch4:tt,pdfColorType:"text",precision:3}),this};var no=t.charSpace,_o=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(no||0)};f.__private__.setCharSpace=f.setCharSpace=function(H){if(isNaN(H))throw new Error("Invalid argument passed to
654jsPDF.setCharSpace");return no=H,this};var Lu=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function(H){var he=f.CapJoinStyles[H];if(he===void 0)throw new Error("Line cap style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Lu=he,K(he+" J"),this};var Nl=0;f.__private__.setLineJoin=f.setLineJoin=function(H){var he=f.CapJoinStyles[H];if(he===void 0)throw new Error("Line join style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Nl=he,K(he+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(H){if(H=H||0,isNaN(H))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return K(T(G(H))+" M"),this},f.GState=NT,f.setGState=function(H){(H=typeof H=="string"?lt[Fe[H]]:ea(null,H)).equals(Le)||(K("/"+H.id+" gs"),Le=H)};var ea=function(H,he){if(!H||!Fe[H]){var Be=!1;for(var tt in lt)if(lt.hasOwnProperty(tt)&<[tt].equals(he)){Be=!0;break}if(Be)he=lt[tt];else{var ot="GS"+(Object.keys(lt).length+1).toString(10);lt[ot]=he,he.id=ot}return H&&(Fe[H]=he.id),Nt.publish("addGState",he),he}};f.addGState=function(H,he){return ea(H,he),this},f.saveGraphicsState=function(){return K("q"),Me.push({key:Qe,size:ee,color:ts}),this},f.restoreGraphicsState=function(){K("Q");var H=Me.pop();return Qe=H.key,ee=H.size,ts=H.color,Le=null,this},f.setCurrentTransformationMatrix=function(H){return K(H.toString()+" cm"),this},f.comment=function(H){return K("#"+H),this};var el=function(H,he){var Be=H||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Be},set:function(St){isNaN(St)||(Be=parseFloat(St))}});var tt=he||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return tt},set:function(St){isNaN(St)||(tt=parseFloat(St))}});var ot="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ot},set:function(St){ot=St.toString()}}),this},nc=function(H,he,Be,tt){el.call(this,H,he),this.type="rect";var ot=Be||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ot},set:function(It){isNaN(It)||(ot=parseFloat(It))}});var St=tt||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return St},set:function(It){isNaN(It)||(St=parseFloat(It))}}),this},Tl=function(){this.page=bt,this.currentPage=I,this.pages=ae.slice(0),this.pagesContext=dt.slice(0),this.x=We,this.y=xt,this.matrix=et,this.width=Iu(I),this.height=La(I),this.outputDestination=we,this.id="",this.objectNumber=-1};Tl.prototype.restore=function(){bt=this.page,I=this.currentPage,dt=this.pagesContext,ae=this.pages,We=this.x,xt=this.y,et=this.matrix,Gs(I,this.width),Du(I,this.height),we=this.outputDestination};var Hs=function(H,he,Be,tt,ot){en.push(new Tl),bt=I=0,ae=[],We=H,xt=he,et=ot,rt([Be,tt])};for(var Ki in f.beginFormObject=function(H,he,Be,tt,ot){return Hs(H,he,Be,tt,ot),this},f.endFormObject=function(H){return function(he){if(Dt[he])en.pop().restore();else{var Be=new Tl,tt="Xo"+(Object.keys(Lt).length+1).toString(10);Be.id=tt,Dt[he]=tt,Lt[tt]=Be,Nt.publish("addFormObject",Be),en.pop().restore()}}(H),this},f.doFormObject=function(H,he){var Be=Lt[Dt[H]];return K("q"),K(he.toString()+" cm"),K("/"+Be.id+" Do"),K("Q"),this},f.getFormObject=function(H){var he=Lt[Dt[H]];return{x:he.x,y:he.y,width:he.width,height:he.height,matrix:he.matrix}},f.save=function(H,he){return H=H||"generated.pdf",(he=he||{}).returnPromise=he.returnPromise||!1,he.returnPromise===!1?(e0(Jn(wr()),H),typeof e0.unload=="function"&&tr.setTimeout&&setTimeout(e0.unload,911),this):new Promise(function(Be,tt){try{var ot=e0(Jn(wr()),H);typeof e0.unload=="function"&&tr.setTimeout&&setTimeout(e0.unload,911),Be(ot)}catch(St){tt(St.message)}})},Pn.API)Pn.API.hasOwnProperty(Ki)&&(Ki==="events"&&Pn.API.events.length?function(H,he){var Be,tt,ot;for(ot=he.length-1;ot!==-1;ot--)Be=he[ot][0],tt=he[ot][1],H.subscribe.apply(H,[Be].concat(typeof tt=="function"?[tt]:tt))}(Nt,Pn.API.events):f[Ki]=Pn.API[Ki]);function Iu(H){return dt[H].mediaBox.topRightX-dt[H].mediaBox.bottomLeftX}function Gs(H,he){dt[H].mediaBox.topRightX=he+dt[H].mediaBox.bottomLeftX}function La(H){return dt[H].mediaBox.topRightY-dt[H].mediaBox.bottomLeftY}function Du(H,he){dt[H].mediaBox.topRightY=he+dt[H].mediaBox.bottomLeftY}var Fh=f.getPageWidth=function(H){return Iu(H=H||I)/je},cs=f.setPageWidth=function(H,he){Gs(H,he*je)},us=f.getPageHeight=function(H){return La(H=H||I)/je},Ii=f.setPageHeight=function(H,he){Du(H,he*je)};return f.internal={pdfEscape:ve,getStyle:El,getFont:Dh,getFontSize:me,getCharSpace:_o,getTextColor:xa,getLineHeight:Ni,getLineHeightFactor:ep,getLineWidth:Bh,write:pe,getHorizontalCoordinate:$i,getVerticalCoordinate:Qo,getCoordinateString:Pu,getVerticalCoordinateString:to,collections:{},newObject:mr,newAdditionalObject:sn,newObjectDeferred:gr,newObjectDeferredBegin:br,getFilters:Ye,putStream:ce,events:Nt,scaleFactor:je,pageSize:{getWidth:function(){return Fh(I)},setWidth:function(H){cs(I,H)},getHeight:function(){return us(I)},setHeight:function(H){Ii(I,H)}},encryptionOptions:d,encryption:rr,getEncryptor:function(H){return d!==null?rr.encryptor(H,0):function(he){return he}},output:zn,getNumberOfPages:zt,get pages(){return ae}
vendor: 4,849 bytes, lines 654-656
654,out:K,f2:P,f3:j,getPageInfo:Cs,getPageInfoByObjId:Wi,getCurrentPageInfo:Za,getPDFVersion:x,Point:el,Rectangle:nc,Matrix:Mt,hasHotfix:Ln},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return Fh(I)},set:function(H){cs(I,H)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return us(I)},set:function(H){Ii(I,H)},enumerable:!0,configurable:!0}),(function(H){for(var he=0,Be=Se.length;he<Be;he++){var tt=ft.call(this,H[he][0],H[he][1],H[he][2],Se[he][3],!0);h===!1&&(p[tt]=!0);var ot=H[he][0].split("-");Xt({id:tt,fontName:ot[0],fontStyle:ot[1]||""})}Nt.publish("addFonts",{fonts:Je,dictionary:Ze})}).call(f,Se),Qe="F1",At(i,n),Nt.publish("initialized"),f}dy.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},dy.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},dy.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},dy.prototype.processOwnerPassword=function(t,e){return R4(M4(e).substr(0,5),t)},dy.prototype.encryptor=function(t,e){var n=M4(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return R4(n,r)}},NT.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||Si(t)!==Si(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return r===0},Pn.API={events:[]},Pn.version="4.2.1";var Ps=Pn.API,KO=1,jx=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Sv=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},gx=function(t){return t.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var n=e.charCodeAt(0).toString(16).toUpperCase();return"#"+(n.length===1?"0"+n:n)})},hr=function(t){return t.toFixed(2)},mp=function(t){return t.toFixed(5)};Ps.__acroform__={};var Jl=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},xG=function(t){return t*KO},Xd=function(t){var e=new Qre,n=An.internal.getHeight(t)||0,r=An.internal.getWidth(t)||0;return e.BBox=[0,0,Number(hr(r)),Number(hr(n))],e},J5e=Ps.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},Z5e=Ps.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},Q5e=Ps.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},Xs=Ps.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Q5e(t,e-1)},Ys=Ps.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return J5e(t,e-1)},Js=Ps.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Z5e(t,e-1)},eMe=Ps.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=t[0],s=t[1],a=t[2],o=t[3],l={};return l.lowerLeft_X=n(i)||0,l.lowerLeft_Y=r(s+o)||0,l.upperRight_X=n(i+a)||0,l.upperRight_Y=r(s)||0,[Number(hr(l.lowerLeft_X)),Number(hr(l.lowerLeft_Y)),Number(hr(l.upperRight_X)),Number(hr(l.upperRight_Y))]},tMe=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=j4(t,n),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+hr(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=Xd(t);return s.scope=t.scope,s.stream=e.join(` 655`),s}},j4=function(t,e){var n=t.fontSize===0?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(P){return P.split(` 656`)}):i.map(function(P){return[P]});var s=n,a=An.internal.getHeight(t)||0;a=a<0?-a:a;var o=An.internal.getWidth(t)||0;o=o<0?-o:o;var l=function(P,j,G){if(P+1<i.length){var B=j+" "+i[P+1][0];return nk(B,t,G).width<=o-4}return!1};s++;e:for(;s>0;){e="",s--;var u,d,h=nk("3",t,s).height,p=t.multiline?a-s:(a-h)/2,f=p+=2,m=0,x=0,v=0;if(s<=0){e=`(...) Tj
657`,e+="% Width of Text: "+nk(e,t,s=12).width+", FieldWidth:"+o+` 658`;break}for(var g="",b=0,y=0;y<i.length;y++)if(i.hasOwnProperty(y)){var S=!1;if(i[y].length!==1&&v!==i[y].length-1){if((h+2)*(b+2)+2>a)continue e;g+=i[y][v],S=!0,x=y,y--}else{g=(g+=i[y][v]+" ").substr(g.length-1)==" "?g.substr(0,g.length-1):g;var A=parseInt(y),k=l(A,g,s),M=y>=i.length-1;if(k&&!M){g+=" ",v=0;continue}if(k||M){if(M)x=A;else if(t.multiline&&(h+2)*(b+2)+2>a)continue e}else{if(!t.multiline||(h+2)*(b+2)+2>a)continue e;x=A}}for(var T="",C=m;C<=x;C++){var R=i[C];if(t.multiline){if(C===x){T+=R[v]+" ",v=(v+1)%R.length;continue}if(C===m){T+=R[R.length-1]+" ";continue}}T+=R[0]+" "}switch(T=T.substr(T.length-1)==" "?T.substr(0,T.length-1):T,d=nk(T,t,s).width,t.textAlign){case"right":u=o-d-2;break;case"center":u=(o-d)/2;break;default:u=2}e+=hr(u)+" "+hr(f)+` Td 659`,e+="("+jx(T)+`) Tj 660`,e+=-hr(u)+` 0 Td 661`,f=-(s+2),d=0,m=S?x:x+1,b++,g=""}break}return r.text=e,r.fontSize=s,r},nk=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},nMe={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},rMe=function(t,e){var n={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},iMe=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(kd.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(nMe)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");KO=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new eie,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];s.objId=void 0,s.hasAnnotation&&rMe(s,n)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(n){(function(r,i){var s=!r;for(var a in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(a)){var o=r[a],l=[],u=o.Rect;if(o.Rect&&(o.Rect=eMe(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=An.createDefaultAppearanceStream(o),Si(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(l=o.getKeyValueListForStream()),o.Rect=u,o.hasAppearanceStream&&!o.appearanceStreamContent){var d=tMe(o);l.push({key:"AP",value:"<</N "+d+">>"}),i.internal.acroformPlugin.xForms.push(d)}if(o.appearanceStreamContent){var h="";for(var p in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(p)){var f=o.appearanceStreamContent[p];if(h+="/"+p+" ",h+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var a in f)if(f.hasOwnProperty(a)){var m=f[a];typeof m=="function"&&(m=m.call(i,o)),h+="/"+a+" "+m+" ",i.internal.acroformPlugin.xForms.indexOf(m)>=0||i.internal.acroformPlugin.xForms.push(m)}}else typeof(m=f)=="function"&&(m=m.call(i,o)),h+="/"+a+" "+m,i.internal.acroformPlugin.xForms.indexOf(m)>=0||i.internal.acroformPlugin.xForms.push(m);h+=">>"}l.push({key:"AP",value:`<< 662`+h+">>"})}i.internal.putStream({additionalKeyValues:l,objectId:o.objId}),i.internal.out("endobj")}s&&function(x,v){for(var g in x)if(x.hasOwnProperty(g)){var b=g,y=x[g];v.internal.newObjectDeferredBegin(y.objId,!0),Si(y)==="object"&&typeof y.putStream=="function"&&y.putStream(),delete x[b]}}(i.internal.acroformPlugin.xForms,i)})(n,t)}),t.internal.acroformPlugin.isInitialized=!0}},Zre=Ps.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(a){return a};if(Array.isArray(t)){for(var i="[",s=0;s<t.length;s++)switch(s!==0&&(i+=" "),Si(t[s])){case"boolean":case"number":case"object":i+=t[s].toString();break;case"string":t[s].substr(0,1)==="/"?i+="/"+gx(t[s].substr(1)):(e!==void 0&&n&&(r=n.internal.getEncryptor(e)),i+="("+jx(r(t[s].toString()))+")")}return i+"]"}
vendor: 57,541 bytes, lines 662-697
662throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},ij=function(t,e,n){var r=function(i){return i};return e!==void 0&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+jx(r(t))+")"},uh=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};uh.prototype.toString=function(){return this.objId+" 0 R"},uh.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},uh.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var n in e)if(Object.getOwnPropertyDescriptor(this,e[n]).configurable===!1){var r=e[n],i=this[r];i&&(Array.isArray(i)?t.push({key:r,value:Zre(i,this.objId,this.scope)}):i instanceof uh?(i.scope=this.scope,t.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&t.push({key:r,value:i}))}return t};var Qre=function(){uh.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Jl(Qre,uh);var eie=function(){uh.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+jx(n(t))+")"}},set:function(n){t=n}})};Jl(eie,uh);var kd=function t(){uh.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(g){if(isNaN(g))throw new Error('Invalid value "'+g+'" for attribute F supplied.');e=g}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Xs(e,3)},set:function(g){g?this.F=Ys(e,3):this.F=Js(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(g){if(isNaN(g))throw new Error('Invalid value "'+g+'" for attribute Ff supplied.');n=g}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(g){r=g!==void 0?g:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(g){r[0]=g}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(g){r[1]=g}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(g){r[2]=g}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(g){r[3]=g}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(g){switch(g){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=g;break;default:throw new Error('Invalid value "'+g+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof TT)return;s="FieldObject"+t.FieldNum++}var g=function(b){return b};return this.scope&&(g=this.scope.internal.getEncryptor(this.objId)),"("+jx(g(s))+")"},set:function(g){s=g.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(g){s=g}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(g){a=g}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(g){o=g}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(g){l=g}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/KO:u},set:function(g){u=g}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(g){d=g}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof TT||this instanceof V0))return ij(h,this.objId,this.scope)},set:function(g){g=g.toString(),h=g}});var p=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof $a==0?ij(p,this.objId,this.scope):p},set:function(g){g=g.toString(),p=this instanceof $a==0?g.substr(0,1)==="("?Sv(g.substr(1,g.length-2)):Sv(g):g}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof $a==1?Sv(p.substr(1,p.length-1)):p},set:function(g){g=g.toString(),p=this instanceof $a==1?"/"+gx(g):g}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(g){this.V=g}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof $a==0?ij(f,this.objId,this.scope):f},set:function(g){g=g.toString(),f=this instanceof $a==0?g.substr(0,1)==="("?Sv(g.substr(1,g.length-2)):Sv(g):g}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof $a==1?Sv(f.substr(1,f.length-1)):f},set:function(g){g=g.toString(),f=this instanceof $a==1?"/"+gx(g):g}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var m,x=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return x},set:function(g){g=!!g,x=g}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(m)return m},set:function(g){m=g}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,1)},set:function(g){g?this.Ff=Ys(this.Ff,1):this.Ff=Js(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,2)},set:function(g){g?this.Ff=Ys(this.Ff,2):this.Ff=Js(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,3)},set:function(g){g?this.Ff=Ys(this.Ff,3):this.Ff=Js(this.Ff,3)}});var v=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(v!==null)return v},set:function(g){if([0,1,2].indexOf(g)===-1)throw new Error('Invalid value "'+g+'" for attribute Q supplied.');v=g}}),Object.defineProperty(this,"textAlign",{get:function(){var g;switch(v){case 0:default:g="left";break;case 1:g="center";break;case 2:g="right"}return g},configurable:!0,enumerable:!0,set:function(g){switch(g){case"right":case 2:v=2;break;case"center":case 1:v=1;break;default:v=0}}})};Jl(kd,uh);var sb=function(){kd.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Zre(e,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=function(s,a,o){o||(o=1);for(var l,u=[];l=a.exec(s);)u.push(l[o]);return u}(r,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(n){e=n,this.sort&&e.sort()},this.addOption=function(n){n=(n=n||"").toString(),e.push(n),this.sort&&e.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();e.indexOf(n)!==-1&&(e.splice(e.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,18)},set:function(n){n?this.Ff=Ys(this.Ff,18):this.Ff=Js(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=Ys(this.Ff,19):this.Ff=Js(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,20)},set:function(n){n?(this.Ff=Ys(this.Ff,20),e.sort()):this.Ff=Js(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,22)},set:function(n){n?this.Ff=Ys(this.Ff,22):this.Ff=Js(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,23)},set:function(n){n?this.Ff=Ys(this.Ff,23):this.Ff=Js(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,27)},set:function(n){n?this.Ff=Ys(this.Ff,27):this.Ff=Js(this.Ff,27)}}),this.hasAppearanceStream=!1};Jl(sb,kd);var ab=function(){sb.call(this),this.fontName="helvetica",this.combo=!1};Jl(ab,sb);var ob=function(){ab.call(this),this.combo=!0};Jl(ob,ab);var JC=function(){ob.call(this),this.edit=!0};Jl(JC,ob);var $a=function(){kd.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,15)},set:function(n){n?this.Ff=Ys(this.Ff,15):this.Ff=Js(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,16)},set:function(n){n?this.Ff=Ys(this.Ff,16):this.Ff=Js(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,17)},set:function(n){n?this.Ff=Ys(this.Ff,17):this.Ff=Js(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,26)},set:function(n){n?this.Ff=Ys(this.Ff,26):this.Ff=Js(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(s){return s};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,i=[];for(r in i.push("<<"),e)i.push("/"+r+" ("+jx(n(e[r]))+")");return i.push(">>"),i.join(` 663`)}},set:function(n){Si(n)==="object"&&(e=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(n){typeof n=="string"&&(e.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){var r=n==null?"":n.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),t="/"+gx(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+gx(n)}})};Jl($a,kd);var ZC=function(){$a.call(this),this.pushButton=!0};Jl(ZC,$a);var lb=function(){$a.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};Jl(lb,$a);var TT=function(){var t,e;kd.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(o){return o};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var s,a=[];for(s in a.push("<<"),r)a.push("/"+s+" ("+jx(i(r[s]))+")");return a.push(">>"),a.join(` 664`)},set:function(i){Si(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+gx(s)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+gx(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=An.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Jl(TT,kd),lb.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},lb.prototype.createOption=function(t){var e=new TT;return e.Parent=this,e.optionName=t,this.Kids.push(e),sMe.call(this.scope,e),e};var QC=function(){$a.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=An.CheckBox.createAppearanceStream()};Jl(QC,$a);var V0=function(){kd.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,13)},set:function(e){e?this.Ff=Ys(this.Ff,13):this.Ff=Js(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,21)},set:function(e){e?this.Ff=Ys(this.Ff,21):this.Ff=Js(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,23)},set:function(e){e?this.Ff=Ys(this.Ff,23):this.Ff=Js(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,24)},set:function(e){e?this.Ff=Ys(this.Ff,24):this.Ff=Js(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,25)},set:function(e){e?this.Ff=Ys(this.Ff,25):this.Ff=Js(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,26)},set:function(e){e?this.Ff=Ys(this.Ff,26):this.Ff=Js(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Jl(V0,kd);var eN=function(){V0.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Xs(this.Ff,14)},set:function(t){t?this.Ff=Ys(this.Ff,14):this.Ff=Js(this.Ff,14)}}),this.password=!0};Jl(eN,V0);var An={CheckBox:{createAppearanceStream:function(){return{N:{On:An.CheckBox.YesNormal},D:{On:An.CheckBox.YesPushDown,Off:An.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),s=j4(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+hr(An.internal.getWidth(t))+" "+hr(An.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+hr(s.fontSize)+" Tf "+i),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join(` 665`),e},YesNormal:function(t){var e=Xd(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),i=[],s=An.internal.getHeight(t),a=An.internal.getWidth(t),o=j4(t,t.caption);return i.push("1 g"),i.push("0 0 "+hr(a)+" "+hr(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+hr(a-1)+" "+hr(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+hr(o.fontSize)+" Tf "+r),i.push(o.text),i.push("ET"),i.push("Q"),e.stream=i.join(` 666`),e},OffPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+hr(An.internal.getWidth(t))+" "+hr(An.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(` 667`),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:An.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=An.RadioButton.Circle.YesNormal,e.D[t]=An.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Xd(t);e.scope=t.scope;var n=[],r=An.internal.getWidth(t)<=An.internal.getHeight(t)?An.internal.getWidth(t)/4:An.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=An.internal.Bezier_C,s=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+mp(An.internal.getWidth(t)/2)+" "+mp(An.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(` 668`),e},YesPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=[],r=An.internal.getWidth(t)<=An.internal.getHeight(t)?An.internal.getWidth(t)/4:An.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*An.internal.Bezier_C).toFixed(5)),a=Number((r*An.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+mp(An.internal.getWidth(t)/2)+" "+mp(An.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+mp(An.internal.getWidth(t)/2)+" "+mp(An.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(` 669`),e},OffPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=[],r=An.internal.getWidth(t)<=An.internal.getHeight(t)?An.internal.getWidth(t)/4:An.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*An.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+mp(An.internal.getWidth(t)/2)+" "+mp(An.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(` 670`),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:An.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=An.RadioButton.Cross.YesNormal,e.D[t]=An.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Xd(t);e.scope=t.scope;var n=[],r=An.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+hr(An.internal.getWidth(t)-2)+" "+hr(An.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(hr(r.x1.x)+" "+hr(r.x1.y)+" m"),n.push(hr(r.x2.x)+" "+hr(r.x2.y)+" l"),n.push(hr(r.x4.x)+" "+hr(r.x4.y)+" m"),n.push(hr(r.x3.x)+" "+hr(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(` 671`),e},YesPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=An.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+hr(An.internal.getWidth(t))+" "+hr(An.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+hr(An.internal.getWidth(t)-2)+" "+hr(An.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(hr(n.x1.x)+" "+hr(n.x1.y)+" m"),r.push(hr(n.x2.x)+" "+hr(n.x2.y)+" l"),r.push(hr(n.x4.x)+" "+hr(n.x4.y)+" m"),r.push(hr(n.x3.x)+" "+hr(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(` 672`),e},OffPushDown:function(t){var e=Xd(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+hr(An.internal.getWidth(t))+" "+hr(An.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(` 673`),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};An.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=An.internal.getWidth(t),n=An.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},An.internal.getWidth=function(t){var e=0;return Si(t)==="object"&&(e=xG(t.Rect[2])),e},An.internal.getHeight=function(t){var e=0;return Si(t)==="object"&&(e=xG(t.Rect[3])),e};var sMe=Ps.addField=function(t){if(iMe(this,t),!(t instanceof kd))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Ps.AcroFormChoiceField=sb,Ps.AcroFormListBox=ab,Ps.AcroFormComboBox=ob,Ps.AcroFormEditBox=JC,Ps.AcroFormButton=$a,Ps.AcroFormPushButton=ZC,Ps.AcroFormRadioButton=lb,Ps.AcroFormCheckBox=QC,Ps.AcroFormTextField=V0,Ps.AcroFormPasswordField=eN,Ps.AcroFormAppearance=An,Ps.AcroForm={ChoiceField:sb,ListBox:ab,ComboBox:ob,EditBox:JC,Button:$a,PushButton:ZC,RadioButton:lb,CheckBox:QC,TextField:V0,PasswordField:eN,Appearance:An},Pn.AcroForm={ChoiceField:sb,ListBox:ab,ComboBox:ob,EditBox:JC,Button:$a,PushButton:ZC,RadioButton:lb,CheckBox:QC,TextField:V0,PasswordField:eN,Appearance:An};function tie(t){return t.reduce(function(e,n,r){return e[n]=r,e},{})}(function(t){var e="addImage_";t.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=t.__addimage__.getImageFileTypeByImageData=function(P,j){var G,B,$,U,Z,V=n;if((j=j||n)==="RGBA"||P.data!==void 0&&P.data instanceof Uint8ClampedArray&&"height"in P&&"width"in P)return"RGBA";if(k(P))for(Z in r)for($=r[Z],G=0;G<$.length;G+=1){for(U=!0,B=0;B<$[G].length;B+=1)if($[G][B]!==void 0&&$[G][B]!==P[B]){U=!1;break}if(U===!0){V=Z;break}}else for(Z in r)for($=r[Z],G=0;G<$.length;G+=1){for(U=!0,B=0;B<$[G].length;B+=1)if($[G][B]!==void 0&&$[G][B]!==P.charCodeAt(B)){U=!1;break}if(U===!0){V=Z;break}}return V===n&&j!==n&&(V=j),V},s=function P(j){for(var G=this.internal.write,B=this.internal.putStream,$=(0,this.internal.getFilters)();$.indexOf("FlateEncode")!==-1;)$.splice($.indexOf("FlateEncode"),1);j.objectId=this.internal.newObject();var U=[];if(U.push({key:"Type",value:"/XObject"}),U.push({key:"Subtype",value:"/Image"}),U.push({key:"Width",value:j.width}),U.push({key:"Height",value:j.height}),j.colorSpace===g.INDEXED?U.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(j.palette.length/3-1)+" "+("sMask"in j&&j.sMask!==void 0?j.objectId+2:j.objectId+1)+" 0 R]"}):(U.push({key:"ColorSpace",value:"/"+j.colorSpace}),j.colorSpace===g.DEVICE_CMYK&&U.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),U.push({key:"BitsPerComponent",value:j.bitsPerComponent}),"decodeParameters"in j&&j.decodeParameters!==void 0&&U.push({key:"DecodeParms",value:"<<"+j.decodeParameters+">>"}),"transparency"in j&&Array.isArray(j.transparency)&&j.transparency.length>0){for(var Z="",V=0,W=j.transparency.length;V<W;V++)Z+=j.transparency[V]+" "+j.transparency[V]+" ";U.push({key:"Mask",value:"["+Z+"]"})}j.sMask!==void 0&&U.push({key:"SMask",value:j.objectId+1+" 0 R"});var O=j.filter!==void 0?["/"+j.filter]:void 0;if(B({data:j.data,additionalKeyValues:U,alreadyAppliedFilters:O,objectId:j.objectId}),G("endobj"),"sMask"in j&&j.sMask!==void 0){var Y,z=(Y=j.sMaskBitsPerComponent)!==null&&Y!==void 0?Y:j.bitsPerComponent,I={width:j.width,height:j.height,colorSpace:"DeviceGray",bitsPerComponent:z,data:j.sMask};"filter"in j&&(I.decodeParameters="/Predictor ".concat(j.predictor," /Colors 1 /BitsPerComponent ").concat(z," /Columns ").concat(j.width),I.filter=j.filter),P.call(this,I)}if(j.colorSpace===g.INDEXED){var q=this.internal.newObject();B({data:T(new Uint8Array(j.palette)),objectId:q}),G("endobj")}},a=function(){var P=this.internal.collections[e+"images"];for(var j in P)s.call(this,P[j])},o=function(){var P,j=this.internal.collections[e+"images"],G=this.internal.write;for(var B in j)G("/I"+(P=j[B]).index,P.objectId,"0","R")},l=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var P=this.internal.collections[e+"images"];return l.call(this),P},d=function(){return Object.keys(this.internal.collections[e+"images"]).length},h=function(P){return typeof t["process"+P.toUpperCase()]=="function"},p=function(P){return Si(P)==="object"&&P.nodeType===1},f=function(P,j){if(P.nodeName==="IMG"&&P.hasAttribute("src")){var G=""+P.getAttribute("src");if(G.indexOf("data:image/")===0)return YC(unescape(G).split("base64,").pop());var B=t.loadFile(G,!0);if(B!==void 0)return B}if(P.nodeName==="CANVAS"){if(P.width===0||P.height===0)throw new Error("Given canvas must have data. Canvas width: "+P.width+", height: "+P.height);var $;switch(j){case"PNG":$="image/png";break;case"WEBP":$="image/webp";break;default:$="image/jpeg"}return YC(P.toDataURL($,1).split("base64,").pop())}},m=function(P){var j=this.internal.collections[e+"images"];if(j){for(var G in j)if(P===j[G].alias)return j[G]}},x=function(P,j,G){return P||j||(P=-96,j=-96),P<0&&(P=-1*G.width*72/P/this.internal.scaleFactor),j<0&&(j=-1*G.height*72/j/this.internal.scaleFactor),P===0&&(P=j*G.width/G.height),j===0&&(j=P*G.height/G.width),[P,j]},v=function(P,j,G,B,$,U){var Z=x.call(this,G,B,$),V=this.internal.getCoordinateString,W=this.internal.getVerticalCoordinateString,O=u.call(this);if(G=Z[0],B=Z[1],O[$.index]=$,U){U*=Math.PI/180;var Y=Math.cos(U),z=Math.sin(U),I=function(te){return te.toFixed(4)},q=[I(Y),I(z),I(-1*z),I(Y),0,0,"cm"]}this.internal.write("q"),U?(this.internal.write([1,"0","0",1,V(P),W(j+B),"cm"].join(" ")),this.internal.write(q.join(" ")),this.internal.write([V(G),"0","0",V(B),"0","0","cm"].join(" "))):this.internal.write([V(G),"0","0",V(B),V(P),W(j+B),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+$.index+" Do"),this.internal.write("Q")},g=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var b=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=t.__addimage__.sHashCode=function(P){var j,G,B=0;if(typeof P=="string")for(G=P.length,j=0;j<G;j++)B=(B<<5)-B+P.charCodeAt(j),B|=0;else if(k(P))for(G=P.byteLength/2,j=0;j<G;j++)B=(B<<5)-B+P[j],B|=0;return B},S=t.__addimage__.validateStringAsBase64=function(P){(P=P||"").toString().trim();var j=!0;return P.length===0&&(j=!1),P.length%4!=0&&(j=!1),/^[A-Za-z0-9+/]+$/.test(P.substr(0,P.length-2))===!1&&(j=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(P.substr(-2))===!1&&(j=!1),j},A=t.__addimage__.extractImageFromDataUrl=function(P){if(P==null||!(P=P.trim()).startsWith("data:"))return null;var j=P.indexOf(",");return j<0?null:P.substring(0,j).trim().endsWith("base64")?P.substring(j+1):null};t.__addimage__.isArrayBuffer=function(P){return P instanceof ArrayBuffer};var k=t.__addimage__.isArrayBufferView=function(P){return P instanceof Int8Array||P instanceof Uint8Array||P instanceof Uint8ClampedArray||P instanceof Int16Array||P instanceof Uint16Array||P instanceof Int32Array||P instanceof Uint32Array||P instanceof Float32Array||P instanceof Float64Array},M=t.__addimage__.binaryStringToUint8Array=function(P){for(var j=P.length,G=new Uint8Array(j),B=0;B<j;B++)G[B]=P.charCodeAt(B);return G},T=t.__addimage__.arrayBufferToBinaryString=function(P){for(var j="",G=k(P)?P:new Uint8Array(P),B=0;B<G.length;B+=8192)j+=String.fromCharCode.apply(null,G.subarray(B,B+8192));return j};t.addImage=function(){var P,j,G,B,$,U,Z,V,W;if(typeof arguments[1]=="number"?(j=n,G=arguments[1],B=arguments[2],$=arguments[3],U=arguments[4],Z=arguments[5],V=arguments[6],W=arguments[7]):(j=arguments[1],G=arguments[2],B=arguments[3],$=arguments[4],U=arguments[5],Z=arguments[6],V=arguments[7],W=arguments[8]),Si(P=arguments[0])==="object"&&!p(P)&&"imageData"in P){var O=P;P=O.imageData,j=O.format||j||n,G=O.x||G||0,B=O.y||B||0,$=O.w||O.width||$,U=O.h||O.height||U,Z=O.alias||Z,V=O.compression||V,W=O.rotation||O.angle||W}var Y=this.internal.getFilters();if(V===void 0&&Y.indexOf("FlateEncode")!==-1&&(V="SLOW"),isNaN(G)||isNaN(B))throw new Error("Invalid coordinates passed to jsPDF.addImage");l.call(this);var z=C.call(this,P,j,Z,V);return v.call(this,G,B,$,U,z,W),this};var C=function(P,j,G,B){var $,U,Z;if(typeof P=="string"&&i(P)===n){P=unescape(P);var V=R(P,!1);(V!==""||(V=t.loadFile(P,!0))!==void 0)&&(P=V)}if(p(P)&&(P=f(P,j)),j=i(P,j),!h(j))throw new Error("addImage does not support files of type '"+j+"', please ensure that a plugin for '"+j+"' support is added.");if(((Z=G)==null||Z.length===0)&&(G=function(W){return typeof W=="string"||k(W)?y(W):k(W.data)?y(W.data):null}(P)),($=m.call(this,G))||(P instanceof Uint8Array||j==="RGBA"||(U=P,P=M(P)),$=this["process"+j.toUpperCase()](P,d.call(this),G,function(W){return W&&typeof W=="string"&&(W=W.toUpperCase()),W in t.image_compression?W:b.NONE}(B),U)),!$)throw new Error("An unknown error occurred whilst processing the image.");return $},R=t.__addimage__.convertBase64ToBinaryString=function(P,j){j=typeof j!="boolean"||j;var G,B="";if(typeof P=="string"){var $;G=($=A(P))!==null&&$!==void 0?$:P;try{B=YC(G)}catch(U){if(j)throw S(G)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+U.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return B};t.getImageProperties=function(P){var j,G,B="";if(p(P)&&(P=f(P)),typeof P=="string"&&i(P)===n&&((B=R(P,!1))===""&&(B=t.loadFile(P)||""),P=B),G=i(P),!h(G))throw new Error("addImage does not support files of type '"+G+"', please ensure that a plugin for '"+G+"' support is added.");if(P instanceof Uint8Array||(P=M(P)),!(j=this["process"+G.toUpperCase()](P)))throw new Error("An unknown error occurred whilst processing the image");return j.fileType=G,j}})(Pn.API),function(t){var e=function(n){if(n!==void 0&&n!="")return!0};Pn.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(n){for(var r,i,s,a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,l=this.internal.getPageInfoByObjId(n.objId),u=n.pageContext.annotations,d=!1,h=0;h<u.length&&!d;h++)switch((r=u[h]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var p=0;p<u.length;p++){r=u[p];var f=this.internal.pdfEscape,m=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var x=this.internal.newAdditionalObject(),v=this.internal.newAdditionalObject(),g=this.internal.getEncryptor(x.objId),b=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y)+"] ")+"/Contents ("+f(g(r.contents))+")",s+=" /Popup "+v.objId+" 0 R",s+=" /P "+l.objId+" 0 R",s+=" /T ("+f(g(b))+") >>",x.content=s;var y=x.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(r.bounds.x+30)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w+30)+" "+o(r.bounds.y)+"] ")+" /Parent "+y,r.open&&(s+=" /Open true"),s+=" >>",v.content=s,this.internal.write(x.objId,"0 R",v.objId,"0 R");break;case"freetext":i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y+r.bounds.h)+"] ";var S="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(r.color||"#000000");s="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(m(r.contents))+")",s+=" /DS("+f(m(S))+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var A=this.annotations._nameMap[r.options.name];r.options.pageNumber=A.page,r.options.top=A.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(m(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var k=o(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+k+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),t.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},t.link=function(n,r,i,s,a){var o=this.internal.getCurrentPageInfo(),l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:l(n),y:u(r),w:l(n+i),h:u(r+s)},options:a,type:"link"})},t.textWithLink=function(n,r,i,s){var a,o,l=this.getTextWidth(n),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){o=s.maxWidth;var d=this.splitTextToSize(n,o).length;a=Math.ceil(u*d)}else o=l,a=u;return this.text(n,r,i,s),i+=.2*u,s.align==="center"&&(r-=l/2),s.align==="right"&&(r-=l),this.link(r,i-u,o,a,s),l},t.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(Pn.API),function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var s=t.__arabicParser__.isInArabicSubstitutionA=function(x){return e[x.charCodeAt(0)]!==void 0},a=t.__arabicParser__.isArabicLetter=function(x){return typeof x=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(x)},o=t.__arabicParser__.isArabicEndLetter=function(x){return a(x)&&s(x)&&e[x.charCodeAt(0)].length<=2},l=t.__arabicParser__.isArabicAlfLetter=function(x){return a(x)&&i.indexOf(x.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(x){return a(x)&&s(x)&&e[x.charCodeAt(0)].length>=1};var u=t.__arabicParser__.arabicLetterHasFinalForm=function(x){return a(x)&&s(x)&&e[x.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(x){return a(x)&&s(x)&&e[x.charCodeAt(0)].length>=3};var d=t.__arabicParser__.arabicLetterHasMedialForm=function(x){return a(x)&&s(x)&&e[x.charCodeAt(0)].length==4},h=t.__arabicParser__.resolveLigatures=function(x){var v=0,g=n,b="",y=0;for(v=0;v<x.length;v+=1)g[x.charCodeAt(v)]!==void 0?(y++,typeof(g=g[x.charCodeAt(v)])=="number"&&(b+=String.fromCharCode(g),g=n,y=0),v===x.length-1&&(g=n,b+=x.charAt(v-(y-1)),v-=y-1,y=0)):(g=n,b+=x.charAt(v-y),v-=y,y=0);return b};t.__arabicParser__.isArabicDiacritic=function(x){return x!==void 0&&r[x.charCodeAt(0)]!==void 0};var p=t.__arabicParser__.getCorrectForm=function(x,v,g){return a(x)?s(x)===!1?-1:!u(x)||!a(v)&&!a(g)||!a(g)&&o(v)||o(x)&&!a(v)||o(x)&&l(v)||o(x)&&o(v)?0:d(x)&&a(v)&&!o(v)&&a(g)&&u(g)?3:o(x)||!a(g)?1:2:-1},f=function(x){var v=0,g=0,b=0,y="",S="",A="",k=(x=x||"").split("\\s+"),M=[];for(v=0;v<k.length;v+=1){for(M.push(""),g=0;g<k[v].length;g+=1)y=k[v][g],S=k[v][g-1],A=k[v][g+1],a(y)?(b=p(y,S,A),M[v]+=b!==-1?String.fromCharCode(e[y.charCodeAt(0)][b]):y):M[v]+=y;M[v]=h(M[v])}return M.join(" ")},m=t.__arabicParser__.processArabic=t.processArabic=function(){var x,v=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,g=[];if(Array.isArray(v)){var b=0;for(g=[],b=0;b<v.length;b+=1)Array.isArray(v[b])?g.push([f(v[b][0]),v[b][1],v[b][2]]):g.push([f(v[b])]);x=g}else x=f(v);return typeof arguments[0]=="string"?x:(arguments[0].text=x,arguments[0])};t.events.push(["preProcessText",m])}(Pn.API),Pn.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},function(t){var e=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(o){n=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(o){i=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(o){s=o}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(o){a=o}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(Pn.API),function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var l=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return l},set:function(x){l=x}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(x){u=x}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(x){d=x}});var h=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return h},set:function(x){h=x}});var p=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return p},set:function(x){p=x}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(x){f=x}});var m=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return m},set:function(x){m=x}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(l){return r.call(this),this.internal.__cell__.headerFunction=typeof l=="function"?l:void 0,this},t.getTextDimensions=function(l,u){r.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),h=u.font||this.getFont(),p=u.scaleFactor||this.internal.scaleFactor,f=0,m=0,x=0,v=this;if(!Array.isArray(l)&&typeof l!="string"){if(typeof l!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");l=String(l)}var g=u.maxWidth;g>0?typeof l=="string"?l=this.splitTextToSize(l,g):Object.prototype.toString.call(l)==="[object Array]"&&(l=l.reduce(function(y,S){return y.concat(v.splitTextToSize(S,g))},[])):l=Array.isArray(l)?l:[l];for(var b=0;b<l.length;b++)f<(x=this.getStringUnitWidth(l[b],{font:h})*d)&&(f=x);return f!==0&&(m=l.length),{w:f/=p,h:Math.max((m*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/p,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var l=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new s(l.left,l.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=t.cell=function(){var l;l=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,h=this.internal.__cell__.margins||e,p=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===l.lineNumber?(l.x=(u.x||0)+(u.width||0),l.y=u.y||0):u.y+u.height+l.height+h.bottom>this.getPageHeight()?(this.cellAddPage(),l.y=h.top,f&&p&&(this.printHeaderRow(l.lineNumber,!0),l.y+=p[0].height)):l.y=u.y+u.height||l.y),l.text[0]!==void 0&&(this.rect(l.x,l.y,l.width,l.height,n===!0?"FD":void 0),l.align==="right"?this.text(l.text,l.x+l.width-d,l.y+d,{align:"right",baseline:"top"}):l.align==="center"?this.text(l.text,l.x+l.width/2,l.y+d,{align:"center",baseline:"top",maxWidth:l.width-d-d}):this.text(l.text,l.x+d,l.y+d,{align:"left",baseline:"top",maxWidth:l.width-d-d})),this.internal.__cell__.lastCell=l,this};t.table=function(l,u,d,h,p){if(r.call(this),!d)throw new Error("No data for PDF table.");var f,m,x,v,g=[],b=[],y=[],S={},A={},k=[],M=[],T=(p=p||{}).autoSize||!1,C=p.printHeaders!==!1,R=p.css&&p.css["font-size"]!==void 0?16*p.css["font-size"]:p.fontSize||12,P=p.margins||Object.assign({width:this.getPageWidth()},e),j=typeof p.padding=="number"?p.padding:3,G=p.headerBackgroundColor||"#c8c8c8",B=p.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=C,this.internal.__cell__.margins=P,this.internal.__cell__.table_font_size=R,this.internal.__cell__.padding=j,this.internal.__cell__.headerBackgroundColor=G,this.internal.__cell__.headerTextColor=B,this.setFontSize(R),h==null)b=g=Object.keys(d[0]),y=g.map(function(){return"left"});else if(Array.isArray(h)&&Si(h[0])==="object")for(g=h.map(function(O){return O.name}),b=h.map(function(O){return O.prompt||O.name||""}),y=h.map(function(O){return O.align||"left"}),f=0;f<h.length;f+=1)A[h[f].name]=.7499990551181103*h[f].width;else Array.isArray(h)&&typeof h[0]=="string"&&(b=g=h,y=g.map(function(){return"left"}));if(T||Array.isArray(h)&&typeof h[0]=="string")for(f=0;f<g.length;f+=1){for(S[v=g[f]]=d.map(function(O){return O[v]}),this.setFont(void 0,"bold"),k.push(this.getTextDimensions(b[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),m=S[v],this.setFont(void 0,"normal"),x=0;x<m.length;x+=1)k.push(this.getTextDimensions(m[x],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);A[v]=Math.max.apply(null,k)+j+j,k=[]}if(C){var $={};for(f=0;f<g.length;f+=1)$[g[f]]={},$[g[f]].text=b[f],$[g[f]].align=y[f];var U=o.call(this,$,A);M=g.map(function(O){return new s(l,u,A[O],U,$[O].text,void 0,$[O].align)}),this.setTableHeaderRow(M),this.printHeaderRow(1,!1)}var Z=h.reduce(function(O,Y){return O[Y.name]=Y.align,O},{});for(f=0;f<d.length;f+=1){"rowStart"in p&&p.rowStart instanceof Function&&p.rowStart({row:f,data:d[f]},this);var V=o.call(this,d[f],A);for(x=0;x<g.length;x+=1){var W=d[f][g[x]];"cellStart"in p&&p.cellStart instanceof Function&&p.cellStart({row:f,col:x,data:W},this),a.call(this,new s(l,u,A[g[x]],V,W,f+2,Z[g[x]]))}}return this.internal.__cell__.table_x=l,this.internal.__cell__.table_y=u,this};var o=function(l,u){var d=this.internal.__cell__.padding,h=this.internal.__cell__.table_font_size,p=this.internal.scaleFactor;return Object.keys(l).map(function(f){var m=l[f];return this.splitTextToSize(m.hasOwnProperty("text")?m.text:m,u[f]-d-d)},this).map(function(f){return this.getLineHeightFactor()*f.length*h/p+d+d},this).reduce(function(f,m){return Math.max(f,m)},0)};t.setTableHeaderRow=function(l){r.call(this),this.internal.__cell__.tableHeaderRow=l},t.printHeaderRow=function(l,u){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var h=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(h[0],h[1],h[2],h[3],void 0,-1)}this.setFont(void 0,"bold");for(var p=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){d=this.internal.__cell__.tableHeaderRow[f].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,p.push(d)),d.lineNumber=l;var m=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,d),this.setTextColor(m)}p.length>0&&this.setTableHeaderRow(p),this.setFont(void 0,"normal"),n=!1}}(Pn.API);var nie={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},rie=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],P4=tie(rie),iie=[100,200,300,400,500,600,700,800,900],aMe=tie(iie);function sj(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),n=function(s){return nie[s=s||"normal"]?s:"normal"}(t.style),r=function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400}(t.weight),i=function(s){return typeof P4[s=s||"normal"]=="number"?s:"normal"}(t.stretch);return{family:e,style:n,weight:r,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,n,r].join(" ")}}}function vG(t,e,n,r){var i;for(i=n;i>=0&&i<e.length;i+=r)if(t[e[i]])return t[e[i]];for(i=n;i>=0&&i<e.length;i-=r)if(t[e[i]])return t[e[i]]}var oMe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},yG={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function bG(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function wG(t){return t.trimLeft()}function lMe(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function cMe(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var Av,rk,_G,SG,AG,aj=["times"];function EG(t,e,n,r,i){var s=4,a=CG;switch(i){case Pn.API.image_compression.FAST:s=1,a=kG;break;case Pn.API.image_compression.MEDIUM:s=6,a=NG;break;case Pn.API.image_compression.SLOW:s=9,a=TG}t=function(l,u,d,h){for(var p,f=l.length/u,m=new Uint8Array(l.length+f),x=[uMe,kG,CG,NG,TG],v=0;v<f;v+=1){var g=v*u,b=l.subarray(g,g+u);if(h)m.set(h(b,d,p),g+v);else{for(var y=x.length,S=[],A=0;A<y;A+=1)S[A]=x[A](b,d,p);var k=hMe(S.concat());m.set(S[k],g+v)}p=b}return m}(t,e,Math.ceil(n*r/8),a);var o=b4(t,{level:s});return Pn.API.__addimage__.arrayBufferToBinaryString(o)}function uMe(t){var e=Array.apply([],t);return e.unshift(0),e}function kG(t,e){var n=t.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var s=t[i-e]||0;r[i+1]=t[i]-s+256&255}return r}function CG(t,e,n){var r=t.length,i=[];i[0]=2;for(var s=0;s<r;s+=1){var a=n&&n[s]||0;i[s+1]=t[s]-a+256&255}return i}function NG(t,e,n){var r=t.length,i=[];i[0]=3;for(var s=0;s<r;s+=1){var a=t[s-e]||0,o=n&&n[s]||0;i[s+1]=t[s]+256-(a+o>>>1)&255}return i}function TG(t,e,n){var r=t.length,i=[];i[0]=4;for(var s=0;s<r;s+=1){var a=dMe(t[s-e]||0,n&&n[s]||0,n&&n[s-e]||0);i[s+1]=t[s]-a+256&255}return i}function dMe(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),i=Math.abs(t-n),s=Math.abs(t+e-n-n);return r<=i&&r<=s?t:i<=s?e:n}function hMe(t){var e=t.map(function(n){return n.reduce(function(r,i){return r+Math.abs(i)},0)});return e.indexOf(Math.min.apply(null,e))}function oj(t,e,n){var r=e*n,i=Math.floor(r/8),s=16-(r-8*i+n),a=(1<<n)-1;return sie(t,i)>>s&a}function MG(t,e,n,r){var i=n*r,s=Math.floor(i/8),a=16-(i-8*s+r),o=(1<<r)-1,l=(e&o)<<a;(function(u,d,h){if(d+1<u.byteLength)u.setUint16(d,h,!1);else{var p=h>>8&255;u.setUint8(d,p)}})(t,s,sie(t,s)&~(o<<a)&65535|l)}function sie(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function fMe(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,i=t[e++],s=i>>7,a=1<<1+(7&i);t[e++],t[e++];var o=null,l=null;s&&(o=e,l=a,e+=3*a);var u=!0,d=[],h=0,p=null,f=0,m=null;for(this.width=n,this.height=r;u&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,m=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var x=t[e++];h=t[e++]|t[e++]<<8,p=t[e++],1&x||(p=null),f=x>>2&7,e++;break;case 254:for(;;){if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var v=t[e++]|t[e++]<<8,g=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,S=t[e++],A=S>>6&1,k=1<<1+(7&S),M=o,T=l,C=!1;S>>7&&(C=!0,M=e,T=k,e+=3*k);var R=e;for(e++;;){var P;if(!((P=t[e++])>=0))throw Error("Invalid block size");if(P===0)break;e+=P}d.push({x:v,y:g,width:b,height:y,has_local_palette:C,palette_offset:M,palette_size:T,data_offset:R,data_length:e-R,transparent_index:p,interlaced:!!A,delay:h,disposal:f});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return m},this.frameInfo=function(j){if(j<0||j>=d.length)throw new Error("Frame index out of range.");return d[j]},this.decodeAndBlitFrameBGRA=function(j,G){var B=this.frameInfo(j),$=B.width*B.height;if($>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var U=new Uint8Array($);RG(t,B.data_offset,U,$);var Z=B.palette_offset,V=B.transparent_index;V===null&&(V=256);var W=B.width,O=n-W,Y=W,z=4*(B.y*n+B.x),I=4*((B.y+B.height)*n+B.x),q=z,te=4*O;B.interlaced===!0&&(te+=4*n*7);for(var se=8,ie=0,le=U.length;ie<le;++ie){var xe=U[ie];if(Y===0&&(Y=W,(q+=te)>=I&&(te=4*O+4*n*(se-1),q=z+(W+O)*(se<<1),se>>=1)),xe===V)q+=4;else{var Ee=t[Z+3*xe],ae=t[Z+3*xe+1],Q=t[Z+3*xe+2];G[q++]=Q,G[q++]=ae,G[q++]=Ee,G[q++]=255}--Y}},this.decodeAndBlitFrameRGBA=function(j,G){var B=this.frameInfo(j),$=B.width*B.height;if($>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var U=new Uint8Array($);RG(t,B.data_offset,U,$);var Z=B.palette_offset,V=B.transparent_index;V===null&&(V=256);var W=B.width,O=n-W,Y=W,z=4*(B.y*n+B.x),I=4*((B.y+B.height)*n+B.x),q=z,te=4*O;B.interlaced===!0&&(te+=4*n*7);for(var se=8,ie=0,le=U.length;ie<le;++ie){var xe=U[ie];if(Y===0&&(Y=W,(q+=te)>=I&&(te=4*O+4*n*(se-1),q=z+(W+O)*(se<<1),se>>=1)),xe===V)q+=4;else{var Ee=t[Z+3*xe],ae=t[Z+3*xe+1],Q=t[Z+3*xe+2];G[q++]=Ee,G[q++]=ae,G[q++]=Q,G[q++]=255}--Y}}}function RG(t,e,n,r){for(var i=t[e++],s=1<<i,a=s+1,o=a+1,l=i+1,u=(1<<l)-1,d=0,h=0,p=0,f=t[e++],m=new Int32Array(4096),x=null;;){for(;d<16&&f!==0;)h|=t[e++]<<d,d+=8,f===1?f=t[e++]:--f;if(d<l)break;var v=h&u;if(h>>=l,d-=l,v!==s){if(v===a)break;for(var g=v<o?v:x,b=0,y=g;y>s;)y=m[y]>>8,++b;var S=y;if(p+b+(g!==v?1:0)>r)return void ji.log("Warning, gif stream longer than expected.");n[p++]=S;var A=p+=b;for(g!==v&&(n[p++]=S),y=g;b--;)y=m[y],n[--A]=255&y,y>>=8;x!==null&&o<4096&&(m[o++]=x<<8|S,o>=u+1&&l<12&&(++l,u=u<<1|1)),x=v}else o=a+1,u=(1<<(l=i+1))-1,x=null}return p!==r&&ji.log("Warning, gif stream shorter than expected."),n}/** 674 * @license 675 Copyright (c) 2008, Adobe Systems Incorporated 676 All rights reserved. 677 678 Redistribution and use in source and binary forms, with or without 679 modification, are permitted provided that the following conditions are 680 met: 681 682 * Redistributions of source code must retain the above copyright notice, 683 this list of conditions and the following disclaimer. 684 685 * Redistributions in binary form must reproduce the above copyright 686 notice, this list of conditions and the following disclaimer in the 687 documentation and/or other materials provided with the distribution. 688 689 * Neither the name of Adobe Systems Incorporated nor the names of its 690 contributors may be used to endorse or promote products derived from 691 this software without specific prior written permission. 692 693 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 694 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 695 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 696 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 697 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,826 bytes, lines 698-704
698 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 699 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 700 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 701 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 702 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 703 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 704*/function lj(t){var e,n,r,i,s,a=Math.floor,o=new Array(64),l=new Array(64),u=new Array(64),d=new Array(64),h=new Array(65535),p=new Array(65535),f=new Array(64),m=new Array(64),x=[],v=0,g=7,b=new Array(64),y=new Array(64),S=new Array(64),A=new Array(256),k=new Array(2048),M=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],C=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],j=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],G=[0,1,2,3,4,5,6,7,8,9,10,11],B=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],$=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function U(z,I){for(var q=0,te=0,se=new Array,ie=1;ie<=16;ie++){for(var le=1;le<=z[ie];le++)se[I[te]]=[],se[I[te]][0]=q,se[I[te]][1]=ie,te++,q++;q*=2}return se}function Z(z){for(var I=z[0],q=z[1]-1;q>=0;)I&1<<q&&(v|=1<<g),q--,--g<0&&(v==255?(V(255),V(0)):V(v),g=7,v=0)}function V(z){x.push(z)}function W(z){V(z>>8&255),V(255&z)}function O(z,I,q,te,se){for(var ie,le=se[0],xe=se[240],Ee=function(ee,re){var me,Ge,He,_e,Ne,ue,Ce,Ke,Qe,je,We=0;for(Qe=0;Qe<8;++Qe){me=ee[We],Ge=ee[We+1],He=ee[We+2],_e=ee[We+3],Ne=ee[We+4],ue=ee[We+5],Ce=ee[We+6];var xt=me+(Ke=ee[We+7]),et=me-Ke,Je=Ge+Ce,Ze=Ge-Ce,Me=He+ue,Xe=He-ue,ut=_e+Ne,lt=_e-Ne,Fe=xt+ut,Le=xt-ut,bt=Je+Me,dt=Je-Me;ee[We]=Fe+bt,ee[We+4]=Fe-bt;var Nt=.707106781*(dt+Le);ee[We+2]=Le+Nt,ee[We+6]=Le-Nt;var _t=.382683433*((Fe=lt+Xe)-(dt=Ze+et)),Lt=.5411961*Fe+_t,Dt=1.306562965*dt+_t,en=.707106781*(bt=Xe+Ze),Mt=et+en,nn=et-en;ee[We+5]=nn+Lt,ee[We+3]=nn-Lt,ee[We+1]=Mt+Dt,ee[We+7]=Mt-Dt,We+=8}for(We=0,Qe=0;Qe<8;++Qe){me=ee[We],Ge=ee[We+8],He=ee[We+16],_e=ee[We+24],Ne=ee[We+32],ue=ee[We+40],Ce=ee[We+48];var Tn=me+(Ke=ee[We+56]),Fn=me-Ke,lr=Ge+Ce,mr=Ge-Ce,gr=He+ue,br=He-ue,sn=_e+Ne,Mr=_e-Ne,yi=Tn+sn,de=Tn-sn,ke=lr+gr,Ye=lr-gr;ee[We]=yi+ke,ee[We+32]=yi-ke;var ce=.707106781*(Ye+de);ee[We+16]=de+ce,ee[We+48]=de-ce;var Pe=.382683433*((yi=Mr+br)-(Ye=mr+Fn)),De=.5411961*yi+Pe,qe=1.306562965*Ye+Pe,$e=.707106781*(ke=br+mr),mt=Fn+$e,vt=Fn-$e;ee[We+40]=vt+De,ee[We+24]=vt-De,ee[We+8]=mt+qe,ee[We+56]=mt-qe,We++}for(Qe=0;Qe<64;++Qe)je=ee[Qe]*re[Qe],f[Qe]=je>0?je+.5|0:je-.5|0;return f}(z,I),ae=0;ae<64;++ae)m[M[ae]]=Ee[ae];var Q=m[0]-q;q=m[0],Q==0?Z(te[0]):(Z(te[p[ie=32767+Q]]),Z(h[ie]));for(var we=63;we>0&&m[we]==0;)we--;if(we==0)return Z(le),q;for(var Ae,K=1;K<=we;){for(var pe=K;m[K]==0&&K<=we;)++K;var ye=K-pe;if(ye>=16){Ae=ye>>4;for(var Se=1;Se<=Ae;++Se)Z(xe);ye&=15}ie=32767+m[K],Z(se[(ye<<4)+p[ie]]),Z(h[ie]),K++}return we!=63&&Z(le),q}function Y(z){z=Math.min(Math.max(z,1),100),s!=z&&(function(I){for(var q=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],te=0;te<64;te++){var se=a((q[te]*I+50)/100);se=Math.min(Math.max(se,1),255),o[M[te]]=se}for(var ie=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],le=0;le<64;le++){var xe=a((ie[le]*I+50)/100);xe=Math.min(Math.max(xe,1),255),l[M[le]]=xe}for(var Ee=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ae=0,Q=0;Q<8;Q++)for(var we=0;we<8;we++)u[ae]=1/(o[M[ae]]*Ee[Q]*Ee[we]*8),d[ae]=1/(l[M[ae]]*Ee[Q]*Ee[we]*8),ae++}(z<50?Math.floor(5e3/z):Math.floor(200-2*z)),s=z)}this.encode=function(z,I){I&&Y(I),x=new Array,v=0,g=7,W(65496),W(65504),W(16),V(74),V(70),V(73),V(70),V(0),V(1),V(1),V(0),W(1),W(1),V(0),V(0),function(){W(65499),W(132),V(0);for(var Ge=0;Ge<64;Ge++)V(o[Ge]);V(1);for(var He=0;He<64;He++)V(l[He])}(),function(Ge,He){W(65472),W(17),V(8),W(He),W(Ge),V(3),V(1),V(17),V(0),V(2),V(17),V(1),V(3),V(17),V(1)}(z.width,z.height),function(){W(65476),W(418),V(0);for(var Ge=0;Ge<16;Ge++)V(T[Ge+1]);for(var He=0;He<=11;He++)V(C[He]);V(16);for(var _e=0;_e<16;_e++)V(R[_e+1]);for(var Ne=0;Ne<=161;Ne++)V(P[Ne]);V(1);for(var ue=0;ue<16;ue++)V(j[ue+1]);for(var Ce=0;Ce<=11;Ce++)V(G[Ce]);V(17);for(var Ke=0;Ke<16;Ke++)V(B[Ke+1]);for(var Qe=0;Qe<=161;Qe++)V($[Qe])}(),W(65498),W(12),V(3),V(1),V(0),V(2),V(17),V(3),V(17),V(0),V(63),V(0);var q=0,te=0,se=0;
vendor: 27,574 bytes, lines 704-710
704v=0,g=7,this.encode.displayName="_encode_";for(var ie,le,xe,Ee,ae,Q,we,Ae,K,pe=z.data,ye=z.width,Se=z.height,ee=4*ye,re=0;re<Se;){for(ie=0;ie<ee;){for(ae=ee*re+ie,we=-1,Ae=0,K=0;K<64;K++)Q=ae+(Ae=K>>3)*ee+(we=4*(7&K)),re+Ae>=Se&&(Q-=ee*(re+1+Ae-Se)),ie+we>=ee&&(Q-=ie+we-ee+4),le=pe[Q++],xe=pe[Q++],Ee=pe[Q++],b[K]=(k[le]+k[xe+256|0]+k[Ee+512|0]>>16)-128,y[K]=(k[le+768|0]+k[xe+1024|0]+k[Ee+1280|0]>>16)-128,S[K]=(k[le+1280|0]+k[xe+1536|0]+k[Ee+1792|0]>>16)-128;q=O(b,u,q,e,r),te=O(y,d,te,n,i),se=O(S,d,se,n,i),ie+=32}re+=8}if(g>=0){var me=[];me[1]=g+1,me[0]=(1<<g+1)-1,Z(me)}return W(65497),new Uint8Array(x)},t=t||50,function(){for(var z=String.fromCharCode,I=0;I<256;I++)A[I]=z(I)}(),e=U(T,C),n=U(j,G),r=U(R,P),i=U(B,$),function(){for(var z=1,I=2,q=1;q<=15;q++){for(var te=z;te<I;te++)p[32767+te]=q,h[32767+te]=[],h[32767+te][1]=q,h[32767+te][0]=te;for(var se=-(I-1);se<=-z;se++)p[32767+se]=q,h[32767+se]=[],h[32767+se][1]=q,h[32767+se][0]=I-1+se;z<<=1,I<<=1}}(),function(){for(var z=0;z<256;z++)k[z]=19595*z,k[z+256|0]=38470*z,k[z+512|0]=7471*z+32768,k[z+768|0]=-11059*z,k[z+1024|0]=-21709*z,k[z+1280|0]=32768*z+8421375,k[z+1536|0]=-27439*z,k[z+1792|0]=-5329*z}(),Y(t)}/** 705 * @license 706 * Copyright (c) 2017 Aras Abbasi 707 * 708 * Licensed under the MIT License. 709 * http://opensource.org/licenses/mit-license 710 */function qu(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function jG(t){function e(C){if(!C)throw Error("assert :P")}function n(C,R,P){for(var j=0;4>j;j++)if(C[R+j]!=P.charCodeAt(j))return!0;return!1}function r(C,R,P,j,G){for(var B=0;B<G;B++)C[R+B]=P[j+B]}function i(C,R,P,j){for(var G=0;G<j;G++)C[R+G]=P}function s(C){return new Int32Array(C)}function a(C,R){for(var P=[],j=0;j<C;j++)P.push(new R);return P}function o(C,R){var P=[];return function j(G,B,$){for(var U=$[B],Z=0;Z<U&&(G.push($.length>B+1?[]:new R),!($.length<B+1));Z++)j(G[Z],B+1,$)}(P,0,C),P}var l=function(){var C=this;function R(N,D){for(var X=1<<D-1>>>0;N&X;)X>>>=1;return X?(N&X-1)+X:N}function P(N,D,X,ne,fe){e(!(ne%X));do N[D+(ne-=X)]=fe;while(0<ne)}function j(N,D,X,ne,fe){if(e(2328>=fe),512>=fe)var ge=s(512);else if((ge=s(fe))==null)return 0;return function(be,Te,Re,ze,Ue,gt){var Oe,it,ht=Te,kt=1<<Re,pt=s(16),Tt=s(16);for(e(Ue!=0),e(ze!=null),e(be!=null),e(0<Re),it=0;it<Ue;++it){if(15<ze[it])return 0;++pt[ze[it]]}if(pt[0]==Ue)return 0;for(Tt[1]=0,Oe=1;15>Oe;++Oe){if(pt[Oe]>1<<Oe)return 0;Tt[Oe+1]=Tt[Oe]+pt[Oe]}for(it=0;it<Ue;++it)Oe=ze[it],0<ze[it]&&(gt[Tt[Oe]++]=it);if(Tt[15]==1)return(ze=new G).g=0,ze.value=gt[0],P(be,ht,1,kt,ze),kt;var jt,Ht=-1,Ft=kt-1,kn=0,hn=1,dr=1,yn=1<<Re;for(it=0,Oe=1,Ue=2;Oe<=Re;++Oe,Ue<<=1){if(hn+=dr<<=1,0>(dr-=pt[Oe]))return 0;for(;0<pt[Oe];--pt[Oe])(ze=new G).g=Oe,ze.value=gt[it++],P(be,ht+kn,Ue,yn,ze),kn=R(kn,Oe)}for(Oe=Re+1,Ue=2;15>=Oe;++Oe,Ue<<=1){if(hn+=dr<<=1,0>(dr-=pt[Oe]))return 0;for(;0<pt[Oe];--pt[Oe]){if(ze=new G,(kn&Ft)!=Ht){for(ht+=yn,jt=1<<(Ht=Oe)-Re;15>Ht&&!(0>=(jt-=pt[Ht]));)++Ht,jt<<=1;kt+=yn=1<<(jt=Ht-Re),be[Te+(Ht=kn&Ft)].g=jt+Re,be[Te+Ht].value=ht-Te-Ht}ze.g=Oe-Re,ze.value=gt[it++],P(be,ht+(kn>>Re),Ue,yn,ze),kn=R(kn,Oe)}}return hn!=2*Tt[15]-1?0:kt}(N,D,X,ne,fe,ge)}function G(){this.value=this.g=0}function B(){this.value=this.g=0}function $(){this.G=a(5,G),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Bd,B)}function U(N,D,X,ne){e(N!=null),e(D!=null),e(2147483648>ne),N.Ca=254,N.I=0,N.b=-8,N.Ka=0,N.oa=D,N.pa=X,N.Jd=D,N.Yc=X+ne,N.Zc=4<=ne?X+ne-4+1:X,le(N)}function Z(N,D){for(var X=0;0<D--;)X|=Ee(N,128)<<D;return X}function V(N,D){var X=Z(N,D);return xe(N)?-X:X}function W(N,D,X,ne){var fe,ge=0;for(e(N!=null),e(D!=null),e(4294967288>ne),N.Sb=ne,N.Ra=0,N.u=0,N.h=0,4<ne&&(ne=4),fe=0;fe<ne;++fe)ge+=D[X+fe]<<8*fe;N.Ra=ge,N.bb=ne,N.oa=D,N.pa=X}function O(N){for(;8<=N.u&&N.bb<N.Sb;)N.Ra>>>=8,N.Ra+=N.oa[N.pa+N.bb]<<Ns-8>>>0,++N.bb,N.u-=8;te(N)&&(N.h=1,N.u=0)}function Y(N,D){if(e(0<=D),!N.h&&D<=Fu){var X=q(N)&Fd[D];return N.u+=D,O(N),X}return N.h=1,N.u=0}function z(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function I(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function q(N){return N.Ra>>>(N.u&Ns-1)>>>0}function te(N){return e(N.bb<=N.Sb),N.h||N.bb==N.Sb&&N.u>Ns}function se(N,D){N.u=D,N.h=te(N)}function ie(N){N.u>=Ia&&(e(N.u>=Ia),O(N))}function le(N){e(N!=null&&N.oa!=null),N.pa<N.Zc?(N.I=(N.oa[N.pa++]|N.I<<8)>>>0,N.b+=8):(e(N!=null&&N.oa!=null),N.pa<N.Yc?(N.b+=8,N.I=N.oa[N.pa++]|N.I<<8):N.Ka?N.b=0:(N.I<<=8,N.b+=8,N.Ka=1))}function xe(N){return Z(N,1)}function Ee(N,D){var X=N.Ca;0>N.b&&le(N);var ne=N.b,fe=X*D>>>8,ge=(N.I>>>ne>fe)+0;for(ge?(X-=fe,N.I-=fe+1<<ne>>>0):X=fe+1,ne=X,fe=0;256<=ne;)fe+=8,ne>>=8;return ne=7^fe+Hc[ne],N.b-=ne,N.Ca=(X<<ne)-1,ge}function ae(N,D,X){N[D+0]=X>>24&255,N[D+1]=X>>16&255,N[D+2]=X>>8&255,N[D+3]=255&X}function Q(N,D){return N[D+0]|N[D+1]<<8}function we(N,D){return Q(N,D)|N[D+2]<<16}function Ae(N,D){return Q(N,D)|Q(N,D+2)<<16}function K(N,D){var X=1<<D;return e(N!=null),e(0<D),N.X=s(X),N.X==null?0:(N.Mb=32-D,N.Xa=D,1)}function pe(N,D){e(N!=null),e(D!=null),e(N.Xa==D.Xa),r(D.X,0,N.X,0,1<<D.Xa)}function ye(){this.X=[],this.Xa=this.Mb=0}function Se(N,D,X,ne){e(X!=null),e(ne!=null);var fe=X[0],ge=ne[0];return fe==0&&(fe=(N*ge+D/2)/D),ge==0&&(ge=(D*fe+N/2)/N),0>=fe||0>=ge?0:(X[0]=fe,ne[0]=ge,1)}function ee(N,D){return N+(1<<D)-1>>>D}function re(N,D){return((4278255360&N)+(4278255360&D)>>>0&4278255360)+((16711935&N)+(16711935&D)>>>0&16711935)>>>0}function me(N,D){C[D]=function(X,ne,fe,ge,be,Te,Re){var ze;for(ze=0;ze<be;++ze){var Ue=C[N](Te[Re+ze-1],fe,ge+ze);Te[Re+ze]=re(X[ne+ze],Ue)}}}function Ge(){this.ud=this.hd=this.jd=0}function He(N,D){return((4278124286&(N^D))>>>1)+(N&D)>>>0}function _e(N){return 0<=N&&256>N?N:0>N?0:255<N?255:void 0}function Ne(N,D){return _e(N+(N-D+.5>>1))}function ue(N,D,X){return Math.abs(D-X)-Math.abs(N-X)}function Ce(N,D,X,ne,fe,ge,be){for(ne=ge[be-1],X=0;X<fe;++X)ge[be+X]=ne=re(N[D+X],ne)}function Ke(N,D,X,ne,fe){var ge;for(ge=0;ge<X;++ge){var be=N[D+ge],Te=be>>8&255,Re=16711935&(Re=(Re=16711935&be)+((Te<<16)+Te));ne[fe+ge]=(4278255360&be)+Re>>>0}}function Qe(N,D){D.jd=255&N,D.hd=N>>8&255,D.ud=N>>16&255}function je(N,D,X,ne,fe,ge){var be;for(be=0;be<ne;++be){var Te=D[X+be],Re=Te>>>8,ze=Te,Ue=255&(Ue=(Ue=Te>>>16)+((N.jd<<24>>24)*(Re<<24>>24)>>>5));ze=255&(ze=(ze+=(N.hd<<24>>24)*(Re<<24>>24)>>>5)+((N.ud<<24>>24)*(Ue<<24>>24)>>>5)),fe[ge+be]=(4278255360&Te)+(Ue<<16)+ze}}function We(N,D,X,ne,fe){C[D]=function(ge,be,Te,Re,ze,Ue,gt,Oe,it){for(Re=gt;Re<Oe;++Re)for(gt=0;gt<it;++gt)ze[Ue++]=fe(Te[ne(ge[be++])])},C[N]=function(ge,be,Te,Re,ze,Ue,gt){var Oe=8>>ge.b,it=ge.Ea,ht=ge.K[0],kt=ge.w;if(8>Oe)for(ge=(1<<ge.b)-1,kt=(1<<Oe)-1;be<Te;++be){var pt,Tt=0;for(pt=0;pt<it;++pt)pt&ge||(Tt=ne(Re[ze++])),Ue[gt++]=fe(ht[Tt&kt]),Tt>>=Oe}else C["VP8LMapColor"+X](Re,ze,ht,kt,Ue,gt,be,Te,it)}}function xt(N,D,X,ne,fe){for(X=D+X;D<X;){var ge=N[D++];ne[fe++]=ge>>16&255,ne[fe++]=ge>>8&255,ne[fe++]=255&ge}}function et(N,D,X,ne,fe){for(X=D+X;D<X;){var ge=N[D++];ne[fe++]=ge>>16&255,ne[fe++]=ge>>8&255,ne[fe++]=255&ge,ne[fe++]=ge>>24&255}}function Je(N,D,X,ne,fe){for(X=D+X;D<X;){var ge=(be=N[D++])>>16&240|be>>12&15,be=240&be|be>>28&15;ne[fe++]=ge,ne[fe++]=be}}function Ze(N,D,X,ne,fe){for(X=D+X;D<X;){var ge=(be=N[D++])>>16&248|be>>13&7,be=be>>5&224|be>>3&31;ne[fe++]=ge,ne[fe++]=be}}function Me(N,D,X,ne,fe){for(X=D+X;D<X;){var ge=N[D++];ne[fe++]=255&ge,ne[fe++]=ge>>8&255,ne[fe++]=ge>>16&255}}function Xe(N,D,X,ne,fe,ge){if(ge==0)for(X=D+X;D<X;)ae(ne,((ge=N[D++])[0]>>24|ge[1]>>8&65280|ge[2]<<8&16711680|ge[3]<<24)>>>0),fe+=32;else r(ne,fe,N,D,X)}function ut(N,D){C[D][0]=C[N+"0"],C[D][1]=C[N+"1"],C[D][2]=C[N+"2"],C[D][3]=C[N+"3"],C[D][4]=C[N+"4"],C[D][5]=C[N+"5"],C[D][6]=C[N+"6"],C[D][7]=C[N+"7"],C[D][8]=C[N+"8"],C[D][9]=C[N+"9"],C[D][10]=C[N+"10"],C[D][11]=C[N+"11"],C[D][12]=C[N+"12"],C[D][13]=C[N+"13"],C[D][14]=C[N+"0"],C[D][15]=C[N+"0"]}function lt(N){return N==Kx||N==qx||N==np||N==Xx}function Fe(){this.eb=[],this.size=this.A=this.fb=0}function Le(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function bt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Fe,this.f.kb=new Le,this.sd=null}function dt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Nt(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function _t(N){return alert("todo:WebPSamplerProcessPlane"),N.T}function Lt(N,D){var X=N.T,ne=D.ba.f.RGBA,fe=ne.eb,ge=ne.fb+N.ka*ne.A,be=Ba[D.ba.S],Te=N.y,Re=N.O,ze=N.f,Ue=N.N,gt=N.ea,Oe=N.W,it=D.cc,ht=D.dc,kt=D.Mc,pt=D.Nc,Tt=N.ka,jt=N.ka+N.T,Ht=N.U,Ft=Ht+1>>1;for(Tt==0?be(Te,Re,null,null,ze,Ue,gt,Oe,ze,Ue,gt,Oe,fe,ge,null,null,Ht):(be(D.ec,D.fc,Te,Re,it,ht,kt,pt,ze,Ue,gt,Oe,fe,ge-ne.A,fe,ge,Ht),++X);Tt+2<jt;Tt+=2)it=ze,ht=Ue,kt=gt,pt=Oe,Ue+=N.Rc,Oe+=N.Rc,ge+=2*ne.A,be(Te,(Re+=2*N.fa)-N.fa,Te,Re,it,ht,kt,pt,ze,Ue,gt,Oe,fe,ge-ne.A,fe,ge,Ht);return Re+=N.fa,N.j+jt<N.o?(r(D.ec,D.fc,Te,Re,Ht),r(D.cc,D.dc,ze,Ue,Ft),r(D.Mc,D.Nc,gt,Oe,Ft),X--):1&jt||be(Te,Re,null,null,ze,Ue,gt,Oe,ze,Ue,gt,Oe,fe,ge+ne.A,null,null,Ht),X}function Dt(N,D,X){var ne=N.F,fe=[N.J];if(ne!=null){var ge=N.U,be=D.ba.S,Te=be==Hd||be==np;D=D.ba.f.RGBA;var Re=[0],ze=N.ka;Re[0]=N.T,N.Kb&&(ze==0?--Re[0]:(--ze,fe[0]-=N.width),N.j+N.ka+N.T==N.o&&(Re[0]=N.o-N.j-ze));var Ue=D.eb;ze=D.fb+ze*D.A,N=Ud(ne,fe[0],N.width,ge,Re,Ue,ze+(Te?0:3),D.A),e(X==Re),N&<(be)&&rl(Ue,ze,Te,ge,Re,D.A)}return 0}function en(N){var D=N.ma,X=D.ba.S,ne=11>X,fe=X==Vh||X==tp||X==Hd||X==$x||X==12||lt(X);if(D.memory=null,D.Ib=null,D.Jb=null,D.Nd=null,!nl(D.Oa,N,fe?11:12))return 0;if(fe&<(X)&&So(),N.da)alert("todo:use_scaling");else{if(ne){if(D.Ib=_t,N.Kb){if(X=N.U+1>>1,D.memory=s(N.U+2*X),D.memory==null)return 0;D.ec=D.memory,D.fc=0,D.cc=D.ec,D.dc=D.fc+N.U,D.Mc=D.cc,D.Nc=D.dc+X,D.Ib=Lt,So()}}else alert("todo:EmitYUV");fe&&(D.Jb=Dt,ne&&Ti())}if(ne&&!vw){for(N=0;256>N;++N)yw[N]=89858*(N-128)+na>>Fa,nE[N]=-22014*(N-128)+na,bw[N]=-45773*(N-128),tE[N]=113618*(N-128)+na>>Fa;for(N=sp;N<ev;++N)D=76283*(N-16)+na>>Fa,rE[N-sp]=pn(D,255),tv[N-sp]=pn(D+8>>4,15);vw=1}return 1}function Mt(N){var D=N.ma,X=N.U,ne=N.T;return e(!(1&N.ka)),0>=X||0>=ne?0:(X=D.Ib(N,D),D.Jb!=null&&D.Jb(N,D,X),D.Dc+=X,1)}function nn(N){N.ma.memory=null}function Tn(N,D,X,ne){return Y(N,8)!=47?0:(D[0]=Y(N,14)+1,X[0]=Y(N,14)+1,ne[0]=Y(N,1),Y(N,3)!=0?0:!N.h)}function Fn(N,D){if(4>N)return N+1;var X=N-2>>1;return(2+(1&N)<<X)+Y(D,X)+1}function lr(N,D){return 120<D?D-120:1<=(X=((X=qA[D-1])>>4)*N+(8-(15&X)))?X:1;var X}function mr(N,D,X){var ne=q(X),fe=N[D+=255&ne].g-8;return 0<fe&&(se(X,X.u+8),ne=q(X),D+=N[D].value,D+=ne&(1<<fe)-1),se(X,X.u+N[D].g),N[D].value}function gr(N,D,X){return X.g+=N.g,X.value+=N.value<<D>>>0,e(8>=X.g),N.g}function br(N,D,X){var ne=N.xc;return e((D=ne==0?0:N.vc[N.md*(X>>ne)+(D>>ne)])<N.Wb),N.Ya[D]}function sn(N,D,X,ne){var fe=N.ab,ge=N.c*D,be=N.C;D=be+D;var Te=X,Re=ne;for(ne=N.Ta,X=N.Ua;0<fe--;){var ze=N.gc[fe],Ue=be,gt=D,Oe=Te,it=Re,ht=(Re=ne,Te=X,ze.Ea);switch(e(Ue<gt),e(gt<=ze.nc),ze.hc){case 2:Uh(Oe,it,(gt-Ue)*ht,Re,Te);break;case 0:var kt=Ue,pt=gt,Tt=Re,jt=Te,Ht=(yn=ze).Ea;kt==0&&(rc(Oe,it,null,null,1,Tt,jt),Ce(Oe,it+1,0,0,Ht-1,Tt,jt+1),it+=Ht,jt+=Ht,++kt);for(var Ft=1<<yn.b,kn=Ft-1,hn=ee(Ht,yn.b),dr=yn.K,yn=yn.w+(kt>>yn.b)*hn;kt<pt;){var jr=dr,Ts=yn,cr=1;for(Ou(Oe,it,Tt,jt-Ht,1,Tt,jt);cr<Ht;){var gn=(cr&~kn)+Ft;gn>Ht&&(gn=Ht),(0,ro[jr[Ts++]>>8&15])(Oe,it+ +cr,Tt,jt+cr-Ht,gn-cr,Tt,jt+cr),cr=gn}it+=Ht,jt+=Ht,++kt&kn||(yn+=hn)}gt!=ze.nc&&r(Re,Te-ht,Re,Te+(gt-Ue-1)*ht,ht);break;case 1:for(ht=Oe,pt=it,Ht=(Oe=ze.Ea)-(jt=Oe&~(Tt=(it=1<<ze.b)-1)),kt=ee(Oe,ze.b),Ft=ze.K,ze=ze.w+(Ue>>ze.b)*kt;Ue<gt;){for(kn=Ft,hn=ze,dr=new Ge,yn=pt+jt,jr=pt+Oe;pt<yn;)Qe(kn[hn++],dr),Rl(dr,ht,pt,it,Re,Te),pt+=it,Te+=it;pt<jr&&(Qe(kn[hn++],dr),Rl(dr,ht,pt,Ht,Re,Te),pt+=Ht,Te+=Ht),++Ue&Tt||(ze+=kt)}break;case 3:if(Oe==Re&&it==Te&&0<ze.b){for(pt=Re,Oe=ht=Te+(gt-Ue)*ht-(jt=(gt-Ue)*ee(ze.Ea,ze.b)),it=Re,Tt=Te,kt=[],jt=(Ht=jt)-1;0<=jt;--jt)kt[jt]=it[Tt+jt];for(jt=Ht-1;0<=jt;--jt)pt[Oe+jt]=kt[jt];Ml(ze,Ue,gt,Re,ht,Re,Te)}else Ml(ze,Ue,gt,Oe,it,Re,Te)}Te=ne,Re=X}Re!=X&&r(ne,X,Te,Re,ge)}function Mr(N,D){var X=N.V,ne=N.Ba+N.c*N.C,fe=D-N.C;if(e(D<=N.l.o),e(16>=fe),0<fe){var ge=N.l,be=N.Ta,Te=N.Ua,Re=ge.width;if(sn(N,fe,X,ne),fe=Te=[Te],e((X=N.C)<(ne=D)),e(ge.v<ge.va),ne>ge.o&&(ne=ge.o),X<ge.j){var ze=ge.j-X;X=ge.j,fe[0]+=ze*Re}if(X>=ne?X=0:(fe[0]+=4*ge.v,ge.ka=X-ge.j,ge.U=ge.va-ge.v,ge.T=ne-X,X=1),X){if(Te=Te[0],11>(X=N.ca).S){var Ue=X.f.RGBA,gt=(ne=X.S,fe=ge.U,ge=ge.T,ze=Ue.eb,Ue.A),Oe=ge;for(Ue=Ue.fb+N.Ma*Ue.A;0<Oe--;){var it=be,ht=Te,kt=fe,pt=ze,Tt=Ue;switch(ne){case vg:Co(it,ht,kt,pt,Tt);break;case Vh:Gh(it,ht,kt,pt,Tt);break;case Kx:Gh(it,ht,kt,pt,Tt),rl(pt,Tt,0,kt,1,0);break;case yg:zu(it,ht,kt,pt,Tt);break;case tp:Xe(it,ht,kt,pt,Tt,1);break;case qx:Xe(it,ht,kt,pt,Tt,1),rl(pt,Tt,0,kt,1,0);break;case Hd:Xe(it,ht,kt,pt,Tt,0);break;case np:Xe(it,ht,kt,pt,Tt,0),rl(pt,Tt,1,kt,1,0);break;case $x:ic(it,ht,kt,pt,Tt);break;case Xx:ic(it,ht,kt,pt,Tt),sc(pt,Tt,kt,1,0);break;case hw:Od(it,ht,kt,pt,Tt);break;default:e(0)}Te+=Re,Ue+=gt}N.Ma+=ge}else alert("todo:EmitRescaledRowsYUVA");e(N.Ma<=X.height)}}N.C=D,e(N.C<=N.i)}function yi(N){var D;if(0<N.ua)return 0;for(D=0;D<N.Wb;++D){var X=N.Ya[D].G,ne=N.Ya[D].H;if(0<X[1][ne[1]+0].g||0<X[2][ne[2]+0].g||0<X[3][ne[3]+0].g)return 0}return 1}function de(N,D,X,ne,fe,ge){if(N.Z!=0){var be=N.qd,Te=N.rd;for(e(Il[N.Z]!=null);D<X;++D)Il[N.Z](be,Te,ne,fe,ne,fe,ge),be=ne,Te=fe,fe+=ge;N.qd=be,N.rd=Te}}function ke(N,D){var X=N.l.ma,ne=X.Z==0||X.Z==1?N.l.j:N.C;if(ne=N.C<ne?ne:N.C,e(D<=N.l.o),D>ne){var fe=N.l.width,ge=X.ca,be=X.tb+fe*ne,Te=N.V,Re=N.Ba+N.c*ne,ze=N.gc;e(N.ab==1),e(ze[0].hc==3),Hh(ze[0],ne,D,Te,Re,ge,be),de(X,ne,D,ge,be,fe)}N.C=N.Ma=D}function Ye(N,D,X,ne,fe,ge,be){var Te=N.$/ne,Re=N.$%ne,ze=N.m,Ue=N.s,gt=X+N.$,Oe=gt;fe=X+ne*fe;var it=X+ne*ge,ht=280+Ue.ua,kt=N.Pb?Te:16777216,pt=0<Ue.ua?Ue.Wa:null,Tt=Ue.wc,jt=gt<it?br(Ue,Re,Te):null;e(N.C<ge),e(it<=fe);var Ht=!1;e:for(;;){for(;Ht||gt<it;){var Ft=0;if(Te>=kt){var kn=gt-X;e((kt=N).Pb),kt.wd=kt.m,kt.xd=kn,0<kt.s.ua&&pe(kt.s.Wa,kt.s.vb),kt=Te+YA}if(Re&Tt||(jt=br(Ue,Re,Te)),e(jt!=null),jt.Qb&&(D[gt]=jt.qb,Ht=!0),!Ht)if(ie(ze),jt.jc){Ft=ze,kn=D;var hn=gt,dr=jt.pd[q(Ft)&Bd-1];e(jt.jc),256>dr.g?(se(Ft,Ft.u+dr.g),kn[hn]=dr.value,Ft=0):(se(Ft,Ft.u+dr.g-256),e(256<=dr.value),Ft=dr.value),Ft==0&&(Ht=!0)}else Ft=mr(jt.G[0],jt.H[0],ze);if(ze.h)break;if(Ht||256>Ft){if(!Ht)if(jt.nd)D[gt]=(jt.qb|Ft<<8)>>>0;else{if(ie(ze),Ht=mr(jt.G[1],jt.H[1],ze),ie(ze),kn=mr(jt.G[2],jt.H[2],ze),hn=mr(jt.G[3],jt.H[3],ze),ze.h)break;D[gt]=(hn<<24|Ht<<16|Ft<<8|kn)>>>0}if(Ht=!1,++gt,++Re>=ne&&(Re=0,++Te,be!=null&&Te<=ge&&!(Te%16)&&be(N,Te),pt!=null))for(;Oe<gt;)Ft=D[Oe++],pt.X[(506832829*Ft&4294967295)>>>pt.Mb]=Ft}else if(280>Ft){if(Ft=Fn(Ft-256,ze),kn=mr(jt.G[4],jt.H[4],ze),ie(ze),kn=lr(ne,kn=Fn(kn,ze)),ze.h)break;if(gt-X<kn||fe-gt<Ft)break e;for(hn=0;hn<Ft;++hn)D[gt+hn]=D[gt+hn-kn];for(gt+=Ft,Re+=Ft;Re>=ne;)Re-=ne,++Te,be!=null&&Te<=ge&&!(Te%16)&&be(N,Te);if(e(gt<=fe),Re&Tt&&(jt=br(Ue,Re,Te)),pt!=null)for(;Oe<gt;)Ft=D[Oe++],pt.X[(506832829*Ft&4294967295)>>>pt.Mb]=Ft}else{if(!(Ft<ht))break e;for(Ht=Ft-280,e(pt!=null);Oe<gt;)Ft=D[Oe++],pt.X[(506832829*Ft&4294967295)>>>pt.Mb]=Ft;Ft=gt,e(!(Ht>>>(kn=pt).Xa)),D[Ft]=kn.X[Ht],Ht=!0}Ht||e(ze.h==te(ze))}if(N.Pb&&ze.h&><fe)e(N.m.h),N.a=5,N.m=N.wd,N.$=N.xd,0<N.s.ua&&pe(N.s.vb,N.s.Wa);else{if(ze.h)break e;be!=null&&be(N,Te>ge?ge:Te),N.a=0,N.$=gt-X}return 1}return N.a=3,0}function ce(N){e(N!=null),N.vc=null,N.yc=null,N.Ya=null;var D=N.Wa;D!=null&&(D.X=null),N.vb=null,e(N!=null)}function Pe(){var N=new fn;return N==null?null:(N.a=0,N.xb=mw,ut("Predictor","VP8LPredictors"),ut("Predictor","VP8LPredictors_C"),ut("PredictorAdd","VP8LPredictorsAdd"),ut("PredictorAdd","VP8LPredictorsAdd_C"),Uh=Ke,Rl=je,Co=xt,Gh=et,ic=Je,Od=Ze,zu=Me,C.VP8LMapColor32b=hs,C.VP8LMapColor8b=fs,N)}function De(N,D,X,ne,fe){var ge=1,be=[N],Te=[D],Re=ne.m,ze=ne.s,Ue=null,gt=0;e:for(;;){if(X)for(;ge&&Y(Re,1);){var Oe=be,it=Te,ht=ne,kt=1,pt=ht.m,Tt=ht.gc[ht.ab],jt=Y(pt,2);if(ht.Oc&1<<jt)ge=0;else{switch(ht.Oc|=1<<jt,Tt.hc=jt,Tt.Ea=Oe[0],Tt.nc=it[0],Tt.K=[null],++ht.ab,e(4>=ht.ab),jt){case 0:case 1:Tt.b=Y(pt,3)+2,kt=De(ee(Tt.Ea,Tt.b),ee(Tt.nc,Tt.b),0,ht,Tt.K),Tt.K=Tt.K[0];break;case 3:var Ht,Ft=Y(pt,8)+1,kn=16<Ft?0:4<Ft?1:2<Ft?2:3;if(Oe[0]=ee(Tt.Ea,kn),Tt.b=kn,Ht=kt=De(Ft,1,0,ht,Tt.K)){var hn,dr=Ft,yn=Tt,jr=1<<(8>>yn.b),Ts=s(jr);if(Ts==null)Ht=0;else{var cr=yn.K[0],gn=yn.w;for(Ts[0]=yn.K[0][0],hn=1;hn<1*dr;++hn)Ts[hn]=re(cr[gn+hn],Ts[hn-1]);for(;hn<4*jr;++hn)Ts[hn]=0;yn.K[0]=null,yn.K[0]=Ts,Ht=1}}kt=Ht;break;case 2:break;default:e(0)}ge=kt}}if(be=be[0],Te=Te[0],ge&&Y(Re,1)&&!(ge=1<=(gt=Y(Re,4))&&11>=gt)){ne.a=3;break e}var Jt;if(Jt=ge)t:{var ms,sr,Fr,ki=ne,ra=be,ia=Te,Mi=gt,$s=X,sa=ki.m,ss=ki.s,Pr=[null],Zr=1,Bi=0,Qr=XA[Mi];n:for(;;){if($s&&Y(sa,1)){var aa=Y(sa,3)+2,il=ee(ra,aa),gs=ee(ia,aa),ba=il*gs;if(!De(il,gs,0,ki,Pr))break n;for(Pr=Pr[0],ss.xc=aa,ms=0;ms<ba;++ms){var hi=Pr[ms]>>8&65535;Pr[ms]=hi,hi>=Zr&&(Zr=hi+1)}}if(sa.h)break n;for(sr=0;5>sr;++sr){var Ar=fw[sr];!sr&&0<Mi&&(Ar+=1<<Mi),Bi<Ar&&(Bi=Ar)}var Un=a(Zr*Qr,G),Gr=Zr,Kr=a(Gr,$);if(Kr==null)var fi=null;else e(65536>=Gr),fi=Kr;var Ci=s(Bi);if(fi==null||Ci==null||Un==null){ki.a=1;break n}var oa=Un;for(ms=Fr=0;ms<Zr;++ms){var ar=fi[ms],wa=ar.G,Oa=ar.H,Kc=0,ac=1,xs=0;for(sr=0;5>sr;++sr){Ar=fw[sr],wa[sr]=oa,Oa[sr]=Fr,!sr&&0<Mi&&(Ar+=1<<Mi);i:{var _a,Sg=Ar,ap=ki,qc=Ci,nv=oa,Sw=Fr,Xc=0,oc=ap.m,Gd=Y(oc,1);if(i(qc,0,0,Sg),Gd){var rv=Y(oc,1)+1,Ag=Y(oc,1),iv=Y(oc,Ag==0?1:8);qc[iv]=1,rv==2&&(qc[iv=Y(oc,8)]=1);var Wh=1}else{var Eg=s(19),za=Y(oc,4)+4;if(19<za){ap.a=3;var lc=0;break i}for(_a=0;_a<za;++_a)Eg[l3[_a]]=Y(oc,3);var No=void 0,Vd=void 0,so=ap,sE=Eg,op=Sg,sv=qc,Aw=0,ao=so.m,Ew=8,kw=a(128,G);r:for(;j(kw,0,7,sE,19);){if(Y(ao,1)){var Cw=2+2*Y(ao,3);if((No=2+Y(ao,Cw))>op)break r}else No=op;for(Vd=0;Vd<op&&No--;){ie(ao);var Wd=kw[0+(127&q(ao))];se(ao,ao.u+Wd.g);var $h=Wd.value;if(16>$h)sv[Vd++]=$h,$h!=0&&(Ew=$h);else{var aE=$h==16,av=$h-16,ov=a3[av],oE=Y(ao,KA[av])+ov;if(Vd+oE>op)break r;for(var f3=aE?Ew:0;0<oE--;)sv[Vd++]=f3}}Aw=1;break r}Aw||(so.a=3),Wh=Aw}(Wh=Wh&&!oc.h)&&(Xc=j(nv,Sw,8,qc,Sg)),Wh&&Xc!=0?lc=Xc:(ap.a=3,lc=0)}if(lc==0)break n;if(ac&&o3[sr]==1&&(ac=oa[Fr].g==0),Kc+=oa[Fr].g,Fr+=lc,3>=sr){var lp,lv=Ci[0];for(lp=1;lp<Ar;++lp)Ci[lp]>lv&&(lv=Ci[lp]);xs+=lv}}if(ar.nd=ac,ar.Qb=0,ac&&(ar.qb=(wa[3][Oa[3]+0].value<<24|wa[1][Oa[1]+0].value<<16|wa[2][Oa[2]+0].value)>>>0,Kc==0&&256>wa[0][Oa[0]+0].value&&(ar.Qb=1,ar.qb+=wa[0][Oa[0]+0].value<<8)),ar.jc=!ar.Qb&&6>xs,ar.jc){var Yc,Gu=ar;for(Yc=0;Yc<Bd;++Yc){var To=Yc,Vu=Gu.pd[To],Sa=Gu.G[0][Gu.H[0]+To];256<=Sa.value?(Vu.g=Sa.g+256,Vu.value=Sa.value):(Vu.g=0,Vu.value=0,To>>=gr(Sa,8,Vu),To>>=gr(Gu.G[1][Gu.H[1]+To],16,Vu),To>>=gr(Gu.G[2][Gu.H[2]+To],0,Vu),gr(Gu.G[3][Gu.H[3]+To],24,Vu))}}}ss.vc=Pr,ss.Wb=Zr,ss.Ya=fi,ss.yc=Un,Jt=1;break t}Jt=0}if(!(ge=Jt)){ne.a=3;break e}if(0<gt){if(ze.ua=1<<gt,!K(ze.Wa,gt)){ne.a=1,ge=0;break e}}else ze.ua=0;var Nw=ne,Tw=be,p3=Te,Mw=Nw.s,cv=Mw.xc;if(Nw.c=Tw,Nw.i=p3,Mw.md=ee(Tw,cv),Mw.wc=cv==0?-1:(1<<cv)-1,X){ne.xb=$c;break e}if((Ue=s(be*Te))==null){ne.a=1,ge=0;break e}ge=(ge=Ye(ne,Ue,0,be,Te,Te,null))&&!Re.h;break e}return ge?(fe!=null?fe[0]=Ue:(e(Ue==null),e(X)),ne.$=0,X||ce(ze)):ce(ze),ge}function qe(N,D){var X=N.c*N.i,ne=X+D+16*D;return e(N.c<=D),N.V=s(ne),N.V==null?(N.Ta=null,N.Ua=0,N.a=1,0):(N.Ta=N.V,N.Ua=N.Ba+X+D,1)}function $e(N,D){var X=N.C,ne=D-X,fe=N.V,ge=N.Ba+N.c*X;for(e(D<=N.l.o);0<ne;){var be=16<ne?16:ne,Te=N.l.ma,Re=N.l.width,ze=Re*be,Ue=Te.ca,gt=Te.tb+Re*X,Oe=N.Ta,it=N.Ua;sn(N,be,fe,ge),mg(Oe,it,Ue,gt,ze),de(Te,X,X+be,Ue,gt,Re),ne-=be,fe+=be*N.c,X+=be}e(X==D),N.C=N.Ma=D}function mt(){this.ub=this.yd=this.td=this.Rb=0}function vt(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function wt(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function nt(){this.Yb=function(){var N=[];return function D(X,ne,fe){for(var ge=fe[ne],be=0;be<ge&&(X.push(fe.length>ne+1?[]:0),!(fe.length<ne+1));be++)D(X[be],ne+1,fe)}(N,0,[3,11]),N}()}function Xt(){this.jb=s(3),this.Wc=o([4,8],nt),this.Xc=o([4,17],nt)}function ft(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function ve(){this.ld=this.La=this.dd=this.tc=0}function rt(){this.Na=this.la=0}function At(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Gt(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Wt(){this.uc=this.M=this.Nb=0,this.wa=Array(new ve),this.Y=0,this.ya=Array(new Gt),this.aa=0,this.l=new an}function zt(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Ut(){this.cb=this.a=0,this.sc="",this.m=new z,this.Od=new mt,this.Kc=new vt,this.ed=new ft,this.Qa=new wt,this.Ic=this.$c=this.Aa=0,this.D=new Wt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,z),this.ia=0,this.pb=a(4,At),this.Pa=new Xt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new zt),this.Hd=0,this.rb=Array(new rt),this.sb=0,this.wa=Array(new ve),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Gt),this.L=this.aa=0,this.gd=o([4,2],ve),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function pn(N,D){return 0>N?0:N>D?D:N}function an(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Cn(){var N=new Ut;return N!=null&&(N.a=0,N.sc="OK",N.cb=0,N.Xb=0,bg||(bg=Jn)),N}function on(N,D,X){return N.a==0&&(N.a=D,N.sc=X,N.cb=0),0}function Hr(N,D,X){return 3<=X&&N[D+0]==157&&N[D+1]==1&&N[D+2]==42}function wr(N,D){if(N==null)return 0;if(N.a=0,N.sc="OK",D==null)return on(N,2,"null VP8Io passed to VP8GetHeaders()");var X=D.data,ne=D.w,fe=D.ha;if(4>fe)return on(N,7,"Truncated header.");var ge=X[ne+0]|X[ne+1]<<8|X[ne+2]<<16,be=N.Od;if(be.Rb=!(1&ge),be.td=ge>>1&7,be.yd=ge>>4&1,be.ub=ge>>5,3<be.td)return on(N,3,"Incorrect keyframe parameters.");if(!be.yd)return on(N,4,"Frame not displayable.");ne+=3,fe-=3;var Te=N.Kc;if(be.Rb){if(7>fe)return on(N,7,"cannot parse picture header");if(!Hr(X,ne,fe))return on(N,3,"Bad code word");Te.c=16383&(X[ne+4]<<8|X[ne+3]),Te.Td=X[ne+4]>>6,Te.i=16383&(X[ne+6]<<8|X[ne+5]),Te.Ud=X[ne+6]>>6,ne+=7,fe-=7,N.za=Te.c+15>>4,N.Ub=Te.i+15>>4,D.width=Te.c,D.height=Te.i,D.Da=0,D.j=0,D.v=0,D.va=D.width,D.o=D.height,D.da=0,D.ib=D.width,D.hb=D.height,D.U=D.width,D.T=D.height,i((ge=N.Pa).jb,0,255,ge.jb.length),e((ge=N.Qa)!=null),ge.Cb=0,ge.Bb=0,ge.Fb=1,i(ge.Zb,0,0,ge.Zb.length),i(ge.Lb,0,0,ge.Lb)}if(be.ub>fe)return on(N,7,"bad partition length");U(ge=N.m,X,ne,be.ub),ne+=be.ub,fe-=be.ub,be.Rb&&(Te.Ld=xe(ge),Te.Kd=xe(ge)),Te=N.Qa;var Re,ze=N.Pa;if(e(ge!=null),e(Te!=null),Te.Cb=xe(ge),Te.Cb){if(Te.Bb=xe(ge),xe(ge)){for(Te.Fb=xe(ge),Re=0;4>Re;++Re)Te.Zb[Re]=xe(ge)?V(ge,7):0;for(Re=0;4>Re;++Re)Te.Lb[Re]=xe(ge)?V(ge,6):0}if(Te.Bb)for(Re=0;3>Re;++Re)ze.jb[Re]=xe(ge)?Z(ge,8):255}else Te.Bb=0;if(ge.Ka)return on(N,3,"cannot parse segment header");if((Te=N.ed).zd=xe(ge),Te.Tb=Z(ge,6),Te.wb=Z(ge,3),Te.Pc=xe(ge),Te.Pc&&xe(ge)){for(ze=0;4>ze;++ze)xe(ge)&&(Te.vd[ze]=V(ge,6));for(ze=0;4>ze;++ze)xe(ge)&&(Te.od[ze]=V(ge,6))}if(N.L=Te.Tb==0?0:Te.zd?1:2,ge.Ka)return on(N,3,"cannot parse filter header");var Ue=fe;if(fe=Re=ne,ne=Re+Ue,Te=Ue,N.Xb=(1<<Z(N.m,2))-1,Ue<3*(ze=N.Xb))X=7;else{for(Re+=3*ze,Te-=3*ze,Ue=0;Ue<ze;++Ue){var gt=X[fe+0]|X[fe+1]<<8|X[fe+2]<<16;gt>Te&&(gt=Te),U(N.Jc[+Ue],X,Re,gt),Re+=gt,Te-=gt,fe+=3}U(N.Jc[+ze],X,Re,Te),X=Re<ne?0:5}if(X!=0)return on(N,X,"cannot parse partitions");for(X=Z(Re=N.m,7),fe=xe(Re)?V(Re,4):0,ne=xe(Re)?V(Re,4):0,Te=xe(Re)?V(Re,4):0,ze=xe(Re)?V(Re,4):0,Re=xe(Re)?V(Re,4):0,Ue=N.Qa,gt=0;4>gt;++gt){if(Ue.Cb){var Oe=Ue.Zb[gt];Ue.Fb||(Oe+=X)}else{if(0<gt){N.pb[gt]=N.pb[0];continue}Oe=X}var it=N.pb[gt];it.Sc[0]=Yx[pn(Oe+fe,127)],it.Sc[1]=rp[pn(Oe+0,127)],it.Eb[0]=2*Yx[pn(Oe+ne,127)],it.Eb[1]=101581*rp[pn(Oe+Te,127)]>>16,8>it.Eb[1]&&(it.Eb[1]=8),it.Qc[0]=Yx[pn(Oe+ze,117)],it.Qc[1]=rp[pn(Oe+Re,127)],it.lc=Oe+Re}if(!be.Rb)return on(N,4,"Not a key frame.");for(xe(ge),be=N.Pa,X=0;4>X;++X){for(fe=0;8>fe;++fe)for(ne=0;3>ne;++ne)for(Te=0;11>Te;++Te)ze=Ee(ge,JA[X][fe][ne][Te])?Z(ge,8):pw[X][fe][ne][Te],be.Wc[X][fe].Yb[ne][Te]=ze;for(fe=0;17>fe;++fe)be.Xc[X][fe]=be.Wc[X][ZA[fe]]}return N.kc=xe(ge),N.kc&&(N.Bd=Z(ge,8)),N.cb=1}function Jn(N,D,X,ne,fe,ge,be){var Te=D[fe].Yb[X];for(X=0;16>fe;++fe){if(!Ee(N,Te[X+0]))return fe;for(;!Ee(N,Te[X+1]);)if(Te=D[++fe].Yb[0],X=0,fe==16)return 16;var Re=D[fe+1].Yb;if(Ee(N,Te[X+2])){var ze=N,Ue=0;if(Ee(ze,(Oe=Te)[(gt=X)+3]))if(Ee(ze,Oe[gt+6])){for(Te=0,gt=2*(Ue=Ee(ze,Oe[gt+8]))+(Oe=Ee(ze,Oe[gt+9+Ue])),Ue=0,Oe=c3[gt];Oe[Te];++Te)Ue+=Ue+Ee(ze,Oe[Te]);Ue+=3+(8<<gt)}else Ee(ze,Oe[gt+7])?(Ue=7+2*Ee(ze,165),Ue+=Ee(ze,145)):Ue=5+Ee(ze,159);else Ue=Ee(ze,Oe[gt+4])?3+Ee(ze,Oe[gt+5]):2;Te=Re[2]}else Ue=1,Te=Re[1];Re=be+u3[fe],0>(ze=N).b&&le(ze);var gt,Oe=ze.b,it=(gt=ze.Ca>>1)-(ze.I>>Oe)>>31;--ze.b,ze.Ca+=it,ze.Ca|=1,ze.I-=(gt+1&it)<<Oe,ge[Re]=((Ue^it)-it)*ne[(0<fe)+0]}return 16}function Zn(N){var D=N.rb[N.sb-1];D.la=0,D.Na=0,i(N.zc,0,0,N.zc.length),N.ja=0}function Sr(N,D,X,ne,fe){fe=N[D+X+32*ne]+(fe>>3),N[D+X+32*ne]=-256&fe?0>fe?0:255:fe}function zn(N,D,X,ne,fe,ge){Sr(N,D,0,X,ne+fe),Sr(N,D,1,X,ne+ge),Sr(N,D,2,X,ne-ge),Sr(N,D,3,X,ne-fe)}function Ln(N){return(20091*N>>16)+N}function rr(N,D,X,ne){var fe,ge=0,be=s(16);for(fe=0;4>fe;++fe){var Te=N[D+0]+N[D+8],Re=N[D+0]-N[D+8],ze=(35468*N[D+4]>>16)-Ln(N[D+12]),Ue=Ln(N[D+4])+(35468*N[D+12]>>16);be[ge+0]=Te+Ue,be[ge+1]=Re+ze,be[ge+2]=Re-ze,be[ge+3]=Te-Ue,ge+=4,D++}for(fe=ge=0;4>fe;++fe)Te=(N=be[ge+0]+4)+be[ge+8],Re=N-be[ge+8],ze=(35468*be[ge+4]>>16)-Ln(be[ge+12]),Sr(X,ne,0,0,Te+(Ue=Ln(be[ge+4])+(35468*be[ge+12]>>16))),Sr(X,ne,1,0,Re+ze),Sr(X,ne,2,0,Re-ze),Sr(X,ne,3,0,Te-Ue),ge++,ne+=32}function Cs(N,D,X,ne){var fe=N[D+0]+4,ge=35468*N[D+4]>>16,be=Ln(N[D+4]),Te=35468*N[D+1]>>16;zn(X,ne,0,fe+be,N=Ln(N[D+1]),Te),zn(X,ne,1,fe+ge,N,Te),zn(X,ne,2,fe-ge,N,Te),zn(X,ne,3,fe-be,N,Te)}function Wi(N,D,X,ne,fe){rr(N,D,X,ne),fe&&rr(N,D+16,X,ne+4)}function Za(N,D,X,ne){jl(N,D+0,X,ne,1),jl(N,D+32,X,ne+128,1)}function ec(N,D,X,ne){var fe;for(N=N[D+0]+4,fe=0;4>fe;++fe)for(D=0;4>D;++D)Sr(X,ne,D,fe,N)}function Qs(N,D,X,ne){N[D+0]&&Ws(N,D+0,X,ne),N[D+16]&&Ws(N,D+16,X,ne+4),N[D+32]&&Ws(N,D+32,X,ne+128),N[D+48]&&Ws(N,D+48,X,ne+128+4)}function El(N,D,X,ne){var fe,ge=s(16);for(fe=0;4>fe;++fe){var be=N[D+0+fe]+N[D+12+fe],Te=N[D+4+fe]+N[D+8+fe],Re=N[D+4+fe]-N[D+8+fe],ze=N[D+0+fe]-N[D+12+fe];ge[0+fe]=be+Te,ge[8+fe]=be-Te,ge[4+fe]=ze+Re,ge[12+fe]=ze-Re}for(fe=0;4>fe;++fe)be=(N=ge[0+4*fe]+3)+ge[3+4*fe],Te=ge[1+4*fe]+ge[2+4*fe],Re=ge[1+4*fe]-ge[2+4*fe],ze=N-ge[3+4*fe],X[ne+0]=be+Te>>3,X[ne+16]=ze+Re>>3,X[ne+32]=be-Te>>3,X[ne+48]=ze-Re>>3,ne+=64}function kl(N,D,X){var ne,fe=D-32,ge=io,be=255-N[fe-1];for(ne=0;ne<X;++ne){var Te,Re=ge,ze=be+N[D-1];for(Te=0;Te<X;++Te)N[D+Te]=Re[ze+N[fe+Te]];D+=32}}function Mu(N,D){kl(N,D,4)}function Ru(N,D){kl(N,D,8)}function tc(N,D){kl(N,D,16)}
vendor: 5,812 bytes, line 710
710function jd(N,D){var X;for(X=0;16>X;++X)r(N,D+32*X,N,D-32,16)}function Cl(N,D){var X;for(X=16;0<X;--X)i(N,D,N[D-1],16),D+=32}function Qa(N,D,X){var ne;for(ne=0;16>ne;++ne)i(D,X+32*ne,N,16)}function Zo(N,D){var X,ne=16;for(X=0;16>X;++X)ne+=N[D-1+32*X]+N[D+X-32];Qa(ne>>5,N,D)}function er(N,D){var X,ne=8;for(X=0;16>X;++X)ne+=N[D-1+32*X];Qa(ne>>4,N,D)}function Dh(N,D){var X,ne=8;for(X=0;16>X;++X)ne+=N[D+X-32];Qa(ne>>4,N,D)}function eo(N,D){Qa(128,N,D)}function On(N,D,X){return N+2*D+X+2>>2}function Bh(N,D){var X,ne=D-32;for(ne=new Uint8Array([On(N[ne-1],N[ne+0],N[ne+1]),On(N[ne+0],N[ne+1],N[ne+2]),On(N[ne+1],N[ne+2],N[ne+3]),On(N[ne+2],N[ne+3],N[ne+4])]),X=0;4>X;++X)r(N,D+32*X,ne,0,ne.length)}function Qf(N,D){var X=N[D-1],ne=N[D-1+32],fe=N[D-1+64],ge=N[D-1+96];ae(N,D+0,16843009*On(N[D-1-32],X,ne)),ae(N,D+32,16843009*On(X,ne,fe)),ae(N,D+64,16843009*On(ne,fe,ge)),ae(N,D+96,16843009*On(fe,ge,ge))}function Ni(N,D){var X,ne=4;for(X=0;4>X;++X)ne+=N[D+X-32]+N[D-1+32*X];for(ne>>=3,X=0;4>X;++X)i(N,D+32*X,ne,4)}function ju(N,D){var X=N[D-1+0],ne=N[D-1+32],fe=N[D-1+64],ge=N[D-1-32],be=N[D+0-32],Te=N[D+1-32],Re=N[D+2-32],ze=N[D+3-32];N[D+0+96]=On(ne,fe,N[D-1+96]),N[D+1+96]=N[D+0+64]=On(X,ne,fe),N[D+2+96]=N[D+1+64]=N[D+0+32]=On(ge,X,ne),N[D+3+96]=N[D+2+64]=N[D+1+32]=N[D+0+0]=On(be,ge,X),N[D+3+64]=N[D+2+32]=N[D+1+0]=On(Te,be,ge),N[D+3+32]=N[D+2+0]=On(Re,Te,be),N[D+3+0]=On(ze,Re,Te)}function ep(N,D){var X=N[D+1-32],ne=N[D+2-32],fe=N[D+3-32],ge=N[D+4-32],be=N[D+5-32],Te=N[D+6-32],Re=N[D+7-32];N[D+0+0]=On(N[D+0-32],X,ne),N[D+1+0]=N[D+0+32]=On(X,ne,fe),N[D+2+0]=N[D+1+32]=N[D+0+64]=On(ne,fe,ge),N[D+3+0]=N[D+2+32]=N[D+1+64]=N[D+0+96]=On(fe,ge,be),N[D+3+32]=N[D+2+64]=N[D+1+96]=On(ge,be,Te),N[D+3+64]=N[D+2+96]=On(be,Te,Re),N[D+3+96]=On(Te,Re,Re)}function $i(N,D){var X=N[D-1+0],ne=N[D-1+32],fe=N[D-1+64],ge=N[D-1-32],be=N[D+0-32],Te=N[D+1-32],Re=N[D+2-32],ze=N[D+3-32];N[D+0+0]=N[D+1+64]=ge+be+1>>1,N[D+1+0]=N[D+2+64]=be+Te+1>>1,N[D+2+0]=N[D+3+64]=Te+Re+1>>1,N[D+3+0]=Re+ze+1>>1,N[D+0+96]=On(fe,ne,X),N[D+0+64]=On(ne,X,ge),N[D+0+32]=N[D+1+96]=On(X,ge,be),N[D+1+32]=N[D+2+96]=On(ge,be,Te),N[D+2+32]=N[D+3+96]=On(be,Te,Re),N[D+3+32]=On(Te,Re,ze)}function Qo(N,D){var X=N[D+0-32],ne=N[D+1-32],fe=N[D+2-32],ge=N[D+3-32],be=N[D+4-32],Te=N[D+5-32],Re=N[D+6-32],ze=N[D+7-32];N[D+0+0]=X+ne+1>>1,N[D+1+0]=N[D+0+64]=ne+fe+1>>1,N[D+2+0]=N[D+1+64]=fe+ge+1>>1,N[D+3+0]=N[D+2+64]=ge+be+1>>1,N[D+0+32]=On(X,ne,fe),N[D+1+32]=N[D+0+96]=On(ne,fe,ge),N[D+2+32]=N[D+1+96]=On(fe,ge,be),N[D+3+32]=N[D+2+96]=On(ge,be,Te),N[D+3+64]=On(be,Te,Re),N[D+3+96]=On(Te,Re,ze)}function Pu(N,D){var X=N[D-1+0],ne=N[D-1+32],fe=N[D-1+64],ge=N[D-1+96];N[D+0+0]=X+ne+1>>1,N[D+2+0]=N[D+0+32]=ne+fe+1>>1,N[D+2+32]=N[D+0+64]=fe+ge+1>>1,N[D+1+0]=On(X,ne,fe),N[D+3+0]=N[D+1+32]=On(ne,fe,ge),N[D+3+32]=N[D+1+64]=On(fe,ge,ge),N[D+3+64]=N[D+2+64]=N[D+0+96]=N[D+1+96]=N[D+2+96]=N[D+3+96]=ge}function to(N,D){var X=N[D-1+0],ne=N[D-1+32],fe=N[D-1+64],ge=N[D-1+96],be=N[D-1-32],Te=N[D+0-32],Re=N[D+1-32],ze=N[D+2-32];N[D+0+0]=N[D+2+32]=X+be+1>>1,N[D+0+32]=N[D+2+64]=ne+X+1>>1,N[D+0+64]=N[D+2+96]=fe+ne+1>>1,N[D+0+96]=ge+fe+1>>1,N[D+3+0]=On(Te,Re,ze),N[D+2+0]=On(be,Te,Re),N[D+1+0]=N[D+3+32]=On(X,be,Te),N[D+1+32]=N[D+3+64]=On(ne,X,be),N[D+1+64]=N[D+3+96]=On(fe,ne,X),N[D+1+96]=On(ge,fe,ne)}function Oc(N,D){var X;for(X=0;8>X;++X)r(N,D+32*X,N,D-32,8)}function Pd(N,D){var X;for(X=0;8>X;++X)i(N,D,N[D-1],8),D+=32}function ts(N,D,X){var ne;for(ne=0;8>ne;++ne)i(D,X+32*ne,N,8)}function xa(N,D){var X,ne=8;for(X=0;8>X;++X)ne+=N[D+X-32]+N[D-1+32*X];ts(ne>>4,N,D)}function no(N,D){var X,ne=4;for(X=0;8>X;++X)ne+=N[D+X-32];ts(ne>>3,N,D)}function _o(N,D){var X,ne=4;for(X=0;8>X;++X)ne+=N[D-1+32*X];ts(ne>>3,N,D)}function Lu(N,D){ts(128,N,D)}function Nl(N,D,X){var ne=N[D-X],fe=N[D+0],ge=3*(fe-ne)+Wx[1020+N[D-2*X]-N[D+X]],be=xg[112+(ge+4>>3)];N[D-X]=io[255+ne+xg[112+(ge+3>>3)]],N[D+0]=io[255+fe-be]}function ea(N,D,X,ne){var fe=N[D+0],ge=N[D+X];return Da[255+N[D-2*X]-N[D-X]]>ne||Da[255+ge-fe]>ne}function el(N,D,X,ne){return 4*Da[255+N[D-X]-N[D+0]]+Da[255+N[D-2*X]-N[D+X]]<=ne}function nc(N,D,X,ne,fe){var ge=N[D-3*X],be=N[D-2*X],Te=N[D-X],Re=N[D+0],ze=N[D+X],Ue=N[D+2*X],gt=N[D+3*X];return 4*Da[255+Te-Re]+Da[255+be-ze]>ne?0:Da[255+N[D-4*X]-ge]<=fe&&Da[255+ge-be]<=fe&&Da[255+be-Te]<=fe&&Da[255+gt-Ue]<=fe&&Da[255+Ue-ze]<=fe&&Da[255+ze-Re]<=fe}function Tl(N,D,X,ne){var fe=2*ne+1;for(ne=0;16>ne;++ne)el(N,D+ne,X,fe)&&Nl(N,D+ne,X)}function Hs(N,D,X,ne){var fe=2*ne+1;for(ne=0;16>ne;++ne)el(N,D+ne*X,1,fe)&&Nl(N,D+ne*X,1)}function Ki(N,D,X,ne){var fe;for(fe=3;0<fe;--fe)Tl(N,D+=4*X,X,ne)}function Iu(N,D,X,ne){var fe;for(fe=3;0<fe;--fe)Hs(N,D+=4,X,ne)}function Gs(N,D,X,ne,fe,ge,be,Te){for(ge=2*ge+1;0<fe--;){if(nc(N,D,X,ge,be))if(ea(N,D,X,Te))Nl(N,D,X);else{var Re=N,ze=D,Ue=X,gt=Re[ze-2*Ue],Oe=Re[ze-Ue],it=Re[ze+0],ht=Re[ze+Ue],kt=Re[ze+2*Ue],pt=27*(jt=Wx[1020+3*(it-Oe)+Wx[1020+gt-ht]])+63>>7,Tt=18*jt+63>>7,jt=9*jt+63>>7;Re[ze-3*Ue]=io[255+Re[ze-3*Ue]+jt],Re[ze-2*Ue]=io[255+gt+Tt],Re[ze-Ue]=io[255+Oe+pt],Re[ze+0]=io[255+it-pt],Re[ze+Ue]=io[255+ht-Tt],Re[ze+2*Ue]=io[255+kt-jt]}D+=ne}}function La(N,D,X,ne,fe,ge,be,Te){for(ge=2*ge+1;0<fe--;){if(nc(N,D,X,ge,be))if(ea(N,D,X,Te))Nl(N,D,X);else{var Re=N,ze=D,Ue=X,gt=Re[ze-Ue],Oe=Re[ze+0],it=Re[ze+Ue],ht=xg[112+(4+(kt=3*(Oe-gt))>>3)],kt=xg[112+(kt+3>>3)],pt=ht+1>>1;Re[ze-2*Ue]=io[255+Re[ze-2*Ue]+pt],Re[ze-Ue]=io[255+gt+kt],Re[ze+0]=io[255+Oe-ht],Re[ze+Ue]=io[255+it-pt]}D+=ne}}function Du(N,D,X,ne,fe,ge){Gs(N,D,X,1,16,ne,fe,ge)}function Fh(N,D,X,ne,fe,ge){Gs(N,D,1,X,16,ne,fe,ge)}function cs(N,D,X,ne,fe,ge){var be;for(be=3;0<be;--be)La(N,D+=4*X,X,1,16,ne,fe,ge)}function us(N,D,X,ne,fe,ge){var be;for(be=3;0<be;--be)La(N,D+=4,1,X,16,ne,fe,ge)}function Ii(N,D,X,ne,fe,ge,be,Te){Gs(N,D,fe,1,8,ge,be,Te),Gs(X,ne,fe,1,8,ge,be,Te)}function H(N,D,X,ne,fe,ge,be,Te){Gs(N,D,1,fe,8,ge,be,Te),Gs(X,ne,1,fe,8,ge,be,Te)}
vendor: 13,604 bytes, line 710
710function he(N,D,X,ne,fe,ge,be,Te){La(N,D+4*fe,fe,1,8,ge,be,Te),La(X,ne+4*fe,fe,1,8,ge,be,Te)}function Be(N,D,X,ne,fe,ge,be,Te){La(N,D+4,1,fe,8,ge,be,Te),La(X,ne+4,1,fe,8,ge,be,Te)}function tt(){this.ba=new bt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Nt,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ot(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function St(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function It(){this.ua=0,this.Wa=new ye,this.vb=new ye,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new $,this.yc=new G}function fn(){this.xb=this.a=0,this.l=new an,this.ca=new bt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new I,this.Pb=0,this.wd=new I,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new It,this.ab=0,this.gc=a(4,St),this.Oc=0}function mn(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new an,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function qn(N,D,X,ne,fe,ge,be){for(N=N==null?0:N[D+0],D=0;D<be;++D)fe[ge+D]=N+X[ne+D]&255,N=fe[ge+D]}function ir(N,D,X,ne,fe,ge,be){var Te;if(N==null)qn(null,null,X,ne,fe,ge,be);else for(Te=0;Te<be;++Te)fe[ge+Te]=N[D+Te]+X[ne+Te]&255}function Br(N,D,X,ne,fe,ge,be){if(N==null)qn(null,null,X,ne,fe,ge,be);else{var Te,Re=N[D+0],ze=Re,Ue=Re;for(Te=0;Te<be;++Te)ze=Ue+(Re=N[D+Te])-ze,Ue=X[ne+Te]+(-256&ze?0>ze?0:255:ze)&255,ze=Re,fe[ge+Te]=Ue}}function ns(N,D,X,ne){var fe=D.width,ge=D.o;if(e(N!=null&&D!=null),0>X||0>=ne||X+ne>ge)return null;if(!N.Cc){if(N.ga==null){var be;if(N.ga=new mn,(be=N.ga==null)||(be=D.width*D.o,e(N.Gb.length==0),N.Gb=s(be),N.Uc=0,N.Gb==null?be=0:(N.mb=N.Gb,N.nb=N.Uc,N.rc=null,be=1),be=!be),!be){be=N.ga;var Te=N.Fa,Re=N.P,ze=N.qc,Ue=N.mb,gt=N.nb,Oe=Re+1,it=ze-1,ht=be.l;if(e(Te!=null&&Ue!=null&&D!=null),Il[0]=null,Il[1]=qn,Il[2]=ir,Il[3]=Br,be.ca=Ue,be.tb=gt,be.c=D.width,be.i=D.height,e(0<be.c&&0<be.i),1>=ze)D=0;else if(be.$a=3&Te[Re+0],be.Z=Te[Re+0]>>2&3,be.Lc=Te[Re+0]>>4&3,Re=Te[Re+0]>>6&3,0>be.$a||1<be.$a||4<=be.Z||1<be.Lc||Re)D=0;else if(ht.put=Mt,ht.ac=en,ht.bc=nn,ht.ma=be,ht.width=D.width,ht.height=D.height,ht.Da=D.Da,ht.v=D.v,ht.va=D.va,ht.j=D.j,ht.o=D.o,be.$a)e:{e(be.$a==1),D=Pe();t:for(;;){if(D==null){D=0;break e}if(e(be!=null),be.mc=D,D.c=be.c,D.i=be.i,D.l=be.l,D.l.ma=be,D.l.width=be.c,D.l.height=be.i,D.a=0,W(D.m,Te,Oe,it),!De(be.c,be.i,1,D,null)||(D.ab==1&&D.gc[0].hc==3&&yi(D.s)?(be.ic=1,Te=D.c*D.i,D.Ta=null,D.Ua=0,D.V=s(Te),D.Ba=0,D.V==null?(D.a=1,D=0):D=1):(be.ic=0,D=qe(D,be.c)),!D))break t;D=1;break e}be.mc=null,D=0}else D=it>=be.c*be.i;be=!D}if(be)return null;N.ga.Lc!=1?N.Ga=0:ne=ge-X}e(N.ga!=null),e(X+ne<=ge);e:{if(D=(Te=N.ga).c,ge=Te.l.o,Te.$a==0){if(Oe=N.rc,it=N.Vc,ht=N.Fa,Re=N.P+1+X*D,ze=N.mb,Ue=N.nb+X*D,e(Re<=N.P+N.qc),Te.Z!=0)for(e(Il[Te.Z]!=null),be=0;be<ne;++be)Il[Te.Z](Oe,it,ht,Re,ze,Ue,D),Oe=ze,it=Ue,Ue+=D,Re+=D;else for(be=0;be<ne;++be)r(ze,Ue,ht,Re,D),Oe=ze,it=Ue,Ue+=D,Re+=D;N.rc=Oe,N.Vc=it}else{if(e(Te.mc!=null),D=X+ne,e((be=Te.mc)!=null),e(D<=be.i),be.C>=D)D=1;else if(Te.ic||Ti(),Te.ic){Te=be.V,Oe=be.Ba,it=be.c;var kt=be.i,pt=(ht=1,Re=be.$/it,ze=be.$%it,Ue=be.m,gt=be.s,be.$),Tt=it*kt,jt=it*D,Ht=gt.wc,Ft=pt<jt?br(gt,ze,Re):null;e(pt<=Tt),e(D<=kt),e(yi(gt));t:for(;;){for(;!Ue.h&&pt<jt;){if(ze&Ht||(Ft=br(gt,ze,Re)),e(Ft!=null),ie(Ue),256>(kt=mr(Ft.G[0],Ft.H[0],Ue)))Te[Oe+pt]=kt,++pt,++ze>=it&&(ze=0,++Re<=D&&!(Re%16)&&ke(be,Re));else{if(!(280>kt)){ht=0;break t}kt=Fn(kt-256,Ue);var kn,hn=mr(Ft.G[4],Ft.H[4],Ue);if(ie(Ue),!(pt>=(hn=lr(it,hn=Fn(hn,Ue)))&&Tt-pt>=kt)){ht=0;break t}for(kn=0;kn<kt;++kn)Te[Oe+pt+kn]=Te[Oe+pt+kn-hn];for(pt+=kt,ze+=kt;ze>=it;)ze-=it,++Re<=D&&!(Re%16)&&ke(be,Re);pt<jt&&ze&Ht&&(Ft=br(gt,ze,Re))}e(Ue.h==te(Ue))}ke(be,Re>D?D:Re);break t}!ht||Ue.h&&pt<Tt?(ht=0,be.a=Ue.h?5:3):be.$=pt,D=ht}else D=Ye(be,be.V,be.Ba,be.c,be.i,D,$e);if(!D){ne=0;break e}}X+ne>=ge&&(N.Cc=1),ne=1}if(!ne)return null;if(N.Cc&&((ne=N.ga)!=null&&(ne.mc=null),N.ga=null,0<N.Ga))return alert("todo:WebPDequantizeLevels"),null}return N.nb+X*fe}function ri(N,D,X,ne,fe,ge){for(;0<fe--;){var be,Te=N,Re=D+(X?1:0),ze=N,Ue=D+(X?0:3);for(be=0;be<ne;++be){var gt=ze[Ue+4*be];gt!=255&&(gt*=32897,Te[Re+4*be+0]=Te[Re+4*be+0]*gt>>23,Te[Re+4*be+1]=Te[Re+4*be+1]*gt>>23,Te[Re+4*be+2]=Te[Re+4*be+2]*gt>>23)}D+=ge}}function di(N,D,X,ne,fe){for(;0<ne--;){var ge;for(ge=0;ge<X;++ge){var be=N[D+2*ge+0],Te=15&(ze=N[D+2*ge+1]),Re=4369*Te,ze=(240&ze|ze>>4)*Re>>16;N[D+2*ge+0]=(240&be|be>>4)*Re>>16&240|(15&be|be<<4)*Re>>16>>4&15,N[D+2*ge+1]=240&ze|Te}D+=fe}}function Ei(N,D,X,ne,fe,ge,be,Te){var Re,ze,Ue=255;for(ze=0;ze<fe;++ze){for(Re=0;Re<ne;++Re){var gt=N[D+Re];ge[be+4*Re]=gt,Ue&=gt}D+=X,be+=Te}return Ue!=255}function Di(N,D,X,ne,fe){var ge;for(ge=0;ge<fe;++ge)X[ne+ge]=N[D+ge]>>8}function Ti(){rl=ri,sc=di,Ud=Ei,mg=Di}function ds(N,D,X){C[N]=function(ne,fe,ge,be,Te,Re,ze,Ue,gt,Oe,it,ht,kt,pt,Tt,jt,Ht){var Ft,kn=Ht-1>>1,hn=Te[Re+0]|ze[Ue+0]<<16,dr=gt[Oe+0]|it[ht+0]<<16;e(ne!=null);var yn=3*hn+dr+131074>>2;for(D(ne[fe+0],255&yn,yn>>16,kt,pt),ge!=null&&(yn=3*dr+hn+131074>>2,D(ge[be+0],255&yn,yn>>16,Tt,jt)),Ft=1;Ft<=kn;++Ft){var jr=Te[Re+Ft]|ze[Ue+Ft]<<16,Ts=gt[Oe+Ft]|it[ht+Ft]<<16,cr=hn+jr+dr+Ts+524296,gn=cr+2*(jr+dr)>>3;yn=gn+hn>>1,hn=(cr=cr+2*(hn+Ts)>>3)+jr>>1,D(ne[fe+2*Ft-1],255&yn,yn>>16,kt,pt+(2*Ft-1)*X),D(ne[fe+2*Ft-0],255&hn,hn>>16,kt,pt+(2*Ft-0)*X),ge!=null&&(yn=cr+dr>>1,hn=gn+Ts>>1,D(ge[be+2*Ft-1],255&yn,yn>>16,Tt,jt+(2*Ft-1)*X),D(ge[be+2*Ft+0],255&hn,hn>>16,Tt,jt+(2*Ft+0)*X)),hn=jr,dr=Ts}1&Ht||(yn=3*hn+dr+131074>>2,D(ne[fe+Ht-1],255&yn,yn>>16,kt,pt+(Ht-1)*X),ge!=null&&(yn=3*dr+hn+131074>>2,D(ge[be+Ht-1],255&yn,yn>>16,Tt,jt+(Ht-1)*X)))}}function So(){Ba[vg]=Zx,Ba[Vh]=gw,Ba[yg]=Qx,Ba[tp]=ip,Ba[Hd]=ya,Ba[$x]=QA,Ba[hw]=h3,Ba[Kx]=gw,Ba[qx]=ip,Ba[np]=ya,Ba[Xx]=QA}function Ld(N){return N&~eE?0>N?0:255:N>>xw}function zc(N,D){return Ld((19077*N>>8)+(26149*D>>8)-14234)}function ta(N,D,X){return Ld((19077*N>>8)-(6419*D>>8)-(13320*X>>8)+8708)}function Vs(N,D){return Ld((19077*N>>8)+(33050*D>>8)-17685)}function tl(N,D,X,ne,fe){ne[fe+0]=zc(N,X),ne[fe+1]=ta(N,D,X),ne[fe+2]=Vs(N,D)}function Ao(N,D,X,ne,fe){ne[fe+0]=Vs(N,D),ne[fe+1]=ta(N,D,X),ne[fe+2]=zc(N,X)}function Eo(N,D,X,ne,fe){var ge=ta(N,D,X);D=ge<<3&224|Vs(N,D)>>3,ne[fe+0]=248&zc(N,X)|ge>>5,ne[fe+1]=D}function rs(N,D,X,ne,fe){var ge=240&Vs(N,D)|15;ne[fe+0]=240&zc(N,X)|ta(N,D,X)>>4,ne[fe+1]=ge}function Id(N,D,X,ne,fe){ne[fe+0]=255,tl(N,D,X,ne,fe+1)}function Bu(N,D,X,ne,fe){Ao(N,D,X,ne,fe),ne[fe+3]=255}function Oh(N,D,X,ne,fe){tl(N,D,X,ne,fe),ne[fe+3]=255}function is(N,D,X){C[N]=function(ne,fe,ge,be,Te,Re,ze,Ue,gt){for(var Oe=Ue+(-2>)*X;Ue!=Oe;)D(ne[fe+0],ge[be+0],Te[Re+0],ze,Ue),D(ne[fe+1],ge[be+0],Te[Re+0],ze,Ue+X),fe+=2,++be,++Re,Ue+=2*X;1>&&D(ne[fe+0],ge[be+0],Te[Re+0],ze,Ue)}}function bi(N,D,X){return X==0?N==0?D==0?6:5:D==0?4:0:X}function wi(N,D,X,ne,fe){switch(N>>>30){case 3:jl(D,X,ne,fe,0);break;case 2:Gc(D,X,ne,fe);break;case 1:Ws(D,X,ne,fe)}}function Uc(N,D){var X,ne,fe=D.M,ge=D.Nb,be=N.oc,Te=N.pc+40,Re=N.oc,ze=N.pc+584,Ue=N.oc,gt=N.pc+600;for(X=0;16>X;++X)be[Te+32*X-1]=129;for(X=0;8>X;++X)Re[ze+32*X-1]=129,Ue[gt+32*X-1]=129;for(0<fe?be[Te-1-32]=Re[ze-1-32]=Ue[gt-1-32]=129:(i(be,Te-32-1,127,21),i(Re,ze-32-1,127,9),i(Ue,gt-32-1,127,9)),ne=0;ne<N.za;++ne){var Oe=D.ya[D.aa+ne];if(0<ne){for(X=-1;16>X;++X)r(be,Te+32*X-4,be,Te+32*X+12,4);for(X=-1;8>X;++X)r(Re,ze+32*X-4,Re,ze+32*X+4,4),r(Ue,gt+32*X-4,Ue,gt+32*X+4,4)}var it=N.Gd,ht=N.Hd+ne,kt=Oe.ad,pt=Oe.Hc;if(0<fe&&(r(be,Te-32,it[ht].y,0,16),r(Re,ze-32,it[ht].f,0,8),r(Ue,gt-32,it[ht].ea,0,8)),Oe.Za){var Tt=be,jt=Te-32+16;for(0<fe&&(ne>=N.za-1?i(Tt,jt,it[ht].y[15],4):r(Tt,jt,it[ht+1].y,0,4)),X=0;4>X;X++)Tt[jt+128+X]=Tt[jt+256+X]=Tt[jt+384+X]=Tt[jt+0+X];for(X=0;16>X;++X,pt<<=2)Tt=be,jt=Te+wg[X],Ll[Oe.Ob[X]](Tt,jt),wi(pt,kt,16*+X,Tt,jt)}else if(Tt=bi(ne,fe,Oe.Ob[0]),Hu[Tt](be,Te),pt!=0)for(X=0;16>X;++X,pt<<=2)wi(pt,kt,16*+X,be,Te+wg[X]);for(X=Oe.Gc,Tt=bi(ne,fe,Oe.Dd),Wc[Tt](Re,ze),Wc[Tt](Ue,gt),pt=kt,Tt=Re,jt=ze,255&(Oe=0|X)&&(170&Oe?zd(pt,256,Tt,jt):ps(pt,256,Tt,jt)),Oe=Ue,pt=gt,255&(X>>=8)&&(170&X?zd(kt,320,Oe,pt):ps(kt,320,Oe,pt)),fe<N.Ub-1&&(r(it[ht].y,0,be,Te+480,16),r(it[ht].f,0,Re,ze+224,8),r(it[ht].ea,0,Ue,gt+224,8)),X=8*ge*N.B,it=N.sa,ht=N.ta+16*ne+16*ge*N.R,kt=N.qa,Oe=N.ra+8*ne+X,pt=N.Ha,Tt=N.Ia+8*ne+X,X=0;16>X;++X)r(it,ht+X*N.R,be,Te+32*X,16);for(X=0;8>X;++X)r(kt,Oe+X*N.B,Re,ze+32*X,8),r(pt,Tt+X*N.B,Ue,gt+32*X,8)}}function ko(N,D,X,ne,fe,ge,be,Te,Re){var ze=[0],Ue=[0],gt=0,Oe=Re!=null?Re.kd:0,it=Re??new ot;if(N==null||12>X)return 7;it.data=N,it.w=D,it.ha=X,D=[D],X=[X],it.gb=[it.gb];e:{var ht=D,kt=X,pt=it.gb;if(e(N!=null),e(kt!=null),e(pt!=null),pt[0]=0,12<=kt[0]&&!n(N,ht[0],"RIFF")){if(n(N,ht[0]+8,"WEBP")){pt=3;break e}var Tt=Ae(N,ht[0]+4);if(12>Tt||4294967286<Tt){pt=3;break e}if(Oe&&Tt>kt[0]-8){pt=7;break e}pt[0]=Tt,ht[0]+=12,kt[0]-=12}pt=0}if(pt!=0)return pt;for(Tt=0<it.gb[0],X=X[0];;){e:{var jt=N;kt=D,pt=X;var Ht=ze,Ft=Ue,kn=ht=[0];if((yn=gt=[gt])[0]=0,8>pt[0])pt=7;else{if(!n(jt,kt[0],"VP8X")){if(Ae(jt,kt[0]+4)!=10){pt=3;break e}if(18>pt[0]){pt=7;break e}var hn=Ae(jt,kt[0]+8),dr=1+we(jt,kt[0]+12);if(2147483648<=dr*(jt=1+we(jt,kt[0]+15))){pt=3;break e}kn!=null&&(kn[0]=hn),Ht!=null&&(Ht[0]=dr),Ft!=null&&(Ft[0]=jt),kt[0]+=18,pt[0]-=18,yn[0]=1}pt=0}}if(gt=gt[0],ht=ht[0],pt!=0)return pt;if(kt=!!(2&ht),!Tt&>)return 3;if(ge!=null&&(ge[0]=!!(16&ht)),be!=null&&(be[0]=kt),Te!=null&&(Te[0]=0),be=ze[0],ht=Ue[0],gt&&kt&&Re==null){pt=0;break}if(4>X){pt=7;break}if(Tt&>||!Tt&&!gt&&!n(N,D[0],"ALPH")){X=[X],it.na=[it.na],it.P=[it.P],it.Sa=[it.Sa];e:{hn=N,pt=D,Tt=X;var yn=it.gb;Ht=it.na,Ft=it.P,kn=it.Sa,dr=22,e(hn!=null),e(Tt!=null),jt=pt[0];var jr=Tt[0];for(e(Ht!=null),e(kn!=null),Ht[0]=null,Ft[0]=null,kn[0]=0;;){if(pt[0]=jt,Tt[0]=jr,8>jr){pt=7;break e}var Ts=Ae(hn,jt+4);if(4294967286<Ts){pt=3;break e}var cr=8+Ts+1&-2;if(dr+=cr,0<yn&&dr>yn){pt=3;break e}if(!n(hn,jt,"VP8 ")||!n(hn,jt,"VP8L")){pt=0;break e}if(jr[0]<cr){pt=7;break e}n(hn,jt,"ALPH")||(Ht[0]=hn,Ft[0]=jt+8,kn[0]=Ts),jt+=cr,jr-=cr}}if(X=X[0],it.na=it.na[0],it.P=it.P[0],it.Sa=it.Sa[0],pt!=0)break}X=[X],it.Ja=[it.Ja],it.xa=[it.xa];e:if(yn=N,pt=D,Tt=X,Ht=it.gb[0],Ft=it.Ja,kn=it.xa,hn=pt[0],jt=!n(yn,hn,"VP8 "),dr=!n(yn,hn,"VP8L"),e(yn!=null),e(Tt!=null),e(Ft!=null),e(kn!=null),8>Tt[0])pt=7;else{if(jt||dr){if(yn=Ae(yn,hn+4),12<=Ht&&yn>Ht-12){pt=3;break e}if(Oe&&yn>Tt[0]-8){pt=7;break e}Ft[0]=yn,pt[0]+=8,Tt[0]-=8,kn[0]=dr}else kn[0]=5<=Tt[0]&&yn[hn+0]==47&&!(yn[hn+4]>>5),Ft[0]=Tt[0];pt=0}if(X=X[0],it.Ja=it.Ja[0],it.xa=it.xa[0],D=D[0],pt!=0)break;if(4294967286<it.Ja)return 3;if(Te==null||kt||(Te[0]=it.xa?2:1),be=[be],ht=[ht],it.xa){if(5>X){pt=7;break}Te=be,Oe=ht,kt=ge,N==null||5>X?N=0:5<=X&&N[D+0]==47&&!(N[D+4]>>5)?(Tt=[0],yn=[0],Ht=[0],W(Ft=new I,N,D,X),Tn(Ft,Tt,yn,Ht)?(Te!=null&&(Te[0]=Tt[0]),Oe!=null&&(Oe[0]=yn[0]),kt!=null&&(kt[0]=Ht[0]),N=1):N=0):N=0}else{if(10>X){pt=7;break}Te=ht,N==null||10>X||!Hr(N,D+3,X-3)?N=0:(Oe=N[D+0]|N[D+1]<<8|N[D+2]<<16,kt=16383&(N[D+7]<<8|N[D+6]),N=16383&(N[D+9]<<8|N[D+8]),1&Oe||3<(Oe>>1&7)||!(Oe>>4&1)||Oe>>5>=it.Ja||!kt||!N?N=0:(be&&(be[0]=kt),Te&&(Te[0]=N),N=1))}if(!N||(be=be[0],ht=ht[0],gt&&(ze[0]!=be||Ue[0]!=ht)))return 3;Re!=null&&(Re[0]=it,Re.offset=D-Re.w,e(4294967286>D-Re.w),e(Re.offset==Re.ha-X));break}return pt==0||pt==7&>&&Re==null?(ge!=null&&(ge[0]|=it.na!=null&&0<it.na.length),ne!=null&&(ne[0]=be),fe!=null&&(fe[0]=ht),0):pt}function nl(N,D,X){var ne=D.width,fe=D.height,ge=0,be=0,Te=ne,Re=fe;if(D.Da=N!=null&&0<N.Da,D.Da&&(Te=N.cd,Re=N.bd,ge=N.v,be=N.j,11>X||(ge&=-2,be&=-2),0>ge||0>be||0>=Te||0>=Re||ge+Te>ne||be+Re>fe))return 0;if(D.v=ge,D.j=be,D.va=ge+Te,D.o=be+Re,D.U=Te,D.T=Re,D.da=N!=null&&0<N.da,D.da){if(!Se(Te,Re,X=[N.ib],ge=[N.hb]))return 0;D.ib=X[0],D.hb=ge[0]}return D.ob=N!=null&&N.ob,D.Kb=N==null||!N.Sd,D.da&&(D.ob=D.ib<3*ne/4&&D.hb<3*fe/4,D.Kb=0),1}function Dd(N){if(N==null)return 2;if(11>N.S){var D=N.f.RGBA;D.fb+=(N.height-1)*D.A,D.A=-D.A}else D=N.f.kb,N=N.height,D.O+=(N-1)*D.fa,D.fa=-D.fa,D.N+=(N-1>>1)*D.Ab,D.Ab=-D.Ab,D.W+=(N-1>>1)*D.Db,D.Db=-D.Db,D.F!=null&&(D.J+=(N-1)*D.lb,D.lb=-D.lb);return 0}function zh(N,D,X,ne){if(ne==null||0>=N||0>=D)return 2;if(X!=null){if(X.Da){var fe=X.cd,ge=X.bd,be=-2&X.v,Te=-2&X.j;if(0>be||0>Te||0>=fe||0>=ge||be+fe>N||Te+ge>D)return 2;N=fe,D=ge}if(X.da){if(!Se(N,D,fe=[X.ib],ge=[X.hb]))return 2;N=fe[0],D=ge[0]}}ne.width=N,ne.height=D;e:{var Re=ne.width,ze=ne.height;if(N=ne.S,0>=Re||0>=ze||!(N>=vg&&13>N))N=2;else{if(0>=ne.Rd&&ne.sd==null){be=ge=fe=D=0;var Ue=(Te=Re*_w[N])*ze;if(11>N||(ge=(ze+1)/2*(D=(Re+1)/2),N==12&&(be=(fe=Re)*ze)),(ze=s(Ue+2*ge+be))==null){N=1;break e}ne.sd=ze,11>N?((Re=ne.f.RGBA).eb=ze,Re.fb=0,Re.A=Te,Re.size=Ue):((Re=ne.f.kb).y=ze,Re.O=0,Re.fa=Te,Re.Fd=Ue,Re.f=ze,Re.N=0+Ue,Re.Ab=D,Re.Cd=ge,Re.ea=ze,Re.W=0+Ue+ge,Re.Db=D,Re.Ed=ge,N==12&&(Re.F=ze,Re.J=0+Ue+2*ge),Re.Tc=be,Re.lb=fe)}if(D=1,fe=ne.S,ge=ne.width,be=ne.height,fe>=vg&&13>fe)if(11>fe)N=ne.f.RGBA,D&=(Te=Math.abs(N.A))*(be-1)+ge<=N.size,D&=Te>=ge*_w[fe],D&=N.eb!=null;else{N=ne.f.kb,Te=(ge+1)/2,Ue=(be+1)/2,Re=Math.abs(N.fa),ze=Math.abs(N.Ab);var gt=Math.abs(N.Db),Oe=Math.abs(N.lb),it=Oe*(be-1)+ge;D&=Re*(be-1)+ge<=N.Fd,D&=ze*(Ue-1)+Te<=N.Cd,D=(D&=gt*(Ue-1)+Te<=N.Ed)&Re>=ge&ze>=Te>>=Te,D&=N.y!=null,D&=N.f!=null,D&=N.ea!=null,fe==12&&(D&=Oe>=ge,D&=it<=N.Tc,D&=N.F!=null)}else D=0;N=D?0:2}}return N!=0||X!=null&&X.fd&&(N=Dd(ne)),N}var Bd=64,Fd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Fu=24,Ns=32,Ia=8,Hc=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
vendor: 4,771 bytes, line 710
7106,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];me("Predictor0","PredictorAdd0"),C.Predictor0=function(){return 4278190080},C.Predictor1=function(N){return N},C.Predictor2=function(N,D,X){return D[X+0]},C.Predictor3=function(N,D,X){return D[X+1]},C.Predictor4=function(N,D,X){return D[X-1]},C.Predictor5=function(N,D,X){return He(He(N,D[X+1]),D[X+0])},C.Predictor6=function(N,D,X){return He(N,D[X-1])},C.Predictor7=function(N,D,X){return He(N,D[X+0])},C.Predictor8=function(N,D,X){return He(D[X-1],D[X+0])},C.Predictor9=function(N,D,X){return He(D[X+0],D[X+1])},C.Predictor10=function(N,D,X){return He(He(N,D[X-1]),He(D[X+0],D[X+1]))},C.Predictor11=function(N,D,X){var ne=D[X+0];return 0>=ue(ne>>24&255,N>>24&255,(D=D[X-1])>>24&255)+ue(ne>>16&255,N>>16&255,D>>16&255)+ue(ne>>8&255,N>>8&255,D>>8&255)+ue(255&ne,255&N,255&D)?ne:N},C.Predictor12=function(N,D,X){var ne=D[X+0];return(_e((N>>24&255)+(ne>>24&255)-((D=D[X-1])>>24&255))<<24|_e((N>>16&255)+(ne>>16&255)-(D>>16&255))<<16|_e((N>>8&255)+(ne>>8&255)-(D>>8&255))<<8|_e((255&N)+(255&ne)-(255&D)))>>>0},C.Predictor13=function(N,D,X){var ne=D[X-1];return(Ne((N=He(N,D[X+0]))>>24&255,ne>>24&255)<<24|Ne(N>>16&255,ne>>16&255)<<16|Ne(N>>8&255,ne>>8&255)<<8|Ne(255&N,255&ne))>>>0};var rc=C.PredictorAdd0;C.PredictorAdd1=Ce,me("Predictor2","PredictorAdd2"),me("Predictor3","PredictorAdd3"),me("Predictor4","PredictorAdd4"),me("Predictor5","PredictorAdd5"),me("Predictor6","PredictorAdd6"),me("Predictor7","PredictorAdd7"),me("Predictor8","PredictorAdd8"),me("Predictor9","PredictorAdd9"),me("Predictor10","PredictorAdd10"),me("Predictor11","PredictorAdd11"),me("Predictor12","PredictorAdd12"),me("Predictor13","PredictorAdd13");var Ou=C.PredictorAdd2;We("ColorIndexInverseTransform","MapARGB","32b",function(N){return N>>8&255},function(N){return N}),We("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(N){return N},function(N){return N>>8&255});var Uh,Ml=C.ColorIndexInverseTransform,hs=C.MapARGB,Hh=C.VP8LColorIndexInverseTransformAlpha,fs=C.MapAlpha,ro=C.VP8LPredictorsAdd=[];ro.length=16,(C.VP8LPredictors=[]).length=16,(C.VP8LPredictorsAdd_C=[]).length=16,(C.VP8LPredictors_C=[]).length=16;var Rl,Co,Gh,ic,Od,zu,ii,jl,Gc,zd,Ws,ps,Jr,Yn,Lr,Ir,Pl,Uu,Vc,Ux,va,Hx,Gx,Vx,rl,sc,Ud,mg,gg=s(511),lw=s(2041),cw=s(225),uw=s(767),dw=0,Wx=lw,xg=cw,io=uw,Da=gg,vg=0,Vh=1,yg=2,tp=3,Hd=4,$x=5,hw=6,Kx=7,qx=8,np=9,Xx=10,KA=[2,3,7],a3=[3,3,11],fw=[280,256,256,256,40],o3=[0,1,1,1,0],l3=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],qA=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],XA=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],YA=8,Yx=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],rp=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],bg=null,c3=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],u3=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Jx=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],pw=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,25
7105,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],d3=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,25
7105,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],JA=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,25
vendor: 23,990 bytes, lines 710-734
7105,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],ZA=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Hu=[],Ll=[],Wc=[],$c=1,mw=2,Il=[],Ba=[];ds("UpsampleRgbLinePair",tl,3),ds("UpsampleBgrLinePair",Ao,3),ds("UpsampleRgbaLinePair",Oh,4),ds("UpsampleBgraLinePair",Bu,4),ds("UpsampleArgbLinePair",Id,4),ds("UpsampleRgba4444LinePair",rs,2),ds("UpsampleRgb565LinePair",Eo,2);var Zx=C.UpsampleRgbLinePair,Qx=C.UpsampleBgrLinePair,gw=C.UpsampleRgbaLinePair,ip=C.UpsampleBgraLinePair,ya=C.UpsampleArgbLinePair,QA=C.UpsampleRgba4444LinePair,h3=C.UpsampleRgb565LinePair,Fa=16,na=1<<Fa-1,sp=-227,ev=482,xw=6,eE=(256<<xw)-1,vw=0,yw=s(256),tE=s(256),bw=s(256),nE=s(256),rE=s(ev-sp),tv=s(ev-sp);is("YuvToRgbRow",tl,3),is("YuvToBgrRow",Ao,3),is("YuvToRgbaRow",Oh,4),is("YuvToBgraRow",Bu,4),is("YuvToArgbRow",Id,4),is("YuvToRgba4444Row",rs,2),is("YuvToRgb565Row",Eo,2);var wg=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],_g=[0,2,8],ww=[8,7,6,4,4,2,2,2,1,1,1,1],iE=1;this.WebPDecodeRGBA=function(N,D,X,ne,fe){var ge=Vh,be=new tt,Te=new bt;be.ba=Te,Te.S=ge,Te.width=[Te.width],Te.height=[Te.height];var Re=Te.width,ze=Te.height,Ue=new dt;if(Ue==null||N==null)var gt=2;else e(Ue!=null),gt=ko(N,D,X,Ue.width,Ue.height,Ue.Pd,Ue.Qd,Ue.format,null);if(gt!=0?Re=0:(Re!=null&&(Re[0]=Ue.width[0]),ze!=null&&(ze[0]=Ue.height[0]),Re=1),Re){Te.width=Te.width[0],Te.height=Te.height[0],ne!=null&&(ne[0]=Te.width),fe!=null&&(fe[0]=Te.height);e:{if(ne=new an,(fe=new ot).data=N,fe.w=D,fe.ha=X,fe.kd=1,D=[0],e(fe!=null),((N=ko(fe.data,fe.w,fe.ha,null,null,null,D,null,fe))==0||N==7)&&D[0]&&(N=4),(D=N)==0){if(e(be!=null),ne.data=fe.data,ne.w=fe.w+fe.offset,ne.ha=fe.ha-fe.offset,ne.put=Mt,ne.ac=en,ne.bc=nn,ne.ma=be,fe.xa){if((N=Pe())==null){be=1;break e}if(function(Oe,it){var ht=[0],kt=[0],pt=[0];t:for(;;){if(Oe==null)return 0;if(it==null)return Oe.a=2,0;if(Oe.l=it,Oe.a=0,W(Oe.m,it.data,it.w,it.ha),!Tn(Oe.m,ht,kt,pt)){Oe.a=3;break t}if(Oe.xb=mw,it.width=ht[0],it.height=kt[0],!De(ht[0],kt[0],1,Oe,null))break t;return 1}return e(Oe.a!=0),0}(N,ne)){if(ne=(D=zh(ne.width,ne.height,be.Oa,be.ba))==0){t:{ne=N;n:for(;;){if(ne==null){ne=0;break t}if(e(ne.s.yc!=null),e(ne.s.Ya!=null),e(0<ne.s.Wb),e((X=ne.l)!=null),e((fe=X.ma)!=null),ne.xb!=0){if(ne.ca=fe.ba,ne.tb=fe.tb,e(ne.ca!=null),!nl(fe.Oa,X,tp)){ne.a=2;break n}if(!qe(ne,X.width)||X.da)break n;if((X.da||lt(ne.ca.S))&&Ti(),11>ne.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),ne.ca.f.kb.F!=null&&Ti()),ne.Pb&&0<ne.s.ua&&ne.s.vb.X==null&&!K(ne.s.vb,ne.s.Wa.Xa)){ne.a=1;break n}ne.xb=0}if(!Ye(ne,ne.V,ne.Ba,ne.c,ne.i,X.o,Mr))break n;fe.Dc=ne.Ma,ne=1;break t}e(ne.a!=0),ne=0}ne=!ne}ne&&(D=N.a)}else D=N.a}else{if((N=new Cn)==null){be=1;break e}if(N.Fa=fe.na,N.P=fe.P,N.qc=fe.Sa,wr(N,ne)){if((D=zh(ne.width,ne.height,be.Oa,be.ba))==0){if(N.Aa=0,X=be.Oa,e((fe=N)!=null),X!=null){if(0<(Re=0>(Re=X.Md)?0:100<Re?255:255*Re/100)){for(ze=Ue=0;4>ze;++ze)12>(gt=fe.pb[ze]).lc&&(gt.ia=Re*ww[0>gt.lc?0:gt.lc]>>3),Ue|=gt.ia;Ue&&(alert("todo:VP8InitRandom"),fe.ia=1)}fe.Ga=X.Id,100<fe.Ga?fe.Ga=100:0>fe.Ga&&(fe.Ga=0)}(function(Oe,it){if(Oe==null)return 0;if(it==null)return on(Oe,2,"NULL VP8Io parameter in VP8Decode().");if(!Oe.cb&&!wr(Oe,it))return 0;if(e(Oe.cb),it.ac==null||it.ac(it)){it.ob&&(Oe.L=0);var ht=_g[Oe.L];if(Oe.L==2?(Oe.yb=0,Oe.zb=0):(Oe.yb=it.v-ht>>4,Oe.zb=it.j-ht>>4,0>Oe.yb&&(Oe.yb=0),0>Oe.zb&&(Oe.zb=0)),Oe.Va=it.o+15+ht>>4,Oe.Hb=it.va+15+ht>>4,Oe.Hb>Oe.za&&(Oe.Hb=Oe.za),Oe.Va>Oe.Ub&&(Oe.Va=Oe.Ub),0<Oe.L){var kt=Oe.ed;for(ht=0;4>ht;++ht){var pt;if(Oe.Qa.Cb){var Tt=Oe.Qa.Lb[ht];Oe.Qa.Fb||(Tt+=kt.Tb)}else Tt=kt.Tb;for(pt=0;1>=pt;++pt){var jt=Oe.gd[ht][pt],Ht=Tt;if(kt.Pc&&(Ht+=kt.vd[0],pt&&(Ht+=kt.od[0])),0<(Ht=0>Ht?0:63<Ht?63:Ht)){var Ft=Ht;0<kt.wb&&(Ft=4<kt.wb?Ft>>2:Ft>>1)>9-kt.wb&&(Ft=9-kt.wb),1>Ft&&(Ft=1),jt.dd=Ft,jt.tc=2*Ht+Ft,jt.ld=40<=Ht?2:15<=Ht?1:0}else jt.tc=0;jt.La=pt}}}ht=0}else on(Oe,6,"Frame setup failed"),ht=Oe.a;if(ht=ht==0){if(ht){Oe.$c=0,0<Oe.Aa||(Oe.Ic=iE);t:{ht=Oe.Ic,kt=4*(Ft=Oe.za);var kn=32*Ft,hn=Ft+1,dr=0<Oe.L?Ft*(0<Oe.Aa?2:1):0,yn=(Oe.Aa==2?2:1)*Ft;if((jt=kt+832+(pt=3*(16*ht+_g[Oe.L])/2*kn)+(Tt=Oe.Fa!=null&&0<Oe.Fa.length?Oe.Kc.c*Oe.Kc.i:0))!=jt)ht=0;else{if(jt>Oe.Vb){if(Oe.Vb=0,Oe.Ec=s(jt),Oe.Fc=0,Oe.Ec==null){ht=on(Oe,1,"no memory during frame initialization.");break t}Oe.Vb=jt}jt=Oe.Ec,Ht=Oe.Fc,Oe.Ac=jt,Oe.Bc=Ht,Ht+=kt,Oe.Gd=a(kn,zt),Oe.Hd=0,Oe.rb=a(hn+1,rt),Oe.sb=1,Oe.wa=dr?a(dr,ve):null,Oe.Y=0,Oe.D.Nb=0,Oe.D.wa=Oe.wa,Oe.D.Y=Oe.Y,0<Oe.Aa&&(Oe.D.Y+=Ft),e(!0),Oe.oc=jt,Oe.pc=Ht,Ht+=832,Oe.ya=a(yn,Gt),Oe.aa=0,Oe.D.ya=Oe.ya,Oe.D.aa=Oe.aa,Oe.Aa==2&&(Oe.D.aa+=Ft),Oe.R=16*Ft,Oe.B=8*Ft,Ft=(kn=_g[Oe.L])*Oe.R,kn=kn/2*Oe.B,Oe.sa=jt,Oe.ta=Ht+Ft,Oe.qa=Oe.sa,Oe.ra=Oe.ta+16*ht*Oe.R+kn,Oe.Ha=Oe.qa,Oe.Ia=Oe.ra+8*ht*Oe.B+kn,Oe.$c=0,Ht+=pt,Oe.mb=Tt?jt:null,Oe.nb=Tt?Ht:null,e(Ht+Tt<=Oe.Fc+Oe.Vb),Zn(Oe),i(Oe.Ac,Oe.Bc,0,kt),ht=1}}if(ht){if(it.ka=0,it.y=Oe.sa,it.O=Oe.ta,it.f=Oe.qa,it.N=Oe.ra,it.ea=Oe.Ha,it.Vd=Oe.Ia,it.fa=Oe.R,it.Rc=Oe.B,it.F=null,it.J=0,!dw){for(ht=-255;255>=ht;++ht)gg[255+ht]=0>ht?-ht:ht;for(ht=-1020;1020>=ht;++ht)lw[1020+ht]=-128>ht?-128:127<ht?127:ht;for(ht=-112;112>=ht;++ht)cw[112+ht]=-16>ht?-16:15<ht?15:ht;for(ht=-255;510>=ht;++ht)uw[255+ht]=0>ht?0:255<ht?255:ht;dw=1}ii=El,jl=Wi,zd=Za,Ws=ec,ps=Qs,Gc=Cs,Jr=Du,Yn=Fh,Lr=Ii,Ir=H,Pl=cs,Uu=us,Vc=he,Ux=Be,va=Tl,Hx=Hs,Gx=Ki,Vx=Iu,Ll[0]=Ni,Ll[1]=Mu,Ll[2]=Bh,Ll[3]=Qf,Ll[4]=ju,Ll[5]=$i,Ll[6]=ep,Ll[7]=Qo,Ll[8]=to,Ll[9]=Pu,Hu[0]=Zo,Hu[1]=tc,Hu[2]=jd,Hu[3]=Cl,Hu[4]=er,Hu[5]=Dh,Hu[6]=eo,Wc[0]=xa,Wc[1]=Ru,Wc[2]=Oc,Wc[3]=Pd,Wc[4]=_o,Wc[5]=no,Wc[6]=Lu,ht=1}else ht=0}ht&&(ht=function(jr,Ts){for(jr.M=0;jr.M<jr.Va;++jr.M){var cr,gn=jr.Jc[jr.M&jr.Xb],Jt=jr.m,ms=jr;for(cr=0;cr<ms.za;++cr){var sr=Jt,Fr=ms,ki=Fr.Ac,ra=Fr.Bc+4*cr,ia=Fr.zc,Mi=Fr.ya[Fr.aa+cr];if(Fr.Qa.Bb?Mi.$b=Ee(sr,Fr.Pa.jb[0])?2+Ee(sr,Fr.Pa.jb[2]):Ee(sr,Fr.Pa.jb[1]):Mi.$b=0,Fr.kc&&(Mi.Ad=Ee(sr,Fr.Bd)),Mi.Za=!Ee(sr,145)+0,Mi.Za){var $s=Mi.Ob,sa=0;for(Fr=0;4>Fr;++Fr){var ss,Pr=ia[0+Fr];for(ss=0;4>ss;++ss){Pr=d3[ki[ra+ss]][Pr];for(var Zr=Jx[Ee(sr,Pr[0])];0<Zr;)Zr=Jx[2*Zr+Ee(sr,Pr[Zr])];Pr=-Zr,ki[ra+ss]=Pr}r($s,sa,ki,ra,4),sa+=4,ia[0+Fr]=Pr}}else Pr=Ee(sr,156)?Ee(sr,128)?1:3:Ee(sr,163)?2:0,Mi.Ob[0]=Pr,i(ki,ra,Pr,4),i(ia,0,Pr,4);Mi.Dd=Ee(sr,142)?Ee(sr,114)?Ee(sr,183)?1:3:2:0}if(ms.m.Ka)return on(jr,7,"Premature end-of-partition0 encountered.");for(;jr.ja<jr.za;++jr.ja){if(ms=gn,sr=(Jt=jr).rb[Jt.sb-1],ki=Jt.rb[Jt.sb+Jt.ja],cr=Jt.ya[Jt.aa+Jt.ja],ra=Jt.kc?cr.Ad:0)sr.la=ki.la=0,cr.Za||(sr.Na=ki.Na=0),cr.Hc=0,cr.Gc=0,cr.ia=0;else{var Bi,Qr;if(sr=ki,ki=ms,ra=Jt.Pa.Xc,ia=Jt.ya[Jt.aa+Jt.ja],Mi=Jt.pb[ia.$b],Fr=ia.ad,$s=0,sa=Jt.rb[Jt.sb-1],Pr=ss=0,i(Fr,$s,0,384),ia.Za)var aa=0,il=ra[3];else{Zr=s(16);var gs=sr.Na+sa.Na;if(gs=bg(ki,ra[1],gs,Mi.Eb,0,Zr,0),sr.Na=sa.Na=(0<gs)+0,1<gs)ii(Zr,0,Fr,$s);else{var ba=Zr[0]+3>>3;for(Zr=0;256>Zr;Zr+=16)Fr[$s+Zr]=ba}aa=1,il=ra[0]}var hi=15&sr.la,Ar=15&sa.la;for(Zr=0;4>Zr;++Zr){var Un=1&Ar;for(ba=Qr=0;4>ba;++ba)hi=hi>>1|(Un=(gs=bg(ki,il,gs=Un+(1&hi),Mi.Sc,aa,Fr,$s))>aa)<<7,Qr=Qr<<2|(3<gs?3:1<gs?2:Fr[$s+0]!=0),$s+=16;hi>>=4,Ar=Ar>>1|Un<<7,ss=(ss<<8|Qr)>>>0}for(il=hi,aa=Ar>>4,Bi=0;4>Bi;Bi+=2){for(Qr=0,hi=sr.la>>4+Bi,Ar=sa.la>>4+Bi,Zr=0;2>Zr;++Zr){for(Un=1&Ar,ba=0;2>ba;++ba)gs=Un+(1&hi),hi=hi>>1|(Un=0<(gs=bg(ki,ra[2],gs,Mi.Qc,0,Fr,$s)))<<3,Qr=Qr<<2|(3<gs?3:1<gs?2:Fr[$s+0]!=0),$s+=16;hi>>=2,Ar=Ar>>1|Un<<5}Pr|=Qr<<4*Bi,il|=hi<<4<<Bi,aa|=(240&Ar)<<Bi}sr.la=il,sa.la=aa,ia.Hc=ss,ia.Gc=Pr,ia.ia=43690&Pr?0:Mi.ia,ra=!(ss|Pr)}if(0<Jt.L&&(Jt.wa[Jt.Y+Jt.ja]=Jt.gd[cr.$b][cr.Za],Jt.wa[Jt.Y+Jt.ja].La|=!ra),ms.Ka)return on(jr,7,"Premature end-of-file encountered.")}if(Zn(jr),Jt=Ts,ms=1,cr=(gn=jr).D,sr=0<gn.L&&gn.M>=gn.zb&&gn.M<=gn.Va,gn.Aa==0)t:{if(cr.M=gn.M,cr.uc=sr,Uc(gn,cr),ms=1,cr=(Qr=gn.D).Nb,sr=(Pr=_g[gn.L])*gn.R,ki=Pr/2*gn.B,Zr=16*cr*gn.R,ba=8*cr*gn.B,ra=gn.sa,ia=gn.ta-sr+Zr,Mi=gn.qa,Fr=gn.ra-ki+ba,$s=gn.Ha,sa=gn.Ia-ki+ba,Ar=(hi=Qr.M)==0,ss=hi>=gn.Va-1,gn.Aa==2&&Uc(gn,Qr),Qr.uc)for(Un=(gs=gn).D.M,e(gs.D.uc),Qr=gs.yb;Qr<gs.Hb;++Qr){aa=Qr,il=Un;var Gr=(Kr=(xs=gs).D).Nb;Bi=xs.R;var Kr=Kr.wa[Kr.Y+aa],fi=xs.sa,Ci=xs.ta+16*Gr*Bi+16*aa,oa=Kr.dd,ar=Kr.tc;if(ar!=0)if(e(3<=ar),xs.L==1)0<aa&&Hx(fi,Ci,Bi,ar+4),Kr.La&&Vx(fi,Ci,Bi,ar),0<il&&va(fi,Ci,Bi,ar+4),Kr.La&&Gx(fi,Ci,Bi,ar);else{var wa=xs.B,Oa=xs.qa,Kc=xs.ra+8*Gr*wa+8*aa,ac=xs.Ha,xs=xs.Ia+8*Gr*wa+8*aa;Gr=Kr.ld,0<aa&&(Yn(fi,Ci,Bi,ar+4,oa,Gr),Ir(Oa,Kc,ac,xs,wa,ar+4,oa,Gr)),Kr.La&&(Uu(fi,Ci,Bi,ar,oa,Gr),Ux(Oa,Kc,ac,xs,wa,ar,oa,Gr)),0<il&&(Jr(fi,Ci,Bi,ar+4,oa,Gr),Lr(Oa,Kc,ac,xs,wa,ar+4,oa,Gr)),Kr.La&&(Pl(fi,Ci,Bi,ar,oa,Gr),Vc(Oa,Kc,ac,xs,wa,ar,oa,Gr))}}if(gn.ia&&alert("todo:DitherRow"),Jt.put!=null){if(Qr=16*hi,hi=16*(hi+1),Ar?(Jt.y=gn.sa,Jt.O=gn.ta+Zr,Jt.f=gn.qa,Jt.N=gn.ra+ba,Jt.ea=gn.Ha,Jt.W=gn.Ia+ba):(Qr-=Pr,Jt.y=ra,Jt.O=ia,Jt.f=Mi,Jt.N=Fr,Jt.ea=$s,Jt.W=sa),ss||(hi-=Pr),hi>Jt.o&&(hi=Jt.o),Jt.F=null,Jt.J=null,gn.Fa!=null&&0<gn.Fa.length&&Qr<hi&&(Jt.J=ns(gn,Jt,Qr,hi-Qr),Jt.F=gn.mb,Jt.F==null&&Jt.F.length==0)){ms=on(gn,3,"Could not decode alpha data.");break t}Qr<Jt.j&&(Pr=Jt.j-Qr,Qr=Jt.j,e(!(1&Pr)),Jt.O+=gn.R*Pr,Jt.N+=gn.B*(Pr>>1),Jt.W+=gn.B*(Pr>>1),Jt.F!=null&&(Jt.J+=Jt.width*Pr)),Qr<hi&&(Jt.O+=Jt.v,Jt.N+=Jt.v>>1,Jt.W+=Jt.v>>1,Jt.F!=null&&(Jt.J+=Jt.v),Jt.ka=Qr-Jt.j,Jt.U=Jt.va-Jt.v,Jt.T=hi-Qr,ms=Jt.put(Jt))}cr+1!=gn.Ic||ss||(r(gn.sa,gn.ta-sr,ra,ia+16*gn.R,sr),r(gn.qa,gn.ra-ki,Mi,Fr+8*gn.B,ki),r(gn.Ha,gn.Ia-ki,$s,sa+8*gn.B,ki))}if(!ms)return on(jr,6,"Output aborted.")}return 1}(Oe,it)),it.bc!=null&&it.bc(it),ht&=1}return ht?(Oe.cb=0,ht):0})(N,ne)||(D=N.a)}}else D=N.a}D==0&&be.Oa!=null&&be.Oa.fd&&(D=Dd(be.ba))}be=D}ge=be!=0?null:11>ge?Te.f.RGBA.eb:Te.f.kb.y}else ge=null;return ge};var _w=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(C,R){for(var P="",j=0;j<4;j++)P+=String.fromCharCode(C[R++]);return P}function d(C,R){return C[R+0]|C[R+1]<<8}function h(C,R){return(C[R+0]|C[R+1]<<8|C[R+2]<<16)>>>0}function p(C,R){return(C[R+0]|C[R+1]<<8|C[R+2]<<16|C[R+3]<<24)>>>0}new l;var f=[0],m=[0],x=[],v=new l,g=t,b=function(C,R){var P={},j=0,G=!1,B=0,$=0;if(P.frames=[],!function(z,I){for(var q=0;q<4;q++)if(z[I+q]!="RIFF".charCodeAt(q))return!0;return!1}(C,R)){for(p(C,R+=4),R+=8;R<C.length;){var U=u(C,R),Z=p(C,R+=4);R+=4;var V=Z+(1&Z);switch(U){case"VP8 ":case"VP8L":P.frames[j]===void 0&&(P.frames[j]={}),(Y=P.frames[j]).src_off=G?$:R-8,Y.src_size=B+Z+8,j++,G&&(G=!1,B=0,$=0);break;case"VP8X":(Y=P.header={}).feature_flags=C[R];var W=R+4;Y.canvas_width=1+h(C,W),W+=3,Y.canvas_height=1+h(C,W),W+=3;break;case"ALPH":G=!0,B=V+8,$=R-8;break;case"ANIM":(Y=P.header).bgcolor=p(C,R),W=R+4,Y.loop_count=d(C,W),W+=2;break;case"ANMF":var O,Y;(Y=P.frames[j]={}).offset_x=2*h(C,R),R+=3,Y.offset_y=2*h(C,R),R+=3,Y.width=1+h(C,R),R+=3,Y.height=1+h(C,R),R+=3,Y.duration=h(C,R),R+=3,O=C[R++],Y.dispose=1&O,Y.blend=O>>1&1}U!="ANMF"&&(R+=V)}return P}}(g,0);b.response=g,b.rgbaoutput=!0,b.dataurl=!1;var y=b.header?b.header:null,S=b.frames?b.frames:null;if(y){y.loop_counter=y.loop_count,f=[y.canvas_height],m=[y.canvas_width];for(var A=0;A<S.length&&S[A].blend!=0;A++);}var k=S[0],M=v.WebPDecodeRGBA(g,k.src_off,k.src_size,m,f);k.rgba=M,k.imgwidth=m[0],k.imgheight=f[0];for(var T=0;T<m[0]*f[0]*4;T++)x[T]=M[T];return this.width=m,this.height=f,this.data=x,this}/** ==================================================================== 711 * @license 712 * jsPDF XMP metadata plugin 713 * Copyright (c) 2016 Jussi Utunen, [email protected] 714 * 715 * Permission is hereby granted, free of charge, to any person obtaining 716 * a copy of this software and associated documentation files (the 717 * "Software"), to deal in the Software without restriction, including 718 * without limitation the rights to use, copy, modify, merge, publish, 719 * distribute, sublicense, and/or sell copies of the Software, and to 720 * permit persons to whom the Software is furnished to do so, subject to 721 * the following conditions: 722 * 723 * The above copyright notice and this permission notice shall be 724 * included in all copies or substantial portions of the Software. 725 * 726 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 727 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 728 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 729 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 730 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 731 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 732 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 733 * ==================================================================== 734 */function pMe(){var t,e=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(e));t=this.internal.__metadata__.rawXml?n:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+t.length+" >>"),this.internal.write("stream"),this.internal.write(t),this.internal.write("endstream"),this.internal.write("endobj")}function mMe(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(t){var e,n,r,i,s,a,o,l,u,d=function(z){return z=z||{},this.isStrokeTransparent=z.isStrokeTransparent||!1,this.strokeOpacity=z.strokeOpacity||1,this.strokeStyle=z.strokeStyle||"#000000",this.fillStyle=z.fillStyle||"#000000",this.isFillTransparent=z.isFillTransparent||!1,this.fillOpacity=z.fillOpacity||1,this.font=z.font||"10px sans-serif",this.textBaseline=z.textBaseline||"alphabetic",this.textAlign=z.textAlign||"left",this.lineWidth=z.lineWidth||1,this.lineJoin=z.lineJoin||"miter",this.lineCap=z.lineCap||"butt",this.path=z.path||[],this.transform=z.transform!==void 0?z.transform.clone():new l,this.globalCompositeOperation=z.globalCompositeOperation||"normal",this.globalAlpha=z.globalAlpha||1,this.clip_path=z.clip_path||[],this.currentPoint=z.currentPoint||new a,this.miterLimit=z.miterLimit||10,this.lastPoint=z.lastPoint||new a,this.lineDashOffset=z.lineDashOffset||0,this.lineDash=z.lineDash||[],this.margin=z.margin||[0,0,0,0],this.prevPageLastElemOffset=z.prevPageLastElemOffset||0,this.ignoreClearRect=typeof z.ignoreClearRect!="boolean"||z.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new h(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,a=this.internal.Point,o=this.internal.Rectangle,l=this.internal.Matrix,u=new d}]);var h=function(z){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var I=z;Object.defineProperty(this,"pdf",{get:function(){return I}});var q=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return q},set:function(K){q=!!K}});var te=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return te},set:function(K){te=!!K}});var se=0;Object.defineProperty(this,"posX",{get:function(){return se},set:function(K){isNaN(K)||(se=K)}});var ie=0;Object.defineProperty(this,"posY",{get:function(){return ie},set:function(K){isNaN(K)||(ie=K)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(K){var pe;typeof K=="number"?pe=[K,K,K,K]:((pe=new Array(4))[0]=K[0],pe[1]=K.length>=2?K[1]:pe[0],pe[2]=K.length>=3?K[2]:pe[0],pe[3]=K.length>=4?K[3]:pe[1]),u.margin=pe}});var le=!1;Object.defineProperty(this,"autoPaging",{get:function(){return le},set:function(K){le=K}});var xe=0;Object.defineProperty(this,"lastBreak",{get:function(){return xe},set:function(K){xe=K}});var Ee=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Ee},set:function(K){Ee=K}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(K){K instanceof d&&(u=K)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(K){u.path=K}});var ae=[];Object.defineProperty(this,"ctxStack",{get:function(){return ae},set:function(K){ae=K}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(K){var pe;pe=p(K),this.ctx.fillStyle=pe.style,this.ctx.isFillTransparent=pe.a===0,this.ctx.fillOpacity=pe.a,this.pdf.setFillColor(pe.r,pe.g,pe.b,{a:pe.a}),this.pdf.setTextColor(pe.r,pe.g,pe.b,{a:pe.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(K){var pe=p(K);this.ctx.strokeStyle=pe.style,this.ctx.isStrokeTransparent=pe.a===0,this.ctx.strokeOpacity=pe.a,pe.a===0?this.pdf.setDrawColor(255,255,255):(pe.a,this.pdf.setDrawColor(pe.r,pe.g,pe.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(K){["butt","round","square"].indexOf(K)!==-1&&(this.ctx.lineCap=K,this.pdf.setLineCap(K))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(K){isNaN(K)||(this.ctx.lineWidth=K,this.pdf.setLineWidth(K))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(K){["bevel","round","miter"].indexOf(K)!==-1&&(this.ctx.lineJoin=K,this.pdf.setLineJoin(K))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(K){isNaN(K)||(this.ctx.miterLimit=K,this.pdf.setMiterLimit(K))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(K){this.ctx.textBaseline=K}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(K){["right","end","center","left","start"].indexOf(K)!==-1&&(this.ctx.textAlign=K)}});var Q=null,we=null,Ae=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ae},set:function(K){Q=null,we=null,Ae=K}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(K){var pe;if(this.ctx.font=K,(pe=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(K))!==null){var ye=pe[1];pe[2];var Se=pe[3],ee=pe[4];pe[5];var re=pe[6],me=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ee)[2];ee=Math.floor(me==="px"?parseFloat(ee)*this.pdf.internal.scaleFactor:me==="em"?parseFloat(ee)*this.pdf.getFontSize():parseFloat(ee)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ee);var Ge=function(We){var xt,et,Je=[],Ze=We.trim();if(Ze==="")return aj;if(Ze in yG)return[yG[Ze]];for(;Ze!=="";){switch(et=null,xt=(Ze=wG(Ze)).charAt(0)){case'"':case"'":et=lMe(Ze.substring(1),xt);break;default:et=cMe(Ze)}if(et===null||(Je.push(et[0]),(Ze=wG(et[1]))!==""&&Ze.charAt(0)!==","))return aj;Ze=Ze.replace(/^,/,"")}return Je}(re);if(this.fontFaces){var He=function(We,xt){var et=We.getFontList(),Je=JSON.stringify(et);if(Q===null||we!==Je){var Ze=function(Me){var Xe=[];return Object.keys(Me).forEach(function(ut){Me[ut].forEach(function(lt){var Fe=null;switch(lt){case"bold":Fe={family:ut,weight:"bold"};break;case"italic":Fe={family:ut,style:"italic"};break;case"bolditalic":Fe={family:ut,weight:"bold",style:"italic"};break;case"":case"normal":Fe={family:ut}}Fe!==null&&(Fe.ref={name:ut,style:lt},Xe.push(Fe))})}),Xe}(et);Q=function(Me){for(var Xe={},ut=0;ut<Me.length;++ut){var lt=sj(Me[ut]),Fe=lt.family,Le=lt.stretch,bt=lt.style,dt=lt.weight;Xe[Fe]=Xe[Fe]||{},Xe[Fe][Le]=Xe[Fe][Le]||{},Xe[Fe][Le][bt]=Xe[Fe][Le][bt]||{},Xe[Fe][Le][bt][dt]=lt}return Xe}(Ze.concat(xt)),we=Je}return Q}(this.pdf,this.fontFaces),_e=Ge.map(function(We){return{family:We,stretch:"normal",weight:Se,style:ye}}),Ne=function(We,xt,et){for(var Je=(et=et||{}).defaultFontFamily||"times",Ze=Object.assign({},oMe,et.genericFontFamilies||{}),Me=null,Xe=null,ut=0;ut<xt.length;++ut)if(Ze[(Me=sj(xt[ut])).family]&&(Me.family=Ze[Me.family]),We.hasOwnProperty(Me.family)){Xe=We[Me.family];break}if(!(Xe=Xe||We[Je]))throw new Error("Could not find a font-family for the rule '"+bG(Me)+"' and default family '"+Je+"'.");if(Xe=function(lt,Fe){if(Fe[lt])return Fe[lt];var Le=P4[lt],bt=Le<=P4.normal?-1:1,dt=vG(Fe,rie,Le,bt);if(!dt)throw new Error("Could not find a matching font-stretch value for "+lt);return dt}(Me.stretch,Xe),Xe=function(lt,Fe){if(Fe[lt])return Fe[lt];for(var Le=nie[lt],bt=0;bt<Le.length;++bt)if(Fe[Le[bt]])return Fe[Le[bt]];throw new Error("Could not find a matching font-style for "+lt)}(Me.style,Xe),!(Xe=function(lt,Fe){if(Fe[lt])return Fe[lt];if(lt===400&&Fe[500])return Fe[500];if(lt===500&&Fe[400])return Fe[400];var Le=aMe[lt],bt=vG(Fe,iie,Le,lt<400?-1:1);if(!bt)throw new Error("Could not find a matching font-weight for value "+lt);return bt}(Me.weight,Xe)))throw new Error("Failed to resolve a font for the rule '"+bG(Me)+"'.");return Xe}(He,_e);this.pdf.setFont(Ne.ref.name,Ne.ref.style)}else{var ue="";(Se==="bold"||parseInt(Se,10)>=700||ye==="bold")&&(ue="bold"),ye==="italic"&&(ue+="italic"),ue.length===0&&(ue="normal");for(var Ce="",Ke={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Qe=0;Qe<Ge.length;Qe++){if(this.pdf.internal.getFont(Ge[Qe],ue,{noFallback:!0,disableWarning:!0})!==void 0){Ce=Ge[Qe];break}if(ue==="bolditalic"&&this.pdf.internal.getFont(Ge[Qe],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ce=Ge[Qe],ue="bold";else if(this.pdf.internal.getFont(Ge[Qe],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ce=Ge[Qe],ue="normal";break}}if(Ce===""){for(var je=0;je<Ge.length;je++)if(Ke[Ge[je]]){Ce=Ke[Ge[je]];break}}Ce=Ce===""?"Times":Ce,this.pdf.setFont(Ce,ue)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(K){this.ctx.globalCompositeOperation=K}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(K){this.ctx.globalAlpha=K}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(K){this.ctx.lineDashOffset=K,Y.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(K){this.ctx.lineDash=K,Y.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(K){this.ctx.ignoreClearRect=!!K}})};h.prototype.setLineDash=function(z){this.lineDash=z},h.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},h.prototype.fill=function(){S.call(this,"fill",!1)},h.prototype.stroke=function(){S.call(this,"stroke",!1)},h.prototype.beginPath=function(){this.path=[{type:"begin"}]},h.prototype.moveTo=function(z,I){if(isNaN(z)||isNaN(I))throw ji.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to
734jsPDF.context2d.moveTo");var q=this.ctx.transform.applyToPoint(new a(z,I));this.path.push({type:"mt",x:q.x,y:q.y}),this.ctx.lastPoint=new a(z,I)},h.prototype.closePath=function(){var z=new a(0,0),I=0;for(I=this.path.length-1;I!==-1;I--)if(this.path[I].type==="begin"&&Si(this.path[I+1])==="object"&&typeof this.path[I+1].x=="number"){z=new a(this.path[I+1].x,this.path[I+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(z.x,z.y)},h.prototype.lineTo=function(z,I){if(isNaN(z)||isNaN(I))throw ji.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var q=this.ctx.transform.applyToPoint(new a(z,I));this.path.push({type:"lt",x:q.x,y:q.y}),this.ctx.lastPoint=new a(q.x,q.y)},h.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},h.prototype.quadraticCurveTo=function(z,I,q,te){if(isNaN(q)||isNaN(te)||isNaN(z)||isNaN(I))throw ji.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var se=this.ctx.transform.applyToPoint(new a(q,te)),ie=this.ctx.transform.applyToPoint(new a(z,I));this.path.push({type:"qct",x1:ie.x,y1:ie.y,x:se.x,y:se.y}),this.ctx.lastPoint=new a(se.x,se.y)},h.prototype.bezierCurveTo=function(z,I,q,te,se,ie){if(isNaN(se)||isNaN(ie)||isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te))throw ji.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var le=this.ctx.transform.applyToPoint(new a(se,ie)),xe=this.ctx.transform.applyToPoint(new a(z,I)),Ee=this.ctx.transform.applyToPoint(new a(q,te));this.path.push({type:"bct",x1:xe.x,y1:xe.y,x2:Ee.x,y2:Ee.y,x:le.x,y:le.y}),this.ctx.lastPoint=new a(le.x,le.y)},h.prototype.arc=function(z,I,q,te,se,ie){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te)||isNaN(se))throw ji.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ie=!!ie,!this.ctx.transform.isIdentity){var le=this.ctx.transform.applyToPoint(new a(z,I));z=le.x,I=le.y;var xe=this.ctx.transform.applyToPoint(new a(0,q)),Ee=this.ctx.transform.applyToPoint(new a(0,0));q=Math.sqrt(Math.pow(xe.x-Ee.x,2)+Math.pow(xe.y-Ee.y,2))}Math.abs(se-te)>=2*Math.PI&&(te=0,se=2*Math.PI),this.path.push({type:"arc",x:z,y:I,radius:q,startAngle:te,endAngle:se,counterclockwise:ie})},h.prototype.arcTo=function(z,I,q,te,se){throw new Error("arcTo not implemented.")},h.prototype.rect=function(z,I,q,te){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te))throw ji.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(z,I),this.lineTo(z+q,I),this.lineTo(z+q,I+te),this.lineTo(z,I+te),this.lineTo(z,I),this.lineTo(z+q,I),this.lineTo(z,I)},h.prototype.fillRect=function(z,I,q,te){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te))throw ji.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var se={};this.lineCap!=="butt"&&(se.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(se.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(z,I,q,te),this.fill(),se.hasOwnProperty("lineCap")&&(this.lineCap=se.lineCap),se.hasOwnProperty("lineJoin")&&(this.lineJoin=se.lineJoin)}},h.prototype.strokeRect=function(z,I,q,te){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te))throw ji.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");m.call(this)||(this.beginPath(),this.rect(z,I,q,te),this.stroke())},h.prototype.clearRect=function(z,I,q,te){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te))throw ji.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(z,I,q,te))},h.prototype.save=function(z){z=typeof z!="boolean"||z;for(var I=this.pdf.internal.getCurrentPageInfo().pageNumber,q=0;q<this.pdf.internal.getNumberOfPages();q++)this.pdf.setPage(q+1),this.pdf.internal.out("q");
vendor: 5,030 bytes, line 734
734if(this.pdf.setPage(I),z){this.ctx.fontSize=this.pdf.internal.getFontSize();var te=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=te}},h.prototype.restore=function(z){z=typeof z!="boolean"||z;for(var I=this.pdf.internal.getCurrentPageInfo().pageNumber,q=0;q<this.pdf.internal.getNumberOfPages();q++)this.pdf.setPage(q+1),this.pdf.internal.out("Q");this.pdf.setPage(I),z&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},h.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var p=function(z){var I,q,te,se;if(z.isCanvasGradient===!0&&(z=z.getColor()),!z)return{r:0,g:0,b:0,a:0,style:z};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(z))I=0,q=0,te=0,se=0;else{var ie=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(z);if(ie!==null)I=parseInt(ie[1]),q=parseInt(ie[2]),te=parseInt(ie[3]),se=1;else if((ie=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(z))!==null)I=parseInt(ie[1]),q=parseInt(ie[2]),te=parseInt(ie[3]),se=parseFloat(ie[4]);else{if(se=1,typeof z=="string"&&z.charAt(0)!=="#"){var le=new Xre(z);z=le.ok?le.toHex():"#000000"}z.length===4?(I=z.substring(1,2),I+=I,q=z.substring(2,3),q+=q,te=z.substring(3,4),te+=te):(I=z.substring(1,3),q=z.substring(3,5),te=z.substring(5,7)),I=parseInt(I,16),q=parseInt(q,16),te=parseInt(te,16)}}return{r:I,g:q,b:te,a:se,style:z}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},m=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};h.prototype.fillText=function(z,I,q,te){if(isNaN(I)||isNaN(q)||typeof z!="string")throw ji.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(te=isNaN(te)?void 0:te,!f.call(this)){var se=V(this.ctx.transform.rotation),ie=this.ctx.transform.scaleX;j.call(this,{text:z,x:I,y:q,scale:ie,angle:se,align:this.textAlign,maxWidth:te})}},h.prototype.strokeText=function(z,I,q,te){if(isNaN(I)||isNaN(q)||typeof z!="string")throw ji.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!m.call(this)){te=isNaN(te)?void 0:te;var se=V(this.ctx.transform.rotation),ie=this.ctx.transform.scaleX;j.call(this,{text:z,x:I,y:q,scale:ie,renderingMode:"stroke",angle:se,align:this.textAlign,maxWidth:te})}},h.prototype.measureText=function(z){if(typeof z!="string")throw ji.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var I=this.pdf,q=this.pdf.internal.scaleFactor,te=I.internal.getFontSize(),se=I.getStringUnitWidth(z)*te/I.internal.scaleFactor;return new function(ie){var le=(ie=ie||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return le}}),this}({width:se*=Math.round(96*q/72*1e4)/1e4})},h.prototype.scale=function(z,I){if(isNaN(z)||isNaN(I))throw ji.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var q=new l(z,0,0,I,0,0);this.ctx.transform=this.ctx.transform.multiply(q)},h.prototype.rotate=function(z){if(isNaN(z))throw ji.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var I=new l(Math.cos(z),Math.sin(z),-Math.sin(z),Math.cos(z),0,0);this.ctx.transform=this.ctx.transform.multiply(I)},h.prototype.translate=function(z,I){if(isNaN(z)||isNaN(I))throw ji.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var q=new l(1,0,0,1,z,I);this.ctx.transform=this.ctx.transform.multiply(q)},h.prototype.transform=function(z,I,q,te,se,ie){if(isNaN(z)||isNaN(I)||isNaN(q)||isNaN(te)||isNaN(se)||isNaN(ie))throw ji.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var le=new l(z,I,q,te,se,ie);this.ctx.transform=this.ctx.transform.multiply(le)},h.prototype.setTransform=function(z,I,q,te,se,ie){z=isNaN(z)?1:z,I=isNaN(I)?0:I,q=isNaN(q)?0:q,te=isNaN(te)?1:te,se=isNaN(se)?0:se,ie=isNaN(ie)?0:ie,this.ctx.transform=new l(z,I,q,te,se,ie)};var x=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};h.prototype.drawImage=function(z,I,q,te,se,ie,le,xe,Ee){var ae=this.pdf.getImageProperties(z),Q=1,we=1,Ae=1,K=1;te!==void 0&&xe!==void 0&&(Ae=xe/te,K=Ee/se,Q=ae.width/te*xe/te,we=ae.height/se*Ee/se),ie===void 0&&(ie=I,le=q,I=0,q=0),te!==void 0&&xe===void 0&&(xe=te,Ee=se),te===void 0&&xe===void 0&&(xe=ae.width,Ee=ae.height);var pe=this.ctx.transform.decompose(),ye=V(pe.rotate.shx),Se=new l,ee=(Se=(Se=(Se=Se.multiply(pe.translate)).multiply(
vendor: 1,153 bytes, line 734
734pe.skew)).multiply(pe.scale)).applyToRectangle(new o(ie-I*Ae,le-q*K,te*Q,se*we));if(this.autoPaging){for(var re,me=v.call(this,ee),Ge=[],He=0;He<me.length;He+=1)Ge.indexOf(me[He])===-1&&Ge.push(me[He]);y(Ge);for(var _e=Ge[0],Ne=Ge[Ge.length-1],ue=_e;ue<Ne+1;ue++){this.pdf.setPage(ue);var Ce=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ke=ue===1?this.posY+this.margin[0]:this.margin[0],Qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],We=ue===1?0:Qe+(ue-2)*je;if(this.ctx.clip_path.length!==0){var xt=this.path;re=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(re,this.posX+this.margin[3],-We+Ke+this.ctx.prevPageLastElemOffset),A.call(this,"fill",!0),this.path=xt}var et=JSON.parse(JSON.stringify(ee));et=b([et],this.posX+this.margin[3],-We+Ke+this.ctx.prevPageLastElemOffset)[0];var Je=(ue>_e||ue<Ne)&&x.call(this);Je&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ce,je,null).clip().discardPath()),this.pdf.addImage(z,"JPEG",et.x,et.y,et.w,et.h,null,null,ye),Je&&this.pdf.restoreGraphicsState()}}
vendor: 47,059 bytes, lines 734-742
734else this.pdf.addImage(z,"JPEG",ee.x,ee.y,ee.w,ee.h,null,null,ye)};var v=function(z,I,q){var te=[];I=I||this.pdf.internal.pageSize.width,q=q||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var se=this.posY+this.ctx.prevPageLastElemOffset;switch(z.type){default:case"mt":case"lt":te.push(Math.floor((z.y+se)/q)+1);break;case"arc":te.push(Math.floor((z.y+se-z.radius)/q)+1),te.push(Math.floor((z.y+se+z.radius)/q)+1);break;case"qct":var ie=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x,z.y);te.push(Math.floor((ie.y+se)/q)+1),te.push(Math.floor((ie.y+ie.h+se)/q)+1);break;case"bct":var le=O(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x2,z.y2,z.x,z.y);te.push(Math.floor((le.y+se)/q)+1),te.push(Math.floor((le.y+le.h+se)/q)+1);break;case"rect":te.push(Math.floor((z.y+se)/q)+1),te.push(Math.floor((z.y+z.h+se)/q)+1)}for(var xe=0;xe<te.length;xe+=1)for(;this.pdf.internal.getNumberOfPages()<te[xe];)g.call(this);return te},g=function(){var z=this.fillStyle,I=this.strokeStyle,q=this.font,te=this.lineCap,se=this.lineWidth,ie=this.lineJoin;this.pdf.addPage(),this.fillStyle=z,this.strokeStyle=I,this.font=q,this.lineCap=te,this.lineWidth=se,this.lineJoin=ie},b=function(z,I,q){for(var te=0;te<z.length;te++)switch(z[te].type){case"bct":z[te].x2+=I,z[te].y2+=q;case"qct":z[te].x1+=I,z[te].y1+=q;default:z[te].x+=I,z[te].y+=q}return z},y=function(z){return z.sort(function(I,q){return I-q})},S=function(z,I){var q=this.fillStyle,te=this.strokeStyle,se=this.lineCap,ie=this.lineWidth,le=Math.abs(ie*this.ctx.transform.scaleX),xe=this.lineJoin;if(this.autoPaging){for(var Ee,ae,Q=JSON.parse(JSON.stringify(this.path)),we=JSON.parse(JSON.stringify(this.path)),Ae=[],K=0;K<we.length;K++)if(we[K].x!==void 0)for(var pe=v.call(this,we[K]),ye=0;ye<pe.length;ye+=1)Ae.indexOf(pe[ye])===-1&&Ae.push(pe[ye]);for(var Se=0;Se<Ae.length;Se++)for(;this.pdf.internal.getNumberOfPages()<Ae[Se];)g.call(this);y(Ae);for(var ee=Ae[0],re=Ae[Ae.length-1],me=ee;me<re+1;me++){this.pdf.setPage(me),this.fillStyle=q,this.strokeStyle=te,this.lineCap=se,this.lineWidth=le,this.lineJoin=xe;var Ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],He=me===1?this.posY+this.margin[0]:this.margin[0],_e=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ne=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ue=me===1?0:_e+(me-2)*Ne;if(this.ctx.clip_path.length!==0){var Ce=this.path;Ee=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(Ee,this.posX+this.margin[3],-ue+He+this.ctx.prevPageLastElemOffset),A.call(this,z,!0),this.path=Ce}if(ae=JSON.parse(JSON.stringify(Q)),this.path=b(ae,this.posX+this.margin[3],-ue+He+this.ctx.prevPageLastElemOffset),I===!1||me===0){var Ke=(me>ee||me<re)&&x.call(this);Ke&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ge,Ne,null).clip().discardPath()),A.call(this,z,I),Ke&&this.pdf.restoreGraphicsState()}this.lineWidth=ie}this.path=Q}else this.lineWidth=le,A.call(this,z,I),this.lineWidth=ie},A=function(z,I){if((z!=="stroke"||I||!m.call(this))&&(z==="stroke"||I||!f.call(this))){for(var q,te,se=[],ie=this.path,le=0;le<ie.length;le++){var xe=ie[le];switch(xe.type){case"begin":se.push({begin:!0});break;case"close":se.push({close:!0});break;case"mt":se.push({start:xe,deltas:[],abs:[]});break;case"lt":var Ee=se.length;if(ie[le-1]&&!isNaN(ie[le-1].x)&&(q=[xe.x-ie[le-1].x,xe.y-ie[le-1].y],Ee>0)){for(;Ee>=0;Ee--)if(se[Ee-1].close!==!0&&se[Ee-1].begin!==!0){se[Ee-1].deltas.push(q),se[Ee-1].abs.push(xe);break}}break;case"bct":q=[xe.x1-ie[le-1].x,xe.y1-ie[le-1].y,xe.x2-ie[le-1].x,xe.y2-ie[le-1].y,xe.x-ie[le-1].x,xe.y-ie[le-1].y],se[se.length-1].deltas.push(q);break;case"qct":var ae=ie[le-1].x+2/3*(xe.x1-ie[le-1].x),Q=ie[le-1].y+2/3*(xe.y1-ie[le-1].y),we=xe.x+2/3*(xe.x1-xe.x),Ae=xe.y+2/3*(xe.y1-xe.y),K=xe.x,pe=xe.y;q=[ae-ie[le-1].x,Q-ie[le-1].y,we-ie[le-1].x,Ae-ie[le-1].y,K-ie[le-1].x,pe-ie[le-1].y],se[se.length-1].deltas.push(q);break;case"arc":se.push({deltas:[],abs:[],arc:!0}),Array.isArray(se[se.length-1].abs)&&se[se.length-1].abs.push(xe)}}te=I?null:z==="stroke"?"stroke":"fill";for(var ye=!1,Se=0;Se<se.length;Se++)if(se[Se].arc)for(var ee=se[Se].abs,re=0;re<ee.length;re++){var me=ee[re];me.type==="arc"?T.call(this,me.x,me.y,me.radius,me.startAngle,me.endAngle,me.counterclockwise,void 0,I,!ye):G.call(this,me.x,me.y),ye=!0}else if(se[Se].close===!0)this.pdf.internal.out("h"),ye=!1;else if(se[Se].begin!==!0){var Ge=se[Se].start.x,He=se[Se].start.y;B.call(this,se[Se].deltas,Ge,He),ye=!0}te&&C.call(this,te),I&&R.call(this)}},k=function(z){var I=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,q=I*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return z-q;case"top":return z+I-q;case"hanging":return z+I-2*q;case"middle":return z+I/2-q;default:return z}},M=function(z){return z+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};h.prototype.createLinearGradient=function(){var z=function(){};return z.colorStops=[],z.addColorStop=function(I,q){this.colorStops.push([I,q])},z.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},z.isCanvasGradient=!0,z},h.prototype.createPattern=function(){return this.createLinearGradient()},h.prototype.createRadialGradient=function(){return this.createLinearGradient()};var T=function(z,I,q,te,se,ie,le,xe,Ee){for(var ae=U.call(this,q,te,se,ie),Q=0;Q<ae.length;Q++){var we=ae[Q];Q===0&&(Ee?P.call(this,we.x1+z,we.y1+I):G.call(this,we.x1+z,we.y1+I)),$.call(this,z,I,we.x2,we.y2,we.x3,we.y3,we.x4,we.y4)}xe?R.call(this):C.call(this,le)},C=function(z){switch(z){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},R=function(){this.pdf.clip(),this.pdf.discardPath()},P=function(z,I){this.pdf.internal.out(n(z)+" "+r(I)+" m")},j=function(z){var I;switch(z.align){case"right":case"end":I="right";break;case"center":I="center";break;default:I="left"}var q,te,se,ie=this.pdf.getTextDimensions(z.text),le=k.call(this,z.y),xe=M.call(this,le)-ie.h,Ee=this.ctx.transform.applyToPoint(new a(z.x,le));if(this.autoPaging){var ae=this.ctx.transform.decompose(),Q=new l;Q=(Q=(Q=Q.multiply(ae.translate)).multiply(ae.skew)).multiply(ae.scale);for(var we=this.ctx.transform.applyToRectangle(new o(z.x,le,ie.w,ie.h)),Ae=Q.applyToRectangle(new o(z.x,xe,ie.w,ie.h)),K=v.call(this,Ae),pe=[],ye=0;ye<K.length;ye+=1)pe.indexOf(K[ye])===-1&&pe.push(K[ye]);y(pe);for(var Se=pe[0],ee=pe[pe.length-1],re=Se;re<ee+1;re++){this.pdf.setPage(re);var me=re===1?this.posY+this.margin[0]:this.margin[0],Ge=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],He=this.pdf.internal.pageSize.height-this.margin[2],_e=He-this.margin[0],Ne=this.pdf.internal.pageSize.width-this.margin[1],ue=Ne-this.margin[3],Ce=re===1?0:Ge+(re-2)*_e;if(this.ctx.clip_path.length!==0){var Ke=this.path;q=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(q,this.posX+this.margin[3],-1*Ce+me),A.call(this,"fill",!0),this.path=Ke}var Qe=b([JSON.parse(JSON.stringify(Ae))],this.posX+this.margin[3],-Ce+me+this.ctx.prevPageLastElemOffset)[0];z.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*z.scale),se=this.lineWidth,this.lineWidth=se*z.scale);var je=this.autoPaging!=="text";if(je||Qe.y+Qe.h<=He){if(je||Qe.y>=me&&Qe.x<=Ne){var We=je?z.text:this.pdf.splitTextToSize(z.text,z.maxWidth||Ne-Qe.x)[0],xt=b([JSON.parse(JSON.stringify(we))],this.posX+this.margin[3],-Ce+me+this.ctx.prevPageLastElemOffset)[0],et=je&&(re>Se||re<ee)&&x.call(this);et&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ue,_e,null).clip().discardPath()),this.pdf.text(We,xt.x,xt.y,{angle:z.angle,align:I,renderingMode:z.renderingMode}),et&&this.pdf.restoreGraphicsState()}}else Qe.y<He&&(this.ctx.prevPageLastElemOffset+=He-Qe.y);z.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=se)}}else z.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*z.scale),se=this.lineWidth,this.lineWidth=se*z.scale),this.pdf.text(z.text,Ee.x+this.posX,Ee.y+this.posY,{angle:z.angle,align:I,renderingMode:z.renderingMode,maxWidth:z.maxWidth}),z.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=se)},G=function(z,I,q,te){q=q||0,te=te||0,this.pdf.internal.out(n(z+q)+" "+r(I+te)+" l")},B=function(z,I,q){return this.pdf.lines(z,I,q,null,null)},$=function(z,I,q,te,se,ie,le,xe){this.pdf.internal.out([e(i(q+z)),e(s(te+I)),e(i(se+z)),e(s(ie+I)),e(i(le+z)),e(s(xe+I)),"c"].join(" "))},U=function(z,I,q,te){for(var se=2*Math.PI,ie=Math.PI/2;I>q;)I-=se;var le=Math.abs(q-I);le<se&&te&&(le=se-le);for(var xe=[],Ee=te?-1:1,ae=I;le>1e-5;){var Q=ae+Ee*Math.min(le,ie);xe.push(Z.call(this,z,ae,Q)),le-=Math.abs(Q-ae),ae=Q}return xe},Z=function(z,I,q){var te=(q-I)/2,se=z*Math.cos(te),ie=z*Math.sin(te),le=se,xe=-ie,Ee=le*le+xe*xe,ae=Ee+le*se+xe*ie,Q=4/3*(Math.sqrt(2*Ee*ae)-ae)/(le*ie-xe*se),we=le-Q*xe,Ae=xe+Q*le,K=we,pe=-Ae,ye=te+I,Se=Math.cos(ye),ee=Math.sin(ye);return{x1:z*Math.cos(I),y1:z*Math.sin(I),x2:we*Se-Ae*ee,y2:we*ee+Ae*Se,x3:K*Se-pe*ee,y3:K*ee+pe*Se,x4:z*Math.cos(q),y4:z*Math.sin(q)}},V=function(z){return 180*z/Math.PI},W=function(z,I,q,te,se,ie){var le=z+.5*(q-z),xe=I+.5*(te-I),Ee=se+.5*(q-se),ae=ie+.5*(te-ie),Q=Math.min(z,se,le,Ee),we=Math.max(z,se,le,Ee),Ae=Math.min(I,ie,xe,ae),K=Math.max(I,ie,xe,ae);return new o(Q,Ae,we-Q,K-Ae)},O=function(z,I,q,te,se,ie,le,xe){var Ee,ae,Q,we,Ae,K,pe,ye,Se,ee,re,me,Ge,He,_e=q-z,Ne=te-I,ue=se-q,Ce=ie-te,Ke=le-se,Qe=xe-ie;for(ae=0;ae<41;ae++)Se=(pe=(Q=z+(Ee=ae/40)*_e)+Ee*((Ae=q+Ee*ue)-Q))+Ee*(Ae+Ee*(se+Ee*Ke-Ae)-pe),ee=(ye=(we=I+Ee*Ne)+Ee*((K=te+Ee*Ce)-we))+Ee*(K+Ee*(ie+Ee*Qe-K)-ye),ae==0?(re=Se,me=ee,Ge=Se,He=ee):(re=Math.min(re,Se),me=Math.min(me,ee),Ge=Math.max(Ge,Se),He=Math.max(He,ee));return new o(Math.round(re),Math.round(me),Math.round(Ge-re),Math.round(He-me))},Y=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var z,I,q=(z=this.ctx.lineDash,I=this.ctx.lineDashOffset,JSON.stringify({lineDash:z,lineDashOffset:I}));this.prevLineDash!==q&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=q)}}})(Pn.API),function(t){var e=function(a){var o,l,u,d,h,p,f,m,x,v;for(l=[],u=0,d=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;d>u;u+=4)(h=(a.charCodeAt(u)<<24)+(a.charCodeAt(u+1)<<16)+(a.charCodeAt(u+2)<<8)+a.charCodeAt(u+3))!==0?(p=(h=((h=((h=((h=(h-(v=h%85))/85)-(x=h%85))/85)-(m=h%85))/85)-(f=h%85))/85)%85,l.push(p+33,f+33,m+33,x+33,v+33)):l.push(122);return function(g,b){for(var y=b;y>0;y--)g.pop()}(l,o.length),String.fromCharCode.apply(String,l)+"~>"},n=function(a){var o,l,u,d,h,p=String,f="length",m=255,x="charCodeAt",v="slice",g="replace";for(a[v](-2),a=a[v](0,-2)[g](/\s/g,"")[g]("z","!!!!!"),u=[],d=0,h=(a+=o="uuuuu"[v](a[f]%5||5))[f];h>d;d+=5)l=52200625*(a[x](d)-33)+614125*(a[x](d+1)-33)+7225*(a[x](d+2)-33)+85*(a[x](d+3)-33)+(a[x](d+4)-33),u.push(m&l>>24,m&l>>16,m&l>>8,m&l);return function(b,y){for(var S=y;S>0;S--)b.pop()}(u,o[f]),p.fromCharCode.apply(p,u)},r=function(a){return a.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var l="",u=0;u<a.length;u+=2)l+=String.fromCharCode("0x"+(a[u]+a[u+1]));return l},s=function(a){for(var o=new Uint8Array(a.length),l=a.length;l--;)o[l]=a.charCodeAt(l);return(o=b4(o)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};t.processDataByFilters=function(a,o){var l=0,u=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),l=0;l<o.length;l+=1)switch(o[l]){case"ASCII85Decode":case"/ASCII85Decode":u=n(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=e(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=i(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=r(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=s(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[l]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(Pn.API),function(t){t.loadFile=function(e,n,r){return function(i,s,a){s=s!==!1,a=typeof a=="function"?a:function(){};var o=void 0;try{o=function(l,u,d){var h=new XMLHttpRequest,p=0,f=function(m){var x=m.length,v=[],g=String.fromCharCode;for(p=0;p<x;p+=1)v.push(g(255&m.charCodeAt(p)));return v.join("")};if(h.open("GET",l,!u),h.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(h.onload=function(){h.status===200?d(f(this.responseText)):d(void 0)}),h.send(null),u&&h.status===200)return f(h.responseText)}(i,s,a)}catch{}return o}(e,n,r)},t.allowFsRead=void 0,t.loadImageFile=t.loadFile}(Pn.API),function(t){function e(){return(tr.html2canvas?Promise.resolve(tr.html2canvas):KC(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function n(){return(tr.DOMPurify?Promise.resolve(tr.DOMPurify):KC(()=>Promise.resolve().then(()=>LKe),void 0)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var l=Si(o);return l==="undefined"?"undefined":l==="string"||o instanceof String?"string":l==="number"||o instanceof Number?"number":l==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":l==="object"?"object":"unknown"},i=function(o,l){var u=document.createElement(o);for(var d in l.className&&(u.className=l.className),l.innerHTML&&l.dompurify&&(u.innerHTML=l.dompurify.sanitize(l.innerHTML)),l.style)u.style[d]=l.style[d];return u},s=function o(l,u){for(var d=l.nodeType===3?document.createTextNode(l.nodeValue):l.cloneNode(!1),h=l.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(o(h,u));return l.nodeType===1&&(l.nodeName==="CANVAS"?(d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0)):l.nodeName!=="TEXTAREA"&&l.nodeName!=="SELECT"||(d.value=l.value),d.addEventListener("load",function(){d.scrollTop=l.scrollTop,d.scrollLeft=l.scrollLeft},!0)),d},a=function o(l){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),d=o.convert(Promise.resolve(),u);return(d=d.setProgress(1,o,1,[o])).set(l)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,l){return o.__proto__=l||a.prototype,o},a.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},a.prototype.from=function(o,l){return this.then(function(){switch(l=l||function(u){switch(r(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),l){case"string":return this.then(n).then(function(u){return this.set({src:i("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},l=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);l.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(l),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},a.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(l){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,l(this.prop.container,u)}).then(function(l){(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(l){var u=this.opt.jsPDF,d=this.opt.fontFaces,h=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,p=Object.assign({async:!0,allowTaint:!0,scale:h,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete p.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var f=0;f<d.length;++f){var m=d[f],x=m.src.find(function(v){return v.format==="truetype"});x&&u.addFont(x.url,m.ref.name,m.ref.style)}return p.windowHeight=p.windowHeight||0,p.windowHeight=p.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):p.windowHeight,u.context2d.save(!0),l(this.prop.container,p)}).then(function(l){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(o,l,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,l):this.outputPdf(o,l)},a.prototype.outputPdf=function(o,l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,l)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(o){if(r(o)!=="object")return this;var l=Object.keys(o||{}).map(function(u){if(u in a.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(l)})},a.prototype.get=function(o,l){return this.then(function(){var u=o in a.template.prop?this.prop[o]:this.opt[o];return l?l(u):u})},a.prototype.setMargin=function(o){return this.then(function(){switch(r(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function l(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(o=o||Pn.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:l(o.inner.width,o.k),height:l(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,l,u,d){return o!=null&&(this.progress.val=o),l!=null&&(this.progress.state=l),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(o,l,u,d){return this.setProgress(o?this.progress.val+o:null,l||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,l){var u=this;return this.thenCore(o,l,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(p){return u.updateProgress(null,d),p}).then(d,h).then(function(p){return u.updateProgress(1),p})})},a.prototype.thenCore=function(o,l,u){u=u||Promise.prototype.then;var d=this;o&&(o=o.bind(d)),l&&(l=l.bind(d));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:a.convert(Object.assign({},d),Promise.prototype),p=u.call(h,o,l);return a.convert(p,d.__proto__)},a.prototype.thenExternal=function(o,l){return Promise.prototype.then.call(this,o,l)},a.prototype.thenList=function(o){var l=this;return o.forEach(function(u){l=l.thenCore(u)}),l},a.prototype.catch=function(o){o&&(o=o.bind(this));var l=Promise.prototype.catch.call(this,o);return a.convert(l,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Pn.getPageSize=function(o,l,u){if(Si(o)==="object"){var d=o;o=d.orientation,l=d.unit||l,u=d.format||u}l=l||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,p=(""+u).toLowerCase(),f={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(l){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+l}var m,x=0,v=0;if(f.hasOwnProperty(p))x=f[p][1]/h,v=f[p][0]/h;else try{x=u[1],v=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",v>x&&(m=v,v=x,x=m);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",x>v&&(m=v,v=x,x=m)}return{width:v,height:x,unit:l,k:h,orientation:o}},t.html=function(o,l){(l=l||{}).callback=l.callback||function(){},l.html2canvas=l.html2canvas||{},l.html2canvas.canvas=l.html2canvas.canvas||this.canvas,l.jsPDF=l.jsPDF||this,l.fontFaces=l.fontFaces?l.fontFaces.map(sj):null;var u=new a(l);return l.worker?u:u.from(o).doCallback()}}(Pn.API),Pn.API.addJS=function(t){var e,n,r=function(i){for(var s="",a=0;a<i.length;a++){var o=i[a];if(o==="("||o===")"){for(var l=0,u=a-1;u>=0&&i[u]==="\\";u--)l++;s+=l%2==0?"\\"+o:o}else s+=o}return s}(t);return this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e!==void 0&&n!==void 0&&this.internal.out("/Names <</JavaScript "+e+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),s=0;s<i.length;s++){var a=i[s],o=r.exec(a);if(o!=null){var l=o[1];n.internal.newObjectDeferredBegin(l,!1)}n.internal.write(a)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(s=0;s<u;s++){var h=n.internal.newObject();d.push(h);var p=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+p.objId+" 0 R /XYZ null null null]>> endobj")}var f=n.internal.newObject();for(n.internal.write("<< /Names [ "),s=0;s<d.length;s++)n.internal.write("(page_"+(s+1)+")"+d[s]+" 0 R");n.internal.write(" ] >>","endobj"),e=n.internal.newObject(),n.internal.write("<< /Dests "+f+" 0 R"),n.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,s){var a={title:i,options:s,children:[]};return r==null&&(r=this.root),r.children.push(a),a},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var a=r.children[s];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var o=this.count=this.count_r({count:0},a);if(o>0&&this.line("/Count "+o),a.options&&a.options.pageNumber){var l=n.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+l.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var u=0;u<r.children.length;u++)this.renderItems(r.children[u])},n.outline.line=function(r){this.ctx.val+=r+`\r 735`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r 736`+r.id+` 0 obj\r 737<<\r 738`},n.outline.objEnd=function(){this.ctx.val+=`>> \r 739endobj\r 740`},n.outline.count_r=function(r,i){for(var s=0;s<i.children.length;s++)r.count++,this.count_r(r,i.children[s]);return r.count}}])}(Pn.API),function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,r,i,s,a,o){var l,u=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=a||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,l=function(h){for(var p,f=256*h.charCodeAt(4)+h.charCodeAt(5),m=h.length,x={width:0,height:0,numcomponents:1},v=4;v<m;v+=2){if(v+=f,e.indexOf(h.charCodeAt(v+1))!==-1){p=256*h.charCodeAt(v+5)+h.charCodeAt(v+6),x={width:256*h.charCodeAt(v+7)+h.charCodeAt(v+8),height:p,numcomponents:h.charCodeAt(v+9)};break}f=256*h.charCodeAt(v+2)+h.charCodeAt(v+3)}return x}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),l.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}d={data:n,width:l.width,height:l.height,colorSpace:o,bitsPerComponent:8,filter:u,index:r,alias:i}}return d}}(Pn.API),Pn.API.processPNG=function(t,e,n,r){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var i,s=$5e(t,{checkCrc:!0}),a=s.width,o=s.height,l=s.channels,u=s.palette,d=s.depth;i=u&&l===1?function(T){for(var C=T.width,R=T.height,P=T.data,j=T.palette,G=T.depth,B=!1,$=[],U=[],Z=void 0,V=!1,W=0,O=0;O<j.length;O++){var Y=xH(j[O],4),z=Y[0],I=Y[1],q=Y[2],te=Y[3];$.push(z,I,q),te!=null&&(te===0?(W++,U.length<1&&U.push(O)):te<255&&(V=!0))}if(V||W>1){B=!0,U=void 0;var se=C*R;Z=new Uint8Array(se);for(var ie=new DataView(P.buffer),le=0;le<se;le++){var xe=oj(ie,le,G),Ee=xH(j[xe],4)[3];Z[le]=Ee}}else W===0&&(U=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:B?8:void 0,colorBytes:P,alphaBytes:Z,needSMask:B,palette:$,mask:U}}(s):l===2||l===4?function(T){for(var C=T.data,R=T.width,P=T.height,j=T.channels,G=T.depth,B=j===2?"DeviceGray":"DeviceRGB",$=j-1,U=R*P,Z=$,V=U*Z,W=1*U,O=Math.ceil(V*G/8),Y=Math.ceil(W*G/8),z=new Uint8Array(O),I=new Uint8Array(Y),q=new DataView(C.buffer),te=new DataView(z.buffer),se=new DataView(I.buffer),ie=!1,le=0;le<U;le++){for(var xe=le*j,Ee=0;Ee<Z;Ee++)MG(te,oj(q,xe+Ee,G),le*Z+Ee,G);var ae=oj(q,xe+Z,G);ae<(1<<G)-1&&(ie=!0),MG(se,ae,1*le,G)}return{colorSpace:B,colorsPerPixel:$,sMaskBitsPerComponent:ie?G:void 0,colorBytes:z,alphaBytes:I,needSMask:ie}}(s):function(T){var C=T.data,R=T.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:R,colorsPerPixel:R==="DeviceGray"?1:3,colorBytes:C instanceof Uint16Array?function(P){for(var j=P.length,G=new Uint8Array(2*j),B=new DataView(G.buffer,G.byteOffset,G.byteLength),$=0;$<j;$++)B.setUint16(2*$,P[$],!1);return G}(C):C,needSMask:!1}}(s);var h,p,f,m=i,x=m.colorSpace,v=m.colorsPerPixel,g=m.sMaskBitsPerComponent,b=m.colorBytes,y=m.alphaBytes,S=m.needSMask,A=m.palette,k=m.mask,M=null;return r!==Pn.API.image_compression.NONE&&typeof b4=="function"?(M=function(T){var C;switch(T){case Pn.API.image_compression.FAST:C=11;break;case Pn.API.image_compression.MEDIUM:C=13;break;case Pn.API.image_compression.SLOW:C=14;break;default:C=12}return C}(r),h=this.decode.FLATE_DECODE,p="/Predictor ".concat(M," /Colors ").concat(v," /BitsPerComponent ").concat(d," /Columns ").concat(a),t=EG(b,Math.ceil(a*v*d/8),v,d,r),S&&(f=EG(y,Math.ceil(a*g/8),1,g,r))):(h=void 0,p=void 0,t=b,S&&(f=y)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:n,data:t,index:e,filter:h,decodeParameters:p,transparency:k,palette:A,sMask:f,predictor:M,width:a,height:o,bitsPerComponent:d,sMaskBitsPerComponent:g,colorSpace:x}}},function(t){t.processGIF89A=function(e,n,r,i){var s=new fMe(e),a=s.width,o=s.height,l=[];s.decodeAndBlitFrameRGBA(0,l);var u={data:l,width:a,height:o},d=new lj(100).encode(u,100);return t.processJPEG.call(this,d,n,r,i)},t.processGIF87A=t.processGIF89A}(Pn.API),qu.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},qu.prototype.parseBGR=function(){this.pos=this.offset;var t="bit"+this.bitPP,e=this.width*this.height*4;if(e>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(e);try{this[t]()}catch(n){ji.log("bit decode error:"+n)}},qu.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,o=0;o<8&&8*i+o<this.width;o++){var l=this.palette[s>>7-o&1];this.data[a+4*o]=l.blue,this.data[a+4*o+1]=l.green,this.data[a+4*o+2]=l.red,this.data[a+4*o+3]=255}n!==0&&(this.pos+=4-n)}},qu.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,o=s>>4,l=15&s,u=this.palette[o];if(this.data[a]=u.blue,this.data[a+1]=u.green,this.data[a+2]=u.red,this.data[a+3]=255,2*i+1>=this.width)break;u=this.palette[l],this.data[a+4]=u.blue,this.data[a+4+1]=u.green,this.data[a+4+2]=u.red,this.data[a+4+3]=255}e!==0&&(this.pos+=4-e)}},qu.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[s]=a.red,this.data[s+1]=a.green,this.data[s+2]=a.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}t!==0&&(this.pos+=4-t)}},qu.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&e)/e*255|0,o=(s>>5&e)/e*255|0,l=(s>>10&e)/e*255|0,u=s>>15?255:0,d=r*this.width*4+4*i;this.data[d]=l,this.data[d+1]=o,this.data[d+2]=a,this.data[d+3]=u}this.pos+=t}},qu.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,l=(a>>5&n)/n*255|0,u=(a>>11)/e*255|0,d=i*this.width*4+4*s;this.data[d]=u,this.data[d+1]=l,this.data[d+2]=o,this.data[d+3]=255}this.pos+=t}},qu.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=e*this.width*4+4*n;this.data[a]=s,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},qu.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*n;this.data[o]=s,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=a}},qu.prototype.getData=function(){return this.data},function(t){t.processBMP=function(e,n,r,i){var s=new qu(e,!1),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},u=new lj(100).encode(l,100);return t.processJPEG.call(this,u,n,r,i)}}(Pn.API),jG.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(e,n,r,i){var s=new jG(e),a=s.width,o=s.height,l={data:s.getData(),width:a,height:o},u=new lj(100).encode(l,100);return t.processJPEG.call(this,u,n,r,i)}}(Pn.API),Pn.API.processRGBA=function(t,e,n){for(var r=t.data,i=r.length,s=new Uint8Array(i/4*3),a=new Uint8Array(i/4),o=0,l=0,u=0;u<i;u+=4){var d=r[u],h=r[u+1],p=r[u+2],f=r[u+3];s[o++]=d,s[o++]=h,s[o++]=p,a[l++]=f}var m=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:m,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},Pn.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Av=Pn.API,rk=Av.getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),s=e.fontSize||this.internal.getFontSize(),a=e.charSpace||this.internal.getCharSpace(),o=e.widths?e.widths:i.metadata.Unicode.widths,l=o.fof?o.fof:1,u=e.kerning?e.kerning:i.metadata.Unicode.kerning,d=u.fof?u.fof:1,h=e.doKerning!==!1,p=0,f=t.length,m=0,x=o[0]||l,v=[];for(n=0;n<f;n++)r=t.charCodeAt(n),typeof i.metadata.widthOfString=="function"?v.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/s)||0)/1e3):(p=h&&Si(u[r])==="object"&&!isNaN(parseInt(u[r][m],10))?u[r][m]/d:0,v.push((o[r]||x)/l+p)),m=r;return v},_G=Av.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Av.processArabic&&(t=Av.processArabic(t)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(t,n,i)/n:rk.apply(this,arguments).reduce(function(s,a){return s+a},0)},SG=function(t,e,n,r){for(var i=[],s=0,a=t.length,o=0;s!==a&&o+e[s]<n;)o+=e[s],s++;i.push(t.slice(0,s));var l=s;for(o=0;s!==a;)o+e[s]>r&&(i.push(t.slice(l,s)),o=0,l=s),o+=e[s],s++;return l!==s&&i.push(t.slice(l,s)),i},AG=function(t,e,n){n||(n={});var r,i,s,a,o,l,u,d=[],h=[d],p=n.textIndent||0,f=0,m=0,x=t.split(" "),v=rk.apply(this,[" ",n])[0];if(l=n.lineIndent===-1?x[0].length+2:n.lineIndent||0){var g=Array(l).join(" "),b=[];x.map(function(S){(S=S.split(/\s*\n/)).length>1?b=b.concat(S.map(function(A,k){return(k&&A.length?` 741`:"")+A})):b.push(S[0])}),x=b,l=_G.apply(this,[g,n])}for(s=0,a=x.length;s<a;s++){var y=0;if(r=x[s],l&&r[0]==` 742`&&(r=r.substr(1),y=1),p+f+(m=(i=rk.apply(this,[r,n])).reduce(function(S,A){return S+A},0))>e||y){if(m>e){for(o=SG.apply(this,[r,i,e-(p+f),e]),d.push(o.shift()),d=[o.pop()];o.length;)h.push([o.shift()]);m=i.slice(r.length-(d[0]?d[0].length:0)).reduce(function(S,A){return S+A},0)}else d=[r];h.push(d),p=m+l,f=v}else d.push(r),p+=f+m,f=v}return u=l?function(S,A){return(A?g:"")+S.join(" ")}:function(S){return S.join(" ")},h.map(u)},Av.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var h=this.internal.getFont(d.fontName,d.fontStyle),p="Unicode";return h.metadata[p]?{widths:h.metadata[p].widths||{0:1},kerning:h.metadata[p].kerning||{}}:{font:h.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var a=1*this.internal.scaleFactor*e/i;s.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,s.lineIndent=n.lineIndent;var o,l,u=[];for(o=0,l=r.length;o<l;o++)u=u.concat(AG.apply(this,[r[o],a,s]));return u},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},s=0;s<16;s++)r[n[s]]=e[s],i[e[s]]=n[s];var a=function(p){return"0x"+parseInt(p,10).toString(16)},o=t.__fontmetrics__.compress=function(p){var f,m,x,v,g=["{"];for(var b in p){if(f=p[b],isNaN(parseInt(b,10))?m="'"+b+"'":(b=parseInt(b,10),m=(m=a(b).slice(2)).slice(0,-1)+i[m.slice(-1)]),typeof f=="number")f<0?(x=a(f).slice(3),v="-"):(x=a(f).slice(2),v=""),x=v+x.slice(0,-1)+i[x.slice(-1)];else{if(Si(f)!=="object")throw new Error("Don't know what to do with value type "+Si(f)+".");x=o(f)}g.push(m+x)}return g.push("}"),g.join("")},l=t.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var f,m,x,v,g={},b=1,y=g,S=[],A="",k="",M=p.length-1,T=1;T<M;T+=1)(v=p[T])=="'"?f?(x=f.join(""),f=void 0):f=[]:f?f.push(v):v=="{"?(S.push([y,x]),y={},x=void 0):v=="}"?((m=S.pop())[0][m[1]]=y,x=void 0,y=m[0]):v=="-"?b=-1:x===void 0?r.hasOwnProperty(v)?(A+=r[v],x=parseInt(A,16)*b,b=1,A=""):A+=v:r.hasOwnProperty(v)?(k+=r[v],y[x]=parseInt(k,16)*b,b=1,x=void 0,k=""):k+=v;return g},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h
vendor: 2,567 bytes, line 742
742={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
vendor: 12,126 bytes, line 742
742dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};
vendor: 9,696 bytes, lines 742-770
742t.events.push(["addFont",function(p){var f=p.font,m=h.Unicode[f.postScriptName];m&&(f.metadata.Unicode={},f.metadata.Unicode.widths=m.widths,f.metadata.Unicode.kerning=m.kerning);var x=d.Unicode[f.postScriptName];x&&(f.metadata.Unicode.encoding=x,f.encoding=x.codePages[0])}])}(Pn.API),function(t){var e=function(n){for(var r=n.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=n.charCodeAt(s);return i};t.API.events.push(["addFont",function(n){var r=void 0,i=n.font,s=n.instance;if(!i.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=s.existsFileInVFS(i.postScriptName)===!1?s.loadFile(i.postScriptName):s.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,o){o=/^\x00\x01\x00\x00/.test(o)?e(o):e(YC(o)),a.metadata=t.API.TTFFont.open(o),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,r)}}])}(Pn),Pn.API.addSvgAsImage=function(t,e,n,r,i,s,a,o){if(isNaN(e)||isNaN(n))throw ji.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw ji.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var u=l.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,l.width,l.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(tr.canvg?Promise.resolve(tr.canvg):KC(()=>import("./index.es-C6VbUyy1.js"),[])).catch(function(p){return Promise.reject(new Error("Could not load canvg: "+p))}).then(function(p){return p.default?p.default:p}).then(function(p){return p.fromString(u,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(p){return p.render(d)}).then(function(){h.addImage(l.toDataURL("image/jpeg",1),e,n,r,i,a,o)})},Pn.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},Pn.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,s,a={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(a),l=[],u=0,d=0,h=0;function p(m,x){var v,g=!1;for(v=0;v<m.length;v+=1)m[v]===x&&(g=!0);return g}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var f=o.length;for(h=0;h<f;h+=1)n[o[h]].value=n[o[h]].defaultValue,n[o[h]].explicitSet=!1}if(Si(t)==="object"){for(i in t)if(s=t[i],p(o,i)&&s!==void 0){if(n[i].type==="boolean"&&typeof s=="boolean")n[i].value=s;else if(n[i].type==="name"&&p(n[i].valueSet,s))n[i].value=s;else if(n[i].type==="integer"&&Number.isInteger(s))n[i].value=s;else if(n[i].type==="array"){for(u=0;u<s.length;u+=1)if(r=!0,s[u].length===1&&typeof s[u][0]=="number")l.push(String(s[u]-1));else if(s[u].length>1){for(d=0;d<s[u].length;d+=1)typeof s[u][d]!="number"&&(r=!1);r===!0&&l.push([s[u][0]-1,s[u][1]-1].join(" "))}n[i].value="["+l.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var m,x=[];for(m in n)n[m].explicitSet===!0&&(n[m].type==="name"?x.push("/"+m+" /"+n[m].value):x.push("/"+m+" "+n[m].value));x.length!==0&&this.internal.write(`/ViewerPreferences 743<< 744`+x.join(` 745`)+` 746>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},Pn.API.addMetadata=function(t,e){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:t,namespaceUri:e??"http://jspdf.default.namespaceuri/",rawXml:typeof e=="boolean"&&e},this.internal.events.subscribe("putCatalog",mMe),this.internal.events.subscribe("postPutResources",pMe)),this},function(t){var e=t.API,n=e.pdfEscape16=function(s,a){for(var o,l=a.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],h=0,p=s.length;h<p;++h){if(o=a.metadata.characterToGlyph(s.charCodeAt(h)),a.metadata.glyIdsUsed.push(o),a.metadata.toUnicode[o]=s.charCodeAt(h),l.indexOf(o)==-1&&(l.push(o),l.push([parseInt(a.metadata.widthOfGlyph(o),10)])),o=="0")return d.join("");o=o.toString(16),d.push(u[4-o.length],o)}return d.join("")},r=function(s){var a,o,l,u,d,h,p;for(d=`/CIDInit /ProcSet findresource begin 74712 dict begin 748begincmap 749/CIDSystemInfo << 750 /Registry (Adobe) 751 /Ordering (UCS) 752 /Supplement 0 753>> def 754/CMapName /Adobe-Identity-UCS def 755/CMapType 2 def 7561 begincodespacerange 757<0000><ffff> 758endcodespacerange`,l=[],h=0,p=(o=Object.keys(s).sort(function(f,m){return f-m})).length;h<p;h++)a=o[h],l.length>=100&&(d+=` 759`+l.length+` beginbfchar 760`+l.join(` 761`)+` 762endbfchar`,l=[]),s[a]!==void 0&&s[a]!==null&&typeof s[a].toString=="function"&&(u=("0000"+s[a].toString(16)).slice(-4),a=("0000"+(+a).toString(16)).slice(-4),l.push("<"+a+"><"+u+">"));return l.length&&(d+=` 763`+l.length+` beginbfchar 764`+l.join(` 765`)+` 766endbfchar 767`),d+`endcmap 768CMapName currentdict /CMap defineresource pop 769end 770end`};e.events.push(["putFont",function(s){(function(a){var o=a.font,l=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof t.API.TTFFont&&o.encoding==="Identity-H"){for(var h=o.metadata.Unicode.widths,p=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),f="",m=0;m<p.length;m++)f+=String.fromCharCode(p[m]);var x=u();d({data:f,addLength1:!0,objectId:x}),l("endobj");var v=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:v}),l("endobj");var g=u();l("<<"),l("/Type /FontDescriptor"),l("/FontName /"+hy(o.fontName)),l("/FontFile2 "+x+" 0 R"),l("/FontBBox "+t.API.PDFObject.convert(o.metadata.bbox)),l("/Flags "+o.metadata.flags),l("/StemV "+o.metadata.stemV),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l(">>"),l("endobj");var b=u();l("<<"),l("/Type /Font"),l("/BaseFont /"+hy(o.fontName)),l("/FontDescriptor "+g+" 0 R"),l("/W "+t.API.PDFObject.convert(h)),l("/CIDToGIDMap /Identity"),l("/DW 1000"),l("/Subtype /CIDFontType2"),l("/CIDSystemInfo"),l("<<"),l("/Supplement 0"),l("/Registry (Adobe)"),l("/Ordering ("+o.encoding+")"),l(">>"),l(">>"),l("endobj"),o.objectNumber=u(),l("<<"),l("/Type /Font"),l("/Subtype /Type0"),l("/ToUnicode "+v+" 0 R"),l("/BaseFont /"+hy(o.fontName)),l("/Encoding /"+o.encoding),l("/DescendantFonts ["+b+" 0 R]"),l(">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]),e.events.push(["putFont",function(s){(function(a){var o=a.font,l=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof t.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var h=o.metadata.rawData,p="",f=0;f<h.length;f++)p+=String.fromCharCode(h[f]);var m=u();d({data:p,addLength1:!0,objectId:m}),l("endobj");var x=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:x}),l("endobj");var v=u();l("<<"),l("/Descent "+o.metadata.decender),l("/CapHeight "+o.metadata.capHeight),l("/StemV "+o.metadata.stemV),l("/Type /FontDescriptor"),l("/
770FontFile2 "+m+" 0 R"),l("/Flags 96"),l("/FontBBox "+t.API.PDFObject.convert(o.metadata.bbox)),l("/FontName /"+hy(o.fontName)),l("/ItalicAngle "+o.metadata.italicAngle),l("/Ascent "+o.metadata.ascender),l(">>"),l("endobj"),o.objectNumber=u();for(var g=0;g<o.metadata.hmtx.widths.length;g++)o.metadata.hmtx.widths[g]=parseInt(o.metadata.hmtx.widths[g]*(1e3/o.metadata.head.unitsPerEm));l("<</Subtype/TrueType/Type/Font/ToUnicode "+x+" 0 R/BaseFont/"+hy(o.fontName)+"/FontDescriptor "+v+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),l("endobj"),o.isAlreadyPutted=!0}})(s)}]);var i=function(s){var a,o=s.text||"",l=s.x,u=s.y,d=s.options||{},h=s.mutex||{},p=h.pdfEscape,f=h.activeFontKey,m=h.fonts,x=f,v="",g=0,b="",y=m[x].encoding;if(m[x].encoding!=="Identity-H")return{text:o,x:l,y:u,options:d,mutex:h};for(b=o,x=f,Array.isArray(o)&&(b=o[0]),g=0;g<b.length;g+=1)m[x].metadata.hasOwnProperty("cmap")&&(a=m[x].metadata.cmap.unicode.codeMap[b[g].charCodeAt(0)]),a||b[g].charCodeAt(0)<256&&m[x].metadata.hasOwnProperty("Unicode")?v+=b[g]:v+="";var S="";return parseInt(x.slice(1))<14||y==="WinAnsiEncoding"?S=p(v,x).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):y==="Identity-H"&&(S=n(v,m[x])),h.isHex=!0,{text:S,x:l,y:u,options:d,mutex:h}};e.events.push(["postProcessText",function(s){var a=s.text||"",o=[],l={text:a,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(a)){var u=0;for(u=0;u<a.length;u+=1)Array.isArray(a[u])&&a[u].length===3?o.push([i(Object.assign({},l,{text:a[u][0]})).text,a[u][1],a[u][2]]):o.push(i(Object.assign({},l,{text:a[u]})).text);s.text=o}else s.text=i(Object.assign({},l,{text:a})).text}])}(Pn),function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0},t.addFileToVFS=function(n,r){return e.call(this),this.internal.vFS[n]=r,this},t.getFileFromVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(Pn.API),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(r){var i,s,a,o,l,u,d,h=e,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],m={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},x={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},v=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","â¹","âº","â¹","â
","â","â
","â½","â¾","â½","â","â","â","â¤","â¥","â¤","â©","âª","â©","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","﹤","ï¹¥","﹤"],g=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),b=!1,y=0;this.__bidiEngine__={};var S=function(P){var j=P.charCodeAt(),G=j>>8,B=x[G];return B!==void 0?h[256*B+(255&j)]:G===252||G===253?"AL":g.test(G)?"L":G===8?"R":"N"},A=function(P){for(var j,G=0;G<P.length;G++){if((j=S(P.charAt(G)))==="L")return!1;if(j==="R")return!0}return!1},k=function(P,j,G,B){var $,U,Z,V,W=j[B];switch(W){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":b=!1;break;case"N":case"AN":break;case"EN":b&&(W="AN");break;case"AL":b=!0,W="R";break;case"WS":case"BN":W="N";break;case"CS":B<1||B+1>=j.length||($=G[B-1])!=="EN"&&$!=="AN"||(U=j[B+1])!=="EN"&&U!=="AN"?W="N":b&&(U="AN"),W=U===$?U:"N";break;case"ES":W=($=B>0?G[B-1]:"B")==="EN"&&B+1<j.length&&j[B+1]==="EN"?"EN":"N";break;case"ET":if(B>0&&G[B-1]==="EN"){W="EN";break}if(b){W="N";break}for(Z=B+1,V=j.length;Z<V&&j[Z]==="ET";)Z++;W=Z<V&&j[Z]==="EN"?"EN":"N";break;case"NSM":if(a&&!o){for(V=j.length,Z=B+1;Z<V&&j[Z]==="NSM";)Z++;if(Z<V){var O=P[B],Y=O>=1425&&O<=2303||O===64286;if($=j[Z],Y&&($==="R"||$==="AL")){W="R";break}}}W=B<1||($=j[B-1])==="B"?"N":G[B-1];break;case"B":b=!1,i=!0,W=y;break;case"S":s=!0,W="N"}return W},M=function(P,j,G){var B=P.split("");return G&&T(B,G,{hiLevel:y}),B.reverse(),j&&j.reverse(),B.join("")},T=function(P,j,G){var B,$,U,Z,V,W=-1,O=P.length,Y=0,z=[],I=y?f:p,q=[];for(b=!1,i=!1,s=!1,$=0;$<O;$++)q[$]=S(P[$]);for(U=0;U<O;U++){if(V=Y,z[U]=k(P,q,z,U),B=240&(Y=I[V][m[z[U]]]),Y&=15,j[U]=Z=I[Y][5],B>0)if(B===16){for($=W;$<U;$++)j[$]=1;W=-1}else W=-1;if(I[Y][6])W===-1&&(W=U);else if(W>-1){for($=W;$<U;$++)j[$]=Z;W=-1}q[U]==="B"&&(j[U]=0),G.hiLevel|=Z}s&&function(te,se,ie){for(var le=0;le<ie;le++)if(te[le]==="S"){se[le]=y;for(var xe=le-1;xe>=0&&te[xe]==="WS";xe--)se[xe]=y}}(q,j,O)},C=function(P,j,G,B,$){if(!($.hiLevel<P)){if(P===1&&y===1&&!i)return j.reverse(),void(G&&G.reverse());for(var U,Z,V,W,O=j.length,Y=0;Y<O;){if(B[Y]>=P){for(V=Y+1;V<O&&B[V]>=P;)V++;for(W=Y,Z=V-1;W<Z;W++,Z--)U=j[W],j[W]=j[Z],j[Z]=U,G&&(U=G[W],G[W]=G[Z],G[Z]=U);Y=V}Y++}}},R=function(P,j,G){var B=P.split(""),$={hiLevel:y};return G||(G=[]),T(B,G,$),function(U,Z,V){if(V.hiLevel!==0&&d)for(var W,O=0;O<U.length;O++)Z[O]===1&&(W=v.indexOf(U[O]))>=0&&(U[O]=v[W+1])}(B,G,$),C(2,B,j,G,$),C(1,B,j,G,$),B.join("")};return this.__bidiEngine__.doBidiReorder=function(P,j,G){if(function($,U){if(U)for(var Z=0;Z<$.length;Z++)U[Z]=Z;o===void 0&&(o=A($)),u===void 0&&(u=A($))}(P,j),a||!l||u)if(a&&l&&o^u)y=o?1:0,P=M(P,j,G);else if(!a&&l&&u)y=o?1:0,P=R(P,j,G),P=M(P,j);else if(!a||o||l||u){if(a&&!l&&o^u)P=M(P,j),o?(y=0,P=R(P,j,G)):(y=1,P=R(P,j,G),P=M(P,j));else if(a&&o&&!l&&u)y=1,P=R(P,j,G),P=M(P,j);else if(!a&&!l&&o^u){var B=d;o?(y=1,P=R(P,j,G),y=0,d=!1,P=R(P,j,G),d=B):(y=0,P=R(P,j,G),P=M(P,j),y=1,d=!1,P=R(P,j,G),d=B,P=M(P,j))}}else y=0,P=R(P,j,G);else y=o?1:0,P=R(P,j,G);return P},this.__bidiEngine__.setOptions=function(P){P&&(a=P.isInputVisual,l=P.isOutputVisual,o=P.isInputRtl,u=P.isOutputRtl,d=P.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var a=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,n.setOptions(s),Object.prototype.toString.call(i)==="[object Array]"){var o=0;for(a=[],o=0;o<i.length;o+=1)Object.prototype.toString.call(i[o])==="[object Array]"?a.push([n.doBidiReorder(i[o][0]),i[o][1],i[o][2]]):a.push([n.doBidiReorder(i[o])]);r.text=a}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(Pn),Pn.API.TTFFont=function(){function t(e){var n;if(this.rawData=e,n=this.contents=new Om(e),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new MMe(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new gMe(this.contents),this.head=new vMe(this),this.name=new SMe(this),this.cmap=new aie(this),this.toUnicode={},this.hhea=new yMe(this),this.maxp=new AMe(this),this.hmtx=new EMe(this),this.post=new wMe(this),this.os2=new bMe(this),thi
vendor: 16,759 bytes, line 770
770s.loca=new TMe(this),this.glyf=new kMe(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,n,r,i,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var a,o,l,u;for(u=[],a=0,o=(l=this.bbox).length;a<o;a++)e=l[a],u.push(Math.round(e*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(n=i>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var n;return((n=this.cmap.unicode)!=null?n.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*n},t.prototype.widthOfString=function(e,n,r){var i,s,a,o;for(a=0,s=0,o=(e=""+e).length;0<=o?s<o:s>o;s=0<=o?++s:--s)i=e.charCodeAt(s),a+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return a*(n/1e3)},t.prototype.lineHeight=function(e,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},t}();var Cd,Om=function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var n,r;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},t.prototype.writeString=function(e){var n,r,i;for(i=[],n=0,r=e.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(e.charCodeAt(n)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,n,r,i,s,a,o,l;return e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),l=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^s)+65536*(255^a)+256*(255^o)+(255^l)+1):72057594037927940*e+281474976710656*n+1099511627776*r+4294967296*i+16777216*s+65536*a+256*o+l},t.prototype.writeLongLong=function(e){var n,r;return n=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var n,r;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n.push(this.readByte());return n},t.prototype.write=function(e){var n,r,i,s;for(s=[],r=0,i=e.length;r<i;r++)n=e[r],s.push(this.writeByte(n));return s},t}(),gMe=function(){var t;function e(n){var r,i,s;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,s=this.tableCount;0<=s?i<s:i>s;i=0<=s?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(n){var r,i,s,a,o,l,u,d,h,p,f,m,x;for(x in f=Object.keys(n).length,l=Math.log(2),h=16*Math.floor(Math.log(f)/l),a=Math.floor(h/l),d=16*f-h,(i=new Om).writeInt(this.scalarType),i.writeShort(f),i.writeShort(h),i.writeShort(a),i.writeShort(d),s=16*f,u=i.pos+s,o=null,m=[],n)for(p=n[x],i.writeString(x),i.writeInt(t(p)),i.writeInt(u),i.writeInt(p.length),m=m.concat(p),x==="head"&&(o=u),u+=p.length;u%4;)m.push(0),u++;return i.write(m),r=2981146554-t(i.data),i.pos=o+8,i.writeUInt32(r),i.data},t=function(n){var r,i,s,a;for(n=oie.call(n);n.length%4;)n.push(0);for(s=new Om(n),i=0,r=0,a=n.length;r<a;r=r+=4)i+=s.readUInt32();return 4294967295&i},e}(),xMe={}.hasOwnProperty,Lh=function(t,e){for(var n in e)xMe.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};Cd=function(){function t(e){var n;this.file=e,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var vMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var n;return(n=new Om).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(e),n.writeShort(this.glyphDataFormat),n.data},t}(),PG=function(){function t(e,n){var r,i,s,a,o,l,u,d,h,p,f,m,x,v,g,b,y;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=n+e.readInt(),h=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(l=0;l<256;++l)this.codeMap[l]=e.readByte();break;case 4:for(f=e.readUInt16(),p=f/2,e.pos+=6,s=function(){var S,A;for(A=[],l=S=0;0<=p?S<p:S>p;l=0<=p?++S:--S)A.push(e.readUInt16());return A}(),e.pos+=2,x=function(){var S,A;for(A=[],l=S=0;0<=p?S<p:S>p;l=0<=p?++S:--S)A.push(e.readUInt16());return A}(),u=function(){var S,A;for(A=[],l=S=0;0<=p?S<p:S>p;l=0<=p?++S:--S)A.push(e.readUInt16());return A}(),d=function(){var S,A;for(A=[],l=S=0;0<=p?S<p:S>p;l=0<=p?++S:--S)A.push(e.readUInt16());return A}(),i=(this.length-e.pos+this.offset)/2,o=function(){var S,A;for(A=[],l=S=0;0<=i?S<i:S>i;l=0<=i?++S:--S)A.push(e.readUInt16());return A}(),l=g=0,y=s.length;g<y;l=++g)for(v=s[l],r=b=m=x[l];m<=v?b<=v:b>=v;r=m<=v?++b:--b)d[l]===0?a=r+u[l]:(a=o[d[l]/2+(r-m)-(p-l)]||0)!==0&&(a+=u[l]),this.codeMap[r]=65535&a}e.pos=h}return t.encode=function(e,n){var r,i,s,a,o,l,u,d,h,p,f,m,x,v,g,b,y,S,A,k,M,T,C,R,P,j,G,B,$,U,Z,V,W,O,Y,z,I,q,te,se,ie,le,xe,Ee,ae,Q;switch(B=new Om,a=Object.keys(e).sort(function(we,Ae){return we-Ae}),n){case"macroman":for(x=0,v=function(){var we=[];for(m=0;m<256;++m)we.push(0);return we}(),b={0:0},s={},$=0,W=a.length;$<W;$++)b[xe=e[i=a[$]]]==null&&(b[xe]=++x),s[i]={old:e[i],new:b[e[i]]},v[i]=b[e[i]];return B.writeUInt16(1),B.writeUInt16(0),B.writeUInt32(12),B.writeUInt16(0),B.writeUInt16(262),B.writeUInt16(0),B.write(v),{charMap:s,subtable:B.data,maxGlyphID:x+1};case"unicode":for(j=[],h=[],y=0,b={},r={},g=u=null,U=0,O=a.length;U<O;U++)b[A=e[i=a[U]]]==null&&(b[A]=++y),r[i]={old:A,new:b[A]},o=b[A]-i,g!=null&&o===u||(g&&h.push(g),j.push(i),u=o),g=i;for(g&&h.push(g),h.push(65535),j.push(65535),R=2*(C=j.length),T=2*Math.pow(Math.log(C)/Math.LN2,2),p=Math.log(T/2)/Math.LN2,M=2*C-T,l=[],k=[],f=[],m=Z=0,Y=j.length;Z<Y;m=++Z){if(P=j[m],d=h[m],P===65535){l.push(0),k.push(0);break}if(P-(G=r[P].new)>=32768)for(l.push(0),k.push(2*(f.length+C-m)),i=V=P;P<=d?V<=d:V>=d;i=P<=d?++V:--V)f.push(r[i].new);else l.push(G-P),k.push(0)}for(B.writeUInt16(3),B.writeUInt16(1),B.writeUInt32(12),B.writeUInt16(4),B.writeUInt16(16+8*C+2*f.length),B.writeUInt16(0),B.writeUInt16(R),B.writeUInt16(T),B.writeUInt16(p),B.writeUInt16(M),ie=0,z=h.length;ie<z;ie++)i=h[ie],B.writeUInt16(i);for(B.writeUInt16(0),le=0,I=j.length;le<I;le++)i=j[le],B.writeUInt16(i);for(Ee=0,q=l.length;Ee<q;Ee++)o=l[Ee],B.writeUInt16(o);for(ae=0,te=k.length;ae<te;ae++)S=k[ae],B.writeUInt16(S);for(Q=0,se=f.length;Q<se;Q++)x=f[Q],B.writeUInt16(x);return{charMap:r,subtable:B.data,maxGlyphID:y+1}}},t}(),aie=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="cmap",t.prototype.parse=function(e){var n,r,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n=new PG(e,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},t.encode=function(e,n){var r,i;return n==null&&(n="macroman"),r=PG.encode(e,n),(i=new Om).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},t}(),yMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t}(),bMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var n,r;for(r=[],n=0;n<10;++n)r.push(e.readByte());return r}(),this.charRange=function(){var n,r;for(r=[],n=0;n<4;++n)r.push(e.readInt());return r}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(e.readInt());return r}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t}(),wMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="post",t.prototype.parse=function(e){var n,r,i;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var s;for(r=e.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)n=e.readByte(),i.push(this.names.push(e.readString(n)));return i;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=(function(){var a,o,l;for(l=[],s=a=0,o=this.file.maxp.numGlyphs;0<=o?a<o:a>o;s=0<=o?++a:--a)l.push(e.readUInt32());return l}).call(this)}},t}(),_Me=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},SMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="name",t.prototype.parse=function(e){var n,r,i,s,a,o,l,u,d,h,p;for(e.pos=this.offset,e.readShort(),n=e.readShort(),o=e.readShort(),r=[],s=0;0<=n?s<n:s>n;s=0<=n?++s:--s)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+o+e.readShort()});for(l={},s=d=0,h=r.length;d<h;s=++d)i=r[s],e.pos=i.offset,u=e.readString(i.length),a=new _Me(u,i),l[p=i.nameID]==null&&(l[p]=[]),l[i.nameID].push(a);this.strings=l,this.copyright=l[0],this.fontFamily=l[1],this.fontSubfamily=l[2],this.uniqueSubfamily=l[3],this.fontName=l[4],this.version=l[5];try{this.postscriptName=l[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=l[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=l[7],this.manufacturer=l[8],this.designer=l[9],this.description=l[10],this.vendorUrl=l[11],this.designerUrl=l[12],this.license=l[13],this.licenseUrl=l[14],this.preferredFamily=l[15],this.preferredSubfamily=l[17],this.compatibleFull=l[18],this.sampleText=l[19]},t}(),AMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t}(),EMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="hmtx",t.prototype.parse=function(e){var n,r,i,s,a,o,l;for(e.pos=this.offset,this.metrics=[],n=0,o=this.file.hhea.numberOfMetrics;0<=o?n<o:n>o;n=0<=o?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],n=u=0;0<=i?u<i:u>i;n=0<=i?++u:--u)d.push(e.readInt16());return d}(),this.widths=(function(){var u,d,h,p;for(p=[],u=0,d=(h=this.metrics).length;u<d;u++)s=h[u],p.push(s.advance);return p}).call(this),r=this.widths[this.widths.length-1],l=[],n=a=0;0<=i?a<i:a>i;n=0<=i?++a:--a)l.push(this.widths.push(r));return l},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t}
770(),oie=[].slice,kMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var n,r,i,s,a,o,l,u,d,h;return e in this.cache?this.cache[e]:(s=this.file.loca,n=this.file.contents,r=s.indexOf(e),(i=s.lengthOf(e))===0?this.cache[e]=null:(n.pos=this.offset+r,a=(o=new Om(n.read(i))).readShort(),u=o.readShort(),h=o.readShort(),l=o.readShort(),d=o.readShort(),this.cache[e]=a===-1?new NMe(o,u,h,l,d):new CMe(o,a,u,h,l,d),this.cache[e]))},t.prototype.encode=function(e,n,r){var i,s,a,o,l;for(a=[],s=[],o=0,l=n.length;o<l;o++)i=e[n[o]],s.push(a.length),i&&(a=a.concat(i.encode(r)));return s.push(a.length),{table:a,offsets:s}},t}(),CMe=function(){function t(e,n,r,i,s,a){this.raw=e,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=s,this.yMax=a,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),NMe=function(){function t(e,n,r,i,s){var a,o;for(this.raw=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return t.prototype.encode=function(){var e,n,r;for(n=new Om(oie.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)n.pos=this.glyphOffsets[e];return n.data},t}(),TMe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Lh(t,Cd),t.prototype.tag="loca",t.prototype.parse=function(e){var n,r;return e.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=2)s.push(2*e.readUInt16());return s}).call(this):(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=4)s.push(e.readUInt32());return s}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,n){for(var r=new Uint32Array(this.offsets.length),i=0,s=0,a=0;a<r.length;++a)if(r[a]=i,s<n.length&&n[s]==a){++s,r[a]=i;var o=this.offsets[a],l=this.offsets[a+1]-o;l>0&&(i+=l)}for(var u=new Array(4*r.length),d=0;d<r.length;++d)u[4*d+3]=255&r[d],u[4*d+2]=(65280&r[d])>>8,u[4*d+1]=(16711680&r[d])>>16,u[4*d]=(4278190080&r[d])>>24;return u},t}(),MMe=function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,n,r,i,s;for(n in i=this.font.cmap.tables[0].codeMap,e={},s=this.subset)r=s[n],e[n]=i[r];return e},t.prototype.glyphsFor=function(e){var n,r,i,s,a,o,l;for(i={},a=0,o=e.length;a<o;a++)i[s=e[a]]=this.font.glyf.glyphFor(s);for(s in n=[],i)(r=i[s])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(s in l=this.glyphsFor(n))r=l[s],i[s]=r;return i},t.prototype.encode=function(e,n){var r,i,s,a,o,l,u,d,h,p,f,m,x,v,g;for(i in r=aie.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(e),f={0:0},g=r.charMap)f[(l=g[i]).old]=l.new;for(m in p=r.maxGlyphID,a)m in f||(f[m]=p++);return d=function(b){var y,S;for(y in S={},b)S[b[y]]=y;return S}(f),h=Object.keys(d).sort(function(b,y){return b-y}),x=function(){var b,y,S;for(S=[],b=0,y=h.length;b<y;b++)o=h[b],S.push(d[o]);return S}(),s=this.font.glyf.encode(a,x,f),u=this.font.loca.encode(s.offsets,x),v={cmap:this.font.cmap.raw(),glyf:s.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(v["OS/2"]=this.font.os2.raw()),this.font.directory.encode(v)},t}();Pn.API.PDFObject=function(){var t;function e(){}return t=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},e.convert=function(n){var r,i,s,a;if(Array.isArray(n))return"["+function(){var o,l,u;for(u=[],o=0,l=n.length;o<l;o++)r=n[o],u.push(e.convert(r));return u}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in s=["<<"],n)a=n[i],s.push("/"+i+" "+e.convert(a));return s.push(">>"),s.join(` 771`)}return""+n},e}();function lie(t,e,n,r,i){r=r||{};var s=1.15,a=i.internal.scaleFactor,o=i.internal.getFontSize()/a,l=i.getLineHeightFactor?i.getLineHeightFactor():s,u=o*l,d=/\r\n|\r|\n/g,h="",p=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(h=typeof t=="string"?t.split(d):t,p=h.length||1),n+=o*(2-s),r.valign==="middle"?n-=p/2*u:r.valign==="bottom"&&(n-=p*u),r.halign==="center"||r.halign==="right"){var f=o;if(r.halign==="center"&&(f*=.5),h&&p>=1){for(var m=0;m<h.length;m++)i.text(h[m],e-i.getStringUnitWidth(h[m])*f,n),n+=u;return i}e-=i.getStringUnitWidth(t)*f}return r.halign==="justify"?i.text(t,e,n,{maxWidth:r.maxWidth||100,align:"justify"}):i.text(t,e,n),i}var LG={},cb=function(){function t(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}
771return t.setDefaults=function(e,n){n===void 0&&(n=null),n?n.__autoTableDocumentDefaults=e:LG=e},t.unifyColor=function(e){return Array.isArray(e)?e:typeof e=="number"?[e,e,e]:typeof e=="string"?[e]:null},t.prototype.applyStyles=function(e,n){var r,i,s;n===void 0&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var a=this.jsPDFDocument.internal.getFont(),o=a.fontStyle,l=a.fontName;if(e.font&&(l=e.font),e.fontStyle){o=e.fontStyle;var u=this.getFontList()[l];u&&u.indexOf(o)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(u[0]),o=u[0])}if(this.jsPDFDocument.setFont(l,o),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var d=t.unifyColor(e.fillColor);d&&(r=this.jsPDFDocument).setFillColor.apply(r,d),d=t.unifyColor(e.textColor),d&&(i=this.jsPDFDocument).setTextColor.apply(i,d),d=t.unifyColor(e.lineColor),d&&(s=this.jsPDFDocument).setDrawColor.apply(s,d),typeof e.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(e,n,r){return this.jsPDFDocument.splitTextToSize(e,n,r)},t.prototype.rect=function(e,n,r,i,s){return this.jsPDFDocument.rect(e,n,r,i,s)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return LG||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width==null&&(e={width:e.getWidth(),height:e.getHeight()}),e},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t}(),L4=function(t,e){return L4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},L4(t,e)};function cie(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L4(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var uie=function(t){cie(e,t);function e(n){var r=t.call(this)||this;return r._element=n,r}return e}(Array);function RMe(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function jMe(t){var e={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return e[t]}function MT(t,e,n){n.applyStyles(e,!0);var r=Array.isArray(t)?t:[t],i=r.map(function(s){return n.getTextWidth(s)}).reduce(function(s,a){return Math.max(s,a)},0);return i}function die(t,e,n,r){var i=e.settings.tableLineWidth,s=e.settings.tableLineColor;t.applyStyles({lineWidth:i,lineColor:s});var a=hie(i,!1);a&&t.rect(n.x,n.y,e.getWidth(t.pageSize().width),r.y-n.y,a)}function hie(t,e){var n=t>0,r=e||e===0;return n&&r?"DF":n?"S":r?"F":null}function fM(t,e){var n,r,i,s;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===3)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t.length===1?t=t[0]:t=e}return typeof t=="object"?(typeof t.vertical=="number"&&(t.top=t.vertical,t.bottom=t.vertical),typeof t.horizontal=="number"&&(t.right=t.horizontal,t.left=t.horizontal),{left:(n=t.left)!==null&&n!==void 0?n:e,top:(r=t.top)!==null&&r!==void 0?r:e,right:(i=t.right)!==null&&i!==void 0?i:e,bottom:(s=t.bottom)!==null&&s!==void 0?s:e}):(typeof t!="number"&&(t=e),{top:t,right:t,bottom:t,left:t})}
771function fie(t,e){var n=fM(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}function PMe(t,e,n,r,i){var s={},a=1.3333333333333333,o=cj(e,function(y){return i.getComputedStyle(y).backgroundColor});o!=null&&(s.fillColor=o);var l=cj(e,function(y){return i.getComputedStyle(y).color});l!=null&&(s.textColor=l);var u=IMe(r,n);u&&(s.cellPadding=u);var d="borderTopColor",h=a*n,p=r.borderTopWidth;if(r.borderBottomWidth===p&&r.borderRightWidth===p&&r.borderLeftWidth===p){var f=(parseFloat(p)||0)/h;f&&(s.lineWidth=f)}else s.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/h,right:(parseFloat(r.borderRightWidth)||0)/h,bottom:(parseFloat(r.borderBottomWidth)||0)/h,left:(parseFloat(r.borderLeftWidth)||0)/h},s.lineWidth.top||(s.lineWidth.right?d="borderRightColor":s.lineWidth.bottom?d="borderBottomColor":s.lineWidth.left&&(d="borderLeftColor"));var m=cj(e,function(y){return i.getComputedStyle(y)[d]});m!=null&&(s.lineColor=m);var x=["left","right","center","justify"];x.indexOf(r.textAlign)!==-1&&(s.halign=r.textAlign),x=["middle","bottom","top"],x.indexOf(r.verticalAlign)!==-1&&(s.valign=r.verticalAlign);var v=parseInt(r.fontSize||"");isNaN(v)||(s.fontSize=v/a);var g=LMe(r);g&&(s.fontStyle=g);var b=(r.fontFamily||"").toLowerCase();return t.indexOf(b)!==-1&&(s.font=b),s}function LMe(t){var e="";return(t.fontWeight==="bold"||t.fontWeight==="bolder"||parseInt(t.fontWeight)>=700)&&(e="bold"),(t.fontStyle==="italic"||t.fontStyle==="oblique")&&(e+="italic"),e}function cj(t,e){var n=pie(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var i=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],s=parseInt(r[4]);return s===0||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function pie(t,e){var n=e(t);return n==="rgba(0, 0, 0, 0)"||n==="transparent"||n==="initial"||n==="inherit"?t.parentElement==null?null:pie(t.parentElement,e):n}function IMe(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),i=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,s=n.map(function(o){return parseInt(o||"0")/r}),a=fM(s,0);return i>a.top&&(a.top=i),i>a.bottom&&(a.bottom=i),a}function mie(t,e,n,r,i){var s,a;r===void 0&&(r=!1),i===void 0&&(i=!1);var o;typeof e=="string"?o=n.document.querySelector(e):o=e;var l=Object.keys(t.getFontList()),u=t.scaleFactor(),d=[],h=[],p=[];if(!o)return console.error("Html table could not be found with input: ",e),{head:d,body:h,foot:p};for(var f=0;f<o.rows.length;f++){var m=o.rows[f],x=(a=(s=m==null?void 0:m.parentElement)===null||s===void 0?void 0:s.tagName)===null||a===void 0?void 0:a.toLowerCase(),v=DMe(l,u,n,m,r,i);v&&(x==="thead"?d.push(v):x==="tfoot"?p.push(v):h.push(v))}return{head:d,body:h,foot:p}}function DMe(t,e,n,r,i,s){for(var a=new uie(r),o=0;o<r.cells.length;o++){var l=r.cells[o],u=n.getComputedStyle(l);if(i||u.display!=="none"){var d=void 0;s&&(d=PMe(t,l,e,u,n)),a.push({rowSpan:l.rowSpan,colSpan:l.colSpan,styles:d,_element:l,content:BMe(l)})}}var h=n.getComputedStyle(r);if(a.length>0&&(i||h.display!=="none"))return a}function BMe(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(n){return n.trim()}).join(` 772`),e.innerText||e.textContent||""}function FMe(t,e,n){for(var r=0,i=[t,e,n];r<i.length;r++){var s=i[r];s&&typeof s!="object"&&console.error("The options parameter should be of type object, is: "+typeof s),s.startY&&typeof s.startY!="number"&&(console.error("Invalid value for startY option",s.startY),delete s.startY)}}function yf(t,e,n,r,i){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),a=1;a<arguments.length;a++){var o=arguments[a];if(o!=null)for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(s[l]=o[l])}return s}function gie(t,e){var n=new cb(t),r=n.getDocumentOptions(),i=n.getGlobalOptions();FMe(i,r,e);var s=yf({},i,r,e),a;typeof window<"u"&&(a=window);var o=OMe(i,r,e),l=zMe(i,r,e),u=UMe(n,s),d=GMe(n,s,a);return{id:e.tableId,content:d,hooks:l,styles:o,settings:u}}function OMe(t,e,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(l){if(l==="columnStyles"){var u=t[l],d=e[l],h=n[l];r.columnStyles=yf({},u,d,h)}else{var p=[t,e,n],f=p.map(function(m){return m[l]||{}});r[l]=yf({},f[0],f[1],f[2])}},s=0,a=Object.keys(r);s<a.length;s++){var o=a[s];i(o)}return r}function zMe(t,e,n){for(var r=[t,e,n],i={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},s=0,a=r;s<a.length;s++){var o=a[s];o.didParseCell&&i.didParseCell.push(o.didParseCell),o.willDrawCell&&i.willDrawCell.push(o.willDrawCell),o.didDrawCell&&i.didDrawCell.push(o.didDrawCell),o.willDrawPage&&i.willDrawPage.push(o.willDrawPage),o.didDrawPage&&i.didDrawPage.push(o.didDrawPage)}return i}function UMe(t,e){var n,r,i,s,a,o,l,u,d,h,p,f,m=fM(e.margin,40/t.scaleFactor()),x=(n=HMe(t,e.startY))!==null&&n!==void 0?n:m.top,v;e.showFoot===!0?v="everyPage":e.showFoot===!1?v="never":v=(r=e.showFoot)!==null&&r!==void 0?r:"everyPage";var g;e.showHead===!0?g="everyPage":e.showHead===!1?g="never":g=(i=e.showHead)!==null&&i!==void 0?i:"everyPage";var b=(s=e.useCss)!==null&&s!==void 0?s:!1,y=e.theme||(b?"plain":"striped"),S=!!e.horizontalPageBreak,A=(a=e.horizontalPageBreakRepeat)!==null&&a!==void 0?a:null;return{includeHiddenHtml:(o=e.includeHiddenHtml)!==null&&o!==void 0?o:!1,useCss:b,theme:y,startY:x,margin:m,pageBreak:(l=e.pageBreak)!==null&&l!==void 0?l:"auto",rowPageBreak:(u=e.rowPageBreak)!==null&&u!==void 0?u:"auto",tableWidth:(d=e.tableWidth)!==null&&d!==void 0?d:"auto",showHead:g,showFoot:v,tableLineWidth:(h=e.tableLineWidth)!==null&&h!==void 0?h:0,tableLineColor:(p=e.tableLineColor)!==null&&p!==void 0?p:200,horizontalPageBreak:S,horizontalPageBreakRepeat:A,horizontalPageBreakBehaviour:(f=e.horizontalPageBreakBehaviour)!==null&&f!==void 0?f:"afterAllRows"}}function HMe(t,e){var n=t.getLastAutoTable(),r=t.scaleFactor(),i=t.pageNumber(),s=!1;if(n&&n.startPageNumber){var a=n.startPageNumber+n.pageNumber-1;s=a===i}return typeof e=="number"?e:(e==null||e===!1)&&s&&(n==null?void 0:n.finalY)!=null?n.finalY+20/r:null}function GMe(t,e,n){var r=e.head||[],i=e.body||[],s=e.foot||[];if(e.html){var a=e.includeHiddenHtml;if(n){var o=mie(t,e.html,n,a,e.useCss)||{};r=o.head||r,i=o.body||r,s=o.foot||r}else console.error("Cannot parse html in non browser environment")}var l=e.columns||VMe(r,i,s);return{columns:l,head:r,body:i,foot:s}}
772function VMe(t,e,n){var r=t[0]||e[0]||n[0]||[],i=[];return Object.keys(r).filter(function(s){return s!=="_element"}).forEach(function(s){var a=1,o;Array.isArray(r)?o=r[parseInt(s)]:o=r[s],typeof o=="object"&&!Array.isArray(o)&&(a=(o==null?void 0:o.colSpan)||1);for(var l=0;l<a;l++){var u=void 0;Array.isArray(r)?u=i.length:u=s+(l>0?"_".concat(l):"");var d={dataKey:u};i.push(d)}}),i}var I4=function(){function t(e,n,r){this.table=n,this.pageNumber=n.pageNumber,this.settings=n.settings,this.cursor=r,this.doc=e.getDocument()}return t}(),WMe=function(t){cie(e,t);function e(n,r,i,s,a,o){var l=t.call(this,n,r,o)||this;return l.cell=i,l.row=s,l.column=a,l.section=s.section,l}return e}(I4),$Me=function(){function t(e,n){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=n.columns,this.head=n.head,this.body=n.body,this.foot=n.foot}return t.prototype.getHeadHeight=function(e){return this.head.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.getFootHeight=function(e){return this.foot.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(e,n,r,i,s,a){for(var o=0,l=n;o<l.length;o++){var u=l[o],d=new WMe(e,this,r,i,s,a),h=u(d)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],h)return!1}return!0},t.prototype.callEndPageHooks=function(e,n){e.applyStyles(e.userStyles);for(var r=0,i=this.hooks.didDrawPage;r<i.length;r++){var s=i[r];s(new I4(e,this,n))}},t.prototype.callWillDrawPageHooks=function(e,n){for(var r=0,i=this.hooks.willDrawPage;r<i.length;r++){var s=i[r];s(new I4(e,this,n))}},t.prototype.getWidth=function(e){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var n=this.columns.reduce(function(i,s){return i+s.wrappedWidth},0);return n}else{var r=this.settings.margin;return e-r.left-r.right}},t}(),xie=function(){function t(e,n,r,i,s){s===void 0&&(s=!1),this.height=0,this.raw=e,e instanceof uie&&(this.raw=e._element,this.element=e._element),this.index=n,this.section=r,this.cells=i,this.spansMultiplePages=s}return t.prototype.getMaxCellHeight=function(e){var n=this;return e.reduce(function(r,i){var s;return Math.max(r,((s=n.cells[i.index])===null||s===void 0?void 0:s.height)||0)},0)},t.prototype.hasRowSpan=function(e){var n=this;return e.filter(function(r){var i=n.cells[r.index];return i?i.rowSpan>1:!1}).length>0},t.prototype.canEntireRowFit=function(e,n){return this.getMaxCellHeight(n)<=e},t.prototype.getMinimumRowHeight=function(e,n){var r=this;return e.reduce(function(i,s){var a=r.cells[s.index];if(!a)return 0;var o=n.getLineHeight(a.styles.fontSize),l=a.padding("vertical"),u=l+o;return u>i?u:i},0)},t}(),vie=function(){function t(e,n,r){var i;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=n,this.section=r,this.raw=e;var s=e;e!=null&&typeof e=="object"&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,s=(i=e.content)!==null&&i!==void 0?i:e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var a=s!=null?""+s:"",o=/\r\n|\r|\n/g;this.text=a.split(o)}return t.prototype.getTextPos=function(){var e;if(this.styles.valign==="top")e=this.y+this.padding("top");else if(this.styles.valign==="bottom")e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var i=this.width-this.padding("horizontal");r=this.x+i/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:e}}
772,t.prototype.getContentHeight=function(e,n){n===void 0&&(n=1.15);var r=Array.isArray(this.text)?this.text.length:1,i=this.styles.fontSize/e*n,s=r*i+this.padding("vertical");return Math.max(s,this.styles.minCellHeight)},t.prototype.padding=function(e){var n=fM(this.styles.cellPadding,0);return e==="vertical"?n.top+n.bottom:e==="horizontal"?n.left+n.right:n[e]},t}(),KMe=function(){function t(e,n,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=n,this.index=r}return t.prototype.getMaxCustomCellWidth=function(e){for(var n=0,r=0,i=e.allRows();r<i.length;r++){var s=i[r],a=s.cells[this.index];a&&typeof a.styles.cellWidth=="number"&&(n=Math.max(n,a.styles.cellWidth))}return n},t}();function qMe(t,e){XMe(t,e);var n=[],r=0;e.columns.forEach(function(s){var a=s.getMaxCustomCellWidth(e);a?s.width=a:(s.width=s.wrappedWidth,n.push(s)),r+=s.width});var i=e.getWidth(t.pageSize().width)-r;i&&(i=D4(n,i,function(s){return Math.max(s.minReadableWidth,s.minWidth)})),i&&(i=D4(n,i,function(s){return s.minWidth})),i=Math.abs(i),!e.settings.horizontalPageBreak&&i>.1/t.scaleFactor()&&(i=i<1?i:Math.round(i),console.log("Of the table content, ".concat(i," units width could not fit page"))),JMe(e),ZMe(e,t),YMe(e)}function XMe(t,e){var n=t.scaleFactor(),r=e.settings.horizontalPageBreak,i=fie(t,e);e.allRows().forEach(function(s){for(var a=0,o=e.columns;a<o.length;a++){var l=o[a],u=s.cells[l.index];if(u){var d=e.hooks.didParseCell;e.callCellHooks(t,d,u,s,l,null);var h=u.padding("horizontal");u.contentWidth=MT(u.text,u.styles,t)+h;var p=MT(u.text.join(" ").split(/[^\S\u00A0]+/),u.styles,t);if(u.minReadableWidth=p+u.padding("horizontal"),typeof u.styles.cellWidth=="number")u.minWidth=u.styles.cellWidth,u.wrappedWidth=u.styles.cellWidth;else if(u.styles.cellWidth==="wrap"||r===!0)u.contentWidth>i?(u.minWidth=i,u.wrappedWidth=i):(u.minWidth=u.contentWidth,u.wrappedWidth=u.contentWidth);else{var f=10/n;u.minWidth=u.styles.minCellWidth||f,u.wrappedWidth=u.contentWidth,u.minWidth>u.wrappedWidth&&(u.wrappedWidth=u.minWidth)}}}}),e.allRows().forEach(function(s){for(var a=0,o=e.columns;a<o.length;a++){var l=o[a],u=s.cells[l.index];if(u&&u.colSpan===1)l.wrappedWidth=Math.max(l.wrappedWidth,u.wrappedWidth),l.minWidth=Math.max(l.minWidth,u.minWidth),l.minReadableWidth=Math.max(l.minReadableWidth,u.minReadableWidth);else{var d=e.styles.columnStyles[l.dataKey]||e.styles.columnStyles[l.index]||{},h=d.cellWidth||d.minCellWidth;h&&typeof h=="number"&&(l.minWidth=h,l.wrappedWidth=h)}u&&(u.colSpan>1&&!l.minWidth&&(l.minWidth=u.minWidth),u.colSpan>1&&!l.wrappedWidth&&(l.wrappedWidth=u.minWidth))}})}function D4(t,e,n){for(var r=e,i=t.reduce(function(f,m){return f+m.wrappedWidth},0),s=0;s<t.length;s++){var a=t[s],o=a.wrappedWidth/i,l=r*o,u=a.width+l,d=n(a),h=u<d?d:u;e-=h-a.width,a.width=h}if(e=Math.round(e*1e10)/1e10,e){var p=t.filter(function(f){return e<0?f.width>n(f):!0});p.length&&(e=D4(p,e,n))}return e}function YMe(t){for(var e={},n=1,r=t.allRows(),i=0;i<r.length;i++)for(var s=r[i],a=0,o=t.columns;a<o.length;a++){var l=o[a],u=e[l.index];if(n>1)n--,delete s.cells[l.index];else if(u)u.cell.height+=s.height,n=u.cell.colSpan,delete s.cells[l.index],u.left--,u.left<=1&&delete e[l.index];else{var d=s.cells[l.index];if(!d)continue;if(d.height=s.height,d.rowSpan>1){var h=r.length-i,p=d.rowSpan>h?h:d.rowSpan;e[l.index]={cell:d,left:p,row:s}}}}}function JMe(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var r=e[n],i=null,s=0,a=0,o=0;o<t.columns.length;o++){var l=t.columns[o];if(a-=1,a>1&&t.columns[o+1])s+=l.width,delete r.cells[l.index];else if(i){var u=i;delete r.cells[l.index],i=null,u.width=l.width+s}else{var u=r.cells[l.index];if(!u)continue;if(a=u.colSpan,s=0,u.colSpan>1){i=u,s+=l.width;continue}u.width=l.width+s}}}function ZMe(t,e){for(var n={count:0,height:0},r=0,i=t.allRows();r<i.length;r++){for(var s=i[r],a=0,o=t.columns;a<o.length;a++){var l=o[a],u=s.cells[l.index];if(u){e.applyStyles(u.styles,!0);var d=u.width-u.padding("horizontal");if(u.styles.overflow==="linebreak")u.text=e.splitTextToSize(u.text,d+1/e.scaleFactor(),{fontSize:u.styles.fontSize});else if(u.styles.overflow==="ellipsize")u.text=IG(u.text,d,u.styles,e,"...");else if(u.styles.overflow==="hidden")u.text=IG(u.text,d,u.styles,e,"");else if(typeof u.styles.overflow=="function"){var h=u.styles.overflow(u.text,d);typeof h=="string"?u.text=[h]:u.text=h}u.contentHeight=u.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var p=u.contentHeight/u.rowSpan;u.rowSpan>1&&n.count*n.height<p*u.rowSpan?n={height:p,count:u.rowSpan}:n&&n.count>0&&n.height>p&&(p=n.height),p>s.height&&(s.height=p)}}n.count--}}function IG(t,e,n,r,i){return t.map(function(s){return QMe(s,e,n,r,i)})}function QMe(t,e,n,r,i){var s=1e4*r.scaleFactor();if(e=Math.ceil(e*s)/s,e>=MT(t,n,r))return t;for(;e<MT(t+i,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i}function yie(t,e){var n=new cb(t),r=e3e(e,n.scaleFactor()),i=new $Me(e,r);return qMe(n,i),n.applyStyles(n.userStyles),i}function e3e(t,e){var n=t.content,r=n3e(n.columns);if(n.head.length===0){var i=DG(r,"head");i&&n.head.push(i)}if(n.foot.length===0){var i=DG(r,"foot");i&&n.foot.push(i)}var s=t.settings.theme,a=t.styles;return{columns:r,head:uj("head",n.head,r,a,s,e),body:uj("body",n.body,r,a,s,e),foot:uj("foot",n.foot,r,a,s,e)}}function uj(t,e,n,r,i,s){var a={},o=e.map(function(l,u){for(var d=0,h={},p=0,f=0,m=0,x=n;m<x.length;m++){var v=x[m];if(a[v.index]==null||a[v.index].left===0)if(f===0){var g=void 0;Array.isArray(l)?g=l[v.index-p-d]:g=l[v.dataKey];var b={};typeof g=="object"&&!Array.isArray(g)&&(b=(g==null?void 0:g.styles)||{});var y=r3e(t,v,u,i,r,s,b),S=new vie(g,y,t);h[v.dataKey]=S,h[v.index]=S,f=S.colSpan-1,a[v.index]={left:S.rowSpan-1,times:f}}else f--,p++;else a[v.index].left--,f=a[v.index].times,d++}return new xie(l,u,t,h)});return o}function DG(t,e){var n={};return t.forEach(function(r){if(r.raw!=null){var i=t3e(e,r.raw);i!=null&&(n[r.dataKey]=i)}}),Object.keys(n).length>0?n:null}function t3e(t,e){if(t==="head"){if(typeof e=="object")return e.header||null;if(typeof e=="string"||typeof e=="number")return e}else if(t==="foot"&&typeof e=="object")return e.footer;return null}function n3e(t){return t.map(function(e,n){var r,i;return typeof e=="object"?i=(r=e.dataKey)!==null&&r!==void 0?r:n:i=n,new KMe(i,e,n)})}function r3e(t,e,n,r,i,s,a){var o=jMe(r),l;t==="head"?l=i.headStyles:t==="body"?l=i.bodyStyles:t==="foot"&&(l=i.footStyles);var u=yf({},o.table,o[t],i.styles,l),d=i.columnStyles[e.dataKey]||i.columnStyles[e.index]||{},h=t==="body"?d:{},p=t==="body"&&n%2===0?yf({},o.alternateRow,i.alternateRowStyles):{},f=RMe(s),m=yf({},f,u,p,h);return yf(m,a)}function i3e(t,e,n){var r;n===void 0&&(n={});var i=fie(t,e),s=new Map,a=[],o=[],l=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?l=e.settings.horizontalPageBreakRepeat:(typeof e.settings.horizontalPageBreakRepeat=="string"||typeof e.settings.horizontalPageBreakRepeat=="number")&&(l=[e.settings.horizontalPageBreakRepeat]),l.forEach(function(p){var f=e.columns.find(function(m){return m.dataKey===p||m.index===p});f&&!s.has(f.index)&&(s.set(f.index,!0),a.push(f.index),o.push(e.columns[f.index]),i-=f.wrappedWidth)});for(var u=!0,d=(r=n==null?void 0:n.start)!==null&&r!==void 0?r:0;d<e.columns.length;){if(s.has(d)){d++;continue}var h=e.columns[d].wrappedWidth;
772if(u||i>=h)u=!1,a.push(d),o.push(e.columns[d]),i-=h;else break;d++}return{colIndexes:a,columns:o,lastIndex:d-1}}function s3e(t,e){for(var n=[],r=0;r<e.columns.length;r++){var i=i3e(t,e,{start:r});i.columns.length&&(n.push(i),r=i.lastIndex)}return n}function bie(t,e){var n=e.settings,r=n.startY,i=n.margin,s={x:i.left,y:r},a=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),o=r+i.bottom+a;if(n.pageBreak==="avoid"){var l=e.body,u=l.reduce(function(p,f){return p+f.height},0);o+=u}var d=new cb(t);(n.pageBreak==="always"||n.startY!=null&&o>d.pageSize().height)&&(_ie(d),s.y=i.top),e.callWillDrawPageHooks(d,s);var h=yf({},s);e.startPageNumber=d.pageNumber(),n.horizontalPageBreak?a3e(d,e,h,s):(d.applyStyles(d.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&e.head.forEach(function(p){return Df(d,e,p,s,e.columns)}),d.applyStyles(d.userStyles),e.body.forEach(function(p,f){var m=f===e.body.length-1;RT(d,e,p,m,h,s,e.columns)}),d.applyStyles(d.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&e.foot.forEach(function(p){return Df(d,e,p,s,e.columns)})),die(d,e,h,s),e.callEndPageHooks(d,s),e.finalY=s.y,t.lastAutoTable=e,d.applyStyles(d.userStyles)}function a3e(t,e,n,r){var i=s3e(t,e),s=e.settings;if(s.horizontalPageBreakBehaviour==="afterAllRows")i.forEach(function(u,d){t.applyStyles(t.userStyles),d>0?i2(t,e,n,r,u.columns,!0):BG(t,e,r,u.columns),o3e(t,e,n,r,u.columns),dj(t,e,r,u.columns)});else for(var a=-1,o=i[0],l=function(){var u=a;if(o){t.applyStyles(t.userStyles);var d=o.columns;a>=0?i2(t,e,n,r,d,!0):BG(t,e,r,d),u=FG(t,e,a+1,r,d),dj(t,e,r,d)}var h=u-a;i.slice(1).forEach(function(p){t.applyStyles(t.userStyles),i2(t,e,n,r,p.columns,!0),FG(t,e,a+1,r,p.columns,h),dj(t,e,r,p.columns)}),a=u};a<e.body.length-1;)l()}function BG(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),(i.showHead==="firstPage"||i.showHead==="everyPage")&&e.head.forEac
772h(function(s){return Df(t,e,s,n,r)})}function o3e(t,e,n,r,i){t.applyStyles(t.userStyles),e.body.forEach(function(s,a){var o=a===e.body.length-1;RT(t,e,s,o,n,r,i)})}function FG(t,e,n,r,i,s){t.applyStyles(t.userStyles),s=s??e.body.length;var a=Math.min(n+s,e.body.length),o=-1;return e.body.slice(n,a).forEach(function(l,u){var d=n+u===e.body.length-1,h=wie(t,e,d,r);l.canEntireRowFit(h,i)&&(Df(t,e,l,r,i),o=n+u)}),o}function dj(t,e,n,r){var i=e.settings;t.applyStyles(t.userStyles),(i.showFoot==="lastPage"||i.showFoot==="everyPage")&&e.foot.forEach(function(s){return Df(t,e,s,n,r)})}function l3e(t,e,n){var r=n.getLineHeight(t.styles.fontSize),i=t.padding("vertical"),s=Math.floor((e-i)/r);return Math.max(0,s)}function c3e(t,e,n,r){var i={};t.spansMultiplePages=!0,t.height=0;for(var s=0,a=0,o=n.columns;a<o.length;a++){var l=o[a],u=t.cells[l.index];if(u){Array.isArray(u.text)||(u.text=[u.text]);var d=new vie(u.raw,u.styles,u.section);d=yf(d,u),d.text=[];var h=l3e(u,e,r);u.text.length>h&&(d.text=u.text.splice(h,u.text.length));var p=r.scaleFactor(),f=r.getLineHeightFactor();u.contentHeight=u.getContentHeight(p,f),u.contentHeight>=e&&(u.contentHeight=e,d.styles.minCellHeight-=e),u.contentHeight>t.height&&(t.height=u.contentHeight),d.contentHeight=d.getContentHeight(p,f),d.contentHeight>s&&(s=d.contentHeight),i[l.index]=d}}var m=new xie(t.raw,-1,t.section,i,!0);m.height=s;for(var x=0,v=n.columns;x<v.length;x++){var l=v[x],d=m.cells[l.index];d&&(d.height=m.height);var u=t.cells[l.index];u&&(u.height=t.height)}return m}function u3e(t,e,n,r){var i=t.pageSize().height,s=r.settings.margin,a=s.top+s.bottom,o=i-a;e.section==="body"&&(o-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var l=e.getMinimumRowHeight(r.columns,t),u=l<n;if(l>o)return console.log("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!u)return!1;var d=e.hasRowSpan(r.columns),h=e.getMaxCellHeight(r.columns)>o;return h?(d&&console.log("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(d||r.settings.rowPageBreak==="avoid")}function RT(t,e,n,r,i,s,a){var o=wie(t,e,r,s);if(n.canEntireRowFit(o,a))Df(t,e,n,s,a);else if(u3e(t,n,o,e)){var l=c3e(n,o,e,t);Df(t,e,n,s,a),i2(t,e,i,s,a),RT(t,e,l,r,i,s,a)}else i2(t,e,i,s,a),RT(t,e,n,r,i,s,a)}function Df(t,e,n,r,i){r.x=e.settings.margin.left;for(var s=0,a=i;s<a.length;s++){var o=a[s],l=n.cells[o.index];if(!l){r.x+=o.width;continue}t.applyStyles(l.styles),l.x=r.x,l.y=r.y;var u=e.callCellHooks(t,e.hooks.willDrawCell,l,n,o,r);if(u===!1){r.x+=o.width;continue}d3e(t,l,r);var d=l.getTextPos();lie(l.text,d.x,d.y,{halign:l.styles.halign,valign:l.styles.valign,maxWidth:Math.ceil(l.width-l.padding("left")-l.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,l,n,o,r),r.x+=o.width}r.y+=n.height}function d3e(t,e,n){var r=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),typeof r.lineWidth=="number"){var i=hie(r.lineWidth,r.fillColor);i&&t.rect(e.x,n.y,e.width,e.height,i)}else typeof r.lineWidth=="object"&&(r.fillColor&&t.rect(e.x,n.y,e.width,e.height,"F"),h3e(t,e,n,r.lineWidth))}function h3e(t,e,n,r){var i,s,a,o;r.top&&(i=n.x,s=n.y,a=n.x+e.width,o=n.y,r.right&&(a+=.5*r.right),r.left&&(i-=.5*r.left),l(r.top,i,s,a,o)),r.bottom&&(i=n.x,s=n.y+e.height,a=n.x+e.width,o=n.y+e.height,r.right&&(a+=.5*r.right),r.left&&(i-=.5*r.left),l(r.bottom,i,s,a,o)),r.left&&(i=n.x,s=n.y,a=n.x,o=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(o+=.5*r.bottom),l(r.left,i,s,a,o)),r.right&&(i=n.x+e.width,s=n.y,a=n.x+e.width,o=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(o+=.5*r.bottom),l(r.right,i,s,a,o));function l(u,d,h,p,f){t.getDocument().setLineWidth(u),t.getDocument().line(d,h,p,f,"S")}}function wie(t,e,n,r){var i=e.settings.margin.bottom,s=e.settings.showFoot;return(s==="everyPage"||s==="lastPage"&&n)&&(i+=e.getFootHeight(e.columns)),t.pageSize().height-r.y-i}function i2(t,e,n,r,i,s){i===void 0&&(i=[]),s===void 0&&(s=!1),t.applyStyles(t.userStyles),e.settings.showFoot==="everyPage"&&!s&&e.foot.forEach(function(o){return Df(t,e,o,r,i)}),e.callEndPageHooks(t,r);var a=e.settings.margin;die(t,e,n,r),_ie(t),e.pageNumber++,r.x=a.left,r.y=a.top,n.y=a.top,e.callWillDrawPageHooks(t,r),e.settings.showHead==="everyPage"&&(e.head.forEac
772h(function(o){return Df(t,e,o,r,i)}),t.applyStyles(t.userStyles))}function _ie(t){var e=t.pageNumber();t.setPage(e+1);var n=t.pageNumber();return n===e?(t.addPage(),!0):!1}function f3e(t){t.API.autoTable=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],i=gie(this,r),s=yie(this,i);return bie(this,s),this},t.API.lastAutoTable=!1,t.API.autoTableText=function(e,n,r,i){lie(e,n,r,i,this)},t.API.autoTableSetDefaults=function(e){return cb.setDefaults(e,this),this},t.autoTableSetDefaults=function(e,n){cb.setDefaults(e,n)},t.API.autoTableHtmlToJson=function(e,n){var r;if(n===void 0&&(n=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var i=new cb(this),s=mie(i,e,window,n,!1),a=s.head,o=s.body,l=((r=a[0])===null||r===void 0?void 0:r.map(function(u){return u.content}))||[];return{columns:l,rows:o,data:o}}}var hj;function jT(t,e){var n=gie(t,e),r=yie(t,n);bie(t,r)}try{if(typeof window<"u"&&window){var OG=window,zG=OG.jsPDF||((hj=OG.jspdf)===null||hj===void 0?void 0:hj.jsPDF);zG&&f3e(zG)}}catch(t){console.error("Could not apply autoTable plugin",t)}const p3e=[120,173,72],m3e=[210,31,81],qw=t=>t.toLocaleString("de-DE",{style:"currency",currency:"EUR"});async function g3e(t){try{const e=await fetch(t);if(!e.ok)return null;const n=await e.blob();return new Promise(r=>{const i=new FileReader;i.onloadend=()=>r(i.result),i.onerror=()=>r(null),i.readAsDataURL(n)})}catch{return null}}async function x3e(t){const e=new Pn({orientation:"portrait",unit:"mm",format:"a4"}),n=e.internal.pageSize.getWidth(),r=18;let i=14;const s=t.shop==="messebau",a=s?m3e:p3e,o=await g3e(s?"/messebau-logo.png":"/ladenbau-logo.png");o?s?e.addImage(o,"PNG",r,i+1,45,10.2):e.addImage(o,"PNG",r,i,45,12):(e.setFontSize(14),e.setTextColor(...a),e.text(s?"messebau.de":"ladenbau.de",r,i+8)),e.setFontSize(9),e.setTextColor(120),e.text(new Date().toLocaleDateString("de-DE"),n-r,i+8,{align:"right"}),i+=16,e.setDrawColor(...a),e.setLineWidth(.8),e.line(r,i,n-r,i),i+=8,e.setFontSize(15),e.setTextColor(30),e.text(`Angebots-Anfrage · ${t.konfiguratorName}`,r,i),i+=6,e.setFontSize(9),e.setTextColor(120),e.text(`Anfrage-ID: ${t.anfrageId}`,r,i),t.identifier&&e.text(`Kennung: ${t.identifier}`,n-r,i,{align:"right"}),i+=8,e.setFontSize(11),e.setTextColor(...a),e.text("Kundendaten",r,i),i+=5,e.setTextColor(40),e.setFontSize(10);const l=t.kunde,u=[`${l.vorname} ${l.nachname}${l.firma?` · ${l.firma}`:""}`,`${l.strasse}`,`${l.plz} ${l.ort}`,`E-Mail: ${l.email}`,`Telefon: ${l.telefon}`];for(const x of u)e.text(x,r,i),i+=5;if(l.nachricht){i+=2,e.setFontSize(9),e.setTextColor(80),e.text("Nachricht:",r,i),i+=4;const x=e.splitTextToSize(l.nachricht,n-2*r);e.text(x,r,i),i+=x.length*4}i+=4,t.konfiguration.length>0&&(e.setFontSize(11),e.setTextColor(...a),e.text("Konfiguration",r,i),i+=2,jT(e,{startY:i+2,margin:{left:r,right:r},head:[["Eigenschaft","Wert"]],body:t.konfiguration.map(x=>[x.label,x.value]),headStyles:{fillColor:[a[0],a[1],a[2]],fontSize:9},bodyStyles:{fontSize:9,textColor:40},styles:{cellPadding:1.5},theme:"striped"}),i=e.lastAutoTable.finalY+8),e.setFontSize(11),e.setTextColor(...a),e.text("Lieferumfang",r,i),jT(e,{startY:i+2,margin:{left:r,right:r},head:[["SKU","Artikel","Menge","Einzelpreis","Gesamtpreis"]],body:t.positionen.map(x=>[x.sku,x.artikelname,String(x.menge),qw(x.einzelpreis),qw(x.gesamtpreis)]),headStyles:{fillColor:[a[0],a[1],a[2]],fontSize:9},bodyStyles:{fontSize:9,textColor:40},columnStyles:{2:{halign:"right"},3:{halign:"right"},4:{halign:"right"}},styles:{cellPadding:1.5},theme:"striped"}),i=e.lastAutoTable.finalY+6;const d=t.mwstSatz??0,h=t.gesamtNetto*(1+d);e.setFontSize(10),e.setTextColor(40);const p=n-r;e.text(`Netto: ${qw(t.gesamtNetto)}`,p,i,{align:"right"}),i+=5,d>0&&(e.text(`zzgl. MwSt. (${Math.round(d*100)}%): ${qw(t.gesamtNetto*d)}`,p,i,{align:"right"}),i+=5,e.setFontSize(11),e.setTextColor(...a),e.text(`Brutto: ${qw(h)}`,p,i,{align:"right"}),i+=6),e.setFontSize(8),e.setTextColor(120),e.text("Unverbindliche Angebots-Anfrage · zzgl. Versandkosten · Preise vorbehaltlich Prüfung durch den Kundenservice.",r,i+6);const f=e.output("blob"),m=e.output("datauristring").split(",")[1]??"";return{blob:f,base64:m}}const UG="https://regalify-pro.lovable.app",v3e="https://www.ladenbau.de/agb/",y3e=wCe({vorname:Xh().trim().min(1,"Vorname ist erforderlich").max(100),nachname:Xh().trim().min(1,"Nachname ist erforderlich").max(100),email:Xh().trim().email("Ungültige E-Mail").max(255),telefon:Xh().trim().min(4,"Telefonnummer ist erforderlich").max(50),strasse:Xh().trim().min(3,"StraÃe & Hausnummer ist erforderlich").max(200),plz:Xh().trim().min(4,"PLZ ist erforderlich").max(10),ort:Xh().trim().min(2,"Ort ist erforderlich").max(100),firma:Xh().trim().max(150).optional().or(uH("")),nachricht:Xh().trim().max(2e3).optional().or(uH(""))}),HG={vorname:"",nachname:"",email:"",telefon:"",strasse:"",plz:"",ort:"",firma:"",nachricht:""};function b3e(){if(typeof crypto<"u"&&"getRandomValues"in crypto){const t=new Uint8Array(4);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("").toUpperCase()}return Math.random().toString(16).slice(2,10).toUpperCase()}function Px({open:t,onOpenChange:e,konfiguratorName:n,konfiguratorTyp:r,konfigurationSnapshot:i,regalTyp:s,buildPdfInput:a}){const[o,l]=E.useState(HG),[u,d]=E.useState(!1),[h,p]=E.useState(!1),[f,m]=E.useState({}),[x,v]=E.useState(null),[g,b]=E.useState(null),[y,S]=E.useState(!1),[A,k]=E.useState(!0),[M,T]=E.useState(!1),[C,R]=E.useState(!1),P=E.useRef(null),j=E.useRef(null),G=Hne();g&&r&&`${UG}${nS(r,s??null,g)}`;function B(W,O){l(Y=>({...Y,[W]:O})),f[W]&&m(Y=>{const z={...Y};return delete z[W],z})}function $(W){T(W),W&&R(!1)}async function U(W){if(W.preventDefault(),!M){R(!0),requestAnimationFrame(()=>{var I,q;(I=P.current)==null||I.scrollIntoView({behavior:"smooth",block:"center"}),(q=P.current)==null||q.focus()});return}const O=y3e.safeParse(o);if(!O.success){const I={};for(const q of O.error.issues){const te=String(q.path[0]);I[te]||(I[te]=q.message)}m(I),dn({title:"Bitte Pflichtfelder prüfen",description:"Adresse und Telefon sind für ein Angebot erforderlich.",variant:"destructive"});return}m({}),d(!0);const Y=O.data,z=b3e();try{const I=a(Y,z),q=$ke(),te={...I,shop:q,kunde:I.kunde??{vorname:Y.vorname,nachname:Y.nachname,email:Y.email,telefon:Y.telefon,strasse:Y.strasse,plz:Y.plz,ort:Y.ort,firma:Y.firma||void 0,nachricht:Y.nachricht||void 0}},se=r&&i?cte(r,i()).catch(K=>(console.warn("Konfiguration konnte nicht gespeichert werden:",K),null)):Promise.resolve(null),[{base64:ie},le]=await Promise.all([x3e(te),se]),xe=(le==null?void 0:le.kurzCode)??null;xe&&b(xe);const Ee=xe&&r?`${UG}${nS(r,s??null,xe)}`:null,ae=`angebot-${n.toLowerCase().replace(/[^a-z0-9]+/g,"-")}-${z}.pdf`,{data:Q,error:we}=await Ot.functions.invoke("send-angebot-anfrage",{body:{konfigurator:n,shop:q,pdfBase64:ie,dateiname:ae,datenschutzAkzeptiert:!0,kunde:{vorname:Y.vorname,nachname:Y.nachname,email:Y.email,telefon:Y.telefon,firma:Y.firma||void 0,strasse:Y.strasse,plz:Y.plz,ort:Y.ort,nachricht:Y.nachricht||void 0},kurzCode:xe,konfiguratorLink:Ee,identifier:te.identifier??null,konfigurationsZusammenfassung:te.konfiguration,positionen:te.positionen.map(K=>({sku:K.sku,artikelname:K.artikelname,menge:K.menge,einzelpreis:K.einzelpreis,gesamt:K.gesamtpreis})),gesamtNetto:te.gesamtNetto,mwstSatz:te.mwstSatz??.19}}),Ae=!we&&!!Q&&Q.mailVersendet!==!1;
772if(k(Ae),!Ae){const K=we?"Verbindung zum Mailversand fehlgeschlagen":(Q==null?void 0:Q.mailFehler)??"Unbekannter Fehler";console.warn("Mailversand fehlgeschlagen:",K),dn({title:"Anfrage konnte nicht versendet werden",description:"Bitte versuchen Sie es erneut oder kontaktieren Sie uns telefonisch.",variant:"destructive"}),d(!1);return}}catch(I){console.error("Anfrage fehlgeschlagen:",I),k(!1),dn({title:"Anfrage konnte nicht versendet werden",description:"Bitte versuchen Sie es erneut.",variant:"destructive"}),d(!1);return}d(!1),v(z),p(!0),G.markAnfrage()}async function Z(W){var Y,z,I,q;if(!(()=>{try{return window.top!==window.self}catch{return!0}})()&&((Y=navigator.clipboard)!=null&&Y.writeText)&&window.isSecureContext)try{return await navigator.clipboard.writeText(W),!0}catch{}try{const te=j.current??document.body,se=document.createElement("textarea");se.value=W,se.style.position="absolute",se.style.left="-9999px",se.style.top="0",se.setAttribute("aria-hidden","true"),te.appendChild(se);const ie=document.activeElement;se.focus({preventScroll:!0}),se.select(),se.setSelectionRange(0,W.length);let le=!1;try{le=document.execCommand("copy")}catch{le=!1}const xe=(((z=document.getSelection())==null?void 0:z.toString())??"")===W;if(se.remove(),(I=ie==null?void 0:ie.focus)==null||I.call(ie,{preventScroll:!0}),le&&xe)return!0}catch{}if((q=navigator.clipboard)!=null&&q.writeText)try{return await navigator.clipboard.writeText(W),!0}catch{}return!1}async function V(){if(!g)return;await Z(g)?(S(!0),setTimeout(()=>S(!1),2e3)):dn({title:"Kopieren fehlgeschlagen",description:"Bitte den Code manuell markieren und kopieren.",variant:"destructive"})}return c.jsx(qf,{open:t,onOpenChange:W=>{e(W),W||(p(!1),l(HG),v(null),b(null),k(!0),T(!1),R(!1))},children:c.jsxs(jh,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[c.jsx(Xf,{children:c.jsx(Yf,{children:"Angebot anfordern"})}),h?c.jsxs("div",{className:"space-y-4 py-2",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-[#28A745] font-semibold text-lg mb-2",children:"Vielen Dank!"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ihre Anfrage zum ",n," wurde an unseren Kundenservice weitergeleitet. Wir melden uns innerhalb von 1â2 Werktagen mit einem unverbindlichen Angebot."]})]}),!A&&c.jsx("div",{className:"rounded-lg border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900",children:"Hinweis: Die Anfrage konnte technisch nicht weitergeleitet werden. Bitte versuchen Sie es erneut oder kontaktieren Sie uns telefonisch."}),x&&c.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3 text-center",children:[c.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Ihre Referenz"}),c.jsx("p",{className:"font-mono font-semibold tracking-wider mt-1",children:x})]}),g&&c.jsxs("div",{ref:j,className:"relative rounded-lg border-2 border-primary/30 bg-primary/5 p-4 text-center",children:[c.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-1",children:"Code zum Wiederladen Ihrer Konfiguration"}),c.jsx("p",{className:"text-2xl font-bold font-mono tracking-[0.2em] text-primary mb-2 select-all cursor-text",children:mT(g)}),c.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:c.jsx(Pt,{size:"sm",variant:"outline",onClick:V,children:y?c.jsxs(c.Fragment,{children:[c.jsx(ti,{className:"w-4 h-4 mr-1.5"})," Kopiert"]}):c.jsxs(c.Fragment,{children:[c.jsx(oF,{className:"w-4 h-4 mr-1.5"})," Code kopieren"]})})}),c.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"90 Tage gültig · verlängert sich bei jedem Aufruf"})]}),c.jsx(Pt,{onClick:()=>e(!1),className:"w-full",children:"SchlieÃen"})]}):c.jsxs("form",{onSubmit:U,className:"space-y-3",noValidate:!0,children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx(Zh,{label:"Vorname *",error:f.vorname,children:c.jsx(yr,{required:!0,value:o.vorname,onChange:W=>B("vorname",W.target.value)})}),c.jsx(Zh,{label:"Nachname *",error:f.nachname,children:c.jsx(yr,{required:!0,value:o.nachname,onChange:W=>B("nachname",W.target.value)})})]}),c.jsx(Zh,{label:"E-Mail *",error:f.email,children:c.jsx(yr,{required:!0,type:"email",value:o.email,onChange:W=>B("email",W.target.value)})}),c.jsx(Zh,{label:"Telefon *",error:f.telefon,children:c.jsx(yr,{required:!0,type:"tel",value:o.telefon,onChange:W=>B("telefon",W.target.value)})}),c.jsx(Zh,{label:"Firma (optional)",error:f.firma,children:c.jsx(yr,{value:o.firma,onChange:W=>B("firma",W.target.value)})}),c.jsx(Zh,{label:"StraÃe & Hausnummer *",error:f.strasse,children:c.jsx(yr,{required:!0,value:o.strasse,onChange:W=>B("strasse",W.target.value)})}),c.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[c.jsx(Zh,{label:"PLZ *",error:f.plz,children:c.jsx(yr,{required:!0,value:o.plz,onChange:W=>B("plz",W.target.value)})}),c.jsx("div",{className:"col-span-2",children:c.jsx(Zh,{label:"Ort *",error:f.ort,children:c.jsx(yr,{required:!0,value:o.ort,onCh
772ange:W=>B("ort",W.target.value)})})})]}),c.jsx(Zh,{label:"Nachricht",error:f.nachricht,children:c.jsx(pA,{rows:3,value:o.nachricht,onChange:W=>B("nachricht",W.target.value)})}),c.jsxs("div",{className:rn("rounded-md border p-3 transition-colors",C?"border-destructive bg-destructive/5":"border-transparent"),children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(G0,{id:"datenschutz-akzeptiert",ref:P,checked:M,onCheckedChange:W=>$(W===!0),"aria-invalid":C||void 0,"aria-describedby":C?"datenschutz-fehler":void 0,className:rn("mt-0.5",C&&"border-destructive data-[state=checked]:bg-destructive")}),c.jsxs(Vn,{htmlFor:"datenschutz-akzeptiert",className:rn("text-sm leading-snug cursor-pointer font-normal",C&&"text-destructive"),children:["Ich habe die"," ",c.jsx("a",{href:"https://www.ladenbau.de/datenschutz/",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",onClick:W=>W.stopPropagation(),children:"Datenschutzbestimmung"})," ","und die"," ",c.jsx("a",{href:v3e,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",onClick:W=>W.stopPropagation(),children:"AGB"})," ","zur Kenntnis genommen und bin mit ihnen einverstanden."]})]}),C&&c.jsx("p",{id:"datenschutz-fehler",className:"text-xs text-destructive mt-2 ml-6",role:"alert",children:"Bitte bestätigen Sie die Datenschutzbestimmungen und AGB, um Ihre Anfrage zu senden."})]}),c.jsx(Pt,{type:"submit",disabled:u,className:"w-full",children:u?"Wird gesendetâ¦":"Angebot anfordern"})]})]})})}function Zh({label:t,error:e,children:n}){return c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm",children:t}),n,e&&c.jsx("p",{className:"text-xs text-destructive mt-1",children:e})]})}function w3e({open:t,onOpenChange:e,konfigurator:n,regalTyp:r,getKonfiguration:i,schemaVersion:s=1}){const[a,o]=E.useState(!1),[l,u]=E.useState(null),[d,h]=E.useState(null),[p,f]=E.useState(!1),m=E.useRef(null),x=Hne();async function v(){o(!0);try{const{kurzCode:S,expiresAt:A}=await cte(n,i(),s,r??null);u(S),h(A),x.markGespeichert()}catch(S){dn({title:"Speichern fehlgeschlagen",description:S instanceof Error?S.message:"Bitte erneut versuchen.",variant:"destructive"})}finally{o(!1)}}async function g(S){var k,M,T,C;if(!(()=>{try{return window.top!==window.self}catch{return!0}})()&&((k=navigator.clipboard)!=null&&k.writeText)&&window.isSecureContext)try{return await navigator.clipboard.writeText(S),!0}catch{}try{const R=m.current??document.body,P=document.createElement("textarea");P.value=S,P.style.position="absolute",P.style.left="-9999px",P.style.top="0",P.setAttribute("aria-hidden","true"),R.appendChild(P);const j=document.activeElement;P.focus({preventScroll:!0}),P.select(),P.setSelectionRange(0,S.length);let G=!1;try{G=document.execCommand("copy")}catch{G=!1}const B=(((M=document.getSelection())==null?void 0:M.toString())??"")===S;if(P.remove(),(T=j==null?void 0:j.focus)==null||T.call(j,{preventScroll:!0}),G&&B)return!0}catch{}if((C=navigator.clipboard)!=null&&C.writeText)try{return await navigator.clipboard.writeText(S),!0}catch{}return!1}async function b(){if(!l)return;await g(l)?(f(!0),setTimeout(()=>f(!1),2e3)):dn({title:"Kopieren fehlgeschlagen",description:"Bitte den Code manuell markieren und kopieren.",variant:"destructive"})}function y(){u(null),h(null),f(!1)}return c.jsx(qf,{open:t,onOpenChange:S=>{e(S),S||y()},children:c.jsxs(jh,{className:"max-w-md",children:[c.jsxs(Xf,{children:[c.jsx(Yf,{children:"Konfiguration speichern"}),c.jsx(D1,{children:l?"Notieren Sie Ihren persönlichen Code. Damit können Sie Ihre Konfiguration jederzeit wieder aufrufen.":"Sie erhalten einen 8-stelligen Code, mit dem Sie Ihre Konfiguration später wieder laden können. Es werden keine persönlichen Daten gespeichert."})]}),l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{ref:m,className:"relative rounded-lg border-2 border-primary/30 bg-primary/5 p-6 text-center",children:[c.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-2",children:"Ihr Code"}),c.jsx("p",{className:"text-3xl font-bold font-mono tracking-[0.2em] text-primary select-all cursor-text",children:mT(l)}),d&&c.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:["Gültig bis ",new Date(d).toLocaleDateString("de-DE")," · verlängert sich bei jedem Aufruf um 90 Tage"]})]}),c.jsx(Pt,{onClick:b,variant:"outline",className:"w-full",children:p?c.jsxs(c.Fragment,{children:[c.jsx(ti,{className:"w-4 h-4 mr-2"}),"Kopiert"]}):c.jsxs(c.Fragment,{children:[c.jsx(oF,{className:"w-4 h-4 mr-2"}
772),"Code kopieren"]})}),c.jsx(Pt,{onClick:()=>e(!1),className:"w-full",children:"SchlieÃen"})]}):c.jsxs("div",{className:"space-y-3 py-2",children:[c.jsxs(Pt,{onClick:v,disabled:a,className:"w-full",size:"lg",children:[c.jsx(I2,{className:"w-4 h-4 mr-2"}),a?"Wird gespeichertâ¦":"Jetzt speichern"]}),c.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Speicherung 90 Tage gültig · keine E-Mail erforderlich"})]})]})})}function Bf({konfigurator:t,regalTyp:e,getKonfiguration:n,schemaVersion:r,disabled:i,variant:s="outline",size:a="default",className:o}){const[l,u]=E.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs(Pt,{type:"button",variant:s,size:a,className:o,disabled:i,onClick:()=>u(!0),children:[c.jsx(I2,{className:"w-4 h-4 mr-2"}),"Konfiguration speichern"]}),c.jsx(w3e,{open:l,onOpenChange:u,konfigurator:t,regalTyp:e,getKonfiguration:n,schemaVersion:r})]})}const GG={GL:"Glatt",RL:"Rundlochung",SL:"Schlüsselloch"},Rg=[120,173,72];async function _3e(){try{const t=await fetch("/ladenbau-logo.png");if(!t.ok)return null;const e=await t.blob();return new Promise(n=>{const r=new FileReader;r.onloadend=()=>n(r.result),r.onerror=()=>
772n(null),r.readAsDataURL(e)})}catch{return null}}async function Sie(t,e,n){const r=new Pn({orientation:"portrait",unit:"mm",format:"a4"}),i=r.internal.pageSize.getWidth(),s=r.internal.pageSize.getHeight(),a=20;let o=15;const l=await _3e();l?r.addImage(l,"PNG",a,o,45,12):(r.setFontSize(14),r.setTextColor(...Rg),r.text("ladenbau.de",a,o+8)),r.setFontSize(9),r.setTextColor(120),r.text(new Date().toLocaleDateString("de-DE"),i-a,o+8,{align:"right"}),o+=16,r.setDrawColor(...Rg),r.setLineWidth(.8),r.line(a,o,i-a,o),o+=10;const u=U0[t.regaltyp]||t.regaltyp;r.setFontSize(16),r.setTextColor(30),r.text(`Tegometall ${u}-Konfiguration`,a,o),o+=8,r.setFontSize(10),r.setTextColor(120),r.text(`SET-SKU: ${e.setSku}`,a,o),o+=12,r.setFontSize(12),r.setTextColor(...Rg),r.text("Konfiguration",a,o),o+=7;const d=n?n.gesamtbreite_plus3:t.breite,h=n&&t.breite&&Math.abs(n.gesamtbreite_plus3-t.breite)>.005,p=y=>y.toLocaleString("de-DE",{minimumFractionDigits:0,maximumFractionDigits:2})+" m",f=h?`${p(d)} (Wunschbreite: ${p(t.breite)})`:p(t.breite??0),m=[];if("fachbodenTiefen"in t&&t.fachbodenTiefen&&t.fachbodenTiefen.length>0){const y=("sockelbodenTiefe"in t?t.sockelbodenTiefe:null)??t.tiefe;m.push(["Sockelbodentiefe",`${y} cm`]),m.push(["Fachbodentiefen",t.fachbodenTiefen.join(" / ")+" cm (von unten nach oben)"])}else m.push(["Tiefe",`${t.tiefe} cm`]);const x=[["Regaltyp",U0[t.regaltyp]||t.regaltyp],["Höhe",`${t.hoehe} cm`],["Gesamtbreite",f],...m,["Säulentyp",("saeulentyp"in t?t.saeulentyp:"6x3")||"6x3"],..."anzahlFachboeden"in t?[["Fachböden pro Modul",`${t.anzahlFachboeden}`]]:[],..."rueckwandtyp"in t?t.rueckwandTypen&&Array.isArray(t.rueckwandTypen)?[["Rückwand","Individuell"],["Rückwandsegmente",t.rueckwandTypen.map(y=>GG[y]||y).join(" / ")+" (von unten nach oben)"]]:[["Rückwand",GG[t.rueckwandtyp]||t.rueckwandtyp]]:[],..."rueckwandfarbe"in t?[["Rückwandfarbe",`${t.rueckwandfarbe}`]]:[],["Farbe",t.farbe],..."sockelblende"in t?[["Sockelblende",t.sockelblende?"Ja":"Nein"]]:[],..."scannerschiene"in t?[["Scannerschiene",t.scannerschiene?"Ja":"Nein"]]:[],["Module",e.modulDetails]];jT(r,{startY:o,head:[],body:x,theme:"plain",margin:{left:a,right:a},styles:{fontSize:9,cellPadding:2},columnStyles:{0:{fontStyle:"bold",cellWidth:50,textColor:[...Rg]},1:{textColor:[30,30,30]}}}),o=r.lastAutoTable.finalY+12,r.setFontSize(12),r.setTextColor(...Rg),r.text("Lieferumfang",a,o),o+=4;const v=e.positionen.filter(y=>y.anzahl>0).map(y=>[y.artikelname,y.sku,String(y.anzahl),H0(y.einzelpreis),H0(y.gesamt)]);jT(r,{startY:o,head:[["Artikel","SKU","Anz.","Einzelpreis","Gesamt"]],body:v,foot:[["","","","Gesamtpreis:",H0(e.gesamtpreis)]],margin:{left:a,right:a},theme:"striped",headStyles:{fillColor:[...Rg],fontSize:8,fontStyle:"bold",textColor:[255,255,255]},bodyStyles:{fontSize:8},footStyles:{fillColor:[240,245,235],textColor:[30,30,30],fontStyle:"bold",fontSize:10},columnStyles:{2:{halign:"right"},3:{halign:"right"},4:{halign:"right"}}});const g=s-15;r.setDrawColor(...Rg),r.setLineWidth(.8),r.line(a,g-6,i-a,g-6),r.setFontSize(8),r.setTextColor(120),r.text("Alle Preise zzgl. MwSt. und Versand. Angebot freibleibend.",a,g);const b=U0[t.regaltyp]||t.regaltyp;r.text(`ladenbau.de · Tegometall ${b}-Konfigurator`,i-a,g,{align:"right"}),r.save(`${b}-${e.setSku}.pdf`)}const qO=!1,q1=.19;function XO(t){return t.staffel_index==null||t.staffel_menge_ab==null||t.basis_einzelpreis==null||t.einzelpreis!=null&&t.basis_einzelpreis===t.einzelpreis?null:{index:t.staffel_index,menge_ab:t.staffel_menge_ab,basis_einzelpreis:t.basis_einzelpreis}}function B4(t){return Math.round(t*100)/100}function S3e(t,e=q1){const n=B4(t.reduce((i,s)=>i+(s.gesamtpreis||0),0)),r=B4(n*(1+e));return{gesamt_netto:n,gesamt_brutto:r}}function yA(t,e=q1){const{gesamt_netto:n,gesamt_brutto:r}=S3e(t,e);return{positionen:t,gesamt_netto:n,gesamt_brutto:r,mwst_satz:e}}function A3e(t){return{artikelnummer:t.sku,bezeichnung:t.artikelname,menge:t.anzahl,einzelpreis:t.einzelpreis,gesamtpreis:t.gesamt,bild_url:t.bild_url??null,produkt_url:t.produkt_url??null,warnung:t.warnung,staffel:XO(t)}}function E3e(t,e=q1){if(!t)return null;const n=t.positionen.filter(r=>r.anzahl>0).map(A3e);return yA(n,e)}function bf(t){return new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function VG(t){return new Intl.NumberFormat("de-DE",{minimumFractionDigits:0,maximumFractionDigits:2}).format(t)}function YO({positionen:t,gruppiert:e=!1,zeigeArtikelnummer:n=!0,zeigeBild:r=!0}){if(t.length===0)return c.jsx("p",{className:"text-sm text-muted-foreground",children:"Noch keine Positionen."});const i=e?Array.from(t.reduce((s,a)=>{const o=a.gruppe??"";return s.has(o)||s.set(o,[]),s.get(o).push(a),s},new Map).entries()):[["",t]];return c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b text-left text-xs uppercase tracking-wide text-muted-foreground",children:[r&&c.jsx("th",{className:"py-2 pr-2 w-12"}),c.jsx("th",{className:"py-2 pr-2",children:"Position"}),n&&c.jsx("th",{className:"py-2 pr-2 hidden md:table-cell",children:"Artikelnummer"}),c.jsx("th",{className:"py-2 pr-2 text-right",children:"Menge"}),c.jsx("th",{className:"py-2 pr-2 text-right",children:"Einzelpreis"}),c.jsx("th",{className:"py-2 text-right",children:"Gesamtpreis"})]})}),c.jsx("tbody",{children:i.map(([s,a])=>c.jsxs(E.Fragment,{children:[e&&s&&c.jsx("tr",{children:c.jsx("td",{colSpan:5+(r?1:0),className:"pt-4 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s})}),a.map((o,l)=>c.jsxs("tr",{className:"border-b last:border-0",children:[r&&c.jsx("td",{className:"py-2 pr-2",children:o.bild_url?c.jsx("img",{src:o.bild_url,alt:"",loading:"lazy",className:"h-10 w-10 rounded object-cover bg-muted"}):c.jsx("div",{className:"h-10 w-10 rounded bg-muted flex items-center justify-center",children:c.jsx(v1,{className:"h-4 w-4 text-muted-foreground
772/50"})})}),c.jsxs("td",{className:"py-2 pr-2 align-top",children:[c.jsx("div",{className:"font-medium",children:o.produkt_url?c.jsxs("a",{href:o.produkt_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-start gap-1 hover:text-primary hover:underline transition-colors",children:[c.jsx("span",{children:o.bezeichnung}),c.jsx(_d,{className:"h-3 w-3 mt-1 shrink-0 opacity-60"})]}):o.bezeichnung}),o.staffel&&c.jsxs(fl,{variant:"secondary",className:"mt-1 text-[10px]",children:["Staffel ab ",VG(o.staffel.menge_ab)," Stk."]}),o.warnung&&c.jsx("div",{className:"mt-1 text-xs text-destructive",children:o.warnung})]}),n&&c.jsx("td",{className:"py-2 pr-2 hidden md:table-cell text-muted-foreground font-mono text-xs",children:o.artikelnummer}),c.jsx("td",{className:"py-2 pr-2 text-right tabular-nums",children:VG(o.menge)}),c.jsx("td",{className:"py-2 pr-2 text-right tabular-nums",children:o.staffel&&o.staffel.basis_einzelpreis!==o.einzelpreis?c.jsxs("span",{children:[c.jsx("span",{className:"text-muted-foreground line-through mr-1",children:bf(o.staffel.basis_einzelpreis)}),bf(o.einzelpreis)]}):bf(o.einzelpreis)}),c.jsx("td",{className:"py-2 text-right tabular-nums font-medium",children:bf(o.gesamtpreis)})]},`${s}-${o.artikelnummer}-${l}`))]},s||"__none__"))})]})})}const k3e="Alle Preise zzgl. Versandkosten â diese werden individuell berechnet und im persönlichen Angebot ausgewiesen.",C3e="zzgl. MwSt. & Versand";function JO({variante:t="lang",className:e}){return c.jsx("p",{className:`text-xs text-muted-foreground ${e??""}`,children:t==="lang"?k3e:C3e})}function pM({ergebnis:t,className:e}){const n=t.gesamt_brutto-t.gesamt_netto,r=Math.round(t.mwst_satz*100);return c.jsxs("div",{className:e,children:[c.jsxs("div",{className:"flex items-center justify-between py-1 text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Gesamt netto"}),c.jsx("span",{className:"tabular-nums",children:bf(t.gesamt_netto)})]}),c.jsxs("div",{className:"flex items-center justify-between py-1 text-sm",children:[c.jsxs("span",{className:"text-muted-foreground",children:["zzgl. ",r,"% MwSt."]}),c.jsx("span",{className:"tabular-nums",children:bf(n)})]}),c.jsxs("div",{className:"mt-1 flex items-center justify-between border-t pt-2 text-base font-semibold",children:[c.jsx("span",{children:"Gesamt brutto"}),c.jsx("span",{className:"tabular-nums",children:bf(t.gesamt_brutto)})]}),c.jsx(JO,{className:"mt-2"})]})}async function N3e(t){const e=new Map,n=Array.from(new Set(t.map(i=>i==null?void 0:i.trim()).filter(i=>!!i)));if(n.length===0)return e;const r=200;for(let i=0;i<n.length;i+=r){const s=n.slice(i,i+r),a=Array.from(new Set(s.flatMap(u=>[u,u.toLowerCase(),u.toUpperCase()]))),{data:o,error:l}=await Ot.from("produkte").select("artikelnummer, bezeichnung, netto_preis, shop_url, bild_url").in("artikelnummer",a);if(l){console.warn("[produkte-enrichment] fetch failed:",l.message);continue}for(const u of o??[]){const d=(u.artikelnummer??"").trim().toLowerCase();d&&e.set(d,{artikelnummer:u.artikelnummer,bezeichnung:u.bezeichnung??"",netto_preis:Number(u.netto_preis??0),shop_url:u.shop_url??null,bild_url:u.bild_url??null})}}return e}function T3e(t,e){return e.size===0?t:t.map(n=>{var l;const r=e.get(((l=n.artikelnummer)==null?void 0:l.trim().toLowerCase())??"");if(!r)return n;const i=r.bild_url??n.bild_url??null,s=r.shop_url??n.produkt_url??null;let a=n.einzelpreis,o=n.gesamtpreis;return(!n.einzelpreis||n.einzelpreis===0)&&r.netto_preis>0&&(a=r.netto_preis,o=B4(n.menge*a)),{...n,bild_url:i,produkt_url:s,einzelpreis:a,gesamtpreis:o}})}function ZO(t){const[e,n]=E.useState(new Map),r=t?t.positionen.map(i=>i.artikelnummer).join("|"):"";return E.useEffect(()=>{let i=!1;if(!t)return;const s=t.positionen.map(a=>a.artikelnummer);if(s.length!==0)return N3e(s).then(a=>{i||n(a)}),()=>{i=!0}},[r]),E.useMemo(()=>{if(!t)return null;if(e.size===0)return t;const i=T3e(t.positionen,e);return yA(i,t.mwst_satz)},[t,e])}function bA({config:t,ergebnis:e,modul:n,untereHoehe:r,activeUniform:i}){const[s,a]=E.useState(!1),o=Ph(),l=e==null?void 0:e.positionen.some(h=>h.warnung),u=E.useMemo(()=>E3e(e),[e]),d=ZO(u);return c.jsxs("div",{className:"space-y-4",children:[c.jsx(Wke,{config:t,modul:n,untereHoehe:r}),c.jsx(bo,{mode:"wait",children:e&&d?c.jsx(tn.div,{initial:{opacity:0,scale:.97}
772,animate:{opacity:1,scale:1},transition:{duration:.3},children:c.jsx(Dn,{className:"config-card overflow-hidden",children:c.jsx("div",{className:"price-glow",children:c.jsx(Bn,{className:"pt-8 pb-6",children:c.jsxs("div",{className:"text-center space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground font-medium tracking-wide uppercase",children:"Gesamtpreis"}),c.jsx(tn.p,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"text-3xl sm:text-5xl font-bold text-foreground tracking-tight",children:bf(d.gesamt_brutto)},d.gesamt_brutto),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Gesamt brutto · inkl. ",Math.round(d.mwst_satz*100),"% MwSt., zzgl. Versandkosten"]}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Netto: ",c.jsx("span",{className:"tabular-nums",children:bf(d.gesamt_netto)})]}),c.jsx("div",{className:"flex items-center justify-center gap-4 pt-3 border-t border-border mt-4",children:c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(hpe,{className:"w-3.5 h-3.5"}),c.jsx("span",{className:"font-mono font-medium",children:e.setSku})]})}),e.modulDetails&&c.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Mf,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:e.modulDetails})]})]})})})})},"price"):c.jsx(tn.div,{initial:{opacity:0}
772,animate:{opacity:1},children:c.jsx(Dn,{className:"config-card",children:c.jsx(Bn,{className:"py-12",children:c.jsxs("div",{className:"text-center space-y-2",children:[c.jsx("div",{className:"w-14 h-14 rounded-2xl bg-muted flex items-center justify-center mx-auto mb-3",children:c.jsx(yJ,{className:"w-6 h-6 text-muted-foreground"})}),c.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Konfigurieren Sie Ihr Regal"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Der Preis wird automatisch berechnet"})]})})})},"placeholder")}),l&&c.jsx(tn.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:c.jsx(Dn,{className:"border-destructive/50 bg-destructive/5",children:c.jsx(Bn,{className:"pt-4",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Ah,{className:"w-5 h-5 text-destructive shrink-0 mt-0.5"}),c.jsx("div",{className:"space-y-1",children:e==null?void 0:e.positionen.filter(h=>h.warnung).map((h,p)=>c.jsx("p",{className:"text-sm text-destructive",children:h.warnung},p))})]})})})}),d&&d.positionen.length>0&&c.jsx(wne,{type:"single",collapsible:!0,defaultValue:"lieferumfang",children:c.jsxs(kO,{value:"lieferumfang",className:"config-card border rounded-xl px-5",children:[c.jsx(CO,{className:"text-sm font-medium",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Mf,{className:"w-4 h-4 text-muted-foreground"}),"Lieferumfang (",d.positionen.length," Positionen)"]})}),c.jsxs(NO,{children:[c.jsx(YO,{positionen:d.positionen}),c.jsx("div",{className:"mt-4 border-t pt-3",children:c.jsx(pM,{ergebnis:d})})]})]})}),e&&c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.15},className:"flex flex-col gap-2.5",children:[qO,c.jsxs(Pt,{onClick:()=>a(!0),size:"lg",className:"w-full text-base font-semibold shadow-md hover:shadow-lg transition-shadow",children:[c.jsx(vJ,{className:"w-5 h-5 mr-2"}),"Angebot anfordern"]}),c.jsxs(Pt,{variant:"outline",className:"w-full text-[13px] sm:text-sm",onClick:()=>{Sie(t,e,i)},children:[c.jsx(gJ,{className:"w-4 h-4 mr-1.5 sm:mr-2 shrink-0"}),o?"PDF Export":"Als PDF downloaden"]}),c.jsx(Bf,{konfigurator:"regal",regalTyp:t.regaltyp,getKonfiguration:()=>({config:t,activeUniformBreite:(i==null?void 0:i.gesamtbreite_plus3)??null}),className:"w-full text-[13px] sm:text-sm"})]}),e&&c.jsx(Px,{open:s,onOpenChange:a,konfiguratorName:`Tegometall ${U0[t.regaltyp]||t.regaltyp}`,tabelle:"regal_anfragen",konfiguratorTyp:"regal",regalTyp:t.regaltyp,konfigurationSnapshot:()=>({config:t,activeUniformBreite:(i==null?void 0:i.gesamtbreite_plus3)??null}),buildInsertPayload:h=>{const p=i?i.gesamtbreite_plus3:t.breite,f={regaltyp:t.regaltyp,hoehe:t.hoehe,breite:t.breite,tatsaechlicheBreite:p,tiefe:t.tiefe,farbe:t.farbe,modulDetails:e.modulDetails},m=e.positionen.filter(x=>x.anzahl>0).map(x=>({artikelname:x.artikelname,sku:x.sku,anzahl:x.anzahl,einzelpreis:x.einzelpreis,gesamt:x.gesamt}));return{gesamtpreis:e.gesamtpreis,set_sku:e.setSku,konfiguration:f,lieferumfang:m}},buildPdfInput:(h,p)=>({konfiguratorName:`Tegometall ${U0[t.regaltyp]||t.regaltyp}`,anfrageId:p,identifier:e.setSku,konfiguration:[{label:"Regaltyp",value:U0[t.regaltyp]||t.regaltyp},{label:"MaÃe (B Ã H Ã T)",value:`${((i==null?void 0:i.gesamtbreite_plus3)??t.breite).toFixed(2)} Ã ${t.hoehe} Ã ${t.tiefe} cm`},{label:"Farbe",value:String(t.farbe??"â")},{label:"Modul-Details",value:e.modulDetails??"â"}],positionen:e.positionen.filter(f=>f.anzahl>0).map(f=>({sku:f.sku,artikelname:f.artikelname,menge:f.anzahl,einzelpreis:f.einzelpreis,gesamtpreis:f.gesamt})),gesamtNetto:e.gesamtpreis,mwstSatz:.19})})]})}function X1({items:t}){return c.jsx("div",{className:"bg-secondary border-b border-border/50 py-1.5 sm:py-2 px-4 shadow-sm",children:c.jsxs("div",{className:"container mx-auto max-w-7xl",children:[c.jsx("p",{className:"text-xs text-muted-foreground font-medium px-1 mb-1 hidden sm:block",children:"Ihre aktuelle Auswahl"}),c.jsxs("div",{className:"relative",children:[c.jsx(tn.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"flex items-center gap-1 sm:gap-2 overflow-x-auto scrollbar-none flex-nowrap px-1 -mx-1 pr-6 sm:pr-1",children:t.map((e,n)=>c.jsxs("span",{className:`inline-flex items-center gap-0.5 sm:gap-1 text-[10px] sm:text-xs whitespace-nowrap px-1.5 sm:px-2.5 py-0.5 sm:py-1 rounded-full transition-colors shrink-0 ${e.highlight?"bg-amber-100 text-amber-800 font-medium":e.done?"bg-primary/10 text-primary font-medium":"bg-muted text-muted-foreground"}`,children:[e.done&&c.jsx(ti,{className:"w-2.5 sm:w-3 h-2.5 sm:h-3"}),e.label]},n))}),c.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-secondary to-transparent pointer-events-none sm:hidden"})]})]})})}function M3e(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const R3e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j3e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P3e={};function WG(t,e){return(P3e.jsx?j3e:R3e).test(t)}const L3e=/[ \t\n\f\r]/g;function I3e(t){return typeof t=="object"?t.type==="text"?$G(t.value):!1:$G(t)}function $G(t){return t.replace(L3e,"")===""}class wA{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}wA.prototype.normal={};wA.prototype.property={};wA.prototype.space=void 0;function Aie(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new wA(n,r,e)}
vendor: 5,095 bytes, line 772
772function F4(t){return t.toLowerCase()}class Zl{constructor(e,n){this.attribute=n,this.property=e}}Zl.prototype.attribute="";Zl.prototype.booleanish=!1;Zl.prototype.boolean=!1;Zl.prototype.commaOrSpaceSeparated=!1;Zl.prototype.commaSeparated=!1;Zl.prototype.defined=!1;Zl.prototype.mustUseProperty=!1;Zl.prototype.number=!1;Zl.prototype.overloadedBoolean=!1;Zl.prototype.property="";Zl.prototype.spaceSeparated=!1;Zl.prototype.space=void 0;let D3e=0;const Cr=Lx(),ca=Lx(),O4=Lx(),$t=Lx(),zi=Lx(),ub=Lx(),pc=Lx();function Lx(){return 2**++D3e}const z4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Cr,booleanish:ca,commaOrSpaceSeparated:pc,commaSeparated:ub,number:$t,overloadedBoolean:O4,spaceSeparated:zi},Symbol.toStringTag,{value:"Module"})),fj=Object.keys(z4);class QO extends Zl{constructor(e,n,r,i){let s=-1;if(super(e,n),KG(this,"space",i),typeof r=="number")for(;++s<fj.length;){const a=fj[s];KG(this,fj[s],(r&z4[a])===z4[a])}}}QO.prototype.defined=!0;function KG(t,e,n){n&&(t[e]=n)}function Y1(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new QO(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[F4(r)]=r,n[F4(s.attribute)]=r}return new wA(e,n,t.space)}const Eie=Y1({properties:{ariaActiveDescendant:null,ariaAtomic:ca,ariaAutoComplete:null,ariaBusy:ca,ariaChecked:ca,ariaColCount:$t,ariaColIndex:$t,ariaColSpan:$t,ariaControls:zi,ariaCurrent:null,ariaDescribedBy:zi,ariaDetails:null,ariaDisabled:ca,ariaDropEffect:zi,ariaErrorMessage:null,ariaExpanded:ca,ariaFlowTo:zi,ariaGrabbed:ca,ariaHasPopup:null,ariaHidden:ca,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zi,ariaLevel:$t,ariaLive:null,ariaModal:ca,ariaMultiLine:ca,ariaMultiSelectable:ca,ariaOrientation:null,ariaOwns:zi,ariaPlaceholder:null,ariaPosInSet:$t,ariaPressed:ca,ariaReadOnly:ca,ariaRelevant:null,ariaRequired:ca,ariaRoleDescription:zi,ariaRowCount:$t,ariaRowIndex:$t,ariaRowSpan:$t,ariaSelected:ca,ariaSetSize:$t,ariaSort:null,ariaValueMax:$t,ariaValueMin:$t,ariaValueNow:$t,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function kie(t,e){return e in t?t[e]:e}function Cie(t,e){return kie(t,e.toLowerCase())}const B3e=Y1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ub,acceptCharset:zi,accessKey:zi,action:null,allow:null,allowFullScreen:Cr,allowPaymentRequest:Cr,allowUserMedia:Cr,alt:null,as:null,async:Cr,autoCapitalize:null,autoComplete:zi,autoFocus:Cr,autoPlay:Cr,blocking:zi,capture:null,charSet:null,checked:Cr,cite:null,className:zi,cols:$t,colSpan:null,content:null,contentEditable:ca,controls:Cr,controlsList:zi,coords:$t|ub,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Cr,defer:Cr,dir:null,dirName:null,disabled:Cr,download:O4,draggable:ca,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Cr,formTarget:null,headers:zi,height:$t,hidden:O4,high:$t,href:null,hrefLang:null,htmlFor:zi,httpEquiv:zi,id:null,imageSizes:null,imageSrcSet:null,inert:Cr,inputMode:null,integrity:null,is:null,isMap:Cr,itemId:null,itemProp:zi,itemRef:zi,itemScope:Cr,itemType:zi,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Cr,low:$t,manifest:null,max:null,maxLength:$t,media:null,method:null,min:null,minLength:$t,multiple:Cr,muted:Cr,name:null,nonce:null,noModule:Cr,noValidate:Cr,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Cr,optimum:$t,pattern:null,ping:zi,placeholder:null,playsInl
772ine:Cr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Cr,referrerPolicy:null,rel:zi,required:Cr,reversed:Cr,rows:$t,rowSpan:$t,sandbox:zi,scope:null,scoped:Cr,seamless:Cr,selected:Cr,shadowRootClonable:Cr,shadowRootDelegatesFocus:Cr,shadowRootMode:null,shape:null,size:$t,sizes:null,slot:null,span:$t,spellCheck:ca,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$t,step:null,style:null,tabIndex:$t,target:null,title:null,translate:null,type:null,typeMustMatch:Cr,useMap:null,value:ca,width:$t,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zi,axis:null,background:null,bgColor:null,border:$t,borderColor:null,bottomMargin:$t,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Cr,declare:Cr,event:null,face:null,frame:null,frameBorder:null,hSpace:$t,leftMargin:$t,link:null,longDesc:null,lowSrc:null,marginHeight:$t,marginWidth:$t,noResize:Cr,noHref:Cr,noShade:Cr,noWrap:Cr,object:null,profile:null,prompt:null,rev:null,rightMargin:$t,rules:null,scheme:null,scrolling:ca,standby:null,summary:null,text:null,topMargin:$t,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$t,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Cr,disableRemotePlayback:Cr,prefix:null,property:null,results:$t,security:null,unselectable:null},space:"html",transform:Cie}),F3e=Y1({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
772-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pc,accentHeight:$t,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$t,amplitude:$t,arabicForm:null,ascent:$t,attributeName:null,attributeType:null,azimuth:$t,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$t,by:null,calcMode:null,capHeight:$t,className:zi,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$t,diffuseConstant:$t,direction:null,display:null,dur:null,divisor:$t,dominantBaseline:null,download:Cr,dx:null,dy:null,edgeMode:null,editable:null,elevation:$t,enableBackground:null,end:null,event:null,exponent:$t,externalResourcesRequired:null,fill:null,fillOpacity:$t,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ub,g2:ub,glyphName:ub,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$t,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$t,horizOriginX:$t,horizOriginY:$t,id:null,ideographic:$t,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$t,k:$t,k1:$t,k2:$t,k3:$t,k4:$t,kernelMatrix:pc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$t,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$t,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 4,419 bytes, lines 772-773
772Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$t,overlineThickness:$t,paintOrder:null,panose1:null,path:null,pathLength:$t,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zi,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$t,pointsAtY:$t,pointsAtZ:$t,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pc,rev:pc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pc,requiredFeatures:pc,requiredFonts:pc,requiredFormats:pc,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$t,specularExponent:$t,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$t,strikethroughThickness:$t,string:null,stroke:null,strokeDashArray:pc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$t,strokeOpacity:$t,strokeWidth:null,style:null,surfaceScale:$t,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pc,tabIndex:$t,tableValues:null,target:null,targetX:$t,targetY:$t,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$t,underlineThickness:$t,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$t,values:null,vAlphabetic:$t,vMathematical:$t,vectorEffect:null,vHanging:$t,vIdeographic:$t,version:null,vertAdvY:$t,vertOriginX:$t,vertOriginY:$t,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$t,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kie}),Nie=Y1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Tie=Y1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cie}),Mie=Y1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),O3e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},z3e=/[A-Z]/g,qG=/-[a-z]/g,U3e=/^data[-\w.:]+$/i;function H3e(t,e){const n=F4(e);let r=e,i=Zl;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&U3e.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(qG,V3e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!qG.test(s)){let a=s.replace(z3e,G3e);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=QO}return new i(r,e)}function G3e(t){return"-"+t.toLowerCase()}function V3e(t){return t.charAt(1).toUpperCase()}const W3e=Aie([Eie,B3e,Nie,Tie,Mie],"html"),ez=Aie([Eie,F3e,Nie,Tie,Mie],"svg");function $3e(t){return t.join(" ").trim()}var tz={},XG=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,K3e=/\n/g,q3e=/^\s*/,X3e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Y3e=/^:\s*/,J3e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Z3e=/^[;\s]*/,Q3e=/^\s+|\s+$/g,eRe=` 773`,YG="/",JG="*",l0="",tRe="comment",nRe="declaration";function rRe(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(m){var x=m.match(K3e);x&&(n+=x.length);var v=m.lastIndexOf(eRe);r=~v?m.length-v:r+m.length}function s(){var m={line:n,column:r};return function(x){return x.position=new a(m),u(),x}}function a(m){this.start=m,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function o(m){var x=new Error(e.source+":"+n+":"+r+": "+m);
vendor: 2,693 bytes, line 773
773if(x.reason=m,x.filename=e.source,x.line=n,x.column=r,x.source=t,!e.silent)throw x}function l(m){var x=m.exec(t);if(x){var v=x[0];return i(v),t=t.slice(v.length),x}}function u(){l(q3e)}function d(m){var x;for(m=m||[];x=h();)x!==!1&&m.push(x);return m}function h(){var m=s();if(!(YG!=t.charAt(0)||JG!=t.charAt(1))){for(var x=2;l0!=t.charAt(x)&&(JG!=t.charAt(x)||YG!=t.charAt(x+1));)++x;if(x+=2,l0===t.charAt(x-1))return o("End of comment missing");var v=t.slice(2,x-2);return r+=2,i(v),t=t.slice(x),r+=2,m({type:tRe,comment:v})}}function p(){var m=s(),x=l(X3e);if(x){if(h(),!l(Y3e))return o("property missing ':'");var v=l(J3e),g=m({type:nRe,property:ZG(x[0].replace(XG,l0)),value:v?ZG(v[0].replace(XG,l0)):l0});return l(Z3e),g}}function f(){var m=[];d(m);for(var x;x=p();)x!==!1&&(m.push(x),d(m));return m}return u(),f()}function ZG(t){return t?t.replace(Q3e,l0):l0}var iRe=rRe,sRe=vN&&vN.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tz,"__esModule",{value:!0});tz.default=oRe;const aRe=sRe(iRe);function oRe(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,aRe.default)(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?e(a,o,s):o&&(n=n||{},n[a]=o)}),n}var mM={};Object.defineProperty(mM,"__esModule",{value:!0});mM.camelCase=void 0;var lRe=/^--[a-zA-Z0-9_-]+$/,cRe=/-([a-z])/g,uRe=/^[^-]+$/,dRe=/^-(webkit|moz|ms|o|khtml)-/,hRe=/^-(ms)-/,fRe=function(t){return!t||uRe.test(t)||lRe.test(t)},pRe=function(t,e){return e.toUpperCase()},QG=function(t,e){return"".concat(e,"-")},mRe=function(t,e){return e===void 0&&(e={}),fRe(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(hRe,QG):t=t.replace(dRe,QG),t.replace(cRe,pRe))};mM.camelCase=mRe;var gRe=vN&&vN.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},xRe=gRe(tz),vRe=mM;function U4(t,e){var n={};return!t||typeof t!="string"||(0,xRe.default)(t,function(r,i){r&&i&&(n[(0,vRe.camelCase)(r,e)]=i)}),n}U4.default=U4;var yRe=U4;const bRe=DS(yRe),Rie=jie("end"),nz=jie("start");function jie(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wRe(t){const e=nz(t),n=Rie(t);if(e&&n)return{start:e,end:n}}function s2(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?eV(t.position):"start"in t||"end"in t?eV(t):"line"in t||"column"in t?H4(t):""}function H4(t){return tV(t&&t.line)+":"+tV(t&&t.column)}function eV(t){return H4(t&&t.start)+"-"+H4(t&&t.end)}function tV(t){return t&&typeof t=="number"?t:1}
vendor: 1,928 bytes, line 773
773class Jo extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=s2(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jo.prototype.file="";Jo.prototype.name="";Jo.prototype.reason="";Jo.prototype.message="";Jo.prototype.stack="";Jo.prototype.column=void 0;Jo.prototype.line=void 0;Jo.prototype.ancestors=void 0;Jo.prototype.cause=void 0;Jo.prototype.fatal=void 0;Jo.prototype.place=void 0;Jo.prototype.ruleId=void 0;Jo.prototype.source=void 0;const rz={}.hasOwnProperty,_Re=new Map,SRe=/[A-Z]/g,ARe=new Set(["table","tbody","thead","tfoot","tr"]),ERe=new Set(["td","th"]),Pie="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kRe(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=LRe(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,361 bytes, line 773
773if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=PRe(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?ez:W3e,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Lie(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function Lie(t,e,n){if(e.type==="element")return CRe(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return NRe(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return MRe(t,e,n);if(e.type==="mdxjsEsm")return TRe(t,e);if(e.type==="root")return RRe(t,e,n);if(e.type==="text")return jRe(t,e)}function CRe(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ez,t.schema=i),t.ancestors.push(e);const s=Die(t,e.tagName,!1),a=IRe(t,e);let o=sz(t,e);return ARe.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!I3e(l):!0})),Iie(t,a,s,e),iz(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function NRe(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}mS(t,e.position)}function TRe(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);mS(t,e.position)}function MRe(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=ez,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:Die(t,e.name,!0),a=DRe(t,e),o=sz(t,e);return Iie(t,a,s,e),iz(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function RRe(t,e,n){const r={};return iz(r,sz(t,e)),t.create(e,t.Fragment,r,n)}function jRe(t,e){return e.value}function Iie(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function iz(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function PRe(t,e,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:e;return o?u(s,a,o):u(s,a)}}function LRe(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=nz(r);return e(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function IRe(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&rz.call(e.properties,i)){const s=BRe(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&ERe.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function DRe(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else mS(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else mS(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function sz(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:_Re;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=Lie(t,s,a);o!==void 0&&n.push(o)}return n}function BRe(t,e,n){const r=H3e(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?M3e(n):$3e(n)),r.property==="style"){let i=typeof n=="object"?n:FRe(t,String(n));return t.stylePropertyNameCase==="css"&&(i=ORe(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?O3e[r.property]||r.property:r.attribute,n]}}function FRe(t,e){try{return bRe(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Jo("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Pie+"#cannot-parse-style-attribute",i}}function Die(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=WG(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=WG(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return rz.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);mS(t)}function mS(t,e){const n=new Jo("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Pie+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ORe(t){const e={};let n;for(n in t)rz.call(t,n)&&(e[zRe(n)]=t[n]);return e}function zRe(t){let e=t.replace(SRe,URe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function URe(t){return"-"+t.toLowerCase()}const pj={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},HRe={};function GRe(t,e){const n=HRe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Bie(t,r,i)}function Bie(t,e,n){if(VRe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return nV(t.children,e,n)}return Array.isArray(t)?nV(t,e,n):""}function nV(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Bie(t[i],e,n);return r.join("")}function VRe(t){return!!(t&&typeof t=="object")}const rV=document.createElement("i");function az(t){const e="&"+t+";";rV.innerHTML=e;const n=rV.textContent;
vendor: 10,930 bytes, line 773
773return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Ch(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function lu(t,e){return t.length>0?(Ch(t,t.length,0,e),t):e}const iV={}.hasOwnProperty;function WRe(t){const e={};let n=-1;for(;++n<t.length;)$Re(e,t[n]);return e}function $Re(t,e){let n;for(n in e){const i=(iV.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){iV.call(i,a)||(i[a]=[]);const o=s[a];KRe(i[a],Array.isArray(o)?o:o?[o]:[])}}}function KRe(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);Ch(t,0,0,r)}function Fie(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function db(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lh=cg(/[A-Za-z]/),Ec=cg(/[\dA-Za-z]/),qRe=cg(/[#-'*+\--9=?A-Z^-~]/);function G4(t){return t!==null&&(t<32||t===127)}const V4=cg(/\d/),XRe=cg(/[\dA-Fa-f]/),YRe=cg(/[!-/:-@[-`{-~]/);function nr(t){return t!==null&&t<-2}function Yl(t){return t!==null&&(t<0||t===32)}function mi(t){return t===-2||t===-1||t===32}const JRe=cg(new RegExp("\\p{P}|\\p{S}","u")),ZRe=cg(/\s/);function cg(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function J1(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&Ec(t.charCodeAt(n+1))&&Ec(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Gi(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return mi(l)?(t.enter(n),o(l)):e(l)}function o(l){return mi(l)&&s++<i?(t.consume(l),o):(t.exit(n),e(l))}}const QRe={tokenize:eje};function eje(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Gi(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return nr(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const tje={tokenize:nje},sV={tokenize:rje};function nje(t){const e=this,n=[];let r=0,i,s,a;return o;function o(y){if(r<n.length){const S=n[r];return e.containerState=S[1],t.attempt(S[0].continuation,l,u)(y)}return u(y)}function l(y){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&b();const S=e.events.length;let A=S,k;for(;A--;)if(e.events[A][0]==="exit"&&e.events[A][1].type==="chunkFlow"){k=e.events[A][1].end;break}g(r);let M=S;for(;M<e.events.length;)e.events[M][1].end={...k},M++;return Ch(e.events,A+1,0,e.events.slice(S)),e.events.length=M,u(y)}return o(y)}function u(y){if(r===n.length){if(!i)return p(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(sV,d,h)(y)}function d(y){return i&&b(),g(r),p(y)}function h(y){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,m(y)}function p(y){return e.containerState={},t.attempt(sV,f,m)(y)}function f(y){return r++,n.push([e.currentConstruct,e.containerState]),p(y)}function m(y){if(y===null){i&&b(),g(0),t.consume(y);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),x(y)}function x(y){if(y===null){v(t.exit("chunkFlow"),!0),g(0),t.consume(y);return}return nr(y)?(t.consume(y),v(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(y),x)}function v(y,S){const A=e.sliceStream(y);if(S&&A.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(A),e.parser.lazy[y.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const M=e.events.length;let T=M,C,R;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(C){R=e.events[T][1].end;break}C=!0}for(g(r),k=M;k<e.events.length;)e.events[k][1].end={...R},k++;Ch(e.events,T+1,0,e.events.slice(M)),e.events.length=k}}function g(y){let S=n.length;for(;S-- >y;){const A=n[S];e.containerState=A[1],A[0].exit.call(e,t)}n.length=y}function b(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function rje(t,e,n){return Gi(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function aV(t){if(t===null||Yl(t)||ZRe(t))return 1;if(JRe(t))return 2}function oz(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const W4={name:"attention",resolveAll:ije,tokenize:sje};function ije(t,e){let n=-1,r,i,s,a,o,l,u,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},p={...t[n][1].start};oV(h,-l),oV(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=lu(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=lu(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),u=lu(u,oz(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=lu(u,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,u=lu(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,Ch(t,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function sje(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=aV(r);let s;return a;function a(l){return s=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===s)return t.consume(l),o;const u=t.exit("attentionSequence"),d=aV(l),h=!d||d===2&&i||n.includes(l),p=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?h:h&&(i||!p)),u._close=!!(s===42?p:p&&(d||!h)),e(l)}}function oV(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const aje={name:"autolink",tokenize:oje};function oje(t,e,n){let r=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(f){return lh(f)?(t.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||Ec(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(t.consume(f),r=0,l):(f===43||f===45||f===46||Ec(f))&&r++<32?(t.consume(f),o):(r=0,u(f))}function l(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||G4(f)?n(f):(t.consume(f),l)}function u(f){return f===64?(t.consume(f),d):qRe(f)?(t.consume(f),u):n(f)}function d(f){return Ec(f)?h(f):n(f)}function h(f){return f===46?(t.consume(f),r=0,d):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):p(f)}function p(f){if((f===45||Ec(f))&&r++<63){const m=f===45?p:h;return t.consume(f),m}return n(f)}}const gM={partial:!0,tokenize:lje};function lje(t,e,n){return r;function r(s){return mi(s)?Gi(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||nr(s)?e(s):n(s)}}const Oie={continuation:{tokenize:uje},exit:dje,name:"blockQuote",tokenize:cje};function cje(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return mi(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function uje(t,e,n){const r=this;return i;function i(a){return mi(a)?Gi(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(Oie,e,n)(a)}}function dje(t){t.exit("blockQuote")}const zie={name:"characterEscape",tokenize:hje};function hje(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return YRe(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const Uie={name:"characterReference",tokenize:fje};function fje(t,e,n){const r=this;let i=0,s,a;return o;function o(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),l}function l(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),s=31,a=Ec,d(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=XRe,d):(t.enter("characterReferenceValue"),s=7,a=V4,d(h))}function d(h){if(h===59&&i){const p=t.exit("characterReferenceValue");return a===Ec&&!az(r.sliceSerialize(p))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(h)&&i++<s?(t.consume(h),d):n(h)}}const lV={partial:!0,tokenize:mje},cV={concrete:!0,name:"codeFenced",tokenize:pje};function pje(t,e,n){const r=this,i={partial:!0,tokenize:A};let s=0,a=0,o;return l;function l(k){return u(k)}function u(k){const M=r.events[r.events.length-1];return s=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=k,t.enter("co
773deFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(a++,t.consume(k),d):a<3?n(k):(t.exit("codeFencedFenceSequence"),mi(k)?Gi(t,h,"whitespace")(k):h(k))}function h(k){return k===null||nr(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(lV,x,S)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||nr(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(k)):mi(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Gi(t,f,"whitespace")(k)):k===96&&k===o?n(k):(t.consume(k),p)}function f(k){return k===null||nr(k)?h(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||nr(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(t.consume(k),m)}function x(k){return t.attempt(i,S,v)(k)}function v(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),g}function g(k){return s>0&&mi(k)?Gi(t,b,"linePrefix",s+1)(k):b(k)}function b(k){return k===null||nr(k)?t.check(lV,x,S)(k):(t.enter("codeFlowValue"),y(k))}function y(k){return k===null||nr(k)?(t.exit("codeFlowValue"),b(k)):(t.consume(k),y)}function S(k){return t.exit("codeFenced"),e(k)}function A(k,M,T){let C=0;return R;function R($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),P}function P($){return k.enter("codeFencedFence"),mi($)?Gi(k,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):j($)}function j($){return $===o?(k.enter("codeFencedFenceSequence"),G($)):T($)}function G($){return $===o?(C++,k.consume($),G):C>=a?(k.exit("codeFencedFenceSequence"),mi($)?Gi(k,B,"whitespace")($):B($)):T($)}function B($){return $===null||nr($)?(k.exit("codeFencedFence"),M($)):T($)}}}function mje(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const mj={name:"codeIndented",tokenize:xje},gje={partial:!0,tokenize:vje};function xje(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Gi(t,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):nr(u)?t.attempt(gje,a,l)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||nr(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),o)}function l(u){return t.exit("codeIndented"),e(u)}}function vje(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):nr(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Gi(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):nr(a)?i(a):n(a)}}const yje={name:"codeText",previous:wje,resolve:bje,tokenize:_je};function bje(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function wje(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _je(t,e,n){let r=0,i,s;return a;function a(h){return t.enter("codeText"),t.enter("codeTextSequence"),o(h)}function o(h){return h===96?(t.consume(h),r++,o):(t.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),l):h===96?(s=t.enter("codeTextSequence"),i=0,d(h)):nr(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),l):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||nr(h)?(t.exit("codeTextData"),l(h)):(t.consume(h),u)}function d(h){return h===96?(t.consume(h),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(s.type="codeTextData",u(h))}}class Sje{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Xw(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Xw(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Xw(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Xw(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Xw(this.left,n.reverse())}}}function Xw(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Hie(t){const e={};let n=-1,r,i,s,a,o,l,u;const d=new Sje(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Aje(d,n)),n=e[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return Ch(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Aje(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let d,h,p=-1,f=n,m=0,x=0;const v=[x];for(;f;){for(;t.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&a.defineSki
vendor: 18,641 bytes, line 773
773p(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(x=p+1,v.push(x),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):v.pop(),p=v.length;p--;){const g=o.slice(v[p],v[p+1]),b=s.pop();l.push([b,b+g.length-1]),t.splice(b,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return u}const Eje={resolve:Cje,tokenize:Nje},kje={partial:!0,tokenize:Tje};function Cje(t){return Hie(t),t}function Nje(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):nr(o)?t.check(kje,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Tje(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Gi(t,s,"linePrefix")}function s(a){if(a===null||nr(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Gie(t,e,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return h;function h(g){return g===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(g),t.exit(s),p):g===null||g===32||g===41||G4(g)?n(g):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),x(g))}function p(g){return g===62?(t.enter(s),t.consume(g),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(t.exit("chunkString"),t.exit(o),p(g)):g===null||g===60||nr(g)?n(g):(t.consume(g),g===92?m:f)}function m(g){return g===60||g===62||g===92?(t.consume(g),f):f(g)}function x(g){return!d&&(g===null||g===41||Yl(g))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(g)):d<u&&g===40?(t.consume(g),d++,x):g===41?(t.consume(g),d--,x):g===null||g===32||g===40||G4(g)?n(g):(t.consume(g),g===92?v:x)}function v(g){return g===40||g===41||g===92?(t.consume(g),x):x(g)}}function Vie(t,e,n,r,i,s){const a=this;let o=0,l;return u;function u(f){return t.enter(r),t.enter(i),t.consume(f),t.exit(i),t.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(t.exit(s),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):nr(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||nr(f)||o++>999?(t.exit("chunkString"),d(f)):(t.consume(f),l||(l=!mi(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(t.consume(f),o++,h):h(f)}}function Wie(t,e,n,r,i,s){let a;return o;function o(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(s),u(p))}function u(p){return p===a?(t.exit(s),l(a)):p===null?n(p):nr(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Gi(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||nr(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?h:d)}function h(p){return p===a||p===92?(t.consume(p),d):d(p)}}function a2(t,e){let n;return r;function r(i){return nr(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):mi(i)?Gi(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Mje={name:"definition",tokenize:jje},Rje={partial:!0,tokenize:Pje};function jje(t,e,n){const r=this;let i;return s;function s(f){return t.enter("definition"),a(f)}function a(f){return Vie.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=db(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):n(f)}function l(f){return Yl(f)?a2(t,u)(f):u(f)}function u(f){return Gie(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return t.attempt(Rje,h,h)(f)}function h(f){return mi(f)?Gi(t,p,"whitespace")(f):p(f)}function p(f){return f===null||nr(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function Pje(t,e,n){return r;function r(o){return Yl(o)?a2(t,i)(o):n(o)}function i(o){return Wie(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return mi(o)?Gi(t,a,"whitespace")(o):a(o)}function a(o){return o===null||nr(o)?e(o):n(o)}}const Lje={name:"hardBreakEscape",tokenize:Ije};function Ije(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return nr(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const Dje={name:"headingAtx",resolve:Bje,tokenize:Fje};function Bje(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Ch(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function Fje(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||Yl(d)?(t.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||nr(d)?(t.exit("atxHeading"),e(d)):mi(d)?Gi(t,o,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Yl(d)?(t.exit("atxHeadingText"),o(d)):(t.consume(d),u)}}const Oje=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uV=["pre","script","style","textarea"],zje={concrete:!0,name:"htmlFlow",resolveTo:Gje,tokenize:Vje},Uje={partial:!0,tokenize:$je},Hje={partial:!0,tokenize:Wje};function Gje(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Vje(t,e,n){const r=this;let i,s,a,o,l;return u;function u(I){return d(I)}function d(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),h}function h(I){return I===33?(t.consume(I),p):I===47?(t.consume(I),s=!0,x):I===63?(t.consume(I),i=3,r.interrupt?e:O):lh(I)?(t.consume(I),a=String.fromCharCode(I),v):n(I)}function p(I){return I===45?(t.consume(I),i=2,f):I===91?(t.consume(I),i=5,o=0,m):lh(I)?(t.consume(I),i=4,r.interrupt?e:O):n(I)}function f(I){return I===45?(t.consume(I),r.interrupt?e:O):n(I)}function m(I){const q="CDATA[";return I===q.charCodeAt(o++)?(t.consume(I),o===q.length?r.interrupt?e:j:m):n(I)}function x(I){return lh(I)?(t.consume(I),a=String.fromCharCode(I),v):n(I)}function v(I){if(I===null||I===47||I===62||Yl(I)){const q=I===47,te=a.toLowerCase();return!q&&!s&&uV.includes(te)?(i=1,r.interrupt?e(I):j(I)):Oje.includes(a.toLowerCase())?(i=6,q?(t.consume(I),g):r.interrupt?e(I):j(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?b(I):y(I))}return I===45||Ec(I)?(t.consume(I),a+=String.fromCharCode(I),v):n(I)}function g(I){return I===62?(t.consume(I),r.interrupt?e:j):n(I)}function b(I){return mi(I)?(t.consume(I),b):R(I)}function y(I){return I===47?(t.consume(I),R):I===58||I===95||lh(I)?(t.consume(I),S):mi(I)?(t.consume(I),y):R(I)}function S(I){return I===45||I===46||I===58||I===95||Ec(I)?(t.consume(I),S):A(I)}function A(I){return I===61?(t.consume(I),k):mi(I)?(t.consume(I),A):y(I)}function k(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),l=I,M):mi(I)?(t.consume(I),k):T(I)}function M(I){return I===l?(t.consume(I),l=null,C):I===null||nr(I)?n(I):(t.consume(I),M)}function T(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Yl(I)?A(I):(t.consume(I),T)}function C(I){return I===47||I===62||mi(I)?y(I):n(I)}function R(I){return I===62?(t.consume(I),P):n(I)}function P(I){return I===null||nr(I)?j(I):mi(I)?(t.consume(I),P):n(I)}function j(I){return I===45&&i===2?(t.consume(I),U):I===60&&i===1?(t.consume(I),Z):I===62&&i===4?(t.consume(I),Y):I===63&&i===3?(t.consume(I),O):I===93&&i===5?(t.consume(I),W):nr(I)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Uje,z,G)(I)):I===null||nr(I)?(t.exit("htmlFlowData"),G(I)):(t.consume(I),j)}function G(I){return t.check(Hje,B,z)(I)}function B(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),$}function $(I){return I===null||nr(I)?G(I):(t.enter("htmlFlowData"),j(I))}function U(I){return I===45?(t.consume(I),O):j(I)}function Z(I){return I===47?(t.consume(I),a="",V):j(I)}function V(I){if(I===62){const q=a.toLowerCase();return uV.includes(q)?(t.consume(I),Y):j(I)}return lh(I)&&a.length<8?(t.consume(I),a+=String.fromCharCode(I),V):j(I)}function W(I){return I===93?(t.consume(I),O):j(I)}function O(I){return I===62?(t.consume(I),Y):I===45&&i===2?(t.consume(I),O):j(I)}function Y(I){return I===null||nr(I)?(t.exit("htmlFlowData"),z(I)):(t.consume(I),Y)}function z(I){return t.exit("htmlFlow"),e(I)}}function Wje(t,e,n){const r=this;return i;function i(a){return nr(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function $je(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(gM,e,n)}}const Kje={name:"htmlText",tokenize:qje};function qje(t,e,n){const r=this;let i,s,a;return o;function o(O){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(O),l}function l(O){return O===33?(t.consume(O),u):O===47?(t.consume(O),A):O===63?(t.consume(O),y):lh(O)?(t.consume(O),T):n(O)}function u(O){return O===45?(t.consume(O),d):O===91?(t.consume(O),s=0,m):lh(O)?(t.consume(O),b):n(O)}function d(O){return O===45?(t.consume(O),f):n(O)}function h(O){return O===null?n(O):O===45?(t.consume(O),p):nr(O)?(a=h,Z(O)):(t.consume(O),h)}function p(O){return O===45?(t.consume(O),f):h(O)}function f(O){return O===62?U(O):O===45?p(O):h(O)}function m(O){const Y="CDATA[";return O===Y.charCodeAt(s++)?(t.consume(O),s===Y.length?x:m):n(O)}function x(O){return O===null?n(O):O===93?(t.consume(O),v):nr(O)?(a=x,Z(O)):(t.consume(O),x)}function v(O){return O===93?(t.consume(O),g):x(O)}function g(O){return O===62?U(O):O===93?(t.consume(O),g):x(O)}function b(O){return O===null||O===62?U(O):nr(O)?(a=b,Z(O)):(t.consume(O),b)}function y(O){return O===null?n(O):O===63?(t.consume(O),S):nr(O)?(a=y,Z(O)):(t.consume(O),y)}function S(O){return O===62?U(O):y(O)}function A(O){return lh(O)?(t.consume(O),k):n(O)}function k(O){return O===45||Ec(O)?(t.consume(O),k):M(O)}function M(O){return nr(O)?(a=M,Z(O)):mi(O)?(t.consume(O),M):U(O)}function T(O){return O===45||Ec(O)?(t.consume(O),T):O===47||O===62||Yl(O)?C(O):n(O)}function C(O){return O===47?(t.consume(O),U):O===58||O===95||lh(O)?(t.consume(O),R):nr(O)?(a=C,Z(O)):mi(O)?(t.consume(O),C):U(O)}function R(O){return O===45||O===46||O===58||O===95||Ec(O)?(t.consume(O),R):P(O)}function P(O){return O===61?(t.consume(O),j):nr(O)?(a=P,Z(O)):mi(O)?(t.consume(O),P):C(O)}function j(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(t.consume(O),i=O,G):nr(O)?(a=j,Z(O)):mi(O)?(t.consume(O),j):(t.consume(O),B)}function G(O){return O===i?(t.consume(O),i=void 0,$):O===null?n(O):nr(O)?(a=G,Z(O)):(t.consume(O),G)}function B(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Yl(O)?C(O):(t.consume(O),B)}function $(O){return O===47||O===62||Yl(O)?C(O):n(O)}function U(O){return O===62?(t.consume(O),t.exit("htmlTextData"),t.exit("htmlText"),e):n(O)}function Z(O){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),V}function V(O){return mi(O)?Gi(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):W(O)}function W(O){return t.enter("htmlTextData"),a(O)}}const lz={name:"labelEnd",resolveAll:Zje,resolveTo:Qje,tokenize:ePe},Xje={tokenize:tPe},Yje={tokenize:nPe},Jje={tokenize:rPe};function Zje(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&Ch(t,0,t.length,n),t}function Qje(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",l,e],["enter",u,e]],o=lu(o,t.slice(s+1,s+r+3)),o=lu(o,[["enter",d,e]]),o=lu(o,oz(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=lu(o,[["exit",d,e],t[a-2],t[a-1],["exit",u,e]]),o=lu(o,t.slice(a+1)),o=lu(o,[["exit",l,e]]),Ch(t,s,t.length,o),t}function ePe(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(p){return s?s._inactive?h(p):(a=r.parser.defined.includes(db(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(Xje,d,a?d:h)(p):p===91?t.attempt(Yje,d,a?u:h)(p):a?d(p):h(p)}function u(p){return t.attempt(Jje,d,h)(p)}function d(p){return e(p)}function h(p){return s._balanced=!0,n(p)}}function tPe(t,e,n){return r;function r(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),i}function i(h){return Yl(h)?a2(t,s)(h):s(h)}function s(h){return h===41?d(h):Gie(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Yl(h)?a2(t,l)(h):d(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?Wie(t,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return Yl(h)?a2(t,d)(h):d(h)}function d(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function nPe(t,e,n){const r=this;return i;function i(o){return Vie.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(db(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function rPe(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const iPe={name:"labelStartImage",resolveAll:lz.resolveAll,tokenize:sPe};function sPe(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const aPe={name:"labelStartLink",resolveAll:lz.resolveAll,tokenize:oPe};function oPe(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const gj={name:"lineEnding",tokenize:lPe};function lPe(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Gi(t,e,"linePrefix")}}const tN={name:"thematicBreak",tokenize:cPe};function cPe(t,e,n){let r=0,i;return s;function s(u){return t.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(t.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||nr(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),mi(u)?Gi(t,o,"whitespace")(u):o(u))}}const Dl={continuation:{tokenize:fPe},exit:mPe,name:"list",tokenize:hPe},uPe={partial:!0,tokenize:gPe},dPe={partial:!0,tokenize:pPe};function hPe(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:V4(f)){if(r.containerState.type||(r.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(tN,n,u)(f):u(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return n(f)}function l(f){return V4(f)&&++a<10?(t.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),u(f)):n(f)}function u(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(gM,r.interrupt?n:d,t.attempt(uPe,p,h))}
vendor: 9,137 bytes, lines 773-775
773function d(f){return r.containerState.initialBlankLine=!0,s++,p(f)}function h(f){return mi(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function fPe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(gM,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gi(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!mi(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(dPe,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gi(t,t.attempt(Dl,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function pPe(t,e,n){const r=this;return Gi(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function mPe(t){t.exit(this.containerState.type)}function gPe(t,e,n){const r=this;return Gi(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!mi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const dV={name:"setextUnderline",resolveTo:xPe,tokenize:vPe};function xPe(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function vPe(t,e,n){const r=this;let i;return s;function s(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),mi(u)?Gi(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||nr(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const yPe={tokenize:bPe};function bPe(t){const e=this,n=t.attempt(gM,r,t.attempt(this.parser.constructs.flowInitial,i,Gi(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Eje,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const wPe={resolveAll:Kie()},_Pe=$ie("string"),SPe=$ie("text");function $ie(t){return{resolveAll:Kie(t==="text"?APe:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(d){return u(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const h=i[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Kie(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function APe(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const u={type:n===t.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(t.splice(n,0,["enter",u,e],["exit",u,e]),n+=2)}n++}return t}const EPe={42:Dl,43:Dl,45:Dl,48:Dl,49:Dl,50:Dl,51:Dl,52:Dl,53:Dl,54:Dl,55:Dl,56:Dl,57:Dl,62:Oie},kPe={91:Mje},CPe={[-2]:mj,[-1]:mj,32:mj},NPe={35:Dje,42:tN,45:[dV,tN],60:zje,61:dV,95:tN,96:cV,126:cV},TPe={38:Uie,92:zie},MPe={[-5]:gj,[-4]:gj,[-3]:gj,33:iPe,38:Uie,42:W4,60:[aje,Kje],91:aPe,92:[Lje,zie],93:lz,95:W4,96:yje},RPe={null:[W4,wPe]},jPe={null:[42,95]},PPe={null:[]},LPe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jPe,contentInitial:kPe,disable:PPe,document:EPe,flow:NPe,flowInitial:CPe,insideSpan:RPe,string:TPe,text:MPe},Symbol.toStringTag,{value:"Module"}));function IPe(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:M(A),check:M(k),consume:b,enter:y,exit:S,interrupt:M(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:m,parser:t,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=e.tokenize.call(u,l);return e.resolveAll&&s.push(e),u;function h(P){return a=lu(a,P),v(),a[a.length-1]!==null?[]:(T(e,0),u.events=oz(s,u.events,u),u.events)}function p(P,j){return BPe(f(P),j)}function f(P){return DPe(a,P)}function m(){const{_bufferIndex:P,_index:j,line:G,column:B,offset:$}=r;return{_bufferIndex:P,_index:j,line:G,column:B,offset:$}}function x(P){i[P.line]=P.column,R()}function v(){let P;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<j.length;)g(j.charCodeAt(r._bufferIndex));else g(j)}}function g(P){d=d(P)}function b(P){nr(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,R()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=P}function y(P,j){const G=j||{};return G.type=P,G.start=m(),u.events.push(["enter",G,u]),o.push(G),G}function S(P){const j=o.pop();return j.end=m(),u.events.push(["exit",j,u]),j}function A(P,j){T(P,j.from)}function k(P,j){j.restore()}function M(P,j){return G;function G(B,$,U){let Z,V,W,O;return Array.isArray(B)?z(B):"tokenize"in B?z([B]):Y(B);function Y(se){return ie;function ie(le){const xe=le!==null&&se[le],Ee=le!==null&&se.null,ae=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return z(ae)(le)}}function z(se){return Z=se,V=0,se.length===0?U:I(se[V])}function I(se){return ie;function ie(le){return O=C(),W=se,se.partial||(u.currentConstruct=se),se.name&&u.parser.constructs.disable.null.includes(se.name)?te():se.tokenize.call(j?Object.assign(Object.create(u),j):u,l,q,te)(le)}}function q(se){return P(W,O),$}function te(se){return O.restore(),++V<Z.length?I(Z[V]):U}}}function T(P,j){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&Ch(u.events,j,u.events.length-j,P.resolve(u.events.slice(j),u)),P.resolveTo&&(u.events=P.resolveTo(u.events,u))}function C(){const P=m(),j=u.previous,G=u.currentConstruct,B=u.events.length,$=Array.from(o);return{from:B,restore:U};function U(){r=P,u.previous=j,u.currentConstruct=G,u.events.length=B,o=$,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function DPe(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function BPe(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=` 774`;break}case-3:{a=`\r 775`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function FPe(t){const r={constructs:WRe([LPe,...(t||{}).extensions||[]]),content:i(QRe),defined:[],document:i(tje),flow:i(yPe),lazy:{},string:i(_Pe),text:i(SPe)};return r;function i(s){return a;function a(o){return IPe(r,s,o)}}}function OPe(t){for(;!Hie(t););return t}const hV=/[\0\t\n\r]/g;function zPe(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const l=[];let u,d,h,p,f;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,e="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(hV.lastIndex=h,u=hV.exec(s),p=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(p),!u){e=s.slice(h);break}
vendor: 11,123 bytes, line 775
775if(f===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(s.slice(h,p)),t+=p-h),f){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}h=p+1}return o&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const UPe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HPe(t){return t.replace(UPe,GPe)}function GPe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Fie(n.slice(s?2:1),s?16:10)}return az(n)||t}const qie={}.hasOwnProperty;function VPe(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),WPe(n)(OPe(FPe(n).document().write(zPe()(t,e,!0))))}function WPe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ee),autolinkProtocol:C,autolinkEmail:C,atxHeading:s(K),blockQuote:s(Ee),characterEscape:C,characterReference:C,codeFenced:s(ae),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ae,a),codeText:s(Q,a),codeTextData:C,data:C,codeFlowValue:C,definition:s(we),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Ae),hardBreakEscape:s(pe),hardBreakTrailing:s(pe),htmlFlow:s(ye,a),htmlFlowData:C,htmlText:s(ye,a),htmlTextData:C,image:s(Se),label:a,link:s(ee),listItem:s(me),listItemValue:p,listOrdered:s(re,h),listUnordered:s(re),paragraph:s(Ge),reference:I,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(K),strong:s(He),thematicBreak:s(Ne)},exit:{atxHeading:l(),atxHeadingSequence:A,autolink:l(),autolinkEmail:xe,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:se,characterReference:ie,codeFenced:l(v),codeFencedFence:x,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(g),codeText:l($),codeTextData:R,data:R,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(G),htmlFlowData:R,htmlText:l(B),htmlTextData:R,image:l(Z),label:W,labelText:V,lineEnding:P,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:q,resourceDestinationString:O,resourceTitleString:Y,resource:z,setextHeading:l(T),setextHeadingLineSequence:M,setextHeadingText:k,strong:l(),thematicBreak:l()}};Xie(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ce={type:"root",children:[]};const Ke={stack:[Ce],tokenStack:[],config:e,enter:o,exit:u,buffer:a,resume:d,data:n},Qe=[];let je=-1;for(;++je<ue.length;)if(ue[je][1].type==="listOrdered"||ue[je][1].type==="listUnordered")if(ue[je][0]==="enter")Qe.push(je);else{const We=Qe.pop();je=i(ue,We,je)}for(je=-1;++je<ue.length;){const We=e[ue[je][0]];qie.call(We,ue[je][1].type)&&We[ue[je][1].type].call(Object.assign({sliceSerialize:ue[je][2].sliceSerialize},Ke),ue[je][1])}if(Ke.tokenStack.length>0){const We=Ke.tokenStack[Ke.tokenStack.length-1];(We[1]||fV).call(Ke,void 0,We[0])}for(Ce.position={start:gp(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:gp(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<e.transforms.length;)Ce=e.transforms[je](Ce)||Ce;return Ce}function i(ue,Ce,Ke){let Qe=Ce-1,je=-1,We=!1,xt,et,Je,Ze;for(;++Qe<=Ke;){const Me=ue[Qe];switch(Me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Me[0]==="enter"?je++:je--,Ze=void 0;break}case"lineEndingBlank":{Me[0]==="enter"&&(xt&&!Ze&&!je&&!Je&&(Je=Qe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!je&&Me[0]==="enter"&&Me[1].type==="listItemPrefix"||je===-1&&Me[0]==="exit"&&(Me[1].type==="listUnordered"||Me[1].type==="listOrdered")){if(xt){let Xe=Qe;for(et=void 0;Xe--;){const ut=ue[Xe];if(ut[1].type==="lineEnding"||ut[1].type==="lineEndingBlank"){if(ut[0]==="exit")continue;et&&(ue[et][1].type="lineEndingBlank",We=!0),ut[1].type="lineEnding",et=Xe}else if(!(ut[1].type==="linePrefix"||ut[1].type==="blockQuotePrefix"||ut[1].type==="blockQuotePrefixWhitespace"||ut[1].type==="blockQuoteMarker"||ut[1].type==="listItemIndent"))break}Je&&(!et||Je<et)&&(xt._spread=!0),xt.end=Object.assign({},et?ue[et][1].start:Me[1].end),ue.splice(et||Qe,0,["exit",xt,Me[2]]),Qe++,Ke++}if(Me[1].type==="listItemPrefix"){const Xe={type:"listItem",_spread:!1,start:Object.assign({},Me[1].start),end:void 0};xt=Xe,ue.splice(Qe,0,["enter",Xe,Me[2]]),Qe++,Ke++,Je=void 0,Ze=!0}}}return ue[Ce][1]._spread=We,Ke}function s(ue,Ce){return Ke;function Ke(Qe){o.call(this,ue(Qe),Qe),Ce&&Ce.call(this,Qe)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ue,Ce,Ke){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Ce,Ke||void 0]),ue.position={start:gp(Ce.start),end:void 0}}function l(ue){return Ce;function Ce(Ke){ue&&ue.call(this,Ke),u.call(this,Ke)}}function u(ue,Ce){const Ke=this.stack.pop(),Qe=this.tokenStack.pop();if(Qe)Qe[0].type!==ue.type&&(Ce?Ce.call(this,ue,Qe[0]):(Qe[1]||fV).call(this,ue,Qe[0]));else throw new Error("Cannot close `"+ue.type+"` ("+s2({start:ue.start,end:ue.end})+"): itâs not open");Ke.position.end=gp(ue.end)}function d(){return GRe(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(ue){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function f(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=ue}function m(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=ue}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ue.replace(/(\r?\n|\r)$/g,"")}function b(ue){const Ce=this.resume(),Ke=this.stack[this.stack.length-1];Ke.label=Ce,Ke.identifier=db(this.sliceSerialize(ue)).toLowerCase()}function y(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=ue}function S(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=ue}function A(ue){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Ke=this.sliceSerialize(ue).length;Ce.depth=Ke}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function M(ue){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function C(ue){const Ke=this.stack[this.stack.length-1].children;let Qe=Ke[Ke.length-1];(!Qe||Qe.type!=="text")&&(Qe=_e(),Qe.position={start:gp(ue.start),end:void 0},Ke.push(Qe)),this.stack.push(Qe)}function R(ue){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(ue),Ce.position.end=gp(ue.end)}function P(ue){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ke=Ce.children[Ce.children.length-1];Ke.position.end=gp(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Ce.type)&&(C.call(this,ue),R.call(this,ue))}function j(){this.data.atHardBreak=!0}function G(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ue}function B(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ue}function $(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=ue}function U(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ce,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Z(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ce,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function V(ue){const Ce=this.sliceSerialize(ue),Ke=this.stack[this.stack.length-2];Ke.label=HPe(Ce),Ke.identifier=db(Ce).toLowerCase()}function W(){const ue=this.stack[this.stack.length-1],Ce=this.resume(),Ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ke.type==="link"){const Qe=ue.children;Ke.children=Qe}else Ke.alt=Ce}function O(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=ue}function Y(){const ue=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=ue}function z(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function q(ue){const Ce=this.resume(),Ke=this.stack[this.stack.length-1];Ke.label=Ce,Ke.identifier=db(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function te(ue){this.data.characterReferenceType=ue.type}function se(ue){const Ce=this.sliceSerialize(ue),Ke=this.data.characterReferenceType;let Qe;Ke?(Qe=Fie(Ce,Ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Qe=az(Ce);const je=this.stack[this.stack.length-1];je.value+=Qe}function ie(ue){const Ce=this.stack.pop();Ce.position.end=gp(ue.end)}function le(ue){R.call(this,ue);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(ue)}function xe(ue){R.call(this,ue);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(ue)}function Ee(){return{type:"blockquote",children:[]}}function ae(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function ye(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function ee(){return{type:"link",title:null,url:"",children:[]}}function re(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function me(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Ge(){return{type:"paragraph",children:[]}}function He(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function Ne(){return{type:"thematicBreak"}}}function gp(t){return{line:t.line,column:t.column,offset:t.offset}}function Xie(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Xie(t,r):$Pe(t,r)}}function $Pe(t,e){let n;for(n in e)if(qie.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function fV(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+s2({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+s2({start:e.start,end:e.end}
vendor: 12,238 bytes, lines 775-780
775)+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+s2({start:e.start,end:e.end})+") is still open")}function KPe(t){const e=this;e.parser=n;function n(r){return VPe(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function qPe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function XPe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` 776`}]}function YPe(t,e){const n=e.value?e.value+` 777`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function JPe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ZPe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function QPe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=J1(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function eLe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function tLe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Yie(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function nLe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Yie(t,e);const i={src:J1(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function rLe(t,e){const n={src:J1(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function iLe(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function sLe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Yie(t,e);const i={href:J1(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function aLe(t,e){const n={href:J1(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function oLe(t,e,n){const r=t.all(e),i=n?lLe(n):Jie(e),s={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:` 778`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:` 779`});const u={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,u),t.applyData(e,u)}function lLe(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Jie(n[r])}return e}function Jie(t){const e=t.spread;return e??t.children.length>1}function cLe(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function uLe(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dLe(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function hLe(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function fLe(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=nz(e.children[1]),l=Rie(e.children[e.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function pLe(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let l=-1;const u=[];for(;++l<o;){const h=e.children[l],p={},f=a?a[l]:void 0;f&&(p.align=f);let m={type:"element",tagName:s,properties:p,children:[]};h&&(m.children=t.all(h),t.patch(h,m),m=t.applyData(h,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function mLe(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const pV=9,mV=32;function gLe(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(gV(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(gV(e.slice(i),i>0,!1)),s.join("")}function gV(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===pV||s===mV;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===pV||s===mV;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function xLe(t,e){const n={type:"text",value:gLe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function vLe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const yLe={blockquote:qPe,break:XPe,code:YPe,delete:JPe,emphasis:ZPe,footnoteReference:QPe,heading:eLe,html:tLe,imageReference:nLe,image:rLe,inlineCode:iLe,linkReference:sLe,link:aLe,listItem:oLe,list:cLe,paragraph:uLe,root:dLe,strong:hLe,table:fLe,tableCell:mLe,tableRow:pLe,text:xLe,thematicBreak:vLe,toml:ik,yaml:ik,definition:ik,footnoteDefinition:ik};function ik(){}const Zie=-1,xM=0,o2=1,PT=2,cz=3,uz=4,dz=5,hz=6,Qie=7,ese=8,xV=typeof self=="object"?self:globalThis,bLe=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case xM:case Zie:return n(a,i);case o2:{const o=n([],i);for(const l of a)o.push(r(l));return o}case PT:{const o=n({},i);for(const[l,u]of a)o[r(l)]=r(u);return o}case cz:return n(new Date(a),i);case uz:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case dz:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case hz:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case Qie:{const{name:o,message:l}=a;return n(new xV[o](l),i)}case ese:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new xV[s](a),i)};return r},vV=t=>bLe(new Map,t)(0),Ev="",{toString:wLe}={},{keys:_Le}=Object,Yw=t=>{const e=typeof t;if(e!=="object"||!t)return[xM,e];const n=wLe.call(t).slice(8,-1);switch(n){case"Array":return[o2,Ev];case"Object":return[PT,Ev];case"Date":return[cz,Ev];case"RegExp":return[uz,Ev];case"Map":return[dz,Ev];case"Set":return[hz,Ev];case"DataView":return[o2,n]}return n.includes("Array")?[o2,n]:n.includes("Error")?[Qie,n]:[PT,n]},sk=([t,e])=>t===xM&&(e==="function"||e==="symbol"),SLe=(t,e,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Yw(a);switch(o){case xM:{let d=a;switch(l){case"bigint":o=ese,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([Zie],a)}return i([o,d],a)}case o2:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),i([l,[...p]],a)}const d=[],h=i([o,d],a);for(const p of a)d.push(s(p));return h}case PT:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([o,d],a);for(const p of _Le(a))(t||!sk(Yw(a[p])))&&d.push([s(p),s(a[p])]);return h}case cz:return i([o,a.toISOString()],a);case uz:{const{source:d,flags:h}=a;return i([o,{source:d,flags:h}],a)}case dz:{const d=[],h=i([o,d],a);for(const[p,f]of a)(t||!(sk(Yw(p))||sk(Yw(f))))&&d.push([s(p),s(f)]);return h}case hz:{const d=[],h=i([o,d],a);for(const p of a)(t||!sk(Yw(p)))&&d.push(s(p));return h}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},yV=(t,{json:e,lossy:n}={})=>{const r=[];return SLe(!(e||n),!!e,new Map,r)(t),r},LT=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?vV(yV(t,e)):structuredClone(t):(t,e)=>vV(yV(t,e));function ALe(t,e){const n=[{type:"text",value:"â©"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function ELe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function kLe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||ALe,r=t.options.footnoteBackLabel||ELe,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[l]);if(!u)continue;const d=t.all(u),h=String(u.identifier).toUpperCase(),p=J1(h.toLowerCase());let f=0;const m=[],x=t.footnoteCounts.get(h);for(;x!==void 0&&++f<=x;){m.length>0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,f);typeof b=="string"&&(b={type:"text",value:b}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(d,!0)};t.patch(u,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...LT(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` 780`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)}
vendor: 9,662 bytes, lines 780-785
780,{type:"text",value:` 781`}]}}const tse=function(t){if(t==null)return MLe;if(typeof t=="function")return vM(t);if(typeof t=="object")return Array.isArray(t)?CLe(t):NLe(t);if(typeof t=="string")return TLe(t);throw new Error("Expected function, string, or object as test")};function CLe(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=tse(t[n]);return vM(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function NLe(t){const e=t;return vM(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function TLe(t){return vM(e);function e(n){return n&&n.type===t}}function vM(t){return e;function e(n,r,i){return!!(RLe(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function MLe(){return!0}function RLe(t){return t!==null&&typeof t=="object"&&"type"in t}const nse=[],jLe=!0,bV=!1,PLe="skip";function LLe(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=tse(i),a=r?-1:1;o(t,void 0,[])();function o(l,u,d){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=nse,m,x,v;if((!e||s(l,u,d[d.length-1]||void 0))&&(f=ILe(n(l,d)),f[0]===bV))return f;if("children"in l&&l.children){const g=l;if(g.children&&f[0]!==PLe)for(x=(r?g.children.length:-1)+a,v=d.concat(g);x>-1&&x<g.children.length;){const b=g.children[x];if(m=o(b,x,v)(),m[0]===bV)return m;x=typeof m[1]=="number"?m[1]:x+a}}return f}}}function ILe(t){return Array.isArray(t)?t:typeof t=="number"?[jLe,t]:t==null?nse:[t]}function rse(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),LLe(t,s,o,i);function o(l,u){const d=u[u.length-1],h=d?d.children.indexOf(l):void 0;return a(l,h,d)}}const $4={}.hasOwnProperty,DLe={};function BLe(t,e){const n=e||DLe,r=new Map,i=new Map,s=new Map,a={...yLe,...n.handlers},o={all:u,applyData:OLe,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:FLe,wrap:ULe};return rse(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),o;function l(d,h){const p=d.type,f=o.handlers[p];if($4.call(o.handlers,p)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:x,...v}=d,g=LT(v);return g.children=o.all(d),g}return LT(d)}return(o.options.unknownHandler||zLe)(o,d,h)}function u(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const m=o.one(p[f],d);if(m){if(f&&p[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=wV(m.value)),!Array.isArray(m)&&m.type==="element")){const x=m.children[0];x&&x.type==="text"&&(x.value=wV(x.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function FLe(t,e){t.position&&(e.position=wRe(t))}function OLe(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,LT(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function zLe(t,e){const n=e.data||{},r="value"in e&&!($4.call(n,"hProperties")||$4.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function ULe(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:` 782`});++r<t.length;)r&&n.push({type:"text",value:` 783`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:` 784`}),n}function wV(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function _V(t,e){const n=BLe(t,e),r=n.one(t,void 0),i=kLe(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` 785`},i),s}function HLe(t,e){return t&&"run"in t?async function(n,r){const i=_V(n,{file:r,...e});await t.run(i,r)}:function(n,r){return _V(n,{file:r,...t||e})}}function SV(t){if(t)throw t}var nN=Object.prototype.hasOwnProperty,ise=Object.prototype.toString,AV=Object.defineProperty,EV=Object.getOwnPropertyDescriptor,kV=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ise.call(e)==="[object Array]"},CV=function(e){if(!e||ise.call(e)!=="[object Object]")return!1;var n=nN.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&nN.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||nN.call(e,i)},NV=function(e,n){AV&&n.name==="__proto__"?AV(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},TV=function(e,n){if(n==="__proto__")if(nN.call(e,n)){if(EV)return EV(e,n).value}else return;return e[n]},GLe=function t(){var e,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(e=arguments[l],e!=null)for(n in e)r=TV(o,n),i=TV(e,n),o!==i&&(d&&i&&(CV(i)||(s=kV(i)))?(s?(s=!1,a=r&&kV(r)?r:[]):a=r&&CV(r)?r:{},NV(o,{name:n,newValue:t(d,a,i)})):typeof i<"u"&&NV(o,{name:n,newValue:i}));return o};const xj=DS(GLe);function K4(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function VLe(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const d=t[++s];let h=-1;if(l){a(l);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?WLe(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function WLe(t,e){let n;return r;function r(...a){const o=t.length>a.length;let l;o&&a.push(i);try{l=t.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const eh={basename:$Le,dirname:KLe,extname:qLe,join:XLe,sep:"/"};function $Le(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');_A(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function KLe(t){if(_A(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function qLe(t){_A(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function XLe(...t){let e=-1,n;for(;++e<t.length;)_A(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":YLe(n)}function YLe(t){_A(t);const e=t.codePointAt(0)===47;let n=JLe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function JLe(t,e){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function _A(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const ZLe={cwd:QLe};function QLe(){return"/"}function q4(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function eIe(t){if(typeof t=="string")t=new URL(t);else if(!q4(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return tIe(t)}function tIe(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const vj=["history","path","basename","stem","extname","dirname"];class sse{constructor(e){let n;e?q4(e)?n={path:e}:typeof e=="string"||nIe(e)?n={value:e}
vendor: 10,979 bytes, lines 785-788
785:n=e:n={},this.cwd="cwd"in n?"":ZLe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vj.length;){const s=vj[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)vj.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?eh.basename(this.path):void 0}set basename(e){bj(e,"basename"),yj(e,"basename"),this.path=eh.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?eh.dirname(this.path):void 0}set dirname(e){MV(this.basename,"dirname"),this.path=eh.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?eh.extname(this.path):void 0}set extname(e){if(yj(e,"extname"),MV(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=eh.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){q4(e)&&(e=eIe(e)),bj(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?eh.basename(this.path,this.extname):void 0}set stem(e){bj(e,"stem"),yj(e,"stem"),this.path=eh.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Jo(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function yj(t,e){if(t&&t.includes(eh.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+eh.sep+"`")}function bj(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function MV(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function nIe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const rIe=function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},iIe={}.hasOwnProperty;class fz extends rIe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=VLe()}copy(){const e=new fz;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(xj(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Sj("data",this.frozen),this.namespace[e]=n,this):iIe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Sj("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=ak(e),r=this.parser||this.Parser;return wj("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),wj("process",this.parser||this.Parser),_j("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=ak(e),l=r.parse(o);r.run(l,o,function(d,h,p){if(d||!h||!p)return u(d);const f=h,m=r.stringify(f,p);oIe(m)?p.value=m:p.result=m,u(d,p)});function u(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(e){let n=!1,r;return this.freeze(),wj("processSync",this.parser||this.Parser),_j("processSync",this.compiler||this.Compiler),this.process(e,i),jV("processSync","process",n),r;function i(s,a){n=!0,SV(s),r=a}}run(e,n,r){RV(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=ak(n);i.run(e,l,u);function u(d,h,p){const f=h||e;d?o(d):a?a(f):r(void 0,f,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),jV("runSync","run",r),i;function s(a,o){SV(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=ak(n),i=this.compiler||this.Compiler;return _j("stringify",i),RV(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(Sj("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;l(d,h)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=xj(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[f,...m]=d;const x=r[p][1];K4(x)&&K4(f)&&(f=xj(!0,x,f)),r[p]=[u,f,...m]}}}}const sIe=new fz().freeze();function wj(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function _j(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Sj(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RV(t){if(!K4(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function jV(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ak(t){return aIe(t)?t:new sse(t)}function aIe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function oIe(t){return typeof t=="string"||lIe(t)}function lIe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const cIe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",PV=[],LV={allowDangerousHtml:!0},uIe=/^(https?|ircs?|mailto|xmpp)$/i,dIe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function hIe(t){const e=fIe(t),n=pIe(t);return mIe(e.runSync(e.parse(n),n),t)}function fIe(t){const e=t.rehypePlugins||PV,n=t.remarkPlugins||PV,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...LV}:LV;return sIe().use(KPe).use(n).use(HLe,r).use(e)}function pIe(t){const e=t.children||"",n=new sse;return typeof e=="string"&&(n.value=e),n}function mIe(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||gIe;for(const d of dIe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+cIe+d.id,void 0);return rse(t,u),kRe(t,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,h,p){if(d.type==="raw"&&p&&typeof h=="number")return a?p.children.splice(h,1):p.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in pj)if(Object.hasOwn(pj,f)&&Object.hasOwn(d.properties,f)){const m=d.properties[f],x=pj[f];(x===null||x.includes(d.tagName))&&(d.properties[f]=l(String(m||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,p)),f&&p&&typeof h=="number")return o&&d.children?p.children.splice(h,1,...d.children):p.children.splice(h,1),h}}}function gIe(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||uIe.test(t.slice(0,e))?t:""}const xIe=`â Unser Regalberater macht wohl gerade Mittagspause! Aber keine Sorge â unsere Mitarbeiter helfen Ihnen gerne weiter: 786 787ð **+49 (0)221 82 82 93 87** 788âï¸ **[email protected]**`,IV="Hallo! ð Ich bin Ihr Regalberater. Fragen Sie mich gerne zu Aufbau, MaÃen, Traglasten oder Konfiguration â ich helfe Ihnen gerne weiter!",vIe="https://ntxxmvyoiatxvggtjtfg.supabase.co/functions/v1/chat",yIe=["Wie baue ich das Regal auf?","Was ist der Unterschied GL/RL?","Welche Tiefe empfehlt ihr?"],Aj=500;function bIe(t,e){const n={};if(n.regaltyp=U0[t.regaltyp]??t.regaltyp,n.hoehe=String(t.hoehe),n.tiefe=String(t.tiefe),"farbe"in t&&(n.farbe=t.farbe),"rueckwandtyp"in t&&t.rueckwandtyp&&(n.rueckwandtyp=t.rueckwandtyp),"saeulentyp"in t&&(n.saeulentyp=t.saeulentyp),"anbauart"in t&&t.anbauart&&(n.anbauart=t.anbauart),e){n.breite=`${e.gesamtbreite} m`,n.gesamtpreis=H0(e.gesamtpreis);const r=e.positionen.filter(i=>i.anzahl>0&&!i.warnung).map(i=>`${i.anzahl}x ${i.artikelname}`).join(", ");r&&(n.positionen=r)}return n}async function wIe(t,e,n,r,i){const s=await fetch(vIe,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50eHhtdnlvaWF0eHZnZ3RqdGZnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE4NDgyNjgsImV4cCI6MjA4NzQyNDI2OH0.35kO11-oFUIEhCT5iqxnjPGFOhiJWhYbgk2zVQUsDXI"},body:JSON.stringify({messages:t,context:bIe(e,n)}),signal:i});if(!s.ok)throw new Error(`HTTP ${s.status}`);if(!s.body)throw new Error("No body");const a=s.body.getReader(),o=new TextDecoder;let l="",u="";const d=p=>{var m,x,v;if(p.endsWith("\r")&&(p=p.slice(0,-1)),p.startsWith(":")||p.trim()===""||!p.startsWith("data: "))return!1;const f=p.slice(6).trim();if(f==="[DONE]")return!0;try{const b=(v=(x=(m=JSON.parse(f).choices)==null?void 0:m[0])==null?void 0:x.delta)==null?void 0:v.content;b&&(u+=b,r(u))}catch{}return!1};let h=!1;for(;!h;){const{done:p,value:f}=await a.read();if(p)break;l+=o.decode(f,{stream:!0});let m;
788for(;(m=l.indexOf(` 789`))!==-1;){const x=l.slice(0,m);if(l=l.slice(m+1),d(x)){h=!0;break}}}if(l.trim())for(const p of l.split(` 790`))p.trim()&&d(p);return u}function SA({config:t,ergebnis:e,quickSuggestions:n}){var y;const[r,i]=E.useState(!1),s=()=>{i(!0)},[a,o]=E.useState([{role:"assistant",content:IV}]),[l,u]=E.useState(""),[d,h]=E.useState(!1),p=E.useRef(null),f=E.useRef(null);E.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[a]),E.useEffect(()=>{r&&f.current&&f.current.focus()},[r]);const m=E.useCallback(async S=>{if(!S.trim()||d)return;u("");const A={role:"user",content:S.trim()},k=[...a,A];o(k),h(!0);const M=new AbortController,T=setTimeout(()=>M.abort(),3e4);try{await wIe(k,t,e,R=>{o(P=>{const j=P[P.length-1];return(j==null?void 0:j.role)==="assistant"&&P.length>k.length?P.map((G,B)=>B===P.length-1?{...G,content:R}:G):[...P.slice(0,k.length),{role:"assistant",content:R}]})},M.signal)}catch(C){console.error("Chat error:",C),o(R=>{const P=R[R.length-1];return(P==null?void 0:P.role)==="assistant"&&P.content.length>0&&R.length>k.length?R:[...R.slice(0,k.length),{role:"assistant",content:xIe}]})}finally{clearTimeout(T),h(!1)}},[d,a,t,e]),x=E.useCallback(S=>{S.preventDefault(),m(l)},[l,m]),v=E.useCallback(()=>{o([{role:"assistant",content:IV}]),u("")},[]),g=a.some(S=>S.role==="user"),b=!g;return c.jsxs(c.Fragment,{children:[c.jsx(bo,{children:!r&&c.jsx(tn.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},className:"fixed bottom-20 sm:bottom-6 right-4 sm:right-6 z-50 will-change-transform",style:{transform:"translateZ(0)"},children:c.jsxs(qN,{delayDuration:0,children:[c.jsx(XN,{asChild:!0,children:c.jsx(Pt,{size:"lg",onClick:s,className:"rounded-full w-14 h-14 shadow-lg hover:shadow-xl transition-shadow p-0",children:c.jsx(h8,{className:"w-6 h-6"})})}),c.jsx(O2,{side:"left",className:"max-w-[200px] text-center",children:"Fragen zu Aufbau, MaÃen oder Konfiguration? Unser KI-Berater hilft Ihnen!"})]})})}),c.jsx(bo,{children:r&&c.jsxs(tn.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2},className:"fixed z-50 bottom-0 right-0 w-full h-[100dvh] sm:bottom-6 sm:right-6 sm:w-[380px] sm:max-w-[calc(100vw-1.5rem)] sm:h-[520px] sm:max-h-[calc(100dvh-6rem)] flex flex-col sm:rounded-2xl border bg-background shadow-2xl overflow-hidden will-change-transform overscroll-contain",style:{transform:"translateZ(0)"},children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-primary text-primary-foreground",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(h8,{className:"w-5 h-5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold leading-none",children:"Regalberater"}),c.jsx("p",{className:"text-[11px] opacity-80",children:"Fragen zu Aufbau & Konfiguration"})]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[g&&c.jsx("button",{onClick:v,className:"hover:opacity-70 transition-opacity p-1",title:"Chat löschen",children:c.jsx(b1,{className:"w-4 h-4"})}),c.jsx("button",{onClick:()=>i(!1),className:"hover:opacity-70 transition-opacity p-1",children:c.jsx(Bc,{className:"w-5 h-5"})})]})]}),c.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[a.map((S,A)=>c.jsx("div",{className:`flex ${S.role==="user"?"justify-end":"justify-start"}`,children:c.jsx("div",{className:`max-w-[85%] rounded-2xl px-3.5 py-2.5 text-sm ${S.role==="user"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"}`,children:S.role==="assistant"?c.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert [&>p]:mb-1.5 [&>p:last-child]:mb-0 [&>ul]:my-1 [&>ol]:my-1",children:c.jsx(hIe,{children:S.content})}):S.content})},A)),b&&c.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 pt-1",children:(n??yIe).map(S=>c.jsx("button",{onClick:()=>m(S),className:"text-xs px-2.5 py-1 rounded-full border border-border hover:bg-accent transition-colors",children:S},S))}),d&&((y=a[a.length-1])==null?void 0:y.role)!=="assistant"&&c.jsx("div",{className:"flex justify-start",children:c.jsx("div",{className:"bg-muted rounded-2xl rounded-bl-md px-4 py-3",children:c.jsx(md,{className:"w-4 h-4 animate-spin text-muted-foreground"})})})]}),c.jsx("div",{className:"border-t px-3 py-2.5",children:c.jsxs("form",{onSubmit:x,className:"flex items-center gap-2",children:[c.jsxs("div",{className:"flex-1 relative",children:[c.jsx("input",{ref:f,value:l,onCh
790ange:S=>u(S.target.value),placeholder:"Frage stellenâ¦",disabled:d,maxLength:Aj,className:"w-full text-sm bg-transparent outline-none placeholder:text-muted-foreground disabled:opacity-50"}),l.length>Aj-100&&c.jsxs("span",{className:"absolute right-0 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:[l.length,"/",Aj]})]}),c.jsx(Pt,{type:"submit",size:"icon",variant:"ghost",disabled:!l.trim()||d,className:"shrink-0 h-8 w-8",children:c.jsx(upe,{className:"w-4 h-4"})})]})})]})})]})}function Z1({activeTab:t,onTabChange:e,totalPrice:n}){const[r,i]=E.useState(!1),s=E.useRef(n);E.useEffect(()=>{if(n!=null&&s.current!=null&&n!==s.current){i(!0);const o=setTimeout(()=>i(!1),600);return()=>clearTimeout(o)}s.current=n},[n]);const a=o=>o.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" â¬";return c.jsx("div",{className:"lg:hidden border-b border-border bg-background",children:c.jsx("div",{className:"container mx-auto px-4 max-w-7xl",children:c.jsxs("div",{className:"grid grid-cols-2 gap-1 py-1.5",children:[c.jsxs("button",{onClick:()=>e("config"),className:`relative flex items-center justify-center gap-2 py-2.5 rounded-lg text-sm font-medium transition-all ${t==="config"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[c.jsx($S,{className:"w-4 h-4"}),"Konfiguration"]}),c.jsxs("button",{onClick:()=>e("result"),className:`relative flex items-center justify-center gap-1.5 py-2.5 rounded-lg text-sm font-medium transition-all min-w-0 ${t==="result"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[c.jsx(yJ,{className:"w-4 h-4 shrink-0"}),n!=null&&n>0?c.jsx(bo,{mode:"wait",children:c.jsx(tn.span,{initial:{scale:1},animate:r?{scale:[1,1.15,1]}:{scale:1},transition:{duration:.4},className:`text-[11px] font-bold px-1.5 py-0.5 rounded-full truncate ${t==="result"?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/10 text-primary"}`,children:a(n)},n)}):c.jsx("span",{className:"truncate",children:"Ergebnis"})]})]})})})}function Ix({expectedKonfigurator:t,applyKonfiguration:e,skip:n}){const[r,i]=Al(),s=r.get("code"),[a,o]=E.useState(!!s),l=E.useRef(!1);return E.useEffect(()=>{l.current||n||!s||(l.current=!0,o(!0),ute(s).then(u=>{if(u.konfigurator!==t){dn({title:"Code gehört zu einem anderen Konfigurator",description:"Bitte den passenden Konfigurator öffnen.",variant:"destructive"});return}e(u.konfiguration),dn({title:"Konfiguration geladen",description:"Ihre gespeicherte Konfiguration wurde wiederhergestellt."})}).catch(u=>{dn({title:"Code ungültig oder abgelaufen",description:u instanceof Error?u.message:"Bitte prüfen.",variant:"destructive"})}).finally(()=>{o(!1);const u=new URLSearchParams(r);u.delete("code"),i(u,{replace:!0})}))},[s,n]),{hydrating:a,hasCode:!!s}}const _Ie=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),{preisliste:s,breitenModule:a,rueckwandLogik:o,farblogik:l,tierPrices:u,isLoading:d,error:h}=F1("wandregal"),[p,f]=E.useState(zSe()),[m,x]=E.useState(null),[v,g]=E.useState(null);Ix({expectedKonfigurator:"regal",skip:d,applyKonfiguration:R=>{const P=R&&typeof R=="object"?R:{};P.config?f(P.config):P&&"hoehe"in P&&"breite"in P&&f(P)}});const b=E.useCallback(R=>{f(P=>{const j={...P,...R};if("hoehe"in R&&P.rueckwandTypen&&(j.rueckwandTypen=null),"breite"in R&&(x(null),g(null)),"tiefe"in R&&P.fachbodenTiefen){const G=j.sockelbodenTiefe??j.tiefe;j.fachbodenTiefen=P.fachbodenTiefen.map(B=>Math.min(B,G));for(let B=1;B<j.fachbodenTiefen.length;B++)j.fachbodenTiefen[B]=Math.min(j.fachbodenTiefen[B],j.fachbodenTiefen[B-1])}if("anzahlFachboeden"in R&&P.fachbodenTiefen){const G=R.anzahlFachboeden,B=P.fachbodenTiefen;if(G<=B.length)j.fachbodenTiefen=B.slice(0,G);else{const $=B.length>0?B[B.length-1]:j.tiefe;j.fachbodenTiefen=[...B,...Array(G-B.length).fill($)]}}return j})},[]),y=E.useMemo(()=>p.breite===null||!a.length?null:a.find(R=>Math.abs(R.gesamtbreite_plus3-p.breite)<.005)||null,[p.breite,a]),S=E.useMemo(()=>
790{if(m)return m;if(!y||p.breite===null)return null;const R=dA(p.breite,a);if(R.length<=1)return y;let P=y,j=1/0;for(const G of R){const B=t4(p,G,s,o,l);B&&B.gesamtpreis<j&&(j=B.gesamtpreis,P=G)}return P},[y,m,p,a,s,o,l]),A=v??S,k=E.useCallback(R=>{x(R),g(null)},[]),M=E.useCallback(R=>{g(R)},[]),T=E.useMemo(()=>{if(!o.length)return null;const R=p.rueckwandTypen?"GL":p.rueckwandtyp,P=o.find(j=>j.rueckwandtyp===R&&j.regalhoehe===p.hoehe);return(P==null?void 0:P.untere_hoehe)??null},[o,p.rueckwandtyp,p.rueckwandTypen,p.hoehe]),C=E.useMemo(()=>{if(!A||!s.length||!o.length||!l.length)return null;const R=v?{...p,breite:v.gesamtbreite_plus3}:p,P=t4(R,A,s,o,l);return H1(P,u)},[p,A,v,s,o,l,u]);return d?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(tn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[c.jsx("div",{className:"w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),c.jsx("p",{className:"text-muted-foreground font-medium",children:"Produktdaten werden geladenâ¦"})]})}):h?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("p",{className:"text-destructive",children:h})}):c.jsx(Ed,{slug:"wandregal",children:c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Wandregal-Konfigurator"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:(()=>{const R=v?v.gesamtbreite_plus3:p.breite,P=v&&p.breite&&Math.abs(v.gesamtbreite_plus3-p.breite)>.005;return[{label:`${p.hoehe} cm`,done:!0},{label:R?P?`${R.toFixed(2)} m (statt ${p.breite.toFixed(2)} m)`:`${R.toFixed(2)} m`:"Breite",done:!!R,highlight:!!P},{label:`${p.tiefe} cm tief`,done:!0},{label:`${p.anzahlFachboeden} Böden`,done:!0},{label:`Säule ${p.saeulentyp}`,done:!0},{label:p.rueckwandTypen?"Ind. Rückwand":p.rueckwandtyp==="GL"?"Glatt":p.rueckwandtyp==="RL"?"Rundloch":"Schlüsselloch",done:!0},{label:p.farbe,done:!0}]})()}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:C==null?void 0:C.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsx("div",{className:n?"":"lg:col-span-3",children:c.jsx(uke,{config:p,onChange:b,breitenModule:a,selectedModul:S,onSelectModul:k,onSelectUniform:M,activeUniform:v,preisliste:s,rueckwandLogik:o,farblogik:l})}),(!n||r==="result")&&c.jsx("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start",children:c.jsx(bA,{config:p,ergebnis:C,modul:A,untereHoehe:T,activeUniform:v})})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e}),c.jsx(SA,{config:p,ergebnis:C})]})})},jg={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})};function Jw({icon:t,title:e,subtitle:n}){return c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(t,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:e}),n&&c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:n})]})]})})}function SIe({config:t,onChange:e,breitenModule:n,selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,preisliste:o,rueckwandLogik:l,farblogik:u}){return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{custom:0,variants:jg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Jw,{icon:Hf,title:"Höhe wählen",subtitle:"Regalhöhe in cm"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:tA.map(d=>c.jsx("button",{onClick:()=>e(U5(t,d)),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.hoehe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:d},d))})})]})}),c.jsx(tn.div,{custom:1,variants:jg,initial:"hidden",animate:"visible",children:c.jsx(vO,{config:t,onChange:e,breitenModule:n,activeModul:a??r})}),t.breite!==null&&c.jsx(tn.div,{custom:1.5,variants:jg,initial:"hidden",animate:"visible",children:c.jsx(yO,{config:t,selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,breitenModule:n,preisliste:o,rueckwandLogik:l,farblogik:u,berechne:n4})}),c.jsx(tn.div,{custom:2,variants:jg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Jw,{icon:sg,title:"Tiefe wählen",subtitle:"Sockel- und Fachbodentiefe festlegen"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{children:c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Lf.filter(d=>d<=ox(t.hoehe)).map(d=>c.jsxs("button",{onClick:()=>e({tiefe:d,...d>=67?{saeulentyp:"8x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.tiefe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[d," cm"]},d))})}),c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"fachboeden",className:"text-sm font-medium",children:"Anzahl Fachböden"}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.max(0,t.anzahlFachboeden-1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"â"}),c.jsx("span",{className:"w-12 text-center text-xl font-bold tabular-nums",children:t.anzahlFachboeden}),c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.min(7,t.anzahlFachboeden+1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"+"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"+ 1 Sockelboden je Seite ist immer enthalten (beidseitig)"})]}),(()=>{const d=cA(t);return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(h=>c.jsx("button",{onClick:()=>{d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3"||e({saeulentyp:h})},disabled:d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3",className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.saeulentyp===h?"border-primary bg-primary/5 text-primary shadow-sm":d.pflicht8x3&&h==="6x3"||t.hoehe===121&&h==="8x3"?"border-border bg-muted text-muted-foreground cursor-not-allowed opacity-50":"border-border hover:border-primary/40"}`,children:h},h))}),d.pflicht8x3&&c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}
790),"8x3 bei dieser Tiefe erforderlich"]}),!d.pflicht8x3&&d.empfohlen==="8x3"&&t.hoehe!==121&&c.jsxs("p",{className:"text-xs text-blue-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 empfohlen bei dieser Tiefe"]})]})})(),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"individuelle-tiefen",className:"cursor-pointer font-medium text-sm",children:"Individuelle Bodentiefen"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Jeder Boden kann eine eigene Tiefe haben"})]}),c.jsx($o,{id:"individuelle-tiefen",checked:t.fachbodenTiefen!==null,onCheckedChange:d=>{e(d?{fachbodenTiefen:Array(t.anzahlFachboeden).fill(t.tiefe),sockelbodenTiefe:t.tiefe}:{fachbodenTiefen:null,sockelbodenTiefe:null})}})]}),c.jsx(bo,{children:t.fachbodenTiefen&&c.jsx(tn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25},className:"overflow-hidden",children:c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 rounded-lg bg-muted/50",children:[c.jsx("span",{className:"text-xs font-medium",children:"Sockelboden"}),c.jsxs(vl,{value:(t.sockelbodenTiefe??t.tiefe).toString(),onValueChange:d=>{const h=Number(d),p={sockelbodenTiefe:h};if(p.tiefe=h,t.fachbodenTiefen){const f=t.fachbodenTiefen.map(m=>Math.min(m,h));for(let m=1;m<f.length;m++)f[m]=Math.min(f[m],f[m-1]);p.fachbodenTiefen=f}e(p)},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:Lf.filter(d=>d<=ox(t.hoehe)).map(d=>c.jsxs(Us,{value:d.toString(),children:[d," cm"]},d))})]})]}),t.fachbodenTiefen.map((d,h)=>{const p=h===0?t.sockelbodenTiefe??t.tiefe:t.fachbodenTiefen[h-1],f=z5.filter(x=>x<=p),m=d<t.tiefe;return c.jsxs("div",{className:`flex items-center justify-between py-1.5 px-3 rounded-lg transition-colors ${m?"bg-primary/5":""}`,children:[c.jsxs("span",{className:"text-xs font-medium",children:["Boden ",h+1," ",h===t.fachbodenTiefen.length-1?"(oben)":""]}),c.jsxs(vl,{value:d.toString(),onValueChange:x=>{const v=Number(x),g=[...t.fachbodenTiefen];g[h]=v;for(let b=h+1;b<g.length;b++)g[b]=Math.min(g[b],g[b-1]);e({fachbodenTiefen:g})},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:f.map(x=>c.jsxs(Us,{value:x.toString(),children:[x," cm"]},x))})]})]},h)}),t.fachbodenTiefen&&t.fachbodenTiefen.length>0&&(()=>{const d=t.sockelbodenTiefe??t.tiefe,h=Math.max(...t.fachbodenTiefen);return d-h<10?c.jsxs("p",{className:"text-xs text-amber-600 mt-3 flex items-start gap-1.5 px-1",children:[c.jsx(pa,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),c.jsx("span",{children:"Tipp: Für optimale Standsicherheit sollte der Sockelboden mindestens 10 cm tiefer als die hängenden Fachböden sein."})]}):null})()]})})})]})]})]})}),c.jsx(tn.div,{custom:3,variants:jg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Jw,{icon:$S,title:"Ausstattung wählen",subtitle:"Zusätzliche Optionen"}),c.jsxs(Bn,{className:"space-y-0",children:[c.jsxs("div",{className:"flex items-center justify-between py-3.5 border-b border-border",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"sockelblende",className:"cursor-pointer font-medium text-sm",children:"Sockelblende"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Verkleidung im Sockelbereich (beidseitig)"})]}),c.jsx($o,{id:"sockelblende",checked:t.sockelblende,onCheckedChange:d=>e({sockelblende:d})})]}),c.jsxs("div",{className:"flex items-center justify-between py-3.5",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"scannerschiene",className:"cursor-pointer font-medium text-sm",children:"Scannerschiene"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Preisauszeichnung an jedem Boden (beidseitig)"})]}),c.jsx($o,{id:"scannerschiene",checked:t.scannerschiene,onCheckedChange:d=>e({scannerschiene:d})})]})]})]})}),c.jsx(tn.div,{custom:4,variants:jg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Jw,{icon:x1,title:"Rückwand wählen",subtitle:"Rückwandtyp auswählen (beidseitig)"}),c.jsx(Bn,{children:c.jsx(rM,{config:t,rueckwandLogik:l,onChange:e})})]})}),c.jsx(tn.div,{custom:5,variants:jg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Jw,{icon:Uf,title:"Farbe wählen",subtitle:"Oberfläche der Metallteile"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(d=>c.jsxs("button",{onClick:()=>e({farbe:d.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.farbe===d.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:d.hex,borderColor:t.farbe===d.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.farbe===d.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:d.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:d.ral})]}),t.farbe===d.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},d.name))})})]})})]})}const AIe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),{preisliste:s,breitenModule:a,rueckwandLogik:o,farblogik:l,tierPrices:u,isLoading:d,error:h}=F1("gondelregal"),[p,f]=E.useState(USe()),[m,x]=E.useState(null),[v,g]=E.useState(null),b=E.useCallback(R=>{f(P=>{const j={...P,...R};if("hoehe"in R&&P.rueckwandTypen&&(j.rueckwandTypen=null),"breite"in R&&(x(null),g(null)),"tiefe"in R&&P.fachbodenTiefen){const G=j.sockelbodenTiefe??j.tiefe;j.fachbodenTiefen=P.fachbodenTiefen.map(B=>Math.min(B,G));for(let B=1;B<j.fachbodenTiefen.length;B++)j.fachbodenTiefen[B]=Math.min(j.fachbodenTiefen[B],j.fachbodenTiefen[B-1])}if("anzahlFachboeden"in R&&P.fachbodenTiefen){const G=R.anzahlFachboeden,B=P.fachbodenTiefen;if(G<=B.length)j.fachbodenTiefen=B.slice(0,G);else{const $=B.length>0?B[B.length-1]:j.tiefe;j.fachbodenTiefen=[...B,...Array(G-B.length).fill($)]}}return j})},[]),y=E.useMemo(()=>p.breite===null||!a.length?null:a.find(R=>Math.abs(R.gesamtbreite_plus3-p.breite)<.005)||null,[p.breite,a]),S=E.useMemo(()=>
790{if(m)return m;if(!y||p.breite===null)return null;const R=dA(p.breite,a);if(R.length<=1)return y;let P=y,j=1/0;for(const G of R){const B=n4(p,G,s,o,l);B&&B.gesamtpreis<j&&(j=B.gesamtpreis,P=G)}return P},[y,m,p,a,s,o,l]),A=v??S,k=E.useCallback(R=>{x(R),g(null)},[]),M=E.useCallback(R=>{g(R)},[]),T=E.useMemo(()=>{if(!o.length)return null;const R=p.rueckwandTypen?"GL":p.rueckwandtyp,P=o.find(j=>j.rueckwandtyp===R&&j.regalhoehe===p.hoehe);return(P==null?void 0:P.untere_hoehe)??null},[o,p.rueckwandtyp,p.rueckwandTypen,p.hoehe]),C=E.useMemo(()=>{if(!A||!s.length||!o.length||!l.length)return null;const R=v?{...p,breite:v.gesamtbreite_plus3}:p,P=n4(R,A,s,o,l);return H1(P,u)},[p,A,v,s,o,l,u]);return d?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(tn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[c.jsx("div",{className:"w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),c.jsx("p",{className:"text-muted-foreground font-medium",children:"Produktdaten werden geladenâ¦"})]})}):h?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("p",{className:"text-destructive",children:h})}):c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Gondelregal-Konfigurator"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:(()=>{const R=v?v.gesamtbreite_plus3:p.breite,P=v&&p.breite&&Math.abs(v.gesamtbreite_plus3-p.breite)>.005;return[{label:`${p.hoehe} cm`,done:!0},{label:R?P?`${R.toFixed(2)} m (statt ${p.breite.toFixed(2)} m)`:`${R.toFixed(2)} m`:"Breite",done:!!R,highlight:!!P},{label:`${p.tiefe} cm tief`,done:!0},{label:`${p.anzahlFachboeden} Böden`,done:!0},{label:`Säule ${p.saeulentyp}`,done:!0},{label:p.rueckwandTypen?"Ind. Rückwand":p.rueckwandtyp==="GL"?"Glatt":p.rueckwandtyp==="RL"?"Rundloch":"Schlüsselloch",done:!0},{label:p.farbe,done:!0}]})()}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:C==null?void 0:C.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsx("div",{className:n?"":"lg:col-span-3",children:c.jsx(SIe,{config:p,onChange:b,breitenModule:a,selectedModul:S,onSelectModul:k,onSelectUniform:M,activeUniform:v,preisliste:s,rueckwandLogik:o,farblogik:l})}),(!n||r==="result")&&c.jsx("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start",children:c.jsx(bA,{config:p,ergebnis:C,modul:A,untereHoehe:T,activeUniform:v})})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e}),c.jsx(SA,{config:p,ergebnis:C})]})},EIe=()=>c.jsx(Ed,{slug:"gondelregal",children:c.jsx(AIe,{})});function kIe(t,e){return{gesamtbreite_module:e,gesamtbreite_plus3:e,anzahl_0665:t==="anzahl_0665"?1:0,anzahl_1000:t==="anzahl_1000"?1:0,anzahl_1250:t==="anzahl_1250"?1:0,anzahl_1330:t==="anzahl_1330"?1:0,modulanzahl:1,schluessel:`anbau-${t}`}}function ase({selectedBreite:t,onSelect:e}){return c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Hf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Modulbreite wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Breite des Anbaumoduls"})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:DSe.map(n=>c.jsx("button",{onClick:()=>e(n.breitePlus3,kIe(n.field,n.breitePlus3)),className:`py-3 rounded-lg border-2 text-sm font-medium transition-all ${t!==null&&Math.abs(t-n.breitePlus3)<.005?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:n.label},n.field))})})]})}function ose({value:t,onChange:e}){return c.jsxs(Dn,{className:"config-card border-primary/20",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(npe,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Anbauart wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Wie wird das Anbaufeld eingesetzt?"})]})]})}),c.jsxs(Bn,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("button",{onClick:()=>e("einseitig"),className:`text-left p-4 rounded-lg border-2 transition-all ${t==="einseitig"?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("span",{className:"font-semibold text-sm block mb-1",children:"Einseitig"}),c.jsx("span",{className:"text-xs text-muted-foreground leading-relaxed",children:"Regal von einer Seite erweitern"})]}),c.jsxs("button",{onClick:()=>e("beidseitig"),className:`text-left p-4 rounded-lg border-2 transition-all ${t==="beidseitig"?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("span",{className:"font-semibold text-sm block mb-1",children:"Beidseitig (Lückenschluss)"}),c.jsx("span",{className:"text-xs text-muted-foreground leading-relaxed",children:"Lücke zwischen zwei bestehenden Regalen schlieÃen"})]})]}),t==="beidseitig"&&c.jsxs("p",{className:"text-xs text-blue-600 mt-3 flex items-start gap-1.5",children:[c.jsx(pa,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),"Beim Lückenschluss entfallen Säulen, FuÃteile und Endkappen, da die
790se von den bestehenden Nachbarregalen bereitgestellt werden."]})]})]})}const CIe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),{preisliste:s,breitenModule:a,rueckwandLogik:o,farblogik:l,tierPrices:u,isLoading:d,error:h}=F1("wandregal"),[p,f]=E.useState(HSe()),[m,x]=E.useState({gesamtbreite_module:1.03,gesamtbreite_plus3:1.03,anzahl_0665:0,anzahl_1000:1,anzahl_1250:0,anzahl_1330:0,modulanzahl:1,schluessel:"anbau-anzahl_1000"}),v=E.useCallback(S=>{f(A=>{const k={...A,...S};if("tiefe"in S&&A.fachbodenTiefen){const M=k.sockelbodenTiefe??k.tiefe;k.fachbodenTiefen=A.fachbodenTiefen.map(T=>Math.min(T,M));for(let T=1;T<k.fachbodenTiefen.length;T++)k.fachbodenTiefen[T]=Math.min(k.fachbodenTiefen[T],k.fachbodenTiefen[T-1])}if("anzahlFachboeden"in S&&A.fachbodenTiefen){const M=S.anzahlFachboeden,T=A.fachbodenTiefen;if(M<=T.length)k.fachbodenTiefen=T.slice(0,M);else{const C=T.length>0?T[T.length-1]:k.tiefe;k.fachbodenTiefen=[...T,...Array(M-T.length).fill(C)]}}return"hoehe"in S&&A.rueckwandTypen&&(k.rueckwandTypen=null),k})},[]),g=E.useCallback((S,A)=>{f(k=>({...k,breite:S})),x(A)},[]),b=E.useMemo(()=>{if(!o.length)return null;const S=p.rueckwandTypen?"GL":p.rueckwandtyp,A=o.find(k=>k.rueckwandtyp===S&&k.regalhoehe===p.hoehe);return(A==null?void 0:A.untere_hoehe)??null},[o,p.rueckwandtyp,p.rueckwandTypen,p.hoehe]),y=E.useMemo(()=>{if(!m||!s.length||!o.length||!l.length)return null;const S=yEe(p,m,s,o,l);return H1(S,u)},[p,m,s,o,l,u]);return d?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(tn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[c.jsx("div",{className:"w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),c.jsx("p",{className:"text-muted-foreground font-medium",children:"Produktdaten werden geladenâ¦"})]})}):h?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("p",{className:"text-destructive",children:h})}):c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Wandregal-Anbaumodul"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:[{label:p.anbauart==="beidseitig"?"Lückenschluss":"Einseitig",done:!0},{label:`${p.hoehe} cm`,done:!0},{label:p.breite?`${(p.breite*100).toFixed(1)} cm`:"Breite",done:!!p.breite},{label:`${p.tiefe} cm tief`,done:!0},{label:`${p.anzahlFachboeden} Böden`,done:!0},{label:`Säule ${p.saeulentyp}`,done:!0},{label:p.rueckwandTypen?"Ind. Rückwand":p.rueckwandtyp==="GL"?"Glatt":p.rueckwandtyp==="RL"?"Rundloch":"Schlüsselloch",done:!0},{label:p.farbe,done:!0}]}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:y==null?void 0:y.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsx("div",{className:n?"":"lg:col-span-3",children:c.jsx(NIe,{config:p,onChange:v,selectedBreite:p.breite,onSelectWidth:g,breitenModule:a,preisliste:s,rueckwandLogik:o,farblogik:l})}),(!n||r==="result")&&c.jsx("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start",children:c.jsx(bA,{config:p,ergebnis:y,modul:m,untereHoehe:b,activeUniform:null})})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e}),c.jsx(SA,{config:p,ergebnis:y,quickSuggestions:["Wie baue ich das Regal auf?","Was bedeutet einseitig und beidseitig bei den Anbaumodulen genau?","Welche Tiefe empfehlt ihr?"]})]})},Pg={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})};function NIe({config:t,onChange:e,selectedBreite:n,onSelectWidth:r,breitenModule:i,preisliste:s,rueckwandLogik:a,farblogik:o}){return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{custom:0,variants:Pg,initial:"hidden",animate:"visible",children:c.jsx(ose,{value:t.anbauart,onCh
790ange:l=>e({anbauart:l})})}),c.jsx(tn.div,{custom:1,variants:Pg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Hf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Höhe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Regalhöhe in cm"})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:tA.map(l=>c.jsx("button",{onClick:()=>e(U5(t,l)),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.hoehe===l?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:l},l))})})]})}),c.jsx(tn.div,{custom:2,variants:Pg,initial:"hidden",animate:"visible",children:c.jsx(ase,{selectedBreite:n,onSelect:r})}),c.jsx(tn.div,{custom:3,variants:Pg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(sg,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Tiefe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Sockel- und Fachbodentiefe festlegen"})]})]})}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Lf.filter(l=>l<=ox(t.hoehe)).map(l=>c.jsxs("button",{onClick:()=>e({tiefe:l,...l>=67?{saeulentyp:"8x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.tiefe===l?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[l," cm"]},l))}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Anzahl Fachböden"}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.max(0,t.anzahlFachboeden-1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"â"}),c.jsx("span",{className:"w-12 text-center text-xl font-bold tabular-nums",children:t.anzahlFachboeden}),c.jsx("button",{onClick:()=>e({anzahlFachboeden:Math.min(7,t.anzahlFachboeden+1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"+"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"+ 1 Sockelboden ist immer enthalten"})]}),(()=>{const l=cA(t);return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(u=>c.jsx("button",{onClick:()=>{l.pflicht8x3&&u==="6x3"||t.hoehe===121&&u==="8x3"||e({saeulentyp:u})},disabled:l.pflicht8x3&&u==="6x3"||t.hoehe===121&&u==="8x3",className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.saeulentyp===u?"border-primary bg-primary/5 text-primary shadow-sm":l.pflicht8x3&&u==="6x3"||t.hoehe===121&&u==="8x3"?"border-border bg-muted text-muted-foreground cursor-not-allowed opacity-50":"border-border hover:border-primary/40"}`,children:u},u))}),l.pflicht8x3&&c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 bei dieser Tiefe erforderlich"]}),!l.pflicht8x3&&l.empfohlen==="8x3"&&t.hoehe!==121&&c.jsxs("p",{className:"text-xs text-blue-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 empfohlen bei dieser Tiefe"]})]})})(),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"individuelle-tiefen-anbau",className:"cursor-pointer font-medium text-sm",children:"Individuelle Bodentiefen"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Jeder Boden kann eine eigene Tiefe haben"})]}),c.jsx($o,{id:"individuelle-tiefen-anbau",checked:t.fachbodenTiefen!==null,onCheckedChange:l=>{e(l?{fachbodenTiefen:Array(t.anzahlFachboeden).fill(t.tiefe),sockelbodenTiefe:t.tiefe}:{fachbodenTiefen:null,sockelbodenTiefe:null})}})]}),c.jsx(bo,{children:t.fachbodenTiefen&&c.jsx(tn.div,{initial:{opacity:0,height:0}
790,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25},className:"overflow-hidden",children:c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 rounded-lg bg-muted/50",children:[c.jsx("span",{className:"text-xs font-medium",children:"Sockelboden"}),c.jsxs(vl,{value:(t.sockelbodenTiefe??t.tiefe).toString(),onValueChange:l=>{const u=Number(l),d={sockelbodenTiefe:u};if(u>t.tiefe&&(d.tiefe=u),t.fachbodenTiefen){const h=t.fachbodenTiefen.map(p=>Math.min(p,u));for(let p=1;p<h.length;p++)h[p]=Math.min(h[p],h[p-1]);d.fachbodenTiefen=h}e(d)},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:Lf.map(l=>c.jsxs(Us,{value:l.toString(),children:[l," cm"]},l))})]})]}),t.fachbodenTiefen.map((l,u)=>{const d=u===0?t.sockelbodenTiefe??t.tiefe:t.fachbodenTiefen[u-1],h=z5.filter(p=>p<=d);return c.jsxs("div",{className:`flex items-center justify-between py-1.5 px-3 rounded-lg transition-colors ${l<t.tiefe?"bg-primary/5":""}`,children:[c.jsxs("span",{className:"text-xs font-medium",children:["Boden ",u+1," ",u===t.fachbodenTiefen.length-1?"(oben)":""]}),c.jsxs(vl,{value:l.toString(),onValueChange:p=>{const f=Number(p),m=[...t.fachbodenTiefen];m[u]=f;for(let x=u+1;x<m.length;x++)m[x]=Math.min(m[x],m[x-1]);e({fachbodenTiefen:m})},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:h.map(p=>c.jsxs(Us,{value:p.toString(),children:[p," cm"]},p))})]})]},u)})]})})})]})]})]})}),c.jsx(tn.div,{custom:4,variants:Pg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx($S,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Ausstattung wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Zusätzliche Optionen"})]})]})}),c.jsxs(Bn,{className:"space-y-0",children:[c.jsxs("div",{className:"flex items-center justify-between py-3.5 border-b border-border",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"sockelblende-a",className:"cursor-pointer font-medium text-sm",children:"Sockelblende"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Verkleidung im Sockelbereich"})]}),c.jsx($o,{id:"sockelblende-a",checked:t.sockelblende,onCheckedChange:l=>e({sockelblende:l})})]}),c.jsxs("div",{className:"flex items-center justify-between py-3.5",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"scannerschiene-a",className:"cursor-pointer font-medium text-sm",children:"Scannerschiene"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Preisauszeichnung an jedem Boden"})]}),c.jsx($o,{id:"scannerschiene-a",checked:t.scannerschiene,onCheckedChange:l=>e({scannerschiene:l})})]})]})]})}),c.jsx(tn.div,{custom:5,variants:Pg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(x1,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Rückwand wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Rückwandtyp auswählen"})]})]})}),c.jsx(Bn,{children:c.jsx(rM,{config:t,rueckwandLogik:a,onChange:e})})]})}),c.jsx(tn.div,{custom:6,variants:Pg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Uf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Farbe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Oberfläche der Metallteile"})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(l=>c.jsxs("button",{onClick:()=>e({farbe:l.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.farbe===l.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:l.hex,borderColor:t.farbe===l.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.farbe===l.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:l.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:l.ral})]}),t.farbe===l.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},l.name))})})]})})]})}const TIe=()=>c.jsx(Ed,{slug:"wandregal-anbau",children:c.jsx(CIe,{})}),Lg={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})},MIe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),{preisliste:s,breitenModule:a,rueckwandLogik:o,farblogik:l,tierPrices:u,isLoading:d,error:h}=F1("gondelregal"),[p,f]=E.useState(GSe()),[m,x]=E.useState({gesamtbreite_module:1.03,gesamtbreite_plus3:1.03,anzahl_0665:0,anzahl_1000:1,anzahl_1250:0,anzahl_1330:0,modulanzahl:1,schluessel:"anbau-anzahl_1000"}),v=E.useCallback(S=>{f(A=>{const k={...A,...S};if("tiefe"in S&&A.fachbodenTiefen){const M=k.sockelbodenTiefe??k.tiefe;k.fachbodenTiefen=A.fachbodenTiefen.map(T=>Math.min(T,M));for(let T=1;T<k.fachbodenTiefen.length;T++)k.fachbodenTiefen[T]=Math.min(k.fachbodenTiefen[T],k.fachbodenTiefen[T-1])}if("anzahlFachboeden"in S&&A.fachbodenTiefen){const M=S.anzahlFachboeden,T=A.fachbodenTiefen;if(M<=T.length)k.fachbodenTiefen=T.slice(0,M);else{const C=T.length>0?T[T.length-1]:k.tiefe;k.fachbodenTiefen=[...T,...Array(M-T.length).fill(C)]}}return"hoehe"in S&&A.rueckwandTypen&&(k.rueckwandTypen=null),k})},[]),g=E.useCallback((S,A)=>{f(k=>({...k,breite:S})),x(A)},[]),b=E.useMemo(()=>
790{if(!o.length)return null;const S=p.rueckwandTypen?"GL":p.rueckwandtyp,A=o.find(k=>k.rueckwandtyp===S&&k.regalhoehe===p.hoehe);return(A==null?void 0:A.untere_hoehe)??null},[o,p.rueckwandtyp,p.rueckwandTypen,p.hoehe]),y=E.useMemo(()=>{if(!m||!s.length||!o.length||!l.length)return null;const S=wEe(p,m,s,o,l);return H1(S,u)},[p,m,s,o,l,u]);return d?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(tn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[c.jsx("div",{className:"w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),c.jsx("p",{className:"text-muted-foreground font-medium",children:"Produktdaten werden geladenâ¦"})]})}):h?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("p",{className:"text-destructive",children:h})}):c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Gondelregal-Anbaumodul"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:[{label:p.anbauart==="beidseitig"?"Lückenschluss":"Einseitig",done:!0},{label:`${p.hoehe} cm`,done:!0},{label:p.breite?`${(p.breite*100).toFixed(1)} cm`:"Breite",done:!!p.breite},{label:`${p.tiefe} cm tief`,done:!0},{label:`${p.anzahlFachboeden} Böden`,done:!0},{label:`Säule ${p.saeulentyp}`,done:!0},{label:p.rueckwandTypen?"Ind. Rückwand":p.rueckwandtyp==="GL"?"Glatt":p.rueckwandtyp==="RL"?"Rundloch":"Schlüsselloch",done:!0},{label:p.farbe,done:!0}]}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:y==null?void 0:y.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsxs("div",{className:n?"":"lg:col-span-3 space-y-4",children:[c.jsx(tn.div,{custom:0,variants:Lg,initial:"hidden",animate:"visible",children:c.jsx(ose,{value:p.anbauart,onChange:S=>v({anbauart:S})})}),c.jsx(tn.div,{custom:1,variants:Lg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Hf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Höhe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Regalhöhe in cm"})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:tA.map(S=>c.jsx("button",{onClick:()=>v(U5(p,S)),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${p.hoehe===S?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:S},S))})})]})}),c.jsx(tn.div,{custom:2,variants:Lg,initial:"hidden",animate:"visible",children:c.jsx(ase,{selectedBreite:p.breite,onSelect:g})}),c.jsx(tn.div,{custom:3,variants:Lg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(sg,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Tiefe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Sockel- und Fachbodentiefe festlegen"})]})]})}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Lf.filter(S=>S<=ox(p.hoehe)).map(S=>c.jsxs("button",{onClick:()=>v({tiefe:S,...S>=67?{saeulentyp:"8x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${p.tiefe===S?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[S," cm"]},S))}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Anzahl Fachböden"}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[c.jsx("button",{onClick:()=>v({anzahlFachboeden:Math.max(0,p.anzahlFachboeden-1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"â"}),c.jsx("span",{className:"w-12 text-center text-xl font-bold tabular-nums",children:p.anzahlFachboeden}),c.jsx("button",{onClick:()=>v({anzahlFachboeden:Math.min(7,p.anzahlFachboeden+1)}),className:"w-10 h-10 rounded-lg border-2 border-border hover:border-primary/40 flex items-center justify-center text-lg font-semibold transition-colors",children:"+"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"+ 1 Sockelboden je Seite ist immer enthalten (beidseitig)"})]}),(()=>{const S=cA(p);return c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(A=>c.jsx("button",{onClick:()=>{S.pflicht8x3&&A==="6x3"||p.hoehe===121&&A==="8x3"||v({saeulentyp:A})},disabled:S.pflicht8x3&&A==="6x3"||p.hoehe===121&&A==="8x3",className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${p.saeulentyp===A?"border-primary bg-primary/5 text-primary shadow-sm":S.pflicht8x3&&A==="6x3"||p.hoehe===121&&A==="8x3"?"border-border bg-muted text-muted-foreground cursor-not-allowed opacity-50":"border-border hover:border-primary/40"}`,children:A},A))}),S.pflicht8x3&&c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}
790),"8x3 bei dieser Tiefe erforderlich"]}),!S.pflicht8x3&&S.empfohlen==="8x3"&&p.hoehe!==121&&c.jsxs("p",{className:"text-xs text-blue-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 empfohlen bei dieser Tiefe"]})]})})(),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"individuelle-tiefen-ga",className:"cursor-pointer font-medium text-sm",children:"Individuelle Bodentiefen"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Jeder Boden kann eine eigene Tiefe haben"})]}),c.jsx($o,{id:"individuelle-tiefen-ga",checked:p.fachbodenTiefen!==null,onCheckedChange:S=>{v(S?{fachbodenTiefen:Array(p.anzahlFachboeden).fill(p.tiefe),sockelbodenTiefe:p.tiefe}:{fachbodenTiefen:null,sockelbodenTiefe:null})}})]}),c.jsx(bo,{children:p.fachbodenTiefen&&c.jsx(tn.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25},className:"overflow-hidden",children:c.jsxs("div",{className:"mt-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between py-1.5 px-3 rounded-lg bg-muted/50",children:[c.jsx("span",{className:"text-xs font-medium",children:"Sockelboden"}),c.jsxs(vl,{value:(p.sockelbodenTiefe??p.tiefe).toString(),onValueChange:S=>{const A=Number(S),k={sockelbodenTiefe:A};if(A>p.tiefe&&(k.tiefe=A),p.fachbodenTiefen){const M=p.fachbodenTiefen.map(T=>Math.min(T,A));for(let T=1;T<M.length;T++)M[T]=Math.min(M[T],M[T-1]);k.fachbodenTiefen=M}v(k)},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:Lf.map(S=>c.jsxs(Us,{value:S.toString(),children:[S," cm"]},S))})]})]}),p.fachbodenTiefen.map((S,A)=>{const k=A===0?p.sockelbodenTiefe??p.tiefe:p.fachbodenTiefen[A-1],M=z5.filter(T=>T<=k);return c.jsxs("div",{className:`flex items-center justify-between py-1.5 px-3 rounded-lg transition-colors ${S<p.tiefe?"bg-primary/5":""}`,children:[c.jsxs("span",{className:"text-xs font-medium",children:["Boden ",A+1," ",A===p.fachbodenTiefen.length-1?"(oben)":""]}),c.jsxs(vl,{value:S.toString(),onValueChange:T=>{const C=Number(T),R=[...p.fachbodenTiefen];R[A]=C;for(let P=A+1;P<R.length;P++)R[P]=Math.min(R[P],R[P-1]);v({fachbodenTiefen:R})},children:[c.jsx(qo,{className:"w-24 h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:M.map(T=>c.jsxs(Us,{value:T.toString(),children:[T," cm"]},T))})]})]},A)})]})})})]})]})]})}),c.jsx(tn.div,{custom:4,variants:Lg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx($S,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Ausstattung wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Zusätzliche Optionen"})]})]})}),c.jsxs(Bn,{className:"space-y-0",children:[c.jsxs("div",{className:"flex items-center justify-between py-3.5 border-b border-border",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"sockelblende-ga",className:"cursor-pointer font-medium text-sm",children:"Sockelblende"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Verkleidung im Sockelbereich (beidseitig)"})]}),c.jsx($o,{id:"sockelblende-ga",checked:p.sockelblende,onCheckedChange:S=>v({sockelblende:S})})]}),c.jsxs("div",{className:"flex items-center justify-between py-3.5",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"scannerschiene-ga",className:"cursor-pointer font-medium text-sm",children:"Scannerschiene"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Preisauszeichnung an jedem Boden (beidseitig)"})]}),c.jsx($o,{id:"scannerschiene-ga",checked:p.scannerschiene,onCheckedChange:S=>v({scannerschiene:S})})]})]})]})}),c.jsx(tn.div,{custom:5,variants:Lg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(x1,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Rückwand wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Rückwandtyp auswählen (beidseitig)"})]})]})}),c.jsx(Bn,{children:c.jsx(rM,{config:p,rueckwandLogik:o,onChange:v})})]})}),c.jsx(tn.div,{custom:6,variants:Lg,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(Uf,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:"Farbe wählen"}),c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Oberfläche der Metallteile"})]})]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(S=>c.jsxs("button",{onClick:()=>v({farbe:S.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${p.farbe===S.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:S.hex,borderColor:p.farbe===S.name?"hsl(var(--primary))":"hsl(var(--border))",transform:p.farbe===S.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:S.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:S.ral})]}),p.farbe===S.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},S.name))})})]})})]}),(!n||r==="result")&&c.jsx("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start",children:c.jsx(bA,{config:p,ergebnis:y,modul:m,untereHoehe:b,activeUniform:null})})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e}),c.jsx(SA,{config:p,ergebnis:y,quickSuggestions:["Wie baue ich das Regal auf?","Was bedeutet einseitig und beidseitig bei den Anbaumodulen genau?","Welche Tiefe empfehlt ihr?"]})]})},RIe=()=>c.jsx(Ed,{slug:"gondelregal-anbau",children:c.jsx(MIe,{})}),kv={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})};
790function ok({icon:t,title:e,subtitle:n}){return c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(t,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:e}),n&&c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:n})]})]})})}function jIe({config:t,onChange:e,breitenModule:n,selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,preisliste:o,farblogik:l}){const u=cA({...t,anzahlFachboeden:0,rueckwandtyp:"GL",fachbodenTiefen:[],sockelbodenTiefe:null});return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{custom:0,variants:kv,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(ok,{icon:Hf,title:"Höhe wählen",subtitle:"Regalhöhe in cm"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:VSe.map(d=>c.jsx("button",{onClick:()=>e({hoehe:d,...d===121&&t.saeulentyp==="8x3"?{saeulentyp:"6x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.hoehe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:d},d))})})]})}),c.jsx(tn.div,{custom:1,variants:kv,initial:"hidden",animate:"visible",children:c.jsx(vO,{config:{...t,anzahlFachboeden:0,rueckwandtyp:"GL",fachbodenTiefen:[],sockelbodenTiefe:null},onChange:d=>e(d),breitenModule:n,activeModul:a??r,excludeWidths:[1.33]})}),t.breite!==null&&c.jsx(tn.div,{custom:1.5,variants:kv,initial:"hidden",animate:"visible",children:c.jsx(yO,{config:{...t,anzahlFachboeden:0,rueckwandtyp:"GL",fachbodenTiefen:[],sockelbodenTiefe:null},selectedModul:r,onSelectModul:i,onSelectUniform:s,activeUniform:a,breitenModule:n,preisliste:o,rueckwandLogik:[],farblogik:l,excludeWidths:[1.33],berechne:(d,h,p,f,m)=>r4(d,h,p,m)})}),c.jsx(tn.div,{custom:2,variants:kv,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(ok,{icon:sg,title:"Tiefe wählen",subtitle:"Sockelbodentiefe festlegen"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Lf.map(d=>c.jsxs("button",{onClick:()=>e({tiefe:d,...d>=67&&t.hoehe!==121?{saeulentyp:"8x3"}:{}}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.tiefe===d?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[d," cm"]},d))}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(d=>{const h=t.hoehe===121&&d==="8x3",p=u.pflicht8x3&&d==="6x3"&&t.hoehe!==121,f=h||p;return c.jsx("button",{onClick:()=>{f||e({saeulentyp:d})},disabled:f,className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.saeulentyp===d?"border-primary bg-primary/5 text-primary shadow-sm":f?"border-border bg-muted text-muted-foreground cursor-not-allowed opacity-50":"border-border hover:border-primary/40"}`,children:d},d)})}),t.hoehe===121?c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 Säulen sind erst ab 141 cm Höhe verfügbar."]}):u.pflicht8x3&&c.jsxs("p",{className:"text-xs text-amber-600 mt-2 flex items-center gap-1",children:[c.jsx(pa,{className:"w-3 h-3 shrink-0"}),"8x3 bei dieser Tiefe erforderlich"]})]})]})]})}),c.jsx(tn.div,{custom:3,variants:kv,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(ok,{icon:x1,title:"Rückwandfarbe wählen",subtitle:"Farbe der Rückwandpaneele"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:Hp.map(d=>c.jsxs("button",{onClick:()=>e({rueckwandfarbe:d.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.rueckwandfarbe===d.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:d.hex,borderColor:t.rueckwandfarbe===d.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.rueckwandfarbe===d.name?"scale(1.05)":"scale(1)"}}),c.jsx("div",{className:"text-left",children:c.jsx("div",{className:"text-sm font-semibold",children:d.displayName})}),t.rueckwandfarbe===d.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},d.name))})})]})}),c.jsx(tn.div,{custom:4,variants:kv,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(ok,{icon:Uf,title:"Farbe wählen",subtitle:"Oberfläche der Metallteile"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(d=>c.jsxs("button",{onClick:()=>e({farbe:d.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.farbe===d.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:d.hex,borderColor:t.farbe===d.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.farbe===d.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:d.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:d.ral})]}),t.farbe===d.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},d.name))})})]})})]})}const PIe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),{preisliste:s,breitenModule:a,farblogik:o,tierPrices:l,isLoading:u,error:d}=F1("paneelwandregal"),[h,p]=E.useState(WSe()),[f,m]=E.useState(null),[x,v]=E.useState(null),g=E.useCallback(C=>{p(R=>{const P={...R,...C};return"breite"in C&&(m(null),v(null)),P})},[]),b=E.useMemo(()=>{const C=a.filter(R=>R.anzahl_1330===0);return fte(C,a,[1.33])},[a]),y=E.useMemo(()=>h.breite===null||!b.length?null:b.find(C=>Math.abs(C.gesamtbreite_plus3-h.breite)<.005)||null,[h.breite,b]),S=E.useMemo(()=>
790{if(f)return f;if(!y||h.breite===null)return null;const C=dA(h.breite,a,[1.33]);if(C.length<=1)return y;let R=y,P=1/0;for(const j of C){const G=r4(h,j,s,o);G&&G.gesamtpreis<P&&(P=G.gesamtpreis,R=j)}return R},[y,f,h,a,s,o]),A=x??S,k=E.useCallback(C=>{m(C),v(null)},[]),M=E.useCallback(C=>{v(C)},[]),T=E.useMemo(()=>{if(!A||!s.length||!o.length)return null;const C=x?{...h,breite:x.gesamtbreite_plus3}:h,R=r4(C,A,s,o);return H1(R,l)},[h,A,x,s,o,l]);return u?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsxs(tn.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-4",children:[c.jsx("div",{className:"w-12 h-12 border-4 border-primary border-t-transparent rounded-full animate-spin mx-auto"}),c.jsx("p",{className:"text-muted-foreground font-medium",children:"Produktdaten werden geladenâ¦"})]})}):d?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("p",{className:"text-destructive",children:d})}):c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Paneelwandregal-Konfigurator"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:(()=>{var R;const C=x?x.gesamtbreite_plus3:h.breite;return[{label:`${h.hoehe} cm`,done:!0},{label:C?`${C.toFixed(2)} m`:"Breite",done:!!C},{label:`${h.tiefe} cm tief`,done:!0},{label:`Säule ${h.saeulentyp}`,done:!0},{label:((R=Hp.find(P=>P.name===h.rueckwandfarbe))==null?void 0:R.displayName)??h.rueckwandfarbe,done:!0},{label:h.farbe,done:!0}]})()}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:T==null?void 0:T.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsx("div",{className:n?"":"lg:col-span-3",children:c.jsx(jIe,{config:h,onChange:g,breitenModule:a,selectedModul:S,onSelectModul:k,onSelectUniform:M,activeUniform:x,preisliste:s,farblogik:o})}),(!n||r==="result")&&c.jsx("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start",children:c.jsx(bA,{config:h,ergebnis:T,modul:A,untereHoehe:null,activeUniform:x})})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e}),c.jsx(SA,{config:h,ergebnis:T})]})},LIe=()=>c.jsx(Ed,{slug:"paneelwandregal",children:c.jsx(PIe,{})}),Ig={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.35}})};function Dg({icon:t,title:e,subtitle:n}){return c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-3",children:[c.jsx("div",{className:"step-badge",children:c.jsx(t,{className:"w-4 h-4"})}),c.jsxs("div",{children:[c.jsx("span",{className:"block leading-tight",children:e}),n&&c.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:n})]})]})})}function IIe({config:t,onChange:e}){const n=hT.filter(i=>i.winkel===t.eckwinkel),r=i=>{const s=hT.filter(o=>o.winkel===i),a=s.some(o=>o.bauform===t.bauform);e({eckwinkel:i,bauform:a?t.bauform:s[0].bauform})};return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{custom:0,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:Jfe,title:"Ecklösung wählen",subtitle:"Winkel und Bauform der Ecklösung"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium mb-2 block",children:"Winkel"}),c.jsx("div",{className:"grid grid-cols-2 gap-2",children:[90,45].map(i=>c.jsxs("button",{onClick:()=>r(i),className:`py-3 rounded-lg border-2 text-sm font-medium transition-all ${t.eckwinkel===i?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[i,"°",c.jsx("span",{className:"block text-xs text-muted-foreground font-normal mt-0.5",children:i===90?"3 Bauformen":"2 Bauformen"})]},i))})]}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium mb-2 block",children:"Bauform"}),c.jsx(bo,{mode:"wait",children:c.jsx(tn.div,{initial:{opacity:0,y:8}
790,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:n.map(i=>c.jsxs("button",{onClick:()=>e({bauform:i.bauform}),className:`p-3 rounded-xl border-2 text-left transition-all ${t.bauform===i.bauform?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"text-sm font-semibold",children:i.label}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:i.description}),t.bauform===i.bauform&&c.jsx(ti,{className:"w-4 h-4 text-primary mt-1.5"})]},i.bauform))},t.eckwinkel)})]})]})]})}),c.jsx(tn.div,{custom:1,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:spe,title:"Anbindung wählen",subtitle:"Wie wird das Eckregal eingebunden?"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:cO.map(i=>c.jsxs("button",{onClick:()=>e({anbindung:i.value}),className:`p-3 rounded-xl border-2 text-left transition-all ${t.anbindung===i.value?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"text-sm font-semibold",children:i.label}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:i.description}),t.anbindung===i.value&&c.jsx(ti,{className:"w-4 h-4 text-primary mt-1.5"})]},i.value))})})]})}),c.jsx(tn.div,{custom:2,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:Hf,title:"Höhe wählen",subtitle:"Regalhöhe in cm"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:tA.map(i=>c.jsx("button",{onClick:()=>e({hoehe:i}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.hoehe===i?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:i},i))})})]})}),c.jsx(tn.div,{custom:3,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:sg,title:"Tiefe & Säulentyp",subtitle:"Fachboden- und Sockeltiefe"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsx("div",{className:"grid grid-cols-2 gap-2",children:BSe.map(i=>c.jsxs("button",{onClick:()=>e({tiefe:i}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.tiefe===i?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:[i," cm"]},i))}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Säulentyp"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-2",children:["6x3","8x3"].map(i=>c.jsx("button",{onClick:()=>e({saeulentyp:i}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.saeulentyp===i?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:i},i))})]})]})]})}),c.jsx(tn.div,{custom:4,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:rpe,title:"Fachböden & Sockelblende"}),c.jsxs(Bn,{className:"space-y-5",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium mb-2 block",children:"Anzahl Fachböden"}),c.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-7 gap-2",children:[0,1,2,3,4,5,6].map(i=>c.jsx("button",{onClick:()=>e({anzahlFachboeden:i}),className:`py-2.5 rounded-lg border-2 text-sm font-medium transition-all ${t.anzahlFachboeden===i?"border-primary bg-primary/5 text-primary shadow-sm":"border-border hover:border-primary/40"}`,children:i},i))})]}),c.jsxs("div",{className:"border-t border-border pt-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Sockelblende"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Blende vor dem Sockelboden"})]}),c.jsx($o,{checked:t.sockelblende,onCheckedChange:i=>e({sockelblende:i})})]})]})]})}),c.jsx(tn.div,{custom:5,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:x1,title:"Rückwandtyp",subtitle:"Nur Glatt oder Rundlochung verfügbar"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-2 gap-2",children:FSe.map(i=>c.jsxs("button",{onClick:()=>e({rueckwandtyp:i.value}),className:`flex items-center gap-2 p-3 rounded-xl border-2 transition-all ${t.rueckwandtyp===i.value?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("span",{className:"text-lg",children:i.icon}),c.jsx("div",{className:"text-sm font-semibold",children:i.label}),t.rueckwandtyp===i.value&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto"})]},i.value))})})]})}),c.jsx(tn.div,{custom:6,variants:Ig,initial:"hidden",animate:"visible",children:c.jsxs(Dn,{className:"config-card",children:[c.jsx(Dg,{icon:Uf,title:"Farbe wählen",subtitle:"Oberfläche der Metallteile"}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:xi.map(i=>c.jsxs("button",{onClick:()=>e({farbe:i.name}),className:`flex items-center gap-2.5 sm:gap-3 p-2.5 sm:p-3.5 rounded-xl border-2 transition-all cursor-pointer ${t.farbe===i.name?"border-primary bg-primary/5 shadow-sm":"border-border hover:border-primary/40"}`,children:[c.jsx("div",{className:"w-9 h-9 sm:w-11 sm:h-11 rounded-lg border-2 shrink-0 shadow-inner transition-transform",style:{backgroundColor:i.hex,borderColor:t.farbe===i.name?"hsl(var(--primary))":"hsl(var(--border))",transform:t.farbe===i.name?"scale(1.05)":"scale(1)"}}),c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-sm font-semibold",children:i.name}),c.jsx("div",{className:"text-xs text-muted-foreground",children:i.ral})]}),t.farbe===i.name&&c.jsx(ti,{className:"w-4 h-4 text-primary ml-auto shrink-0"})]},i.name))})})]})})]})}const IT=.7,Ha=5,Qc=100*IT,eu="hsl(var(--destructive))",xx="hsl(var(--foreground))";function DIe(t){const e=t.saeulentyp==="6x3";let n;return t.bauform==="rund"?n=e?104.5:106.5:t.bauform==="inneneck"?n=e?74:76:n=e?93.6:95.6,t.eckwinkel===45&&(n=n/2),n*IT}function BIe({cx:t,cy:e,a:n,depth:r}){const i=[`${t},${e}`,`${t-n},${e}`,`${t-n},${e+r}`,`${t-r},${e+n}`,`${t},${e+n}`].join(" ");return c.jsxs("g",{children:[c.jsx("defs",{children:c.jsx("pattern",{id:"hatch-module",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground
790/30",strokeWidth:"0.8"})})}),c.jsx("polygon",{points:i,fill:"url(#hatch-module)",stroke:xx,strokeWidth:"0.8"}),c.jsx("text",{x:t-n/2,y:e+r/2+2,textAnchor:"middle",className:"fill-foreground text-[5px] font-semibold",children:"IE 90°"})]})}function FIe({cx:t,cy:e,a:n,depth:r}){const i={x:t-n,y:e},s={x:t,y:e+n},a={x:t-n,y:e+r},o={x:t-r,y:e+n},l={x:t,y:e},u={x:(i.x+l.x)/2,y:(i.y+l.y)/2},d={x:(l.x+s.x)/2,y:(l.y+s.y)/2},h=(u.x+d.x)/2,p=(u.y+d.y)/2,f=Math.cos(Math.PI/4),m=Math.sin(Math.PI/4),x=h-r*f,v=p+r*m,g=[`M${i.x},${i.y}`,`Q${u.x},${u.y} ${h},${p}`,`L${x},${v}`,`L${a.x},${a.y}`,"Z"].join(" "),b=[`M${h},${p}`,`Q${d.x},${d.y} ${s.x},${s.y}`,`L${o.x},${o.y}`,`L${x},${v}`,"Z"].join(" ");return c.jsxs("g",{children:[c.jsxs("defs",{children:[c.jsx("pattern",{id:"hatch-module",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})}),c.jsx("pattern",{id:"hatch-module2",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(-45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})})]}),c.jsx("path",{d:g,fill:"url(#hatch-module)",stroke:xx,strokeWidth:"0.8"}),c.jsx("path",{d:b,fill:"url(#hatch-module2)",stroke:xx,strokeWidth:"0.8"}),c.jsx("line",{x1:h,y1:p,x2:x,y2:v,stroke:"hsl(var(--primary))",strokeWidth:"1.5"})]})}function OIe({cx:t,cy:e,a:n,depth:r}){const i={x:t-n,y:e},s={x:t,y:e+n},a={x:t-n,y:e+r},o={x:t-r,y:e+n},l={x:t,y:e},u=(i.x+l.x)/2,d=(i.y+l.y)/2,h=(l.x+s.x)/2,p=(l.y+s.y)/2,f=(u+h)/2,m=(d+p)/2,x=Math.cos(Math.PI/4),v=Math.sin(Math.PI/4),g=f-r*x,b=m+r*v,y=[`M${i.x},${i.y}`,`L${f},${m}`,`L${g},${b}`,`L${a.x},${a.y}`,"Z"].join(" "),S=[`M${f},${m}`,`L${s.x},${s.y}`,`L${o.x},${o.y}`,`L${g},${b}`,"Z"].join(" ");return c.jsxs("g",{children:[c.jsxs("defs",{children:[c.jsx("pattern",{id:"hatch-module",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})}),c.jsx("pattern",{id:"hatch-module2",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(-45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})})]}),c.jsx("path",{d:y,fill:"url(#hatch-module)",stroke:xx,strokeWidth:"0.8"}),c.jsx("path",{d:S,fill:"url(#hatch-module2)",stroke:xx,strokeWidth:"0.8"}),c.jsx("line",{x1:f,y1:m,x2:g,y2:b,stroke:"hsl(var(--primary))",strokeWidth:"1.5"}),c.jsx("text",{x:(i.x+f)/2,y:(i.y+b)/2+2,textAnchor:"middle",className:"fill-foreground text-[4.5px] font-semibold",children:"IE 45°"}),c.jsx("text",{x:(f+s.x)/2,y:(m+s.y)/2+2,textAnchor:"middle",className:"fill-foreground text-[4.5px] font-semibold",children:"IE 45°"})]})}function zIe({cx:t,cy:e,a:n,depth:r,cos45:i,sin45:s}){const a={x:t-n,y:e},o={x:t+n*i,y:e+n*s},l={x:t-n,y:e+r},u={x:o.x-r*s,y:o.y+r*i},d=[`M${a.x},${a.y}`,`L${o.x},${o.y}`,`L${u.x},${u.y}`,`L${l.x},${l.y}`,"Z"].join(" ");return c.jsxs("g",{children:[c.jsx("defs",{children:c.jsx("pattern",{id:"hatch-45",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})})}),c.jsx("path",{d,fill:"url(#hatch-45)",stroke:xx,strokeWidth:"0.8"}),c.jsx("text",{x:(a.x+o.x)/2,y:(a.y+o.y)/2+r*.3,textAnchor:"middle",className:"fill-foreground text-[4.5px] font-semibold",children:"IE 45°"})]})}function UIe({cx:t,cy:e,a:n,depth:r,cos45:i,sin45:s}){const a={x:t-n,y:e},o={x:t+n*i,y:e+n*s},l={x:t-n,y:e+r},u={x:o.x-r*s,y:o.y+r*i},d=[`M${a.x},${a.y}`,`Q${t},${e} ${o.x},${o.y}`,`L${u.x},${u.y}`,`L${l.x},${l.y}`,"Z"].join(" ");return c.jsxs("g",{children:[c.jsx("defs",{children:c.jsx("pattern",{id:"hatch-45r",patternUnits:"userSpaceOnUse",width:"5",height:"5",patternTransform:"rotate(45)",children:c.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"5",className:"stroke-muted-foreground/30",strokeWidth:"0.8"})})}),c.jsx("path",{d,fill:"url(#hatch-45r)",stroke:xx,strokeWidth:"0.8"}),c.jsx("text",{x:(a.x+o.x)/2,y:(a.y+o.y)/2+r*.3,textAnchor:"middle",className:"fill-foreground text-[4.5px] font-semibold",children:"IER 45°"})]})}function HIe({config:t}){const e=t.eckwinkel===90,n=hT.find(A=>A.winkel===t.eckwinkel&&A.bauform===t.bauform),r=cO.find(A=>
790A.value===t.anbindung),i=t.tiefe*IT,s=DIe(t),a=t.anbindung==="zwei-regale",o=t.anbindung!=="freistehend",l=s+Qc+30,u=e?40+l:60+l*.7,d=e?30:40;if(e){const A=u+40,k=d+l+30,M=t.bauform==="inneneck"?c.jsx(BIe,{cx:u,cy:d,a:s,depth:i}):t.bauform==="rund"?c.jsx(FIe,{cx:u,cy:d,a:s,depth:i}):c.jsx(OIe,{cx:u,cy:d,a:s,depth:i});return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"bg-muted/30 rounded-lg border border-border p-3",children:c.jsxs("svg",{viewBox:`0 0 ${A} ${k}`,className:"w-full max-w-sm mx-auto",children:[c.jsxs("defs",{children:[c.jsx("marker",{id:"arr-e",markerWidth:"5",markerHeight:"5",refX:"4",refY:"2.5",orient:"auto",children:c.jsx("path",{d:"M0,0.5 L4,2.5 L0,4.5",fill:"none",stroke:"currentColor",strokeWidth:"0.6"})}),c.jsx("marker",{id:"arr-s",markerWidth:"5",markerHeight:"5",refX:"1",refY:"2.5",orient:"auto",children:c.jsx("path",{d:"M5,0.5 L1,2.5 L5,4.5",fill:"none",stroke:"currentColor",strokeWidth:"0.6"})})]}),c.jsx("rect",{x:u-l,y:d-Ha,width:l+Ha,height:Ha,className:"fill-muted-foreground/70 stroke-foreground",strokeWidth:"0.8"}),c.jsx("rect",{x:u,y:d,width:Ha,height:l,className:"fill-muted-foreground/70 stroke-foreground",strokeWidth:"0.8"}),c.jsx("path",{d:`M${u-18},${d} A18,18 0 0,0 ${u},${d+18}`,fill:"none",className:"stroke-muted-foreground",strokeWidth:"0.7"}),c.jsx("text",{x:u-10,y:d+13,textAnchor:"middle",className:"fill-muted-foreground text-[6px] font-medium",children:"90°"}),M,a&&c.jsxs("g",{children:[c.jsx("rect",{x:u-s-Qc,y:d,width:Qc,height:i,fill:eu,fillOpacity:"0.25",stroke:eu,strokeWidth:"1.2"}),c.jsx("text",{x:u-s-Qc/2,y:d+i/2+2,textAnchor:"middle",className:"text-[5px] font-medium",fill:eu,children:"Regal 100 cm"})]}),o&&c.jsxs("g",{children:[c.jsx("rect",{x:u-i,y:d+s,width:i,height:Qc,fill:eu,fillOpacity:"0.25",stroke:eu,strokeWidth:"1.2"}),c.jsx("text",{x:u-i/2,y:d+s+Qc/2+2,textAnchor:"middle",className:"text-[5px] font-medium",fill:eu,transform:`rotate(-90, ${u-i/2}, ${d+s+Qc/2+2})`,children:"Regal 100 cm"})]}),c.jsxs("g",{className:"text-muted-foreground",children:[c.jsx("line",{x1:u+Ha+10,y1:d,x2:u+Ha+10,y2:d+s,stroke:"currentColor",strokeWidth:"0.6",markerStart:"url(#arr-s)",markerEnd:"url(#arr-e)"}),c.jsx("line",{x1:u+Ha+6,y1:d,x2:u+Ha+13,y2:d,stroke:"currentColor",strokeWidth:"0.4"}),c.jsx("line",{x1:u+Ha+6,y1:d+s,x2:u+Ha+13,y2:d+s,stroke:"currentColor",strokeWidth:"0.4"}),c.jsxs("text",{x:u+Ha+15,y:d+s/2+2,textAnchor:"start",className:"fill-muted-foreground text-[5px] font-medium",children:[(s/IT).toLocaleString("de-DE",{maximumFractionDigits:1})," cm"]})]})]})}),c.jsx(DV,{config:t,bauformInfo:n,anbindungInfo:r})]})}const h=Math.cos(Math.PI/4),p=Math.sin(Math.PI/4),f=l*h,m=l*p,x=-p,v=h,g={x:u+s*h,y:d+s*p},b=u+f+40,y=d+m+i*v+40,S=t.bauform==="rund"?c.jsx(UIe,{cx:u,cy:d,a:s,depth:i,cos45:h,sin45:p}):c.jsx(zIe,{cx:u,cy:d,a:s,depth:i,cos45:h,sin45:p});return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"bg-muted/30 rounded-lg border border-border p-3",children:c.jsxs("svg",{viewBox:`0 0 ${b} ${y}`,className:"w-full max-w-sm mx-auto",children:[c.jsxs("defs",{children:[c.jsx("marker",{id:"arr-e",markerWidth:"5",markerHeight:"5",refX:"4",refY:"2.5",orient:"auto",children:c.jsx("path",{d:"M0,0.5 L4,2.5 L0,4.5",fill:"none",stroke:"currentColor",strokeWidth:"0.6"})}),c.jsx("marker",{id:"arr-s",markerWidth:"5",markerHeight:"5",refX:"1",refY:"2.5",orient:"auto",children:c.jsx("path",{d:"M5,0.5 L1,2.5 L5,4.5",fill:"none",stroke:"currentColor",strokeWidth:"0.6"})})]}),c.jsx("rect",{x:u-l,y:d-Ha,width:l,height:Ha,className:"fill-muted-foreground/70 stroke-foreground",strokeWidth:"0.8"}),c.jsx("polygon",{points:[`${u},${d}`,`${u+f},${d+m}`,`${u+f+Ha*p},${d+m-Ha*h}`,`${u+Ha*p},${d-Ha*h}`].join(" "),className:"fill-muted-foreground/70 stroke-foreground",strokeWidth:"0.8"}),c.jsx("circle",{cx:u,cy:d,r:Ha/2,className:"fill-muted-foreground/70"}),c.jsx("path",{d:`M${u-18},${d} A18,18 0 0,0 ${u+18*h},${d+18*p}`,fill:"none",className:"stroke-muted-foreground",strokeWidth:"0.7"}),c.jsx("text",{x:u-3,y:d+16,textAnchor:"middle",className:"fill-muted-foreground text-[6px] font-medium",children:"45°"}),S,a&&c.jsxs("g",{children:[c.jsx("rect",{x:u-s-Qc,y:d,width:Qc,height:i,fill:eu,fillOpacity:"0.25",stroke:eu,strokeWidth:"1.2"}),c.jsx("text",{x:u-s-Qc/2,y:d+i/2+2,textAnchor:"middle",className:"text-[5px] font-medium",fill:eu,children:"Regal 100 cm"})]}),o&&(()=>{const A=g.x,k=g.y,M=A+Qc*h,T=k+Qc*p,C=x*i,R=v*i;return c.jsxs("g",{children:[c.jsx("polygon",{points:`${A},${k} ${M},${T} ${M+C},${T+R} ${A+C},${k+R}`,fill:eu,fillOpacity:"0.25",stroke:eu,strokeWidth:"1.2"}),c.jsx("text",{x:(A+M)/2+C/2,y:(k+T)/2+R/2+2,textAnchor:"middle",className:"text-[5px] font-medium",fill:eu,transform:`rotate(45, ${(A+M)/2+C/2}, ${(k+T)/2+R/2+2})`,children:"Regal 100 cm"})]})})()]})}),c.jsx(DV,{config:t,bauformInfo:n,anbindungInfo:r})]})}function DV({config:t,bauformInfo:e,anbindungInfo:n}){return c.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5 text-xs px-1",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Eckwinkel"}),c.jsxs("span",{className:"font-medium",children:[t.eckwinkel,"°"]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Bauform"}),c.jsx("span",{className:"font-medium",children:(e==null?void 0:e.label)??t.bauform})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Module"}),c.jsx("span",{className:"font-medium",children:(e==null?void 0:e.description)??"â"})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Anbindung"}),c.jsx("span",{className:"font-medium",children:(n==null?void 0:n.label)??t.anbindung})]})]})}const GIe=()=>{const[t]=Al(),e=t.get("embed")==="true",n=Ph(),[r,i]=E.useState("config"),[s,a]=E.useState(OSe()),{preisliste:o,farblogik:l,tierPrices:u,isLoading:d}=F1("eckregal"),h=g=>{a(b=>({...b,...g}))};Ix({expectedKonfigurator:"regal",skip:d,applyKonfiguration:g=>{const b=g&&typeof g=="object"?g:{},y="config"in b&&b.regaltyp==="eckregal"?b.config:b;y&&typeof y=="object"&&"eckwinkel"in y&&a(S=>({...S,...y}))}});const p=E.useMemo(()=>
790{if(d||!o.length||!l.length)return null;const g=EEe(s,o,l);return H1(g,u)},[s,o,l,u,d]),f=hT.find(g=>g.winkel===s.eckwinkel&&g.bauform===s.bauform),m=cO.find(g=>g.value===s.anbindung),x=p==null?void 0:p.positionen.some(g=>g.warnung),v=p&&p.positionen.some(g=>g.einzelpreis>0);return c.jsxs("div",{className:`min-h-screen ${e?"bg-background":"bg-secondary/50"}`,children:[c.jsxs("div",{className:"sticky top-0 z-50 bg-background shadow-sm",children:[!e&&c.jsx("header",{className:"border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4 py-3.5 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-10 w-auto"}),c.jsx("div",{children:c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Tegometall Eckregal-Konfigurator"})})]})}),e&&c.jsx("div",{className:"container mx-auto px-4 pt-3 max-w-7xl",children:c.jsxs("a",{href:"/konfigurator?embed=true",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx(zf,{className:"w-4 h-4"})," Zurück zur Auswahl"]})}),c.jsx(X1,{items:[{label:`${s.eckwinkel}° ${(f==null?void 0:f.label)??""}`,done:!0},{label:(m==null?void 0:m.label)??s.anbindung,done:!0},{label:`${s.hoehe} cm`,done:!0},{label:`${s.tiefe} cm tief`,done:!0},{label:`${s.anzahlFachboeden} Fachböden`,done:!0},{label:s.rueckwandtyp,done:!0},{label:s.farbe,done:!0}]}),c.jsx(Z1,{activeTab:r,onTabChange:i,totalPrice:p==null?void 0:p.gesamtpreis})]}),c.jsx("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:c.jsx(bo,{mode:"wait",children:c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.3},className:n?"":"grid grid-cols-1 lg:grid-cols-5 gap-6 items-start",children:[(!n||r==="config")&&c.jsx("div",{className:n?"":"lg:col-span-3",children:c.jsx(IIe,{config:s,onChange:h})}),(!n||r==="result")&&c.jsxs("div",{className:n?"":"lg:col-span-2 lg:sticky lg:top-28 lg:self-start space-y-4",children:[c.jsx(tn.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.35},className:"bg-card rounded-xl border border-border p-4 shadow-sm",children:c.jsxs($b,{defaultValue:"photo",children:[c.jsxs(dx,{className:"mb-3 w-full grid grid-cols-2",children:[c.jsx(Xl,{value:"photo",className:"text-xs",children:"Beispielbild"}),c.jsx(Xl,{value:"topview",className:"text-xs",children:"Draufsicht"})]}),c.jsx(vu,{value:"photo",children:c.jsx(zne,{config:s,modul:null})}),c.jsx(vu,{value:"topview",children:c.jsx(HIe,{config:s})})]})}),c.jsx(VIe,{config:s,ergebnis:p,isLoading:d,hasWarnings:x,hasRealPrices:v,bauformLabel:(f==null?void 0:f.label)??"",anbindungLabel:(m==null?void 0:m.label)??s.anbindung})]})]},n?r:"desktop")})}),c.jsx(Kf,{isEmbed:e})]})};function VIe({config:t,ergebnis:e,isLoading:n,hasWarnings:r,hasRealPrices:i,bauformLabel:s,anbindungLabel:a}){const[o,l]=E.useState(!1),u=Ph();if(n)return c.jsx(Dn,{className:"config-card",children:c.jsxs(Bn,{className:"py-12 text-center",children:[c.jsx(md,{className:"w-8 h-8 animate-spin text-muted-foreground mx-auto mb-3"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Daten werden geladenâ¦"})]})});if(!e)return null;const d=e.positionen.filter(f=>f.anzahl>0).reduce((f,m)=>{const x=f.find(v=>v.schluessel===m.schluessel&&!v.warnung&&!m.warnung);return x?(x.anzahl+=m.anzahl,x.gesamt+=m.gesamt):f.push({...m}),f},[]),h=d.filter(f=>!f.warnung&&f.einzelpreis>0),p=d.filter(f=>f.warnung||f.einzelpreis===0);return c.jsxs("div",{className:"space-y-4",children:[c.jsx(tn.div,{initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},transition:{duration:.3},children:c.jsx(Dn,{className:"config-card overflow-hidden",children:c.jsx("div",{className:"price-glow",children:c.jsx(Bn,{className:"pt-8 pb-6",children:c.jsxs("div",{className:"text-center space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground font-medium tracking-wide uppercase",children:"Gesamtpreis (bekannte Teile)"}),c.jsx(tn.p,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"text-3xl sm:text-5xl font-bold text-foreground tracking-tight",children:i?H0(e.gesamtpreis):"â"},e.gesamtpreis),c.jsx("p",{className:"text-xs text-muted-foreground",children:i?"zzgl. MwSt. & Versandkosten · Eck-spezifische Teile werden ergänzt":"Preise werden nach CSV-Upload ergänzt"}),c.jsx("div",{className:"text-xs text-muted-foreground pt-2",children:c.jsx("span",{className:"font-mono font-medium",children:e.modulDetails})})]})})})})}),r&&c.jsx(Dn,{className:"border-destructive/30 bg-destructive/5",children:c.jsx(Bn,{className:"pt-4 pb-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Ah,{className:"w-5 h-5 text-destructive shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:"Eck-spezifische Artikel noch nicht hinterlegt"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Sockelblenden, Fachböden und Rückwände für Ecklösungen werden nach CSV-Upload automatisch zugeordnet."})]})]})})}),d.length>0&&c.jsx(wne,{type:"single",collapsible:!0,defaultValue:"lieferumfang",children:c.jsxs(kO,{value:"lieferumfang",className:"config-card border rounded-xl px-5",children:[c.jsx(CO,{className:"text-sm font-medium",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Mf,{className:"w-4 h-4 text-muted-foreground"}),"Lieferumfang (",d.length," Positionen)"]})}),c.jsx(NO,{children:c.jsx("div",{className:"overflow-x-auto -mx-1",children:c.jsxs("table",{className:"w-full text-sm table-fixed",children:[c.jsxs("colgroup",{children:[c.jsx("col",{className:"w-auto"}),c.jsx("col",{className:"w-[10%]"}),c.jsx("col",{className:"w-[16%]"})]}),c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-border",children:[c.jsx("th",{className:"text-left px-3 py-2 font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Artikel"}),c.jsx("th",{className:"text-center px-3 py-2 font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Anz."}),c.jsx("th",{className:"text-right px-3 py-2 font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Gesamt"})]})}),c.jsxs("tbody",{children:[h.map((f,m)=>c.jsxs("tr",{className:"border-b border-border/50",children:[c.jsx("td",{className:"px-3 py-3",children:c.jsxs("div",{className:"flex items-center gap-2.5",children:[f.bild_url&&c.jsx("img",{src:f.bild_url,alt:"",className:"w-10 h-10 object-contain rounded shrink-0"}),c.jsx("span",{className:"text-sm leading-snug",children:f.produkt_url?c.jsx("a",{href:f.produkt_url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline hover:text-primary transition-colors",children:f.artikelname}):f.artikelname})]})}),c.jsx("td",{className:"px-3 py-3 text-center tabular-nums",children:f.anzahl}),c.jsx("td",{className:"px-3 py-3 text-right font-medium tabular-nums",children:H0(f.gesamt)})]},`known-${m}`)),p.length>0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-3 pt-4 pb-2",children:c.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Eck-spezifisch (Preis folgt)"})})}),p.map((f,m)=>c.jsxs("tr",{className:"border-b border-border/50 bg-muted/30",children:[c.jsx("td",{className:"px-3 py-3",children:c.jsxs("div",{children:[c.jsx("span",{className:"text-sm leading-snug",children:f.artikelname}),f.typ&&c.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5",children:f.typ}),f.schluessel&&c.jsxs("span",{className:"block text-xs text-muted-foreground font-mono mt-0.5",children:["Schlüssel: ",f.schluessel]}),f.sku&&c.jsxs("span",{className:"block text-xs text-muted-foreground font-mono mt-0.5",children:["SKU: ",f.sku]})]})}),c.jsx("td",{className:"px-3 py-3 text-center tabular-nums",children:f.anzahl}),c.jsx("td",{className:"px-3 py-3 text-right text-xs text-muted-foreground italic",children:"0,00 â¬"})]}
790,`ph-${m}`)),i&&c.jsxs("tr",{className:"font-bold text-base border-t-2 border-border",children:[c.jsx("td",{colSpan:2,className:"px-3 py-4 text-right",children:"Zwischensumme:"}),c.jsx("td",{className:"px-3 py-4 text-right tabular-nums text-primary",children:H0(e.gesamtpreis)})]})]})]})})})]})}),c.jsxs(tn.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.15},className:"flex flex-col gap-2.5",children:[qO,c.jsxs(Pt,{onClick:()=>l(!0),size:"lg",className:"w-full text-base font-semibold shadow-md hover:shadow-lg transition-shadow",children:[c.jsx(vJ,{className:"w-5 h-5 mr-2"}),"Angebot anfordern"]}),c.jsxs(Pt,{variant:"outline",className:"w-full text-[13px] sm:text-sm",onClick:()=>Sie(t,e,null),children:[c.jsx(gJ,{className:"w-4 h-4 mr-1.5 sm:mr-2 shrink-0"}),u?"PDF Export":"Als PDF downloaden"]}),c.jsx(Bf,{konfigurator:"regal",regalTyp:"eckregal",getKonfiguration:()=>({regaltyp:"eckregal",config:t}),className:"w-full text-[13px] sm:text-sm"})]}),c.jsx(Px,{open:o,onOpenChange:l,konfiguratorName:"Tegometall Eckregal",tabelle:"regal_anfragen",konfiguratorTyp:"regal",konfigurationSnapshot:()=>({regaltyp:"eckregal",config:t}),buildInsertPayload:()=>{const f={regaltyp:"eckregal",eckwinkel:t.eckwinkel,bauform:t.bauform,anbindung:t.anbindung,hoehe:t.hoehe,tiefe:t.tiefe,anzahlFachboeden:t.anzahlFachboeden,rueckwandtyp:t.rueckwandtyp,farbe:t.farbe,modulDetails:e.modulDetails},m=e.positionen.filter(x=>x.anzahl>0).map(x=>({artikelname:x.artikelname,sku:x.sku,anzahl:x.anzahl,einzelpreis:x.einzelpreis,gesamt:x.gesamt}));return{gesamtpreis:e.gesamtpreis,set_sku:e.setSku,konfiguration:f,lieferumfang:m}},buildPdfInput:(f,m)=>({konfiguratorName:"Tegometall Eckregal",anfrageId:m,identifier:e.setSku,konfiguration:[{label:"Eckwinkel",value:`${t.eckwinkel}°`},{label:"Bauform",value:s},{label:"Anbindung",value:a},{label:"Höhe",value:`${t.hoehe} cm`},{label:"Tiefe",value:`${t.tiefe} cm`},{label:"Fachböden",value:String(t.anzahlFachboeden)},{label:"Rückwand",value:String(t.rueckwandtyp)},{label:"Farbe",value:String(t.farbe??"â")},{label:"Modul-Details",value:e.modulDetails??"â"}],positionen:e.positionen.filter(x=>x.anzahl>0).map(x=>({sku:x.sku,artikelname:x.artikelname,menge:x.anzahl,einzelpreis:x.einzelpreis,gesamtpreis:x.gesamt})),gesamtNetto:e.gesamtpreis,mwstSatz:.19})})]})}const WIe=()=>c.jsx(Ed,{slug:"eckregal",children:c.jsx(GIe,{})}),DT=[{id:"global",label:"Global / Backend",items:[{to:"/admin/global/produktkatalog",label:"Produktkatalog (Channable)",icon:Zd},{to:"/admin/staffelpreise",label:"Staffelpreise (Xentral)",icon:Zd},{to:"/admin/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]},{id:"analytics",label:"Nutzungsanalyse",items:[{to:"/admin/analytics",label:"Ãbersicht",icon:Kfe}]},{id:"tegometall",label:"Tegometall Regal-Konfi",items:[{to:"/admin/tegometall/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/modules",label:"Modulkombinationen",icon:sg},{to:"/admin/images",label:"Regalbilder",icon:xc},{to:"/admin/preview",label:"Vorschau",icon:Vo},{to:"/admin/embed",label:"Einbettung",icon:ou},{to:"/admin/tegometall/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]},{id:"boden",label:"StandOnFloor Boden-Konfi",items:[{to:"/admin/boden/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/boden/bilder",label:"Bilder",icon:xc},{to:"/admin/boden/videos",label:"Videos",icon:IC},{to:"/admin/boden/vorschau",label:"Vorschau",icon:Vo},{to:"/admin/boden/einbettung",label:"Einbettung",icon:ou},{to:"/admin/boden/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]},{id:"standonfloor-wuerfel",label:"StandOnFloor Würfel-Konfi (Alu)",items:[{to:"/admin/standonfloor-wuerfel/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/standonfloor-wuerfel/bilder",label:"Bilder",icon:xc},{to:"/admin/standonfloor-wuerfel/vorschau",label:"Vorschau",icon:Vo},{to:"/admin/standonfloor-wuerfel/einbettung",label:"Einbettung",icon:ou},{to:"/admin/standonfloor-wuerfel/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]},{id:"easycubes",label:"EasyCubes Würfel-Konfi (Kunststoff)",items:[{to:"/admin/easycubes/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/easycubes/bilder",label:"Bilder",icon:xc},{to:"/admin/easycubes/vorschau",label:"Vorschau",icon:Vo},{to:"/admin/easycubes/einbettung",label:"Einbettung",icon:ou},{to:"/admin/easycubes/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",
790icon:Cp}]},{id:"messestand",label:"Messestand-Konfi",items:[{to:"/admin/messestand/modelle",label:"3D-Modelle",icon:xc},{to:"/admin/messestand/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/messestand/vorschau",label:"Vorschau",icon:Vo},{to:"/admin/messestand/einbettung",label:"Einbettung",icon:ou},{to:"/admin/messestand/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]},{id:"spacewall",label:"Spacewall Lamellenwand-Konfi",items:[{to:"/admin/spacewall/produkte",label:"Produktdaten",icon:Zd},{to:"/admin/spacewall/farben",label:"Farben",icon:Uf},{to:"/admin/spacewall/bilder",label:"Bilder",icon:xc},{to:"/admin/spacewall/kantenschutz",label:"Kantenschutz",icon:cF},{to:"/admin/spacewall/vorschau",label:"Vorschau",icon:Vo},{to:"/admin/spacewall/einbettung",label:"Einbettung",icon:ou},{to:"/admin/spacewall/gespeicherte-konfigurationen",label:"Gespeicherte Konfigurationen",icon:Cp}]}],lse="admin.sidebar.groups";function $Ie(t){try{const n=localStorage.getItem(lse);if(n)return JSON.parse(n)}catch{}const e={};for(const n of DT)e[n.id]=n.items.some(r=>t.startsWith(r.to));if(!Object.values(e).some(Boolean))for(const n of DT)e[n.id]=!0;return e}const KIe=()=>{const{user:t,loading:e,isAdmin:n,signOut:r}=WZ(),i=Tx(),s=Wf(),[a,o]=E.useState(!1),[l,u]=E.useState(0),[d,h]=E.useState(()=>$Ie(s.pathname));E.useEffect(()=>{h(x=>{const v={...x};let g=!1;for(const b of DT)b.items.some(y=>s.pathname.startsWith(y.to))&&!v[b.id]&&(v[b.id]=!0,g=!0);return g?v:x})},[s.pathname]),E.useEffect(()=>{try{localStorage.setItem(lse,JSON.stringify(d))}catch{}},[d]);const p=x=>h(v=>({...v,[x]:!v[x]}));if(E.useEffect(()=>{Iee().then(v=>{const g=796-v.length;u(g>0?g:0)})},[s.pathname]),e)return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:c.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"})});if(!t||!n)return c.jsx(R5,{to:"/",replace:!0});const f=async()=>{await r(),i("/")},m=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"p-4 border-b border-border",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-8 w-auto"}),c.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Admin"})]})}),c.jsx("nav",{className:"flex-1 p-3 space-y-4 overflow-y-auto",children:DT.map(x=>{const v=d[x.id]??!1;return c.jsxs("div",{className:"space-y-1",children:[c.jsxs("button",{type:"button",onClick:()=>p(x.id),"aria-expanded":v,className:"w-full flex items-center justify-between px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground transition-colors",children:[c.jsx("span",{className:"truncate text-left",children:x.label}),c.jsx(Su,{className:`w-4 h-4 shrink-0 transition-transform ${v?"":"-rotate-90"}`})]}),v&&c.jsx("div",{className:"space-y-1",children:x.items.map(g=>c.jsxs(Jxe,{to:g.to,onClick:()=>o(!1),className:({isActive:b})=>`flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors ${b?"bg-primary/10 text-primary font-medium":"text-foreground hover:bg-muted"}`,children:[c.jsx(g.icon,{className:"w-4 h-4 shrink-0"}),c.jsx("span",{className:"truncate",children:g.label}),g.to==="/admin/images"&&l>0&&c.jsx("span",{className:"ml-auto bg-destructive text-destructive-foreground text-xs font-bold rounded-full min-w-5 h-5 flex items-center justify-center px-1.5",children:l})]},g.to))})]},x.id)})}),c.jsxs("div",{className:"p-3 border-t border-border",children:[c.jsx("p",{className:"text-xs text-muted-foreground mb-2 px-3 truncate",children:t.email}),c.jsxs(Pt,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:f,children:[c.jsx(ope,{className:"w-4 h-4 mr-2"}),"Abmelden"]})]})]});return c.jsxs("div",{className:"flex min-h-screen bg-secondary",children:[c.jsx("aside",{className:"hidden lg:flex w-64 bg-card border-r border-border flex-col shrink-0",children:m}),c.jsxs("div",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-card border-b border-border h-14 flex items-center px-4",children:[c.jsx(Pt,{variant:"ghost",size:"icon",onClick:()=>o(!a),children:a?c.jsx(Bc,{className:"w-5 h-5"}):c.jsx(lpe,{className:"w-5 h-5"})}),c.jsx("span",{className:"ml-3 font-semibold text-sm",children:"Admin"})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"lg:hidden fixed inset-0 z-40 bg-black/40",onClick:()=>o(!1)}),c.jsx("aside",{className:"lg:hidden fixed left-0 top-0 bottom-0 z-50 w-64 bg-card border-r border-border flex flex-col",children:m})]}),c.jsx("main",{className:"flex-1 lg:p-6 p-4 pt-18 lg:pt-6 overflow-auto",children:c.jsx(Bxe,{})})]})},qIe=()=>c.jsx(R5,{to:"/admin/tegometall/produkte",replace:!0}),AA=E.forwardRef(({className:t,...e},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:rn("w-full caption-bottom text-sm",t),...e})}));AA.displayName="Table";const EA=E.forwardRef(({className:t,...e},n)=>c.jsx("thead",{ref:n,className:rn("[&_tr]:border-b",t),...e}));EA.displayName="TableHeader";const kA=E.forwardRef(({className:t,...e},n)=>c.jsx("tbody",{ref:n,className:rn("[&_tr:last-child]:border-0",t),...e}));kA.displayName="TableBody";const XIe=E.forwardRef(({className:t,...e},n)=>c.jsx("tfoot",{ref:n,className:rn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));XIe.displayName="TableFooter";const kc=E.forwardRef(({className:t,...e},n)=>c.jsx("tr",{ref:n,className:rn("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));kc.displayName="TableRow";const ws=E.forwardRef(({className:t,...e},n)=>c.jsx("th",{ref:n,className:rn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));ws.displayName="TableHead";const Pi=E.forwardRef(({className:t,...e},n)=>c.jsx("td",{ref:n,className:rn("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Pi.displayName="TableCell";const YIe=E.forwardRef(({className:t,...e},n)=>c.jsx("caption",{ref:n,className:rn("mt-4 text-sm text-muted-foreground",t),...e}));YIe.displayName="TableCaption";const JIe=()=>{const[t,e]=E.useState([]),[n,r]=E.useState(new Set),[i,s]=E.useState({}),[a,o]=E.useState({}),[l,u]=E.useState(""),[d,h]=E.useState("all"),[p,f]=E.useState(!0),m=async()=>{const{data:T}=await Ot.rpc("get_missing_skus");r(new Set((T??[]).map(C=>C.sku)))},x=async()=>{f(!0);const[T]=await Promise.all([Ot.from("preisliste").select("id, artikelname, schluessel, sku, preis").order("artikelname").order("sku").limit(5e3),m()]);e(T.data??[]),s({}),f(!1)};E.useEffect(()=>{x()},[]);const v=(T,C)=>{s(R=>({...R,[T]:C}))},g=async T=>{const C=i[T];if(!C)return;o(P=>({...P,[T]:!0}));const{error:R}=await Ot.from("preisliste").update({sku:C.trim()}).eq("id",T);R?dn({title:"Fehler",description:R.message,variant:"destructive"}):(e(P=>P.map(j=>j.id===T?{...j,sku:C.trim()}:j)),s(P=>{const j={...P};return delete j[T],j}),dn({title:"Gespeichert",description:`SKU aktualisiert auf ${C.trim()}`}),await m()),o(P=>({...P,[T]:!1}))},b=async()=>{const T=Object.entries(i);if(T.length!==0)for(const[C]of T)await g(C)},y=E.useMemo(()=>{let T=t;if(d==="missing"&&(T=T.filter(C=>n.has(C.sku))),d==="matched"&&(T=T.filter(C=>!n.has(C.sku))),l.trim()){const C=l.toLowerCase();T=T.filter(R=>R.sku.toLowerCase().includes(C)||R.artikelname.toLowerCase().includes(C)||R.schluessel.toLowerCase().includes(C))}return T},[t,l,d,n]),S=n.size,A=t.length-S,k=Object.keys(i).length,M=T=>
790T.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" â¬";return c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Artikelnummern der Preisliste bearbeiten, damit sie mit dem Channable-Feed übereinstimmen."}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[c.jsxs("button",{onClick:()=>h("all"),className:`bg-background border rounded-lg p-3 text-left transition-colors ${d==="all"?"ring-2 ring-primary":""}`,children:[c.jsx("p",{className:"text-xs text-muted-foreground",children:"Gesamt"}),c.jsx("p",{className:"text-xl font-bold",children:t.length})]}),c.jsxs("button",{onClick:()=>h("matched"),className:`bg-background border rounded-lg p-3 text-left transition-colors ${d==="matched"?"ring-2 ring-primary":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ti,{className:"w-3.5 h-3.5 text-primary"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Channable-Match"})]}),c.jsx("p",{className:"text-xl font-bold text-primary",children:A})]}),c.jsxs("button",{onClick:()=>h("missing"),className:`bg-background border rounded-lg p-3 text-left transition-colors ${d==="missing"?"ring-2 ring-destructive":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ah,{className:"w-3.5 h-3.5 text-destructive"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Kein Match"})]}),c.jsx("p",{className:"text-xl font-bold text-destructive",children:S})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1 max-w-sm",children:[c.jsx(lF,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(yr,{placeholder:"SKU, Artikelname oder Schlüssel suchenâ¦",value:l,onChange:T=>u(T.target.value),className:"pl-9"})]}),k>0&&c.jsxs(Pt,{onClick:b,size:"sm",children:[c.jsx(I2,{className:"w-4 h-4 mr-1.5"}),k," Ãnderung",k>1?"en":""," speichern"]})]}),c.jsx("div",{className:"bg-background border rounded-lg overflow-x-auto",children:c.jsxs(AA,{children:[c.jsx(EA,{children:c.jsxs(kc,{children:[c.jsx(ws,{children:"Artikelname"}),c.jsx(ws,{children:"Schlüssel"}),c.jsx(ws,{className:"text-right",children:"Preis"}),c.jsx(ws,{className:"min-w-[200px]",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(uJ,{className:"w-3.5 h-3.5"}),"SKU (editierbar)"]})}),c.jsx(ws,{className:"w-20",children:"Status"}),c.jsx(ws,{className:"w-20"})]})}),c.jsx(kA,{children:p?c.jsx(kc,{children:c.jsx(Pi,{colSpan:6,className:"text-center py-8",children:c.jsx(md,{className:"w-5 h-5 animate-spin mx-auto text-muted-foreground"})})}):y.length===0?c.jsx(kc,{children:c.jsx(Pi,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"Keine Einträge gefunden."})}):y.map(T=>{const C=i[T.id]??T.sku,R=T.id in i,P=!n.has(C);return c.jsxs(kc,{className:R?"bg-primary/5":"",children:[c.jsx(Pi,{className:"max-w-xs truncate text-sm",children:T.artikelname}),c.jsx(Pi,{className:"text-xs font-mono text-muted-foreground",children:T.schluessel}),c.jsx(Pi,{className:"text-right tabular-nums text-sm",children:M(T.preis)}),c.jsx(Pi,{children:c.jsx(yr,{value:C,onChange:j=>v(T.id,j.target.value),className:`font-mono text-xs h-8 ${R?"border-primary ring-1 ring-primary/30":""}`})}),c.jsx(Pi,{children:P?c.jsxs(fl,{variant:"outline",className:"text-xs bg-primary/10 text-primary border-primary/30",children:[c.jsx(ti,{className:"w-3 h-3 mr-1"}),"Match"]}):c.jsxs(fl,{variant:"outline",className:"text-xs bg-destructive/10 text-destructive border-destructive/30",children:[c.jsx(Ah,{className:"w-3 h-3 mr-1"}),"Fehlt"]})}),c.jsx(Pi,{children:R&&c.jsx(Pt,{size:"sm",variant:"ghost",className:"h-8 px-2",disabled:a[T.id],onClick:()=>g(T.id),children:a[T.id]?c.jsx(md,{className:"w-3.5 h-3.5 animate-spin"}):c.jsx(I2,{className:"w-3.5 h-3.5"})})})]},T.id)})})]})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Hinweis: Ãnderungen an der SKU sind permanent. Nach dem nächsten Channable-Import werden passende Artikel automatisch mit Preisen, Bildern und Shop-Links angereichert."})]})};function es({icon:t,title:e,description:n,actions:r}){return c.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap mb-6",children:[c.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c.jsx("div",{className:"shrink-0 rounded-md bg-primary/10 text-primary w-10 h-10 flex items-center justify-center",children:c.jsx(t,{className:"w-5 h-5"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"text-2xl font-bold leading-tight",children:e}),n&&c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:n})]})]}),r&&c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:r})]})}const Ej=25,ZIe=()=>{const[t,e]=E.useState([]),[n,r]=E.useState([]),[i,s]=E.useState([]),[a,o]=E.useState(""),[l,u]=E.useState(0),[d,h]=E.useState(0),[p,f]=E.useState(!0),[m,x]=E.useState(!1),[v,g]=E.useState(!1),b=async()=>{f(!0);try{const[R,P,j]=await Promise.all([Ot.from("produkte").select("*").order("artikelnummer").range(l*Ej,(l+1)*Ej-1),Ot.from("import_log").select("*").order("gestartet_am",{ascending:!1}).limit(5),Ot.from("produkte").select("*",{count:"exact",head:!0})]);e(R.data??[]),r(P.data??[]),h(j.count??0),await y()}catch(R){console.error("Load error:",R)}f(!1)},y=async()=>{try{const{data:R}=await Ot.rpc("get_missing_skus");s(R??[])}catch{}};E.useEffect(()=>{b()},[l]);const S=async()=>{var R;x(!0);try{const P="ntxxmvyoiatxvggtjtfg",{supabase:j}=await KC(async()=>{const{supabase:Z}=await Promise.resolve().then(()=>Lbe);return{supabase:Z}},void 0),{data:G}=await j.auth.getSession(),B=(R=G.session)==null?void 0:R.access_token;if(!B){alert("Bitte als Admin einloggen."),x(!1);return}const U=await(await fetch(`https://${P}.supabase.co/functions/v1/sync-products`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${B}`},body:JSON.stringify({quelle:"manuell"})})).json();if(U.error)alert(`Import-Fehler: ${U.error}`);else if(U.success){const Z=[`${U.count??0} Artikel importiert`,`Preisliste: ${U.enriched??0} angereichert · ${U.missing??0} ohne Match`,`Spacewall: ${U.enrichedSpacewall??0} angereichert · ${U.missingSpacewall??0}
790 ohne Match`,`Easycubes: ${U.enrichedEasycubes??0} angereichert · ${U.missingEasycubes??0} ohne Match`];console.info("[sync-products]",Z.join(" · "))}}catch(P){alert(`Fehler: ${P}`)}x(!1),await b()},A=E.useMemo(()=>{if(!a.trim())return t;const R=a.toLowerCase();return t.filter(P=>P.artikelnummer.toLowerCase().includes(R)||P.bezeichnung.toLowerCase().includes(R)||P.ean&&P.ean.toLowerCase().includes(R))},[t,a]),k=n.find(R=>R.status==="success"),M=Math.ceil(d/Ej),T=R=>R?new Date(R).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"â",C=R=>R.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})+" â¬";return c.jsxs("div",{className:"max-w-6xl space-y-6",children:[c.jsx(es,{icon:Zd,title:"Produktkatalog (Channable)",description:"Globaler Artikel-Feed aus Channable für alle Konfiguratoren. Automatischer Import täglich um 07:00 Uhr; manueller Import jederzeit möglich."}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"bg-card border rounded-lg p-4 flex items-start gap-3",children:[c.jsx(Mf,{className:"w-5 h-5 text-primary mt-0.5 shrink-0"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Artikel im Katalog"}),c.jsx("p",{className:"text-2xl font-bold",children:d.toLocaleString("de-DE")})]})]}),c.jsxs("div",{className:"bg-card border rounded-lg p-4 flex items-start gap-3",children:[c.jsx(Yfe,{className:"w-5 h-5 text-primary mt-0.5 shrink-0"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Letzter Import"}),c.jsx("p",{className:"text-sm font-medium",children:k?T(k.abgeschlossen_am):"Noch kein Import"}),k&&c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[k.anzahl_artikel," Artikel · ",k.quelle==="auto"?"Automatisch":"Manuell"]})]})]}),c.jsxs("div",{className:"bg-card border rounded-lg p-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manueller Import"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Feed jetzt abrufen"})]}),c.jsxs(Pt,{onClick:S,disabled:m,size:"sm",children:[m?c.jsx(md,{className:"w-4 h-4 animate-spin mr-1.5"}):c.jsx(rx,{className:"w-4 h-4 mr-1.5"}),m?"Importiereâ¦":"Jetzt importieren"]})]})]}),i.length>0&&c.jsx("div",{className:"bg-destructive/10 border border-destructive/30 rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Ah,{className:"w-5 h-5 text-destructive mt-0.5 shrink-0"}),c.jsxs("div",{className:"min-w-0 w-full",children:[c.jsxs("p",{className:"font-medium text-destructive",children:[i.length," Konfigurator-Artikel ohne Channable-Match"]}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Diese Artikel werden vom Konfigurator benötigt, aber ihre SKU wurde im Channable-Feed nicht gefunden. Preise und Daten bleiben auf dem manuell gepflegten Stand."}),c.jsx("div",{className:"mt-3 max-h-48 overflow-y-auto space-y-1",children:i.map(R=>c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx(fl,{variant:"outline",className:"font-mono bg-background shrink-0",children:R.sku}),c.jsx("span",{className:"text-muted-foreground truncate",children:R.artikelname})]},R.sku))})]})]})}),c.jsxs("div",{className:"bg-card border-2 border-primary/20 rounded-lg overflow-hidden",children:[c.jsxs("button",{className:"w-full px-5 py-4 text-left font-medium hover:bg-primary/5 flex items-center gap-3 transition-colors",onClick:()=>g(!v),children:[c.jsx(uJ,{className:"w-5 h-5 text-primary shrink-0"}),c.jsx("span",{className:"flex-1",children:"SKU-Mapping: Artikelnummern zuordnen"}),i.length>0&&c.jsxs(fl,{variant:"destructive",className:"text-xs font-bold",children:[i.length," offen"]}),c.jsx(nx,{className:`w-4 h-4 text-muted-foreground transition-transform ${v?"rotate-90":""}`})]}),v&&c.jsx("div",{className:"p-5 border-t",children:c.jsx(JIe,{})})]}),n.length>0&&c.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[c.jsx("h3",{className:"text-sm font-semibold mb-3",children:"Import-Verlauf"}),c.jsx("div",{className:"space-y-2",children:n.map(R=>c.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[R.status==="success"?c.jsx(m5,{className:"w-4 h-4 text-primary shrink-0"}):R.status==="error"?c.jsx(fJ,{className:"w-4 h-4 text-destructive shrink-0"}):c.jsx(md,{className:"w-4 h-4 animate-spin text-muted-foreground shrink-0"}),c.jsx("span",{className:"text-muted-foreground",children:T(R.gestartet_am)}),c.jsx(fl,{variant:R.quelle==="auto"?"secondary":"outline",className:"text-xs",children:R.quelle==="auto"?"Automatisch":"Manuell"}),R.anzahl_artikel>0&&c.jsxs("span",{className:"text-muted-foreground",children:[R.anzahl_artikel," Artikel"]}),R.fehler_details&&c.jsx("span",{className:"text-destructive text-xs truncate max-w-xs",children:R.fehler_details})]},R.id))})]}),c.jsxs("div",{className:"bg-card border rounded-lg",children:[c.jsxs("div",{className:"p-4 border-b flex items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1 max-w-sm",children:[c.jsx(lF,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(yr,{placeholder:"Artikelnummer, Bezeichnung oder EAN suchenâ¦",value:a,onChange:R=>o(R.target.value),className:"pl-9"})]}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Seite ",l+1," von ",M||1]})]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs(AA,{children:[c.jsx(EA,{children:c.jsxs(kc,{children:[c.jsx(ws,{className:"w-16",children:"Bild"}),c.jsx(ws,{children:"Artikelnr."}),c.jsx(ws,{children:"Bezeichnung"}),c.jsx(ws,{className:"text-right",children:"Netto-Preis"}),c.jsx(ws,{children:"EAN"}),c.jsx(ws,{className:"w-16 text-center",children:"Shop"})]})}),c.jsx(kA,{children:p?c.jsx(kc,{children:c.jsx(Pi,{colSpan:6,className:"text-center py-8",children:c.jsx(md,{className:"w-5 h-5 animate-spin mx-auto text-muted-foreground"})})}):A.length===0?c.jsx(kc,{children:c.jsx(Pi,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:a?"Keine Ergebnisse gefunden.":"Noch keine Produkte importiert."})}):A.map(R=>c.jsxs(kc,{children:[c.jsx(Pi,{children:R.bild_url?c.jsx("img",{src:R.bild_url,alt:"",className:"w-10 h-10 object-contain rounded border bg-white",loading:"lazy"}):c.jsx("div",{className:"w-10 h-10 rounded border bg-muted flex items-center justify-center",children:c.jsx(xc,{className:"w-4 h-4 text-muted-foreground"})})}),c.jsx(Pi,{className:"font-mono text-xs",children:R.artikelnummer}),c.jsx(Pi,{className:"max-w-xs truncate",children:R.bezeichnung}),c.jsx(Pi,{className:"text-right tabular-nums",children:C(R.netto_preis)}),c.jsx(Pi,{className:"font-mono text-xs text-muted-foreground",children:R.ean||"â"}),c.jsx(Pi,{className:"text-center",children:R.shop_url?c.jsx("a",{href:R.shop_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center text-primary hover:text-primary/80",children:c.jsx(_d,{className:"w-4 h-4"})}):c.jsx("span",{className:"text-muted-foreground",children:"â"})})]},R.id))})]})}),M>1&&c.jsxs("div",{className:"p-3 border-t flex items-center justify-between",children:[c.jsxs(Pt,{variant:"ghost",size:"sm",disabled:l===0,onClick:()=>u(R=>Math.max(0,R-1)),children:[c.jsx(Ob,{className:"w-4 h-4 mr-1"}),"Zurück"]}),c.jsxs(Pt,{variant:"ghost",size:"sm",disabled:l>=M-1,onClick:()=>u(R=>R+1),children:["Weiter",c.jsx(nx,{className:"w-4 h-4 ml-1"})]})]})]}),c.jsx(QIe,{})]})},BV=[{label:"Tegometall",rpc:"enrich_preisliste_from_produkte",link:"/admin/tegometall/produkte"},{label:"Spacewall",rpc:"enrich_spacewall_produkte_from_produkte",link:"/admin/spacewall/produkte"},{label:"Easycubes",rpc:"enrich_easycubes_produkte_from_produkte",link:"/admin/easycubes/produkte"},{label:"Boden",rpc:"enrich_boden_produkte_from_produkte",link:"/admin/boden/produkte"},{label:"StandOnFloor",rpc:"enrich_standonfloor_produkte_from_produkte",link:"/admin/standonfloor/produkte"},{label:"Messestand",rpc:"enrich_messestand_produkte_from_produkte",link:"/admin/messestand/produkte"}];function QIe(){const[t,e]=E.useState({}),[n,r]=E.useState(!1),i=async()=>{r(!0);const s={};await Promise.all(BV.map(async a=>{try{const{data:o}=await Ot.rpc(a.rpc),l=Array.isArray(o)?o[0]:void 0;s[a.rpc]=l?{enriched:l.enriched_count,missing:l.missing_count}:null}catch{s[a.rpc]=null}})),e(s),r(!1)};return E.useEffect(()=>{i()},[]),c.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h3",{className:"text-sm font-semibold",children:"Match-Status pro Konfigurator"}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:i,disabled:n,children:[n?c.jsx(md,{className:"w-3.5 h-3.5 animate-spin mr-1.5"}):c.jsx(rx,{className:"w-3.5 h-3.5 mr-1.5"}),"Neu prüfen"]})]}),c.jsxs(AA,{children:[c.jsx(EA,{children:c.jsxs(kc,{children:[c.jsx(ws,{children:"Konfigurator"}),c.jsx(ws,{className:"text-right",children:"Gematcht"}),c.jsx(ws,{className:"text-right",children:"Fehlend"}),c.jsx(ws,{className:"text-right",children:"Gesamt"}),c.jsx(ws,{className:"w-32"})]})}),c.jsx(kA,{children:BV.map(s=>{const a=t[s.rpc],o=a?a.enriched+a.missing:0;return c.jsxs(kc,{children:[c.jsx(Pi,{className:"font-medium",children:s.label}),c.jsx(Pi,{className:"text-right tabular-nums",children:a?c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(m5,{className:"w-3.5 h-3.5 text-primary"}),a.enriched]}):"â"}),c.jsx(Pi,{className:"text-right tabular-nums",children:a?a.missing>0?c.jsx(fl,{variant:"destructive",className:"font-mono",children:a.missing}):c.jsx("span",{className:"text-muted-foreground",children:"0"}):"â"}),c.jsx(Pi,{className:"text-right tabular-nums text-muted-foreground",children:o||"â"}),c.jsx(Pi,{className:"text-right",children:c.jsx(Pt,{asChild:!0,variant:"ghost",size:"sm",children:c.jsxs("a",{href:s.link,children:["Details",c.jsx(_d,{className:"w-3.5 h-3.5 ml-1.5"})]})})})]},s.rpc)})})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Hinweis: âNeu prüfenâ ruft die jeweilige Anreicherungs-Funktion auf und aktualisiert gleichzeitig Preise, Bilder und Shop-URLs aus dem Channable-Feed."})]})}var cse="AlertDialog",[e4e,xqe]=ja(cse,[Wee]),Jf=Wee(),use=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jf(e);return c.jsx($5,{...r,...n,modal:!0})};use.displayName=cse;var t4e="AlertDialogTrigger",n4e=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Jf(n);return c.jsx(ote,{...i,...r,ref:e})});n4e.displayName=t4e;var r4e="AlertDialogPortal",dse=t=>{const{__scopeAlertDialog:e,...n}=t,r=Jf(e);return c.jsx(K5,{...r,...n})};dse.displayName=r4e;var i4e="AlertDialogOverlay",hse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Jf(n);return c.jsx(j1,{...i,...r,ref:e})});hse.displayName=i4e;var hb="AlertDialogContent",[s4e,a4e]=e4e(hb),o4e=DY("AlertDialogContent"),fse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,s=Jf(n),a=E.useRef(null),o=ur(e,a),l=E.useRef(null);return c.jsx(YAe,{contentName:hb,titleName:pse,docsSlug:"alert-dialog",children:c.jsx(s4e,{scope:n,cancelRef:l,children:c.jsxs(P1,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:cn(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(o4e,{children:r}),c.jsx(c4e,{contentRef:a})]})})})});fse.displayName=hb;var pse="AlertDialogTitle",mse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Jf(n);return c.jsx(L1,{...i,...r,ref:e})});mse.displayName=pse;var gse="AlertDialogDescription",xse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Jf(n);return c.jsx(I1,{...i,...r,ref:e})});xse.displayName=gse;var l4e="AlertDialogAction",vse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=Jf(n);return c.jsx(q5,{...i,...r,ref:e})});vse.displayName=l4e;var yse="AlertDialogCancel",bse=E.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=a4e(yse,n),s=Jf(n),a=ur(e,i);return c.jsx(q5,{...s,...r,ref:a})});bse.displayName=yse;var c4e=({contentRef:t})=>{const e=`\`${hb}\` requires a description for the component to be accessible for screen reader users. 791
792You can add a description to the \`${hb}\` by passing a \`${gse}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 793 794Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${hb}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 795 796For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return E.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},u4e=use,d4e=dse,wse=hse,_se=fse,Sse=vse,Ase=bse,Ese=mse,kse=xse;const vx=u4e,h4e=d4e,Cse=E.forwardRef(({className:t,...e},n)=>c.jsx(wse,{className:rn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Cse.displayName=wse.displayName;const zm=E.forwardRef(({className:t,...e},n)=>c.jsxs(h4e,{children:[c.jsx(Cse,{}),c.jsx(_se,{ref:n,className:rn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));
796zm.displayName=_se.displayName;const Um=({className:t,...e})=>c.jsx("div",{className:rn("flex flex-col space-y-2 text-center sm:text-left",t),...e});Um.displayName="AlertDialogHeader";const Hm=({className:t,...e})=>c.jsx("div",{className:rn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Hm.displayName="AlertDialogFooter";const Gm=E.forwardRef(({className:t,...e},n)=>c.jsx(Ese,{ref:n,className:rn("text-lg font-semibold",t),...e}));Gm.displayName=Ese.displayName;const Vm=E.forwardRef(({className:t,...e},n)=>c.jsx(kse,{ref:n,className:rn("text-sm text-muted-foreground",t),...e}));Vm.displayName=kse.displayName;const Wm=E.forwardRef(({className:t,...e},n)=>c.jsx(Sse,{ref:n,className:rn(jF(),t),...e}));Wm.displayName=Sse.displayName;const $m=E.forwardRef(({className:t,...e},n)=>c.jsx(Ase,{ref:n,className:rn(jF({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));$m.displayName=Ase.displayName;function f4e({label:t,rpc:e}){const[n,r]=E.useState(null),[i,s]=E.useState(!1),a=async()=>{s(!0);try{const{data:u,error:d}=await Ot.rpc(e);if(d)throw d;const h=Array.isArray(u)?u[0]:void 0;h&&r({enriched:h.enriched_count,missing:h.missing_count})}catch(u){console.error("ChannableMatchStatus",e,u),dn({title:"Match-Status konnte nicht geladen werden",description:String((u==null?void 0:u.message)??u),variant:"destructive"})}finally{s(!1)}};E.useEffect(()=>{a()},[e]);const o=n?n.enriched+n.missing:0,l=n&&n.missing===0&&o>0;return c.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card flex flex-wrap items-center gap-4",children:[c.jsx("div",{className:"shrink-0",children:l?c.jsx(m5,{className:"w-5 h-5 text-primary"}):c.jsx(Ah,{className:"w-5 h-5 text-amber-500"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"text-sm font-medium",children:["Channable-Match für ",t]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n?`${n.enriched} von ${o} SKUs aus dem Channable-Feed angereichert${n.missing>0?` · ${n.missing} ohne Match`:""}`:"Wird geladenâ¦"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Pt,{variant:"outline",size:"sm",onClick:a,disabled:i,children:[i?c.jsx(md,{className:"w-3.5 h-3.5 animate-spin"}):c.jsx(rx,{className:"w-3.5 h-3.5"}),c.jsx("span",{className:"ml-1.5",children:"Neu prüfen"})]}),c.jsx(Pt,{asChild:!0,variant:"ghost",size:"sm",children:c.jsxs(ax,{to:"/admin/global/produktkatalog",children:["Zum Synch",c.jsx(_d,{className:"w-3.5 h-3.5 ml-1.5"})]})})]})]})}function Uy({title:t,description:e,tableName:n,columns:r,separator:i=";",mode:s="replace",onSuccess:a}){const[o,l]=E.useState(null),[u,d]=E.useState([]),[h,p]=E.useState(0),[f,m]=E.useState(!1),[x,v]=E.useState(null),[g,b]=E.useState(!1),y=E.useRef(null),S=E.useCallback(M=>{l(M),v(null);const T=new FileReader;T.onload=C=>{var B;const P=((B=C.target)==null?void 0:B.result).trim().split(` 797`);if(P.length<2)return;const j=P[0].split(i).map($=>$.trim()),G=P.slice(1).filter($=>$.trim()).map($=>{const U=$.split(i),Z={};return j.forEach((V,W)=>{Z[V]=(U[W]||"").trim()}),Z});p(G.length),d(G.slice(0,15))},T.readAsText(M,"UTF-8")},[i]),A=M=>{M.preventDefault(),b(!1);const T=M.dataTransfer.files[0];T&&T.name.endsWith(".csv")&&S(T)},k=async()=>{if(o){m(!0),v(null);try{const T=(await o.text()).trim().split(` 798`),C=T[0].split(i).map(j=>j.trim()),R=T.slice(1).filter(j=>j.trim()).map(j=>{const G=j.split(i),B={};C.forEach((U,Z)=>{B[U]=(G[Z]||"").trim()});const $={};return r.forEach(U=>{const Z=B[U.csv]||"";$[U.db]=U.transform?U.transform(Z):Z}),$});if(s==="replace"){const{error:j}=await Ot.rpc("truncate_table",{p_table_name:n});if(j)throw new Error(`Löschen fehlgeschlagen: ${j.message}`)}const P=200;for(let j=0;j<R.length;j+=P){const G=R.slice(j,j+P),{error:B}=await Ot.from(n).insert(G);if(B)throw new Error(`Import fehlgeschlagen bei Zeile ${j+1}: ${B.message}`)}v({success:!0,message:`${R.length} Einträge erfolgreich importiert.`}),a==null||a()}catch(M){v({success:!1,message:M.message})}finally{m(!1)}}};return c.jsxs(Dn,{children:[c.jsxs(li,{children:[c.jsx(ci,{className:"text-base",children:t}),e&&c.jsx("p",{className:"text-sm text-muted-foreground",children:e})]}),c.jsxs(Bn,{className:"space-y-4",children:[c.jsxs("div",{onDrop:A,onDragOver:M=>{M.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onClick:()=>{var M;return(M=y.current)==null?void 0:M.click()},className:`border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${g?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[c.jsx(pu,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),c.jsx("p",{className:"text-sm font-medium",children:"CSV-Datei hierher ziehen oder klicken"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Semikolon-getrennt (;), UTF-8"}),c.jsx("input",{ref:y,type:"file",accept:".csv",className:"hidden",onChange:M=>{var C;const T=(C=M.target.files)==null?void 0:C[0];T&&S(T)}})]}),o&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Qfe,{className:"w-4 h-4 text-primary"}),c.jsx("span",{className:"font-medium",children:o.name}),c.jsxs("span",{className:"text-muted-foreground",children:["(",h," Zeilen)"]})]}),u.length>0&&c.jsxs("div",{className:"overflow-x-auto border rounded-md",children:[c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsx("tr",{className:"bg-muted",children:Object.keys(u[0]).map(M=>c.jsx("th",{className:"text-left p-2 font-medium whitespace-nowrap",children:M},M))})}),c.jsx("tbody",{children:u.map((M,T)=>c.jsx("tr",{className:"border-t border-border/50",children:Object.values(M).map((C,R)=>c.jsx("td",{className:"p-2 whitespace-nowrap max-w-[200px] truncate",children:C},R))},T))})]}),h>15&&c.jsxs("p",{className:"text-xs text-muted-foreground p-2 text-center",children:["... und ",h-15," weitere Zeilen"]})]}),o&&!(x!=null&&x.success)&&c.jsx(Pt,{onClick:k,disabled:f,className:"w-full",children:f?"Importiereâ¦":s==="append"?"Daten hinzufügen":"Import bestätigen"}),x&&c.jsxs("div",{className:`flex items-center gap-2 p-3 rounded-md text-sm ${x.success?"bg-primary/10 text-primary":"bg-destructive/10 text-destructive"}`,children:[x.success?c.jsx(ti,{className:"w-4 h-4"}):c.jsx(Ah,{className:"w-4 h-4"}),x.message]})]})]})}function Nse(t){if(!t||t.trim()==="")return 0;const e=parseFloat(t.replace(",","."));return Number.isFinite(e)?e:0}function kj(t){return/[;"\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}const FV=[{csv:"Artikelname",db:"artikelname",transform:t=>t},{csv:"Schluessel",db:"schluessel",transform:t=>t},{csv:"SKU",db:"sku",transform:t=>t},{csv:"Preis",db:"preis",transform:t=>Nse(t)}];function Q1({title:t,description:e,tableName:n,exportPrefix:r,channableLabel:i,channableRpc:s}){const[a,o]=E.useState([]),[l,u]=E.useState(0),[d,h]=E.useState(""),[p,f]=E.useState("all"),[m,x]=E.useState(new Set),[v,g]=E.useState(!0),[b,y]=E.useState(!1),[S,A]=E.useState(null),[k,M]=E.useState(null),[T,C]=E.useState(null),[R,P]=E.useState(new Set),[j,G]=E.useState(null),[B,$]=E.useState(!1),[U,Z]=E.useState(!1),V=E.useCallback(async()=>{g(!0);const[{count:ae},{data:Q}]=await Promise.all([Ot.from(n).select("*",{count:"exact",head:!0}),Ot.from(n).select("id, artikelname, schluessel, sku, preis").order("artikelname",{ascending:!0}).limit(1e3)]);u(ae??0);const we=(Q??[]).map(ye=>({id:String(ye.id),artikelname:String(ye.artikelname??""),schluessel:String(ye.schluessel??""),sku:String(ye.sku??""),preis:Number(ye.preis??0)}
798));o(we);const Ae=Array.from(new Set(we.map(ye=>ye.sku).filter(Boolean))),K=new Set,pe=500;for(let ye=0;ye<Ae.length;ye+=pe){const Se=Ae.slice(ye,ye+pe),{data:ee}=await Ot.from("produkte").select("artikelnummer").in("artikelnummer",Se);(ee??[]).forEach(re=>K.add(String(re.artikelnummer)))}x(K),P(new Set),A(null),M(null),g(!1)},[n]);E.useEffect(()=>{V()},[V]);async function W(){y(!0);try{const ae=[];for(let ye=0;;ye+=1e3){const{data:Se,error:ee}=await Ot.from(n).select("artikelname, schluessel, sku, preis").order("artikelname",{ascending:!0}).range(ye,ye+1e3-1);if(ee)throw ee;if(!Se||Se.length===0||(ae.push(...Se),Se.length<1e3))break}const we=["Artikelname;Schluessel;SKU;Preis"];for(const ye of ae)we.push([kj(String(ye.artikelname??"")),kj(String(ye.schluessel??"")),kj(String(ye.sku??"")),String(ye.preis??0).replace(".",",")].join(";"));const Ae=new Blob(["\uFEFF"+we.join(`\r 799`)],{type:"text/csv;charset=utf-8"}),K=URL.createObjectURL(Ae),pe=document.createElement("a");pe.href=K,pe.download=`${r}_${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(K),dn({title:"CSV heruntergeladen",description:`${ae.length} Artikel exportiert.`})}catch(ae){dn({title:"Download fehlgeschlagen",description:ae.message,variant:"destructive"})}finally{y(!1)}}function O(ae){A(ae.id),M({artikelname:ae.artikelname,schluessel:ae.schluessel,sku:ae.sku,preis:String(ae.preis).replace(".",",")})}function Y(){A(null),M(null)}async function z(ae){var ye;if(!k)return;const Q=k.sku.trim();if(!Q){dn({title:"SKU darf nicht leer sein",variant:"destructive"});return}C(ae);const we=Nse(k.preis),{error:Ae}=await Ot.from(n).update({artikelname:k.artikelname.trim(),schluessel:k.schluessel.trim(),sku:Q,preis:we}).eq("id",ae);if(Ae){C(null),dn({title:"Speichern fehlgeschlagen",description:Ae.message,variant:"destructive"});return}const K=((ye=a.find(Se=>Se.id===ae))==null?void 0:ye.sku)??"";let pe=!1;if(Q){const{data:Se}=await Ot.from("produkte").select("artikelnummer").eq("artikelnummer",Q).maybeSingle();pe=!!Se}x(Se=>{const ee=new Set(Se);return K&&K!==Q&&(a.some(me=>me.id!==ae&&me.sku===K)||ee.delete(K)),pe?ee.add(Q):ee.delete(Q),ee}),o(Se=>Se.map(ee=>ee.id===ae?{...ee,artikelname:k.artikelname.trim(),schluessel:k.schluessel.trim(),sku:Q,preis:we}:ee)),C(null),A(null),M(null),dn({title:"Gespeichert"})}async function I(ae){Z(!0);try{for(let we=0;we<ae.length;we+=500){const Ae=ae.slice(we,we+500),{error:K}=await Ot.from(n).delete().in("id",Ae);if(K)throw K}dn({title:`${ae.length} Artikel gelöscht`}),G(null),$(!1),await V()}catch(Q){dn({title:"Löschen fehlgeschlagen",description:Q.message,variant:"destructive"})}finally{Z(!1)}}const q=E.useMemo(()=>a.filter(ae=>{if(!(!d||ae.sku.toLowerCase().includes(d.toLowerCase())||ae.artikelname.toLowerCase().includes(d.toLowerCase())||ae.schluessel.toLowerCase().includes(d.toLowerCase())))return!1;if(p==="all")return!0;const we=m.has(ae.sku);return p==="matched"?we:!we}),[a,d,p,m]),te=E.useMemo(()=>q.filter(ae=>m.has(ae.sku)).length,[q,m]),se=q.length-te,ie=q.length>0&&q.every(ae=>R.has(ae.id)),le=!ie&&q.some(ae=>R.has(ae.id));function xe(){P(ae=>{const Q=new Set(ae);return ie?q.forEach(we=>Q.delete(we.id)):q.forEach(we=>Q.add(we.id)),Q})}function Ee(ae){P(Q=>{const we=new Set(Q);return we.has(ae)?we.delete(ae):we.add(ae),we})}return c.jsxs("div",{className:"space-y-6 max-w-6xl",children:[c.jsx(es,{icon:Zd,title:t,description:e??`${l} Artikel in der Datenbank.`,actions:c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(Pt,{variant:"outline",onClick:V,disabled:v,children:[c.jsx(rx,{className:`w-4 h-4 mr-1.5 ${v?"animate-spin":""}`}),"Aktualisieren"]}),c.jsxs(Pt,{variant:"outline",onClick:W,disabled:b||l===0,children:[c.jsx(Zfe,{className:"w-4 h-4 mr-1.5"}),b?"Exportiereâ¦":"CSV herunterladen"]})]})}),s&&i&&c.jsx(f4e,{label:i,rpc:s}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsx(Uy,{title:"Artikel ergänzen / aktualisieren",description:'Neue Zeilen werden hinzugefügt. Bestehende SKUs werden NICHT überschrieben â nutzen Sie dafür âKomplett ersetzen". Spalten: Artikelname;Schluessel;SKU;Preis (zusätzliche Spalten in der CSV werden ignoriert).',tableName:n,mode:"append",columns:FV,onSuccess:V}),c.jsx(Uy,{title:"Komplett ersetzen",description:"ACHTUNG: Löscht alle bestehenden Art
799ikel und ersetzt sie durch die CSV. Spalten: Artikelname;Schluessel;SKU;Preis (zusätzliche Spalten in der CSV werden ignoriert).",tableName:n,mode:"replace",columns:FV,onSuccess:V})]}),c.jsxs("div",{className:"border border-border rounded-lg bg-card",children:[c.jsxs("div",{className:"p-3 border-b space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(yr,{placeholder:"Suchen (SKU, Artikelname, Schlüssel)â¦",value:d,onChange:ae=>h(ae.target.value),className:"max-w-sm"}),c.jsxs(vl,{value:p,onValueChange:ae=>f(ae),children:[c.jsx(qo,{className:"w-[200px]",children:c.jsx(yl,{placeholder:"Zuordnung"})}),c.jsxs(Xo,{children:[c.jsx(Us,{value:"all",children:"Alle Artikel"}),c.jsx(Us,{value:"matched",children:"Nur zugeordnete"}),c.jsx(Us,{value:"unmatched",children:"Nur nicht zugeordnete"})]})]}),R.size>0&&c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsxs("span",{className:"text-xs text-muted-foreground",children:[R.size," ausgewählt"]}),c.jsxs(Pt,{variant:"destructive",size:"sm",onClick:()=>$(!0),disabled:U,children:[c.jsx(yo,{className:"w-4 h-4 mr-1.5"}),"Auswahl löschen"]})]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:v?"Ladeâ¦":`${q.length} sichtbar · ${te} zugeordnet · ${se} nicht zugeordnet${a.length>=1e3?` (von ${l} insgesamt, erste 1.000 geladen)`:` von ${l}`}`}),c.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Hinweis: Geänderte SKUs werden gegen den letzten Channable-Sync (Tabelle ",c.jsx("code",{children:"produkte"}),') geprüft. Neue, noch nicht synchronisierte Artikelnummern erscheinen erst nach dem nächsten Sync als âZugeordnet".']})]}),c.jsx("div",{className:"overflow-x-auto max-h-[600px]",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{className:"bg-muted sticky top-0 z-10",children:c.jsxs("tr",{children:[c.jsx("th",{className:"p-2 w-8",children:c.jsx(G0,{checked:ie?!0:le?"indeterminate":!1,onCheckedChange:xe,"aria-label":"Alle auswählen"})}),c.jsx("th",{className:"text-left p-2",children:"Artikelname"}),c.jsx("th",{className:"text-left p-2",children:"Schlüssel"}),c.jsx("th",{className:"text-left p-2",children:"SKU"}),c.jsx("th",{className:"text-left p-2 w-36",children:"Zuordnung"}),c.jsx("th",{className:"text-right p-2",children:"Preis â¬"}),c.jsx("th",{className:"p-2 w-24 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{children:[q.map(ae=>{const Q=m.has(ae.sku),we=S===ae.id,Ae=R.has(ae.id);return c.jsxs("tr",{className:`border-t border-border hover:bg-muted/40 ${Ae?"bg-primary/5":""}`,children:[c.jsx("td",{className:"p-2",children:c.jsx(G0,{checked:Ae,onCheckedChange:()=>Ee(ae.id),"aria-label":`Auswählen ${ae.sku}`})}),c.jsx("td",{className:"p-2 max-w-xs",children:we?c.jsx(yr,{value:k.artikelname,onChange:K=>M(pe=>pe&&{...pe,artikelname:K.target.value}),className:"h-7 text-xs"}):c.jsx("span",{className:"block truncate",children:ae.artikelname})}),c.jsx("td",{className:"p-2 font-mono text-[10px]",children:we?c.jsx(yr,{value:k.schluessel,onChange:K=>M(pe=>pe&&{...pe,schluessel:K.target.value}),className:"h-7 text-xs font-mono"}):ae.schluessel}),c.jsx("td",{className:"p-2 font-mono text-[10px]",children:we?c.jsx(yr,{value:k.sku,onChange:K=>M(pe=>pe&&{...pe,sku:K.target.value}),className:"h-7 text-xs font-mono",placeholder:"SKU / Channable-Artikelnr."}):ae.sku}),c.jsx("td",{className:"p-2",children:Q?c.jsx("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary",children:"Zugeordnet"}):c.jsx("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium bg-amber-100 text-amber-800",children:"Nicht zugeordnet"})}),c.jsx("td",{className:"p-2 text-right tabular-nums",children:we?c.jsx(yr,{value:k.preis,onChange:K=>M(pe=>pe&&{...pe,preis:K.target.value}),onKeyDown:K=>{K.key==="Enter"&&z(ae.id),K.key==="Escape"&&Y()},className:"h-7 text-xs text-right"}):ae.preis.toFixed(2)}),c.jsx("td",{className:"p-2",children:c.jsx("div",{className:"flex justify-end gap-1",children:we?c.jsxs(c.Fragment,{children:[c.jsx(Pt,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>z(ae.id),disabled:T===ae.id,title:"Speichern",children:c.jsx(I2,{className:"w-3.5 h-3.5"})}),c.jsx(Pt,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:Y,title:"Abbrechen",children:c.jsx(Bc,{className:"w-3.5 h-3.5"})})]}):c.jsxs(c.Fragment,{children:[c.jsx(Pt,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>O(ae),title:"Bearbeiten",children:c.jsx(v5,{className:"w-3.5 h-3.5"})}),c.jsx(Pt,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>G(ae),title:"Löschen",children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]})})})]},ae.id)}
799),!v&&q.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"p-6 text-center text-muted-foreground",children:"Keine Artikel."})})]})]})})]}),c.jsx(vx,{open:!!j,onOpenChange:ae=>!ae&&G(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:"Artikel löschen?"}),c.jsxs(Vm,{children:["Soll der Artikel ",c.jsx("strong",{children:j==null?void 0:j.sku})," (",j==null?void 0:j.artikelname,") wirklich gelöscht werden? Diese Aktion kann nicht rückgängig gemacht werden."]})]}),c.jsxs(Hm,{children:[c.jsx($m,{disabled:U,children:"Abbrechen"}),c.jsx(Wm,{onClick:ae=>{ae.preventDefault(),j&&I([j.id])},disabled:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:U?"Löscheâ¦":"Löschen"})]})]})}),c.jsx(vx,{open:B,onOpenChange:$,children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsxs(Gm,{children:[R.size," Artikel löschen?"]}),c.jsx(Vm,{children:"Sollen die ausgewählten Artikel wirklich gelöscht werden? Diese Aktion kann nicht rückgängig gemacht werden."})]}),c.jsxs(Hm,{children:[c.jsx($m,{disabled:U,children:"Abbrechen"}),c.jsx(Wm,{onClick:ae=>{ae.preventDefault(),I(Array.from(R))},disabled:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:U?"Löscheâ¦":"Löschen"})]})]})})]})}function p4e(){return c.jsx(Q1,{title:"Tegometall Produktdaten",tableName:"preisliste",exportPrefix:"tegometall-preisliste",channableLabel:"Tegometall",channableRpc:"enrich_preisliste_from_produkte"})}function OV(t){return!t||t.trim()===""?0:parseFloat(t.replace(",","."))}const m4e=()=>c.jsxs("div",{className:"max-w-4xl space-y-6",children:[c.jsx(es,{icon:sg,title:"Modulkombinationen & Logik",description:"Breiten-Module, Rückwandlogik und Farblogik als CSV importieren."}),c.jsx(Uy,{title:"Breiten-Module importieren",description:"Format: Gesamtbreite_module;Gesamtbreite_plus3;Anzahl0665;Anzahl1000;Anzahl1250;Anzahl1330;Modulanzahl;Schluessel",tableName:"breiten_module",columns:[{csv:"Gesamtbreite_module",db:"gesamtbreite_module",transform:OV},{csv:"Gesamtbreite_plus3",db:"gesamtbreite_plus3",transform:OV},{csv:"Anzahl0665",db:"anzahl_0665",transform:t=>parseInt(t)||0},{csv:"Anzahl1000",db:"anzahl_1000",transform:t=>parseInt(t)||0},{csv:"Anzahl1250",db:"anzahl_1250",transform:t=>parseInt(t)||0},{csv:"Anzahl1330",db:"anzahl_1330",transform:t=>parseInt(t)||0},{csv:"Modulanzahl",db:"modulanzahl",transform:t=>parseInt(t)||0},{csv:"Schluessel",db:"schluessel",transform:t=>t}]}),c.jsx(Uy,{title:"Rückwandlogik importieren",description:"Format: Rueckwandtyp;Regalhoehe;Untere_Hoehe;Schluessel",tableName:"rueckwand_logik",columns:[{csv:"Rueckwandtyp",db:"rueckwandtyp",transform:t=>t},{csv:"Regalhoehe",db:"regalhoehe",transform:t=>parseInt(t)||0},{csv:"Untere_Hoehe",db:"untere_hoehe",transform:t=>parseInt(t)||0},{csv:"Schluessel",db:"schluessel",transform:t=>t}]}),c.jsx(Uy,{title:"Farblogik importieren",description:"Format: Farbe_Name;RAL_Code",tableName:"farblogik",columns:[{csv:"Farbe_Name",db:"farbe_name",transform:t=>t},{csv:"RAL_Code",db:"ral_code",transform:t=>parseInt(t)||0}]}),c.jsx(Uy,{title:"Eck-Bestandteile importieren",description:"Sockelblenden, Fachböden und Rückwände für Ecklösungen. Format: Typ;Farbe;Artikelname;Variable;Variable;Rückwandtyp;Schlüssel;SKU",tableName:"preisliste",mode:"append",columns:[{csv:"Typ",db:"typ",transform:t=>t},{csv:"Farbe",db:"farbe",transform:t=>parseInt(t)||0},{csv:"Artikelname",db:"artikelname",transform:t=>t},{csv:"Schlüssel",db:"schluessel",transform:t=>t},{csv:"SKU",db:"sku",transform:t=>t}]})]}),g4e=()=>{const t=`${window.location.origin}/konfigurator`;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Konfigurator-Vorschau",description:c.jsxs(c.Fragment,{children:["Live-Vorschau des Konfigurator-Widgets."," ",c.jsx("a",{href:t,target:"_blank",rel:"noopener",className:"text-primary hover:underline",children:"In neuem Tab öffnen â"})]})}),c.jsx("div",{className:"border rounded-lg overflow-hidden bg-card",children:c.jsx("iframe",{src:"/konfigurator?embed=true",className:"w-full border-0",style:{height:"85vh",minHeight:600},title:"Konfigurator-Vorschau"})})]})},rN="https://regalify-pro.lovable.app";function x4e(t,e=rN,n){const r=e.replace(/\/$/,""),i=t.startsWith("/")?t:`/${t}`,s=new URLSearchParams({embed:"true",...n??{}});return`${r}${i}?${s.toString()}`}function Km({configuratorPath:t,iframeTitle:e,showLivePreview:n=!0,defaultHeight:r="900",extraParams:i}
799){const[s,a]=E.useState(rN),[o,l]=E.useState(r),[u,d]=E.useState(!1),p=`<iframe 800 src="${x4e(t,s,i)}" 801 width="100%" 802 height="${o}" 803 frameborder="0" 804 style="border: none; border-radius: 8px;" 805 title="${e}" 806></iframe>`,f=()=>{navigator.clipboard.writeText(p),d(!0),dn({title:"Code kopiert"}),setTimeout(()=>d(!1),2e3)},m=new URLSearchParams({embed:"true",...i??{}}),x=`${window.location.origin}${t}?${m.toString()}`;return c.jsxs("div",{className:"max-w-3xl space-y-6",children:[c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"iFrame-Einstellungen"})}),c.jsxs(Bn,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"baseUrl",children:"Basis-URL (veröffentlichte App)"}),c.jsx(yr,{id:"baseUrl",type:"url",value:s,onChange:v=>a(v.target.value),className:"mt-1.5",placeholder:rN}),s!==rN&&c.jsxs("p",{className:"text-xs text-yellow-600 mt-1 flex items-center gap-1",children:[c.jsx(Ah,{className:"w-3 h-3"}),"Stellen Sie sicher, dass dies die veröffentlichte URL ist â die Preview-URL erfordert Login."]})]}),c.jsxs("div",{children:[c.jsx(Vn,{htmlFor:"height",children:"Höhe (px)"}),c.jsx(yr,{id:"height",type:"number",value:o,onChange:v=>l(v.target.value),min:"400",max:"2000",className:"mt-1.5 max-w-[200px]"})]})]})]}),c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"Einbettungs-Code"})}),c.jsxs(Bn,{className:"space-y-3",children:[c.jsx("pre",{className:"bg-muted p-4 rounded-md text-xs overflow-x-auto whitespace-pre-wrap font-mono",children:p}),c.jsxs(Pt,{onClick:f,variant:"outline",size:"sm",children:[u?c.jsx(ti,{className:"w-4 h-4 mr-2"}):c.jsx(oF,{className:"w-4 h-4 mr-2"}),u?"Kopiert!":"Code kopieren"]})]})]}),c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"Shopware-Integration"})}),c.jsx(Bn,{children:c.jsxs("ol",{className:"text-sm space-y-2 list-decimal list-inside text-muted-foreground",children:[c.jsx("li",{children:"In Shopware Administration â Erlebniswelten öffnen"}),c.jsx("li",{children:"Gewünschte Seite bearbeiten oder neue Seite erstellen"}),c.jsx("li",{children:"HTML-Element in die Erlebniswelt ziehen"}),c.jsx("li",{children:"Den obigen iFrame-Code in das HTML-Element einfügen"}),c.jsx("li",{children:"Seite speichern und veröffentlichen"})]})})]}),n&&c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"Live-Vorschau"})}),c.jsxs(Bn,{children:[c.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Vorschau über die aktuelle Domain (",window.location.origin,"). Der oben generierte Code verweist immer auf die veröffentlichte URL."]}),c.jsx("iframe",{src:x,className:"w-full border border-border rounded",style:{height:"70vh",minHeight:600},title:`${e} â Vorschau`})]})]})]})}const v4e=()=>c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"iFrame-Code zum Einbetten des Regal-Konfigurators in Shopware oder andere Websites."}),c.jsx(Km,{configuratorPath:"/konfigurator",iframeTitle:"Tegometall Regal-Konfigurator",showLivePreview:!1})]});var pz="Progress",mz=100,[y4e,vqe]=ja(pz),[b4e,w4e]=y4e(pz),Tse=E.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=_4e,...a}=t;(i||i===0)&&!zV(i)&&console.error(S4e(`${i}`,"Progress"));const o=zV(i)?i:mz;r!==null&&!UV(r,o)&&console.error(A4e(`${r}`,"Progress"));const l=UV(r,o)?r:null,u=BT(l)?s(l,o):void 0;return c.jsx(b4e,{scope:n,value:l,max:o,children:c.jsx(vn.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":BT(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":jse(l,o),"data-value":l??void 0,"data-max":o,...a,ref:e})})});Tse.displayName=pz;var Mse="ProgressIndicator",Rse=E.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,i=w4e(Mse,n);return c.jsx(vn.div,{"data-state":jse(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:e})});Rse.displayName=Mse;function _4e(t,e){return`${Math.round(t/e*100)}%`}function jse(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function BT(t){return typeof t=="number"}function zV(t){return BT(t)&&!isNaN(t)&&t>0}function UV(t,e){return BT(t)&&!isNaN(t)&&t<=e&&t>=0}function S4e(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${mz}\`.`}function A4e(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: 807 - a positive number 808 - less than the value passed to \`max\` (or ${mz} if no \`max\` prop is set) 809 - \`null\` or \`undefined\` if the progress is indeterminate. 810 811Defaulting to \`null\`.`}var Pse=Tse,E4e=Rse;const FT=E.forwardRef(({className:t,value:e,...n},r)=>c.jsx(Pse,{ref:r,className:rn("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:c.jsx(E4e,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));FT.displayName=Pse.displayName;var Lse="Toggle",gz=E.forwardRef((t,e)=>
811{const{pressed:n,defaultPressed:r,onPressedChange:i,...s}=t,[a,o]=Ja({prop:n,onChange:i,defaultProp:r??!1,caller:Lse});return c.jsx(vn.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...s,ref:e,onClick:cn(t.onClick,()=>{t.disabled||o(!a)})})});gz.displayName=Lse;var Ise=gz,ug="ToggleGroup",[Dse,yqe]=ja(ug,[V1]),Bse=V1(),xz=Bt.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const i=r;return c.jsx(k4e,{...i,ref:e})}if(n==="multiple"){const i=r;return c.jsx(C4e,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${ug}\``)});xz.displayName=ug;var[Fse,Ose]=Dse(ug),k4e=Bt.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[a,o]=Ja({prop:n,defaultProp:r??"",onChange:i,caller:ug});return c.jsx(Fse,{scope:t.__scopeToggleGroup,type:"single",value:Bt.useMemo(()=>a?[a]:[],[a]),onItemActivate:o,onItemDeactivate:Bt.useCallback(()=>o(""),[o]),children:c.jsx(zse,{...s,ref:e})})}),C4e=Bt.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[a,o]=Ja({prop:n,defaultProp:r??[],onChange:i,caller:ug}),l=Bt.useCallback(d=>o((h=[])=>[...h,d]),[o]),u=Bt.useCallback(d=>o((h=[])=>h.filter(p=>p!==d)),[o]);return c.jsx(Fse,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:u,children:c.jsx(zse,{...s,ref:e})})});xz.displayName=ug;var[N4e,T4e]=Dse(ug),zse=Bt.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:a,loop:o=!0,...l}=t,u=Bse(n),d=Mx(a),h={role:"group",dir:d,...l};return c.jsx(N4e,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(TO,{asChild:!0,...u,orientation:s,dir:d,loop:o,children:c.jsx(vn.div,{...h,ref:e})}):c.jsx(vn.div,{...h,ref:e})})}),OT="ToggleGroupItem",Use=Bt.forwardRef((t,e)=>{const n=Ose(OT,t.__scopeToggleGroup),r=T4e(OT,t.__scopeToggleGroup),i=Bse(t.__scopeToggleGroup),s=n.value.includes(t.value),a=r.disabled||t.disabled,o={...t,pressed:s,disabled:a},l=Bt.useRef(null);return r.rovingFocus?c.jsx(MO,{asChild:!0,...i,focusable:!a,active:s,ref:l,children:c.jsx(HV,{...o,ref:e})}):c.jsx(HV,{...o,ref:e})});Use.displayName=OT;var HV=Bt.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...i}=t,s=Ose(OT,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=s.type==="single"?a:void 0;return c.jsx(gz,{...o,...i,ref:e,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Hse=xz,Gse=Use;const Vse=m1("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),M4e=E.forwardRef(({className:t,variant:e,size:n,...r},i)=>c.jsx(Ise,{ref:i,className:rn(Vse({variant:e,size:n,className:t})),...r}));M4e.displayName=Ise.displayName;const Wse=E.createContext({size:"default",variant:"default"}),zT=E.forwardRef(({className:t,variant:e,size:n,children:r,...i},s)=>c.jsx(Hse,{ref:s,className:rn("flex items-center justify-center gap-1",t),...i,children:c.jsx(Wse.Provider,{value:{variant:e,size:n},children:r})}));zT.displayName=Hse.displayName;const mf=E.forwardRef(({className:t,children:e,variant:n,size:r,...i},s)=>{const a=E.useContext(Wse);return c.jsx(Gse,{ref:s,className:rn(Vse({variant:a.variant||n,size:a.size||r}),t),...i,children:e})});mf.displayName=Gse.displayName;const R4e="https://ntxxmvyoiatxvggtjtfg.supabase.co";function j4e({open:t,onOpenChange:e,slots:n,checks:r,onChecksDone:i}){var S;const[s,a]=E.useState("unchecked"),[o,l]=E.useState(0),[u,d]=E.useState(!1),h=rA(),p=E.useMemo(()=>s==="all"?n:n.filter(A=>{var M;const k=(M=r.get(A.fileName))==null?void 0:M.status;return s==="unchecked"?!k||k==="pending":s==="wrong"?k==="wrong"||k==="mismatch":!0}),[n,r,s]);E.useEffect(()=>{l(0)},[s,t]);const f=p[o]??null,m=n.filter(A=>{var M;const k=(M=r.get(A.fileName))==null?void 0:M.status;return k==="ok"||k==="wrong"}).length,x=E.useCallback(async A=>
811{if(!(!f||u)){d(!0);try{await Ot.from("image_checks").upsert({file_name:f.fileName,status:A,expected_modules:f.expectedModules,expected_shelves:f.expectedShelves,checked_at:new Date().toISOString(),details:A==="ok"?"Manuell bestätigt":"Manuell als falsch markiert"},{onConflict:"file_name"})}finally{d(!1)}i(),o<p.length-1&&l(k=>k+1)}},[f,u,o,p.length,i]),v=E.useCallback(()=>{o<p.length-1&&l(A=>A+1)},[o,p.length]),g=E.useCallback(()=>{o>0&&l(A=>A-1)},[o]);E.useEffect(()=>{if(!t)return;const A=k=>{k.key==="ArrowRight"||k.key==="Enter"?(k.preventDefault(),x("ok")):k.key==="ArrowLeft"||k.key==="Backspace"?(k.preventDefault(),x("wrong")):k.key==="ArrowUp"?(k.preventDefault(),g()):k.key==="ArrowDown"?(k.preventDefault(),v()):k.key==="Escape"&&e(!1)};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[t,x,v,g,e]);const b=f?`${R4e}/storage/v1/object/public/shelf-images/${f.fileName}${h}`:"",y=f?(S=r.get(f.fileName))==null?void 0:S.status:void 0;return c.jsx(qf,{open:t,onOpenChange:e,children:c.jsxs(jh,{className:"max-w-4xl h-[90vh] flex flex-col p-0 gap-0",children:[c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h2",{className:"text-lg font-bold",children:"Speed-Review"}),c.jsxs(fl,{variant:"secondary",className:"text-xs",children:[m," / ",n.length," geprüft"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(epe,{className:"w-4 h-4 text-muted-foreground"}),c.jsxs(zT,{type:"single",value:s,onValueChange:A=>{A&&a(A)},size:"sm",children:[c.jsx(mf,{value:"unchecked",className:"text-xs",children:"Ungeprüft"}),c.jsx(mf,{value:"wrong",className:"text-xs",children:"Falsch"}),c.jsx(mf,{value:"all",className:"text-xs",children:"Alle"})]})]})]}),c.jsxs("div",{className:"px-6 py-2",children:[c.jsx(FT,{value:m/Math.max(n.length,1)*100,className:"h-2"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:p.length>0?`${o+1} / ${p.length} (Filter: ${s==="all"?"Alle":s==="unchecked"?"Ungeprüft":"Falsch"})`:"Keine Bilder in diesem Filter"})]}),f?c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-2 min-h-0",children:[c.jsxs("div",{className:"mb-3 text-center",children:[c.jsx("p",{className:"text-sm font-semibold text-foreground",children:f.label}),c.jsxs("div",{className:"flex items-center gap-2 justify-center mt-1",children:[f.expectedModules!=null&&c.jsxs(fl,{variant:"outline",className:"text-xs",children:["Soll: ",f.expectedModules," Module"]}),f.expectedShelves!=null&&c.jsxs(fl,{variant:"outline",className:"text-xs",children:["Soll: ",f.expectedShelves," Fachböden"]})]}),y&&c.jsx(fl,{className:`mt-1 text-xs ${y==="ok"?"bg-green-600 text-white":y==="wrong"||y==="mismatch"?"bg-destructive text-destructive-foreground":"bg-muted text-muted-foreground"}`,children:y==="ok"?"â Bestätigt":y==="wrong"||y==="mismatch"?"â Falsch":"Ungeprüft"})]}),c.jsx("div",{className:"flex-1 min-h-0 w-full flex items-center justify-center",children:c.jsx("img",{src:b,alt:f.label,className:"max-h-full max-w-full object-contain rounded-lg border border-border"})}),c.jsxs("div",{className:"flex items-center gap-4 py-4",children:[c.jsx(Pt,{variant:"outline",size:"icon",onClick:g,disabled:o===0,children:c.jsx(Ob,{className:"w-5 h-5"})}),c.jsxs(Pt,{size:"lg",className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground px-8 text-base",onClick:()=>x("wrong"),disabled:u,children:[c.jsx(Bc,{className:"w-5 h-5 mr-2"}),"Falsch",c.jsx("span",{className:"ml-2 text-xs opacity-70",children:"â / â«"})]}),c.jsxs(Pt,{size:"lg",className:"bg-green-600 hover:bg-green-700 text-white px-8 text-base",onClick:()=>x("ok"),disabled:u,children:[c.jsx(ti,{className:"w-5 h-5 mr-2"}),"Passt",c.jsx("span",{className:"ml-2 text-xs opacity-70",children:"â / âµ"})]}),c.jsx(Pt,{variant:"outline",size:"icon",onClick:v,disabled:o>=p.length-1,children:c.jsx(nx,{className:"w-5 h-5"})})]})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:c.jsxs("div",{className:"text-center",children:[c.jsx(ti,{className:"w-12 h-12 mx-auto mb-3 text-green-600"}),c.jsx("p",{className:"text-lg font-medium",children:"Alle Bilder in diesem Filter geprüft!"}),c.jsx("p",{className:"text-sm mt-1",children:"Wechseln Sie den Filter oder schlieÃen Sie den Review."})]})})]})})}const fy=[1,2,3,4,5,6,7,8,9,10],t0=[0,1,2,3,4,5,6,7],py=[0,1,2,3,4,5,6],GV=xi.length*fy.length*t0.length,Cj=xi.length*py.length,VV=xi.length*Hp.length,P4e=()=>{var me,Ge,He;const[t,e]=E.useState("wandregal"),[n,r]=E.useState(xi[0]),[i,s]=E.useState("ie90"),[a,o]=E.useState(new Set),[l,u]=E.useState(!0),[d,h]=E.useState(null),[p,f]=E.useState(null),[m,x]=E.useState(null),[v,g]=E.useState(null),[b,y]=E.useState(null),[S,A]=E.useState(!1),[k,M]=E.useState(new Map),[T,C]=E.useState(!1),R=E.useRef(null),P=rA(),{toast:j}=HS(),G=E.useCallback(async()=>{u(!0);const _e=await Iee();o(new Set(_e)),u(!1)},[]),B=E.useCallback(async()=>{const{data:_e}=await Ot.from("image_checks").select("file_name, status");if(_e){const Ne=new Map;for(const ue of _e)Ne.set(ue.file_name,{status:ue.status});M(Ne)}},[]);E.useEffect(()=>{G(),B()},[G,B]);const $=_e=>{const Ne=k.get(_e);return!Ne||Ne.status==="pending"?"unchecked":Ne.status==="ok"?"ok":Ne.status==="wrong"||Ne.status==="mismatch"?"wrong":"unchecked"},U=_e=>{let Ne=0;for(const ue of xi)for(const Ce of fy)for(const Ke of t0)a.has(Gp(ue.code,Ce,Ke,_e))&&Ne++;return Ne},Z=()=>{let _e=0;for(const Ne of xi)for(const ue of Hp)a.has(Oy(Ne.code,ue.name))&&_e++;return _e},V=_e=>{let Ne=0;for(const ue of xi)for(const Ce of py)a.has(Vp(ue.code,Ce,_e))&&Ne++;return Ne},W=()=>qh.reduce((_e,Ne)=>_e+V(Ne.value),0),O=U("wandregal")+U("gondelregal"),Y=Z(),z=W(),I=O+Y+z,q=GV*2+VV+Cj*qh.length,te=()=>t==="paneelwandregal"?Y:t==="eckregal"?z:U(t),se=()=>t==="paneelwandregal"?VV:t==="eckregal"?Cj*qh.length:GV,ie=t==="paneelwandregal"||t==="eckregal"?"wandregal":t,le=_e=>{if(t==="paneelwandregal"){let ue=0;for(const Ce of Hp)a.has(Oy(_e,Ce.name))&&ue++;return ue}if(t==="eckregal"){let ue=0;for(const Ce of qh)for(const Ke of py)a.has(Vp(_e,Ke,Ce.value))&&ue++;return ue}let Ne=0;for(const ue of fy)for(const Ce of t0)a.has(Gp(_e,ue,Ce,ie))&&Ne++;return Ne},xe=t==="paneelwandregal"?Hp.length:t==="eckregal"?py.length*qh.length:fy.length*t0.length,Ee=(_e,Ne)=>a.has(Gp(n.code,_e,Ne,ie)),ae=(_e,Ne)=>a.has(Oy(_e,Ne)),Q=(_e,Ne,ue)=>a.has(Vp(_e,Ne,ue)),we=_e=>{y(_e),g(URL.createObjectURL(_e))},Ae=async()=>
811{if(!b)return;A(!0);let _e=null;p?_e=(await YSe(p.tegoCode,p.paneelFarbe,b)).error:m?_e=(await ZSe(m.ralCode,m.fb,m.type,b)).error:d&&(_e=(await XSe(n.code,d.breite,d.fb,b,ie)).error),A(!1),_e?j({title:"Upload fehlgeschlagen",description:_e,variant:"destructive"}):(j({title:"Bild gespeichert â"}),K(),G())},K=()=>{h(null),f(null),x(null),y(null),v&&URL.revokeObjectURL(v),g(null)},pe=_e=>{_e.preventDefault();const Ne=_e.dataTransfer.files[0];Ne&&Ne.type.startsWith("image/")&&we(Ne)},ye=!!(d||p||m),Se=p?`${p.tegoName} + ${p.paneelFarbe}`:m?`${((me=xi.find(_e=>_e.code===m.ralCode))==null?void 0:me.name)??m.ralCode} | ${(Ge=qh.find(_e=>_e.value===m.type))==null?void 0:Ge.label} | ${m.fb} Fachböden`:d?`${n.name} (RAL ${n.code}) | ${d.breite} Meter | ${d.fb} Fachböden`:"",ee=()=>{const _e=[];if(t==="paneelwandregal")for(const Ne of xi)for(const ue of Hp){const Ce=Oy(Ne.code,ue.name);a.has(Ce)&&_e.push({fileName:Ce,label:`${Ne.name} (RAL ${Ne.code}) + ${ue.displayName}`,expectedModules:null,expectedShelves:null})}else if(t==="eckregal")for(const Ne of qh)for(const ue of xi)for(const Ce of py){const Ke=Vp(ue.code,Ce,Ne.value);a.has(Ke)&&_e.push({fileName:Ke,label:`${Ne.label} | ${ue.name} | ${Ce} FB`,expectedModules:null,expectedShelves:Ce})}else for(const Ne of xi)for(const ue of fy)for(const Ce of t0){const Ke=Gp(Ne.code,ue,Ce,t);a.has(Ke)&&_e.push({fileName:Ke,label:`${Ne.name} (RAL ${Ne.code}) | ${ue}m | ${Ce} FB`,expectedModules:ue,expectedShelves:Ce})}return _e},re=({fileName:_e})=>{const Ne=$(_e);return Ne==="ok"?c.jsx(KN,{children:c.jsxs(qN,{children:[c.jsx(XN,{asChild:!0,children:c.jsx("div",{className:"absolute top-0.5 right-0.5 bg-green-600 text-white rounded-full p-0.5",children:c.jsx(m5,{className:"w-2.5 h-2.5"})})}),c.jsx(O2,{side:"bottom",className:"text-xs",children:"Manuell bestätigt"})]})}):Ne==="wrong"?c.jsx(KN,{children:c.jsxs(qN,{children:[c.jsx(XN,{asChild:!0,children:c.jsx("div",{className:"absolute top-0.5 right-0.5 bg-destructive text-destructive-foreground rounded-full p-0.5",children:c.jsx(fJ,{className:"w-2.5 h-2.5"})})}),c.jsx(O2,{side:"bottom",className:"text-xs",children:"Als falsch markiert"})]})}):c.jsx("div",{className:"absolute top-0.5 right-0.5 w-2.5 h-2.5 rounded-full bg-muted-foreground/30"})};return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:xc,title:"Regalbilder",description:c.jsxs(c.Fragment,{children:[I," / ",q," Bilder gesamt â ",te()," / ",se()," ",t==="wandregal"?"Wandregal":t==="gondelregal"?"Gondelregal":t==="paneelwandregal"?"Paneelwandregal":"Eckregal"]}),actions:c.jsxs(Pt,{onClick:()=>C(!0),disabled:te()===0,children:[c.jsx(ti,{className:"w-4 h-4 mr-2"}),"Speed-Review starten"]})}),c.jsx(FT,{value:te()/se()*100,className:"h-2"}),c.jsxs(zT,{type:"single",value:t,onValueChange:_e=>{_e&&e(_e)},className:"justify-start",children:[c.jsx(mf,{value:"wandregal",className:"text-sm",children:"Wandregal"}),c.jsx(mf,{value:"gondelregal",className:"text-sm",children:"Gondelregal"}),c.jsx(mf,{value:"paneelwandregal",className:"text-sm",children:"Paneelwandregal"}),c.jsx(mf,{value:"eckregal",className:"text-sm",children:"Eckregal"})]}),c.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:xi.map(_e=>{const Ne=le(_e.code);return c.jsxs(Dn,{className:"p-3",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("div",{className:"w-4 h-4 rounded-full border border-border",style:{background:_e.hex}}),c.jsx("span",{className:"text-sm font-medium",children:_e.name})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[Ne," / ",xe]}),c.jsx(FT,{value:Ne/xe*100,className:"mt-1 h-1.5"})]},_e.code)})}),t==="eckregal"?c.jsxs(c.Fragment,{children:[c.jsx(zT,{type:"single",value:i,onValueChange:_e=>{_e&&s(_e)},className:"justify-start flex-wrap",children:qh.map(_e=>{const Ne=V(_e.value);return c.jsxs(mf,{value:_e.value,className:"text-xs",children:[_e.label," (",Ne,"/",Cj,")"]},_e.value)})}),c.jsx($b,{value:String(n.code),onValueChange:_e=>{const Ne=xi.find(ue=>String(ue.code)===_e);Ne&&r(Ne)},children:c.jsx(dx,{className:"w-full grid grid-cols-4",children:xi.map(_e=>c.jsx(Xl,{value:String(_e.code),className:"text-xs",children:_e.name},_e.code))})}),c.jsxs(Dn,{children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-2",children:[c.jsx("div",{className:"w-4 h-4 rounded-full border border-border",style:{background:n.hex}}),n.name," â ",(He=qh.find(_e=>_e.value===i))==null?void 0:He.label]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-7 gap-2",children:py.map(_e=>
811{const Ne=Q(n.code,_e,i),ue=Vp(n.code,_e,i);return c.jsxs("div",{className:"space-y-1",children:[c.jsxs("p",{className:"text-xs text-muted-foreground text-center font-medium",children:[_e," FB"]}),c.jsx("button",{onClick:()=>x({ralCode:n.code,fb:_e,type:i}),className:`w-full aspect-square rounded-md flex items-center justify-center transition-colors overflow-hidden relative ${Ne?"border border-primary/30 hover:border-primary/60 bg-muted/20":"bg-destructive/5 border-2 border-dashed border-destructive/30 hover:border-destructive/50 hover:bg-destructive/10"}`,children:Ne?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:uO(n.name,_e,i)+P,alt:`${n.name} ${i} ${_e}FB`,className:"w-full h-full object-contain",loading:"lazy"}),c.jsx(re,{fileName:ue})]}):c.jsx(ph,{className:"w-3.5 h-3.5 text-destructive/50"})}),Ne&&c.jsxs("p",{className:"text-[9px] text-muted-foreground text-center",children:["Soll: ",_e,"FB"]})]},_e)})})})]})]}):t==="paneelwandregal"?c.jsx("div",{className:"space-y-6 max-w-3xl",children:xi.map(_e=>c.jsxs(Dn,{children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-sm flex items-center gap-2",children:[c.jsx("div",{className:"w-4 h-4 rounded-full border border-border",style:{background:_e.hex}}),_e.name," (RAL ",_e.code,")"]})}),c.jsx(Bn,{children:c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:Hp.map(Ne=>{const ue=ae(_e.code,Ne.name);return c.jsxs("button",{onClick:()=>f({tegoCode:_e.code,tegoName:_e.name,paneelFarbe:Ne.name}),className:`group relative rounded-lg overflow-hidden border-2 transition-all ${ue?"border-primary/40 hover:border-primary/70":"border-dashed border-border hover:border-primary/40 hover:bg-muted/30"}`,children:[ue?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:fT(_e.name,Ne.name)+P,alt:`${_e.name} + ${Ne.displayName}`,className:"w-full h-28 object-cover",loading:"lazy"}),c.jsx("div",{className:"absolute top-1.5 right-1.5 bg-primary text-primary-foreground rounded-full p-0.5",children:c.jsx(ti,{className:"w-3 h-3"})}),c.jsx("div",{className:"absolute inset-0 bg-background/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:c.jsx(pu,{className:"w-5 h-5 text-foreground"})})]}):c.jsxs("div",{className:"h-28 flex flex-col items-center justify-center gap-1.5 text-muted-foreground group-hover:text-foreground transition-colors",children:[c.jsx(ph,{className:"w-5 h-5"}),c.jsx("span",{className:"text-[10px]",children:"Upload"})]}),c.jsxs("div",{className:"px-2 py-1.5 flex items-center gap-1.5 bg-muted/50",children:[c.jsx("div",{className:"w-3 h-3 rounded border border-border shrink-0",style:{background:Ne.hex}}),c.jsx("span",{className:"text-xs font-medium truncate",children:Ne.displayName})]})]},Ne.name)})})})]},_e.code))}):c.jsxs(c.Fragment,{children:[c.jsx($b,{value:String(n.code),onValueChange:_e=>{const Ne=xi.find(ue=>String(ue.code)===_e);Ne&&r(Ne)},children:c.jsx(dx,{className:"w-full grid grid-cols-4",children:xi.map(_e=>c.jsx(Xl,{value:String(_e.code),className:"text-xs",children:_e.name},_e.code))})}),c.jsxs(Dn,{children:[c.jsx(li,{className:"pb-3",children:c.jsxs(ci,{className:"text-base flex items-center gap-2",children:[c.jsx("div",{className:"w-4 h-4 rounded-full border border-border",style:{background:n.hex}}),n.name," (RAL ",n.code,")"]})}),c.jsx(Bn,{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-xs text-muted-foreground font-medium p-2 text-left",children:"Breite â / Fachböden â"}),t0.map(_e=>c.jsxs("th",{className:"text-xs text-muted-foreground font-medium p-2 text-center",children:[_e," FB"]},_e))]})}),c.jsx("tbody",{children:fy.map(_e=>c.jsxs("tr",{className:"border-t border-border",children:[c.jsxs("td",{className:"text-sm font-medium p-2",children:[_e," m"]}),t0.map(Ne=>{const ue=Ee(_e,Ne),Ce=Gp(n.code,_e,Ne,ie);return c.jsxs("td",{className:"p-1",children:[c.jsx("button",{onClick:()=>h({breite:_e,fb:Ne}),className:`w-full aspect-square rounded-md flex items-center justify-center transition-colors overflow-hidden relative ${ue?"border border-primary/30 hover:border-primary/60 bg-muted/20":"bg-destructive/5 border-2 border-dashed border-destructive/30 hover:border-destructive/50 hover:bg-destructive/10"}`,children:ue?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:Fy(n.name,_e,Ne,ie)+P,alt:`${_e}m ${Ne}FB`,className:"w-full h-full object-contain",loading:"lazy"}),c.jsx(re,{fileName:Ce})]}):c.jsx(ph,{className:"w-3.5 h-3.5 text-destructive/50"})}),ue&&c.jsxs("p",{className:"text-[9px] text-muted-foreground mt-0.5",children:["Soll: ",_e,"m · ",Ne,"FB"]})]},Ne)})]},_e))})]})})]})]}),c.jsx(qf,{open:ye,onOpenChange:_e=>{_e||K()},children:c.jsxs(jh,{className:"sm:max-w-md",children:[c.jsxs(Xf,{children:[c.jsxs(Yf,{className:"flex items-center gap-2",children:[c.jsx(xc,{className:"w-5 h-5"}),"Bild hochladen"]}),c.jsx(D1,{children:Se})]}),v?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative rounded-lg overflow-hidden border border-border",children:[c.jsx("img",{src:v,alt:"Vorschau",className:"w-full h-auto"}),c.jsx("button",{onClick:()=>{y(null),v&&URL.revokeObjectURL(v),g(null)},className:"absolute top-2 right-2 bg-background/80 rounded-full p-1 hover:bg-background",children:c.jsx(Bc,{className:"w-4 h-4"})})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Wird automatisch auf max. 1200px Breite skaliert und als WebP gespeichert."}),c.jsxs(Pt,{onClick:Ae,disabled:S,className:"w-full",children:[S?c.jsx("div",{className:"w-4 h-4 border-2 border-primary-foreground border-t-transparent roun
811ded-full animate-spin"}):c.jsx(pu,{className:"w-4 h-4 mr-2"}),S?"Wird optimiert & hochgeladenâ¦":"Speichern"]})]}):c.jsxs("div",{onDragOver:_e=>_e.preventDefault(),onDrop:pe,onClick:()=>{var _e;return(_e=R.current)==null?void 0:_e.click()},className:"border-2 border-dashed border-border rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 hover:bg-muted/30 transition-colors",children:[c.jsx(pu,{className:"w-8 h-8 mx-auto text-muted-foreground mb-3"}),c.jsx("p",{className:"text-sm font-medium",children:"Bild hierher ziehen oder klicken"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"JPG, PNG oder WebP"}),c.jsx("input",{ref:R,type:"file",accept:"image/jpeg,image/png,image/webp",className:"hidden",onChange:_e=>{var ue;const Ne=(ue=_e.target.files)==null?void 0:ue[0];Ne&&we(Ne)}})]})]})}),c.jsx(j4e,{open:T,onOpenChange:C,slots:ee(),checks:k,onChecksDone:B})]})};function L4e(){const[t,e]=E.useState(!1),[n,r]=E.useState([]),[i,s]=E.useState([]),[a,o]=E.useState(0),[l,u]=E.useState(!0),d=async()=>{u(!0);const[{data:p},{data:f},{count:m}]=await Promise.all([Ot.from("tier_price_sync_log").select("*").order("started_at",{ascending:!1}).limit(15),Ot.from("unmatched_tier_price_skus").select("*").limit(200),Ot.from("product_tier_prices").select("*",{count:"exact",head:!0})]);r(p||[]),s(f||[]),o(m||0),u(!1)};E.useEffect(()=>{d()},[]);const h=async()=>{e(!0);try{const{data:p,error:f}=await Ot.functions.invoke("sync-staffelpreise",{body:{source:"manual"}});if(f)throw f;cEe(),zb.success(`Sync abgeschlossen: ${(p==null?void 0:p.rows_imported)??0} importiert, ${(p==null?void 0:p.unmatched_count)??0} unmatched`),await d()}catch(p){zb.error("Sync fehlgeschlagen: "+((p==null?void 0:p.message)||p))}finally{e(!1)}};return c.jsxs("div",{className:"space-y-6 p-4 md:p-6",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold",children:"Staffelpreise (Xentral)"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Aktuell ",a.toLocaleString("de-DE")," Staffeln in der Datenbank. Cron läuft alle 6 Stunden."]})]}),c.jsxs(Pt,{onClick:h,disabled:t,children:[t?c.jsx(md,{className:"h-4 w-4 animate-spin mr-2"}):c.jsx(rx,{className:"h-4 w-4 mr-2"}),"Jetzt synchronisieren"]})]}),c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"Letzte Synchronisationen"})}),c.jsx(Bn,{className:"overflow-x-auto",children:l?c.jsx("div",{className:"flex justify-center py-6",children:c.jsx(md,{className:"h-5 w-5 animate-spin"})}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-muted-foreground border-b",children:[c.jsx("th",{className:"py-2 pr-4",children:"Start"}),c.jsx("th",{className:"py-2 pr-4",children:"Quelle"}),c.jsx("th",{className:"py-2 pr-4",children:"Status"}),c.jsx("th",{className:"py-2 pr-4 text-right",children:"Importiert"}),c.jsx("th",{className:"py-2 pr-4 text-right",children:"Skipped"}),c.jsx("th",{className:"py-2 pr-4 text-right",children:"Unmatched"}),c.jsx("th",{className:"py-2 pr-4",children:"Fehler"})]})}),c.jsxs("tbody",{children:[n.map(p=>c.jsxs("tr",{className:"border-b",children:[c.jsx("td",{className:"py-2 pr-4",children:new Date(p.started_at).toLocaleString("de-DE")}),c.jsx("td",{className:"py-2 pr-4",children:p.quelle}),c.jsx("td",{className:"py-2 pr-4",children:p.status}),c.jsx("td",{className:"py-2 pr-4 text-right tabular-nums",children:p.rows_imported}),c.jsx("td",{className:"py-2 pr-4 text-right tabular-nums",children:p.rows_skipped}),c.jsx("td",{className:"py-2 pr-4 text-right tabular-nums",children:p.unmatched_count}),c.jsx("td",{className:"py-2 pr-4 text-xs text-destructive max-w-xs truncate",children:p.error_text||"â"})]},p.id)),n.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"py-4 text-center text-muted-foreground",children:"Noch keine Läufe."})})]})]})})]}),c.jsxs(Dn,{children:[c.jsxs(li,{children:[c.jsxs(ci,{className:"text-base",children:["Unmatched SKUs (",i.length,")"]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Artikel aus dem Xentral-Export, die nicht in der Produktdatenbank (Channable) vorhanden sind."})]}),c.jsx(Bn,{className:"overflow-x-auto",children:i.length===0?c.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"Alle SKUs gemappt."}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-muted-foreground border-b",children:[c.jsx("th",{className:"py-2 pr-4",children:"Artikelnummer"}),c.jsx("th",{className:"py-2 pr-4 text-right",children:"Staffeln"}),c.jsx("th",{className:"py-2 pr-4",children:"Zuletzt gesehen"})]})}),c.jsx("tbody",{children:i.map(p=>c.jsxs("tr",{className:"border-b",children:[c.jsx("td",{className:"py-2 pr-4 font-mono text-xs",children:p.artikelnummer}),c.jsx("td",{className:"py-2 pr-4 text-right tabular-nums",children:p.staffel_count}),c.jsx("td",{className:"py-2 pr-4",children:new Date(p.last_seen).toLocaleStr
811ing("de-DE")})]},p.artikelnummer))})]})})]})]})}const I4e=()=>{const t=Wf();return E.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),c.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),c.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},D4e={Insel:{anzahlSeiten:4,anzahlEckprofile:4},Kopf:{anzahlSeiten:3,anzahlEckprofile:2},Eck:{anzahlSeiten:2,anzahlEckprofile:1},Reihe:{anzahlSeiten:1,anzahlEckprofile:0}},B4e={1:{rlb:0,rls:0},2:{rlb:.5,rls:.5},3:{rlb:1,rls:.5},4:{rlb:1,rls:1}},F4e={Insel:4,Kopf:1,Eck:0,Reihe:-1},vz=[{schluessel:"Rollstuhlfreundlich",bezeichnung:"Rollstuhlfreundlich",beschreibung:"Flacher Ãbergang ohne Stolperkante â ideal für barrierefreie Stände."},{schluessel:"Alu gerade",bezeichnung:"Aluminium gerade",beschreibung:"Sauberer, gerader Abschluss aus eloxiertem Aluminium."},{schluessel:"Alu abflachend klein",bezeichnung:"Aluminium klein abflachend",beschreibung:"Leicht abfallende Kante für einen weichen Ãbergang."},{schluessel:"Alu abflachend groà grau",bezeichnung:"Aluminium groà abflachend, grau",beschreibung:"Stark abgeflachte Kante in grau â kraftvoller Materialauftritt."},{schluessel:"Alu abflachend groà schwarz",bezeichnung:"Aluminium groà abflachend, schwarz",beschreibung:"Stark abgeflachte Kante in schwarz â eleganter, dunkler Abschluss."},{schluessel:"Alu LED",bezeichnung:"Aluminium LED",beschreibung:"Aluminium-Profil mit Aussparung für LED-Leisten."}],fb=["Square wood light","Square wood dark","Light wood","Marble Travertine","Marble black","Marble white","Concrete dark","Concrete light","white","black"],qm=[{schluessel:"Square wood light",bezeichnung:"Square Wood Hell",farbe:"#C9A77A",kategorie:"Holz"},{schluessel:"Square wood dark",bezeichnung:"Square Wood Dunkel",farbe:"#5C3A24",kategorie:"Holz"},{schluessel:"Light wood",bezeichnung:"Helles Holz",farbe:"#D4B896",kategorie:"Holz"},{schluessel:"Brown wood",bezeichnung:"Braunes Holz",farbe:"#8B5A3C",kategorie:"Holz"},{schluessel:"Dark wood",bezeichnung:"Dunkles Holz",farbe:"#3E2723",kategorie:"Holz"},{schluessel:"Fine wood",bezeichnung:"Feines Holz",farbe:"#6D4C41",kategorie:"Holz"},{schluessel:"Barn wood",bezeichnung:"Scheunenholz",farbe:"#A1887F",kategorie:"Holz"},{schluessel:"Studs",bezeichnung:"Stollen",farbe:"#E8E2D4",kategorie:"Industrial"},{schluessel:"Deco",bezeichnung:"Deko",farbe:"#D7CCC8",kategorie:"Industrial"},{schluessel:"Iron metal plate",bezeichnung:"Eisenmetallplatte",farbe:"#546E7A",kategorie:"Industrial"},{schluessel:"Gold leaf metal",bezeichnung:"Goldblattmetall",farbe:"#D4AF37",kategorie:"Industrial"},{schluessel:"Corten steel",bezeichnung:"Cortenstahl",farbe:"#A0522D",kategorie:"Industrial"},{schluessel:"Green striped carpet",bezeichnung:"Grüner gestreifter Teppich",farbe:"#556B2F",kategorie:"Textil"},{schluessel:"Blue carpeting",bezeichnung:"Blauer Teppich",farbe:"#1E3A8A",kategorie:"Textil"},{schluessel:"Portugese tile",bezeichnung:"Portugiesische Fliese",farbe:"#4A6FA5",kategorie:"Keramik"},{schluessel:"Green terracotta",bezeichnung:"Grüne Terrakotta",farbe:"#88A878",kategorie:"Keramik"},{schluessel:"Old terracotta",bezeichnung:"Alte Terrakotta",farbe:"#B85450",kategorie:"Keramik"},{schluessel:"Ceramic ornate",bezeichnung:"Keramik verziert",farbe:"#B8956A",kategorie:"Keramik"},{schluessel:"Ceramic Blue arch",bezeichnung:"Keramik blauer Bogen",farbe:"#3F7CAC",kategorie:"Keramik"},{schluessel:"Ceramic geometric",bezeichnung:"Keramik geometrisch",farbe:"#9CA3AF",kategorie:"Keramik"},{schluessel:"Marble white",bezeichnung:"Marmor weiÃ",farbe:"#F5F5F0",kategorie:"Marmor"},{schluessel:"Marble Travertine",bezeichnung:"Marmor Travertin",farbe:"#D4C5A9",kategorie:"Marmor"},{schluessel:"Marble blue",bezeichnung:"Marmor blau",farbe:"#4A6FA5",kategorie:"Marmor"},{schluessel:"Marble black",bezeichnung:"Marmor schwarz",farbe:"#1C1C1C",kategorie:"Marmor"},{schluessel:"Pebbles in grass",bezeichnung:"Kieselsteine im Gras",farbe:"#7CB342",kategorie:"Natur"},{schluessel:"Ground",bezeichnung:"Boden",farbe:"#8D6E63",kategorie:"Natur"},{schluessel:"Flagstone grey",bezeichnung:"Platten grau",farbe:"#9E9E9E",kategorie:"Natur"},{schluessel:"Flagstone brown",bezeichnung:"Platten braun",farbe:"#795548",kategorie:"Natur"},{schluessel:"Flagstone mixed",bezeichnung:"Platten gemischt",farbe:"#A1887F",kategorie:"Natur"},{schluessel:"Granite",bezeichnung:"Granit",farbe:"#616161",kategorie:"Natur"},{schluessel:"Concrete plates",bezeichnung:"Betonplatten",farbe:"#BDBDBD",kategorie:"Beton"},{schluessel:"Concrete bare",bezeichnung:"Beton pur",farbe:"#9E9E9E",kategorie:"Beton"},{schluessel:"Concrete dark",bezeichnung:"Beton dunkel",farbe:"#424242",kategorie:"Beton"},{schluessel:"Concrete light",bezeichnung:"Beton hell",farbe:"#E0E0E0",kategorie:"Beton"}
811,{schluessel:"transparent",bezeichnung:"Transparent",farbe:"#F5F5F5",kategorie:"Einfarbig"},{schluessel:"white",bezeichnung:"WeiÃ",farbe:"#FFFFFF",kategorie:"Einfarbig"},{schluessel:"black",bezeichnung:"Schwarz",farbe:"#1C1C1C",kategorie:"Einfarbig"}],CA={Insel:{titel:"Inselstand",beschreibung:"Freistehend, alle 4 Seiten sind zugänglich und werden daher umlaufend mit Kantenprofilen versehen. Mit 4 Eckstücken.",seitenMitRand:["oben","unten","links","rechts"]},Kopf:{titel:"Kopfstand",beschreibung:"An der oberen Seite der ausgewählten Breite angrenzend. 3 Seiten mit Kantenprofilen und 2 Eckstücken.",seitenMitRand:["unten","links","rechts"]},Eck:{titel:"Eckstand",beschreibung:"An zwei Seiten angrenzend, daher mit Kantenprofil an einer Breiten- und einer Tiefenseite mit einem Eckstück.",seitenMitRand:["unten","rechts"]},Reihe:{titel:"Reihenstand",beschreibung:"Nur von einer Seite zugänglich, daher nur eine Seite mit Kantenprofilen und ohne Eckstücke.",seitenMitRand:["unten"]}};function Ho(t){return qm.find(e=>e.schluessel===t)}function $se(t){return vz.find(e=>e.schluessel===t)}const $p=[{id:1,label:"MaÃe"},{id:2,label:"Bodenplatte"},{id:3,label:"Bodenfinish"},{id:4,label:"Kantenprofile"},{id:5,label:"Würfel-Highlights"},{id:6,label:"Transport"},{id:7,label:"Zusammenfassung"}];function WV(t,e){var n,r,i,s;switch(t){case 1:return`${e.breite.toLocaleString("de-DE",{minimumFractionDigits:1})} à ${e.laenge.toLocaleString("de-DE",{minimumFractionDigits:1})} m`;case 2:{const a=e.bodenplatteTyp==="Big"?"Big Cable":e.bodenplatteTyp==="Basic"?"Basic":"";if(!a)return"";const o=((n=e.ersatzPlatten)==null?void 0:n.length)??0;if(o===0)return a;const l=e.bodenplatteTyp==="Basic"?"Big Cable":"Basic";return`${a} +${o} ${l}`}case 3:return e.bodenfinishKategorie==="Plattendesign"&&e.plattendesign?((r=Ho(e.plattendesign))==null?void 0:r.bezeichnung)??e.plattendesign:"";case 4:return e.kantenprofileGewuenscht===!1?"Ohne Kantenprofile":e.kantentyp&&e.standtyp?`${(i=$se(e.kantentyp))==null?void 0:i.bezeichnung}, ${CA[e.standtyp].titel}`:"";case 5:{const a=(s=e.wuerfelBereiche)==null?void 0:s[0],o=(a==null?void 0:a.wuerfel.length)??0;return o===0?e.wuerfelHighlightsSkipped?"Ãbersprungen":"Keine Würfel":`${o} Würfel platziert`}case 6:return e.transportArt==="Palette"?"Lieferung auf Palette":e.transportArt==="Transportbox"?"Transportboxen":"";default:return""}}function O4e({current:t,maxReached:e,canNext:n,onJump:r,config:i}){const s=Ph(),[a,o]=E.useState(!1),l=$p.find(u=>u.id===t);if(s){const u=t/$p.length*100,d=t>1,h=t<e||n;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sticky top-0 z-50 bg-white shadow-md border-b border-[#E0E0E0]",children:c.jsxs("div",{className:"px-2 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-1",children:[c.jsx("button",{type:"button",disabled:!d,onClick:()=>d&&r(t-1),className:"h-11 w-11 shrink-0 flex items-center justify-center rounded-md text-[hsl(var(--konfig-ink))] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Vorheriger Schritt",children:c.jsx(Ob,{className:"w-5 h-5"})}),c.jsx("button",{type:"button",onClick:()=>o(!0),className:"flex-1 min-w-0 text-center h-11 px-2 rounded-md hover:bg-[#F5F5F5] active:bg-[#EFEFEF] transition","aria-label":"Schritte anzeigen",children:c.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[c.jsxs("div",{className:"leading-tight",children:[c.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-[#6B7280]",children:["Schritt ",t," von ",$p.length]}),c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-primary))] truncate",children:l==null?void 0:l.label})]}),c.jsx(Su,{className:"w-4 h-4 text-[#6B7280] shrink-0"})]})}),c.jsx("button",{type:"button",disabled:!h,onClick:()=>h&&r(t+1),className:"h-11 w-11 shrink-0 flex items-center justify-center rounded-md text-[hsl(var(--konfig-ink))] disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Nächster Schritt",children:c.jsx(nx,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"mt-1.5 h-1 bg-[#F0F0F0] rounded overflow-hidden",children:c.jsx("div",{className:"h-full bg-[hsl(var(--konfig-primary))] transition-all duration-300",style:{width:`${u}%`}})})]})}),a&&c.jsx("div",{className:"fixed inset-0 z-[60] bg-black/40 backdrop-blur-sm",onClick:()=>o(!1),children:c.jsxs("div",{className:"absolute top-0 left-0 right-0 bg-white rounded-b-2xl shadow-xl",onClick:p=>p.stopPropagation(),style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[#
811E0E0E0]",children:[c.jsx("div",{className:"font-semibold text-[hsl(var(--konfig-ink))]",children:"Alle Schritte"}),c.jsx("button",{type:"button",onClick:()=>o(!1),"aria-label":"SchlieÃen",className:"h-9 w-9 flex items-center justify-center rounded-md hover:bg-[#F5F5F5]",children:c.jsx(Bc,{className:"w-5 h-5 text-[#6B7280]"})})]}),c.jsx("ul",{className:"py-2 max-h-[70vh] overflow-y-auto",children:$p.map(p=>{const f=p.id<t,m=p.id===t,x=p.id<=e,v=p.id===t+1&&n,g=!x&&!v;return c.jsx("li",{children:c.jsxs("button",{type:"button",disabled:g,onClick:()=>{g||(r(p.id),o(!1))},className:`w-full flex items-center gap-3 px-4 py-3 text-left transition ${m?"bg-[#FBE4EB]":g?"opacity-50":"hover:bg-[#F5F5F5]"}`,children:[c.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold shrink-0 ${m?"bg-[hsl(var(--konfig-primary))] text-white":f?"bg-[hsl(var(--konfig-ink))] text-white":"bg-[#E0E0E0] text-[#6B7280]"}`,children:f?c.jsx(ti,{className:"w-4 h-4"}):g?c.jsx(d8,{className:"w-3.5 h-3.5"}):p.id}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:`text-sm font-medium ${m?"text-[hsl(var(--konfig-primary))]":g?"text-[#9CA3AF]":"text-[hsl(var(--konfig-ink))]"}`,children:p.label}),(f||m)&&c.jsx("div",{className:"text-xs text-[#6B7280] truncate",children:WV(p.id,i)}),v&&!f&&!m&&c.jsx("div",{className:"text-xs text-[hsl(var(--konfig-primary))]",children:"Bereit â jetzt freigeschaltet"}),g&&c.jsx("div",{className:"text-xs text-[#9CA3AF]",children:"Erst vorherige Schritte abschlieÃen"})]})]})},p.id)})})]})})]})}return c.jsx("div",{className:"sticky top-0 z-50 bg-white shadow-md border-b border-[#E0E0E0]",children:c.jsx("div",{className:"max-w-6xl mx-auto px-4 py-3",children:c.jsx("div",{className:"flex items-stretch gap-2 overflow-x-auto",children:$p.map(u=>{const d=u.id<t,h=u.id===t,p=u.id<=e,f=u.id===t+1&&n,m=!p&&!f;return c.jsxs("button",{onClick:()=>(p||f)&&r(u.id),disabled:m,title:m?"Bitte erst die vorherigen Schritte abschlieÃen":void 0,"aria-disabled":m,className:`flex-1 min-w-[110px] text-left px-3 py-2 rounded-md transition ${h?"bg-[#FBE4EB]":p?"hover:bg-[#F5F5F5] cursor-pointer":f?"hover:bg-[#F5F5F5] cursor-pointer ring-1 ring-[hsl(var(--konfig-primary))]/40":"opacity-50 cursor-not-allowed bg-[#FAFAFA]"}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold ${h?"bg-[hsl(var(--konfig-primary))] text-white":d?"bg-[hsl(var(--konfig-ink))] text-white":"bg-[#E0E0E0] text-[#6B7280]"}`,children:d?c.jsx(ti,{className:"w-3.5 h-3.5"}):m?c.jsx(d8,{className:"w-3 h-3"}):u.id}),c.jsx("span",{className:`text-sm font-medium ${h?"text-[hsl(var(--konfig-primary))]":m?"text-[#9CA3AF]":"text-[hsl(var(--konfig-ink))]"}`,children:u.label})]}),d&&c.jsx("div",{className:"text-xs text-[#6B7280] mt-1 truncate",children:WV(u.id,i)})]},u.id)})})})})}const yM="boden-images",Kse=[{category:"bodenplatte",key:"basic",label:"Basic"},{category:"bodenplatte",key:"big",label:"Big Cable"}],qse=qm.map(t=>({category:"plattendesign",key:t.schluessel,label:t.bezeichnung,sublabel:t.kategorie})),Xse=vz.map(t=>({category:"kantentyp",key:t.schluessel,label:t.bezeichnung})),Yse=[{category:"klickverbinder",key:"detail",label:"Klickverbinder â Detail",sublabel:"Quadratisches Produktbild des Verbindungsstücks"}],Jse=[{category:"klickverbinder",key:"kanten-alu-verbinder",label:"Alu-Verbinder Kantenprofil",sublabel:"Verbindet Aluminium-Kantenprofile mit den Bodenplatten"},{category:"klickverbinder",key:"kanten-eckverbinder",label:"Eckverbinder Kantenprofil",sublabel:"Verbindet die Kantenprofile in den Ecken"}],Zse=[{category:"plattendesign",key:"transparent-inspiration",label:"Transparent â Inspirationsbild",sublabel:"Nur in der Inspirationskarte (Logo unter Cover) â ersetzt nicht das Plattenbild"}],Qse=[{category:"transport",key:"palette",label:"Lieferung auf Palette",sublabel:"Schritt 5 â Karte Palette"},{category:"transport",key:"transportbox",label:"Transportboxen / FlightCases",sublabel:"Schritt 5 â Karte Transportboxen"}];function Nj(t){return Ih("transport",t)}const Tj=[...Kse,...qse,...Xse,...Yse,...Jse,...Zse,...Qse];function z4e(t){return t.toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/Ã/g,"ss").normalize("NFKD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function e1(t,e){return`${t}/${z4e(e)}.webp`}function Ih(t,e,n){const{data:r}=Ot.storage.from(yM).getPublicUrl(e1(t,e)),i=n?`?v=${n}`:"";return r.publicUrl+i}function U4e(t){return Ih("bodenplatte",t==="Basic"?"basic":"big")}function xd(t){return Ih("plattendesign",t)}function H4e(){return Ih("plattendesign","transparent-inspiration")}function G4e(t){return Ih("kantentyp",t)}function V4e(){return Ih("klickverbinder","detail")}function W4e(){return Ih("klickverbinder","kanten-alu-verbinder")}function $4e(){return Ih("klickverbinder","kanten-eckverbinder")}async function K4e(){const t=new Set,e=["bodenplatte","plattendesign","kantentyp","klickverbinder","transport"];for(const n of e){const{data:r,error:i}=await Ot.storage.from(yM).list(n,{limit:1e3});if(!i)for(const s of r??[])t.add(`${n}/${s.name}`)}return t}async function q4e(t,e=1200,n=.88){const r=await createImageBitmap(t),i=Math.min(1,e/Math.max(r.width,r.height)),s=Math.round(r.width*i),a=Math.round(r.height*i),o=document.createElement("canvas");return o.width=s,o.height=a,o.getContext("2d").drawImage(r,0,0,s,a),await new Promise((u,d)=>{o.toBlob(h=>
811h?u(h):d(new Error("Konvertierung fehlgeschlagen")),"image/webp",n)})}async function X4e(t,e,n){const r=await q4e(n),{error:i}=await Ot.storage.from(yM).upload(e1(t,e),r,{upsert:!0,contentType:"image/webp",cacheControl:"3600"});if(i)throw i}async function Y4e(t,e){const{error:n}=await Ot.storage.from(yM).remove([e1(t,e)]);if(n)throw n}const b0="standonfloor",Dp={id:"standonfloor",label:"StandOnFloor Würfel",material:"Aluminium",raster:50,unterboden:2.6,wuerfelHoehe:10,coverplatte:1},yz={standonfloor:Dp};function $V(){return{grundflaecheRasterX:4,grundflaecheRasterZ:4,wuerfel:[]}}function bM(t){return{gx:t.groesseX??1,gz:t.groesseZ??1}}function Af(t){const{gx:e,gz:n}=bM(t),r=[];for(let i=0;i<e;i++)for(let s=0;s<n;s++)r.push({spalte:t.spalte+i,reihe:t.reihe+s});return r}function pb(t,e,n){const{gx:r,gz:i}=bM(t);return e>=t.spalte&&e<t.spalte+r&&n>=t.reihe&&n<t.reihe+i}function M_(t,e,n){let r=-1;for(const i of t.wuerfel)pb(i,e,n)&&i.stapelIndex>r&&(r=i.stapelIndex);return r}function J4e(t,e,n,r){for(const i of t.wuerfel)if(i.stapelIndex===r&&pb(i,e,n))return i;return null}const Z4e=["weiÃ","schwarz","rot","blau"];function c0(t,e){return`${t}\\${e}`}function iN(t,e){return`${t}_${e}`}function eae(t){const e=t.toLowerCase().trim();return e.includes("big sale")||e==="sale"||e.includes("rot")?"#c92626":e.includes("schwarz")?"#1f2329":e.includes("weiÃ")||e.includes("weiss")?"#f3f3f3":e.includes("silber")||e.includes("alu")?"#c8ccd1":e.includes("anthrazit")?"#383c42":e.includes("lichtgrau")?"#cfd2d6":e.includes("juraweiÃ")||e.includes("juraweiss")?"#ece7d8":e.includes("holz dunkel")||e.includes("nussbaum")||e.includes("wenge")?"#5c3a21":e.includes("holz hell")||e.includes("eiche")||e.includes("buche")?"#d9b382":e.includes("carbon")?"#202428":e.includes("kieselstein")?"#9a958b":e.includes("pflasterstein")?"#7d7a76":e.includes("gras")||e.includes("grün")||e.includes("gruen")?"#5c8a3a":e.includes("druckvorlage")?e.includes("schwarz")?"#1f2329":e.includes("weiÃ")||e.includes("weiss")?"#f3f3f3":"#cccccc":"#bfc3c7"}function Mj(t,e,n,r,i={}){const s=e.toLowerCase();let a,o;t==="Cube"||t==="Boden"?(a=.55,o=.4):(a=s.includes("hochglänzend")||s.includes("hochglanz")?.5:.3,o=s.includes("matt")?.85:s.includes("hochglänzend")||s.includes("hochglanz")?.2:.5),(s.includes("holz")||s.includes("stein")||s.includes("eiche")||s.includes("buche")||s.includes("nussbaum")||s.includes("kiesel")||s.includes("pflaster"))&&(a=0,o=.85);let l;t==="Cube"?(l="#ffffff",a=.15,o=.55):t==="Boden"?(l="#1f2329",a=.55,o=.45):l=eae(e);let u=null;if(i.useTexture&&t==="Cover"){const d=c0(t,e),h=r.find(p=>p.schluessel===d);u=(h==null?void 0:h.bild_url)??null}return{color:l,metalness:a,roughness:o,textureUrl:u}}function KV(t,e,n){const r=t.wuerfel.find(i=>i.stapelIndex===0&&Af(i).some(s=>s.spalte===e&&s.reihe===n));if(!r)return t.global.coverVariante;if(t.mode==="einzeln"&&r.blockId){const i=t.bloecke.find(s=>s.id===r.blockId);if(i)return i.coverVariante}return t.global.coverVariante}function X4({config:t,step:e=99,wuerfelProdukte:n=[]}){var pe;const{breite:r,laenge:i,plattendesign:s,bodenfinishKategorie:a,standtyp:o,kantenprofileGewuenscht:l,ersatzPlatten:u,ersatzAnzahlOhnePosition:d,bodenplatteTyp:h,finishBereiche:p,wuerfelBereiche:f}=t,m=Math.max(0,Math.round(d??0)),x=h==="Basic"?"Big Cable":"Basic",v=E.useId().replace(/[:]/g,""),g=`plattenDesignImg-${v}`,b=`bodenGrid-${v}`,y=`ersatzHatch-${v}`,S=h==="Basic"?"BC":"B",A=E.useMemo(()=>{const ye=new Set;for(const Se of qm)ye.add(Se.schluessel),ye.add(Se.schluessel.trim().toLowerCase());return ye},[]),k=E.useMemo(()=>{const ye=new Map;for(const Se of n){if(Se.bestandteil!=="Cover")continue;ye.set(Se.variable,Se.bild_url);const ee=Se.variable.trim().toLowerCase();ye.has(ee)||ye.set(ee,Se.bild_url)}return ye},[n]),M=ye=>{if(ye)return A.has(ye)||A.has(ye.trim().toLowerCase())?xd(ye):k.has(ye)?k.get(ye):k.get(ye.trim().toLowerCase())},T=E.useMemo(()=>new Set((u??[]).map(ye=>`${ye.r}_${ye.c}`)),[u]),C=E.useMemo(()=>{const ye=new Set;for(const Se of f??[])for(const ee of Se.wuerfel)if(ee.stapelIndex===0)for(const re of Af(ee))ye.add(`${Se.reihe+re.reihe}_${Se.spalte+re.spalte}`);return ye},[f]),R=E.useMemo(()=>{const ye=new Map;for(const Se of f??[])for(const ee of Se.wuerfel)if(ee.stapelIndex===0)for(const re of Af(ee)){const me=KV(Se,re.spalte,re.reihe);if(!me||ye.has(me))continue;const Ge=M(me);Ge&&ye.set(me,Ge)}return ye},[f,k,A]),P=e>=3,j=e>=4,G=Math.max(2,Math.round(r*2)),B=Math.max(2,Math.round(i*2)),$=r/i,U=100,Z=$>=1?U:U*$,V=$>=1?U/$:U,W=Z/G,O=V/B,Y=Math.max(.8,U*.015),z=P&&s&&a==="Plattendesign"?xd(s):null,I=!!z,te=P&&s?((pe=Ho(s))==null?void 0:pe.farbe)??"#E0E0E0":"#E0E0E0";let se="#E0E0E0";I?se=`url(#${g})`:P&&a==="Plattendesign"&&s&&(se=te);const ie=ye=>{const Se=ye.replace("#",""),ee=Se.length===3?Se.split("").map(He=>He+He).join(""):Se,re=parseInt(ee.substring(0,2),16)/255,me=parseInt(ee.substring(2,4),16)/255,Ge=parseInt(ee.substring(4,6),16)/255;return .299*re+.587*me+.114*Ge},le=ye=>{const Se=ie(ye)>.85;return{stroke:Se?"#8A8F98":"#FFFFFF",width:Math.max(.08,Math.min(W,O)*(Se?.075:.05))}},xe=!P||P&&a==="Plattendesign"&&ie(te)>.85,Ee=xe?"#8A8F98":"#FFFFFF",ae=Math.max(.08,Math.min(W,O)*(xe?.075:.05)),Q=o?CA[o].seitenMitRand:[],we="#9CA3AF",Ae="hsl(var(--konfig-primary))",K=ye=>!j||!o?"transparent":Q.includes(ye)?l?we:"transparent":Ae;return c.jsxs("div",{className:"w-full bg-white border border-[#
811E0E0E0] rounded-lg p-4 sm:p-6 flex flex-col items-center gap-3 overflow-hidden",children:[c.jsxs("div",{className:"flex items-stretch gap-2 w-full min-w-0",children:[c.jsx("div",{className:"shrink-0 w-6","aria-hidden":!0}),c.jsxs("div",{className:"flex-1 min-w-0 flex justify-center text-sm text-[hsl(var(--konfig-ink))] font-medium",children:[r.toLocaleString("de-DE",{minimumFractionDigits:1})," m"]})]}),c.jsxs("div",{className:"flex items-stretch gap-2 w-full min-w-0",children:[c.jsxs("div",{className:"text-sm text-[hsl(var(--konfig-ink))] font-medium flex items-center justify-center shrink-0 w-6",style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:[i.toLocaleString("de-DE",{minimumFractionDigits:1})," m"]}),c.jsx("div",{className:"flex-1 min-w-0 flex items-center justify-center",children:c.jsxs("svg",{viewBox:`${-Y} ${-Y} ${Z+Y*2} ${V+Y*2}`,preserveAspectRatio:"xMidYMid meet",className:"w-full h-auto max-h-[420px]",style:{aspectRatio:`${Z+Y*2} / ${V+Y*2}`},children:[c.jsxs("defs",{children:[I&&c.jsxs("pattern",{id:g,patternUnits:"userSpaceOnUse",width:W,height:O,children:[c.jsx("rect",{width:W,height:O,fill:te}),c.jsx("image",{href:z,width:W,height:O,preserveAspectRatio:"xMidYMid slice"})]}),c.jsxs("pattern",{id:b,patternUnits:"userSpaceOnUse",width:W,height:O,children:[c.jsx("rect",{width:W,height:O,fill:se}),c.jsx("path",{d:`M ${W} 0 V ${O} M 0 ${O} H ${W}`,stroke:Ee,strokeWidth:ae,fill:"none"})]}),c.jsx("pattern",{id:y,patternUnits:"userSpaceOnUse",width:Math.max(2,W*.18),height:Math.max(2,W*.18),patternTransform:"rotate(45)",children:c.jsx("line",{x1:0,y1:0,x2:0,y2:Math.max(2,W*.18),stroke:"hsl(var(--konfig-primary))",strokeWidth:Math.max(.4,W*.05)})})]}),c.jsx("rect",{x:0,y:0,width:Z,height:V,fill:`url(#${b})`}),P&&a==="Plattendesign"&&p&&p.length>0&&c.jsx("g",{pointerEvents:"none",children:p.flatMap(ye=>{var me;const Se=((me=Ho(ye.designSchluessel))==null?void 0:me.farbe)??"#E0E0E0",ee=xd(ye.designSchluessel),re=le(Se);return ye.platten.filter(Ge=>Ge.r>=0&&Ge.r<B&&Ge.c>=0&&Ge.c<G).filter(Ge=>!(e>=5&&C.has(`${Ge.r}_${Ge.c}`))).map(Ge=>c.jsxs("g",{children:[c.jsx("rect",{x:Ge.c*W,y:Ge.r*O,width:W,height:O,fill:Se}),c.jsx("image",{href:ee,x:Ge.c*W,y:Ge.r*O,width:W,height:O,preserveAspectRatio:"xMidYMid slice"}),c.jsx("path",{d:`M ${(Ge.c+1)*W} ${Ge.r*O} V ${(Ge.r+1)*O} M ${Ge.c*W} ${(Ge.r+1)*O} H ${(Ge.c+1)*W}`,stroke:re.stroke,strokeWidth:re.width,fill:"none"})]},`fb-${ye.id}-${Ge.r}-${Ge.c}`))})}),e>=2&&h&&u&&u.length>0&&c.jsx("g",{pointerEvents:"none",children:u.filter(ye=>ye.r>=0&&ye.r<B&&ye.c>=0&&ye.c<G).map(ye=>e>=5&&C.has(`${ye.r}_${ye.c}`)?null:c.jsxs("g",{children:[c.jsx("rect",{x:ye.c*W,y:ye.r*O,width:W,height:O,fill:`url(#${y})`,fillOpacity:.55}),c.jsx("rect",{x:ye.c*W+.1,y:ye.r*O+.1,width:W-.2,height:O-.2,fill:"none",stroke:"hsl(var(--konfig-primary))",strokeWidth:Math.max(.12,Math.min(W,O)*.04)}),c.jsx("text",{x:ye.c*W+W/2,y:ye.r*O+O/2,fontSize:Math.max(1.6,Math.min(W,O)*.42),fill:"hsl(var(--konfig-primary))",fontWeight:800,textAnchor:"middle",dominantBaseline:"central",style:{paintOrder:"stroke",stroke:"#FFFFFF",strokeWidth:Math.max(.2,Math.min(W,O)*.08)},children:S})]},`ep-${ye.r}-${ye.c}`))}),e>=5&&f&&f.length>0&&c.jsx("g",{pointerEvents:"none",children:f.map((ye,Se)=>{const ee=W,re=O,me=[];for(const Ge of ye.wuerfel)if(Ge.stapelIndex===0)for(const He of Af(Ge)){const _e=He.spalte,Ne=He.reihe;me.find(ue=>ue.sp===_e&&ue.re===Ne)||me.push({sp:_e,re:Ne,cover:KV(ye,_e,Ne)})}return c.jsx("g",{children:me.map((Ge,He)=>{const _e=ye.spalte+Ge.sp,Ne=ye.reihe+Ge.re,ue=_e*ee,Ce=Ne*re,Ke=ee,Qe=re,je=!1,We=R.get(Ge.cover)??null,xt=!!We,et=eae(Ge.cover),Je=T.has(`${Ne}_${_e}`),Ze=(Ge.cover||"").split(/\s+/).map(Me=>Me.charAt(0).toUpperCase()).join("").slice(0,2)||"?";return c.jsxs("g",{children:[c.jsx("rect",{x:ue,y:Ce,width:Ke,height:Qe,fill:et,fillOpacity:1}),xt&&c.jsx("image",{href:We,x:ue,y:Ce,width:Ke,height:Qe,preserveAspectRatio:"xMidYMid slice"}),!xt&&!je&&c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:ue+Ke*.06,y:Ce+Qe*.06,width:Ke*.88,height:Qe*.88,fill:"none",stroke:"hsl(var(--konfig-ink))",strokeWidth:Math.max(.15,Math.min(W,O)*.04),strokeDasharray:`${W*.08} ${W*.06}`}),c.jsx("text",{x:ue+Ke/2,y:Ce+Qe/2,fontSize:Math.max(1.4,Math.min(W,O)*.3),fill:"hsl(var(--konfig-ink))",fontWeight:700,textAnchor:"middle",dominantBaseline:"central",style:{paintOrder:"stroke",stroke:"#FFFFFF",strokeWidth:Math.max(.15,Math.min(W,O)*.06)},children:Ze})]}),c.jsx("path",{d:`M ${ue+Ke} ${Ce} V ${Ce+Qe} M ${ue} ${Ce+Qe} H ${ue+Ke}`,stroke:Ee,strokeWidth:ae,fill:"none"}),Je&&c.jsx("text",{x:ue+Ke/2,y:Ce+Qe/2,fontSize:Math.max(1.2,Math.min(W,O)*.32),fill:"hsl(var(--konfig-primary))",fillOpacity:.55,fontWeight:800,textAnchor:"middle",dominantBaseline:"central",children:"BC"})]},`wb-${ye.id}-${He}`)})},`wb-${ye.id}`)})}),c.jsx("rect",{x:0,y:0,width:Z,height:V,fill:"none",stroke:Ee,strokeWidth:Math.max(.18,ae*1.2)}),c.jsx("line",{x1:0,y1:0,x2:Z,y2:0,stroke:K("oben"),strokeWidth:Y,strokeLinecap:"square"}),c.jsx("line",{x1:0,y1:V,x2:Z,y2:V,stroke:K("unten"),strokeWidth:Y,strokeLinecap:"square"}),c.jsx("line",{x1:0,y1:0,x2:0,y2:V,stroke:K("links"),strokeWidth:Y,strokeLinecap:"square"}),c.jsx("line",{x1:Z,y1:0,x2:Z,y2:V,stroke:K("rechts"),strokeWidth:Y,strokeLinecap:"square"})]})})]}),c.jsxs("div",{className:"text-xs text-[#6B7280]",children:["Gesamtfläche: ",(r*i).toLocaleStr
811ing("de-DE",{minimumFractionDigits:1})," m²"]}),j&&o&&c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-1 text-xs text-[#6B7280]",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{"aria-hidden":!0,className:"inline-block w-5 h-1 rounded-sm",style:{background:"#9CA3AF"}}),"mit Kantenprofil"]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{"aria-hidden":!0,className:"inline-block w-5 h-1 rounded-sm",style:{background:"hsl(var(--konfig-primary))"}}),"ohne Kantenprofil"]})]}),e>=2&&h&&m>0&&c.jsxs("div",{className:"text-xs text-[hsl(var(--konfig-primary))]",children:["+ ",m," ",x,"-Platte",m===1?"":"n"," ohne feste Position"]}),e>=2&&h&&u&&u.length>0&&c.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 text-xs text-[#6B7280]",children:c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center justify-center w-5 h-4 rounded-sm bg-white border border-[hsl(var(--konfig-primary))] text-[10px] font-extrabold text-[hsl(var(--konfig-primary))]",children:S}),S==="BC"?"Big Cable Platte":"Basic Platte"]})}),c.jsx("div",{className:"text-xs text-[#6B7280] text-center max-w-prose leading-relaxed border-t border-[#E0E0E0] pt-3 mt-1 w-full",children:"Die Kanten zwischen den Bodenplatten werden nicht in dieser Deutlichkeit sichtbar sein. Darstellung dient lediglich zur Anschauung der Anzahl der Bodenplatten. Ãbergang ist nahezu fugenfrei."})]})}var tae=["PageUp","PageDown"],nae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rae={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ew="Slider",[Y4,Q4e,eDe]=GS(ew),[iae,bqe]=ja(ew,[eDe]),[tDe,wM]=iae(ew),sae=E.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:d,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:f=!1,form:m,...x}=t,v=E.useRef(new Set),g=E.useRef(0),y=a==="horizontal"?nDe:rDe,[S=[],A]=Ja({prop:d,defaultProp:u,onChange:P=>{var G;(G=[...v.current][g.current])==null||G.focus(),h(P)}}),k=E.useRef(S);function M(P){const j=lDe(S,P);R(P,j)}function T(P){R(P,g.current)}function C(){const P=k.current[g.current];S[g.current]!==P&&p(S)}function R(P,j,{commit:G}={commit:!1}){const B=hDe(s),$=fDe(Math.round((P-r)/s)*s+r,B),U=gT($,[r,i]);A((Z=[])=>{const V=aDe(Z,U,j);if(dDe(V,l*s)){g.current=V.indexOf(U);const W=String(V)!==String(Z);return W&&G&&p(V),W?V:Z}else return Z})}return c.jsx(tDe,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:i,valueIndexToChangeRef:g,thumbs:v.current,values:S,orientation:a,form:m,children:c.jsx(Y4.Provider,{scope:t.__scopeSlider,children:c.jsx(Y4.Slot,{scope:t.__scopeSlider,children:c.jsx(y,{"aria-disabled":o,"data-disabled":o?"":void 0,...x,ref:e,onPointerDown:cn(x.onPointerDown,()=>{o||(k.current=S)}),min:r,max:i,inverted:f,onSlideStart:o?void 0:M,onSlideMove:o?void 0:T,onSlideEnd:o?void 0:C,onHomeKeyDown:()=>!o&&R(r,0,{commit:!0}),onEndKeyDown:()=>!o&&R(i,S.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:j})=>{if(!o){const $=tae.includes(P.key)||P.shiftKey&&nae.includes(P.key)?10:1,U=g.current,Z=S[U],V=s*$*j;R(Z+V,U,{commit:!0})}}})})})})});sae.displayName=ew;var[aae,oae]=iae(ew,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nDe=E.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:u,...d}=t,[h,p]=E.useState(null),f=ur(e,y=>p(y)),m=E.useRef(void 0),x=Mx(i),v=x==="ltr",g=v&&!s||!v&&s;function b(y){const S=m.current||h.getBoundingClientRect(),A=[0,S.width],M=bz(A,g?[n,r]:[r,n]);return m.current=S,M(y-S.left)}return c.jsx(aae,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:c.jsx(lae,{dir:x,"data-orientation":"horizontal",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:y=>{const S=b(y.clientX);a==null||a(S)},onSlideMove:y=>{const S=b(y.clientX);o==null||o(S)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:y=>{const A=rae[g?"from-left":"from-right"].includes(y.key);u==null||u({event:y,direction:A?-1:1})}})})}),rDe=E.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onStepKeyDown:l,...u}=t,d=E.useRef(null),h=ur(e,d),p=E.useRef(void 0),f=!i;function m(x){const v=p.current||d.current.getBoundingClientRect(),g=[0,v.height],y=bz(g,f?[r,n]:[n,r]);return p.current=v,y(x-v.top)}return c.jsx(aae,{scope:t.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:c.jsx(lae,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const v=m(x.clientY);s==null||s(v)},onSlideMove:x=>{const v=m(x.clientY);a==null||a(v)},onSlideEnd:()=>{p.current=void 0,o==null||o()},onStepKeyDown:x=>{const g=rae[f?"from-bottom":"from-top"].includes(x.key);l==null||l({event:x,direction:g?-1:1})}})})}),lae=E.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:l,...u}=t,d=wM(ew,n);return c.jsx(vn.span,{...u,ref:e,onKeyDown:cn(t.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(o(h),h.preventDefault()):tae.concat(nae).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:cn(t.onPointerDown,h=>{const p=h.target;p.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(p)?p.focus():r(h)}),onPointerMove:cn(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:cn(t.onPointerUp,h=>{const p=h.target;p.hasPointerCapture(h.pointerId)&&(p.releasePointerCapture(h.pointerId),s(h))})})}),cae="SliderTrack",uae=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=wM(cae,n);return c.jsx(vn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});uae.displayName=cae;var J4="SliderRange",dae=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=wM(J4,n),s=oae(J4,n),a=E.useRef(null),o=ur(e,a),l=i.values.length,u=i.values.map(p=>pae(p,i.min,i.max)),d=l>1?Math.min(...u):0,h=100-Math.max(...u);return c.jsx(vn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...t.style,[s.startEdge]:d+"%",[s.endEdge]:h+"%"}})});dae.displayName=J4;var Z4="SliderThumb",hae=E.forwardRef((t,e)=>{const n=Q4e(t.__scopeSlider),[r,i]=E.useState(null),s=ur(e,o=>i(o)),a=E.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return c.jsx(iDe,{...t,ref:s,index:a})}),iDe=E.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,a=wM(Z4,n),o=oae(Z4,n),[l,u]=E.useState(null),d=ur(e,b=>u(b)),h=l?a.form||!!l.closest("form"):!0,p=qS(l),f=a.values[r],m=f===void 0?0:pae(f,a.min,a.max),x=oDe(r,a.values.length),v=p==null?void 0:p[o.size],g=v?
811cDe(v,m,o.direction):0;return E.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${m}% + ${g}px)`},children:[c.jsx(Y4.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(vn.span,{role:"slider","aria-label":t["aria-label"]||x,"aria-valuemin":a.min,"aria-valuenow":f,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:d,style:f===void 0?{display:"none"}:t.style,onFocus:cn(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),h&&c.jsx(fae,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:f},r)]})});hae.displayName=Z4;var sDe="RadioBubbleInput",fae=E.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=E.useRef(null),s=ur(i,r),a=hA(e);return E.useEffect(()=>{const o=i.current;if(!o)return;const l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&d){const h=new Event("input",{bubbles:!0});d.call(o,e),o.dispatchEvent(h)}},[a,e]),c.jsx(vn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});fae.displayName=sDe;function aDe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function pae(t,e,n){const s=100/(n-e)*(t-e);return gT(s,[0,100])}function oDe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function lDe(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function cDe(t,e,n){const r=t/2,s=bz([0,50],[0,r]);return(r-s(e)*n)*n}function uDe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function dDe(t,e){if(e>0){const n=uDe(t);return Math.min(...n)>=e}return!0}function bz(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function hDe(t){return(String(t).split(".")[1]||"").length}function fDe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var mae=sae,pDe=uae,mDe=dae,gDe=hae;const wz=E.forwardRef(({className:t,...e},n)=>c.jsxs(mae,{ref:n,className:rn("relative flex w-full touch-none select-none items-center",t),...e,children:[c.jsx(pDe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(mDe,{className:"absolute h-full bg-primary"})}),c.jsx(gDe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));wz.displayName=mae.displayName;const t1=.5,mb=1,w0=20,l2=2.5,Rj=t=>{const e=Math.round((t-mb)/t1)*t1+mb;return Math.round(e*10)/10},jj=t=>{const e=l2/t,n=Math.round(Math.ceil(e/t1)*t1*10)/10;return Math.max(mb,Math.min(w0,n))};function qV({label:t,value:e,onCommit:n}){const[r,i]=E.useState(e),[s,a]=E.useState(!1);E.useEffect(()=>{s||i(e)},[e,s]);const o=Rj(r),l=u=>{const d=Math.max(mb,Math.min(w0,Rj(e+u)));d!==e&&(i(d),n(d))};return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[c.jsx("label",{className:"font-medium text-[hsl(var(--konfig-ink))]",children:t}),c.jsxs("div",{className:"text-3xl font-bold text-[hsl(var(--konfig-primary))]",children:[o.toLocaleString("de-DE",{minimumFractionDigits:1})," m"]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:()=>l(-t1),disabled:e<=mb,"aria-label":`${t} verringern`,className:"h-11 w-11 shrink-0 flex items-center justify-center rounded-md border border-[#E0E0E0] text-[hsl(var(--konfig-ink))] hover:border-[hsl(var(--konfig-primary))] hover:text-[hsl(var(--konfig-primary))] disabled:opacity-30 disabled:cursor-not-allowed transition",children:c.jsx(y1,{className:"w-5 h-5"})}),c.jsx("div",{className:"flex-1",children:c.jsx(wz,{"aria-label":`${t} in Meter`,min:mb,max:w0,step:.01,value:[Math.min(w0,r)],onPointerDown:()=>a(!0),onValueChange:([u])=>{i(u)},onValueCommit:([u])=>{const d=Rj(u);i(d),a(!1),d!==e&&n(d)}})}),c.jsx("button",{type:"button",onClick:()=>l(t1),disabled:e>=w0,"aria-label":`${t} erhöhen`,className:"h-11 w-11 shrink-0 flex items-center justify-center rounded-md border border-[#
811E0E0E0] text-[hsl(var(--konfig-ink))] hover:border-[hsl(var(--konfig-primary))] hover:text-[hsl(var(--konfig-primary))] disabled:opacity-30 disabled:cursor-not-allowed transition",children:c.jsx(ph,{className:"w-5 h-5"})})]}),c.jsxs("div",{className:"flex justify-between text-xs text-[#6B7280] mt-1 px-14",children:[c.jsx("span",{children:"1,0 m"}),c.jsx("span",{children:"20,0 m"})]})]})}function xDe({config:t,onChange:e}){return E.useEffect(()=>{const n={},r=Math.min(w0,t.breite);let i=Math.min(w0,t.laenge);r*i<l2&&(i=jj(r)),r!==t.breite&&(n.breite=r),i!==t.laenge&&(n.laenge=i),Object.keys(n).length>0&&e(n)},[]),c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Wählen Sie die MaÃe Ihres Bodens"}),c.jsx("p",{className:"text-[#6B7280]",children:"Stellen Sie Breite und Länge in 0,5-Meter-Schritten ein."})]}),c.jsx(qV,{label:"Breite",value:t.breite,onCommit:n=>e(n*t.laenge<l2?{breite:n,laenge:jj(n)}:{breite:n})}),c.jsx(qV,{label:"Länge",value:t.laenge,onCommit:n=>e(n*t.breite<l2?{laenge:n,breite:jj(n)}:{laenge:n})}),c.jsxs("div",{className:"text-lg text-[hsl(var(--konfig-ink))]",children:["Gesamtfläche: ",c.jsxs("span",{className:"font-bold",children:[(t.breite*t.laenge).toLocaleString("de-DE",{minimumFractionDigits:1})," m²"]}),c.jsx("div",{className:"text-xs text-[#6B7280] mt-1",children:"Mindestfläche 2,5 m² (Mindestabnahme 10 Platten) â kleinere Flächen werden automatisch angepasst."})]}),c.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--konfig-primary))]/30 bg-[hsl(var(--konfig-primary-soft))] px-3 py-2 text-xs text-[hsl(var(--konfig-ink))]",children:[c.jsx(pa,{className:"w-4 h-4 mt-0.5 shrink-0 text-[hsl(var(--konfig-primary))]"}),c.jsxs("span",{children:["GröÃere Flächen über 20 m je Seite sind selbstverständlich möglich â bitte kontaktieren Sie für ein individuelles Angebot unseren"," ",c.jsx("span",{className:"font-semibold",children:"Kundenservice"}),"."]})]})]})}const lk="#3F4A52",ck="#0F1A20",Pj="hsl(var(--konfig-primary))",Cv=["hsl(var(--konfig-primary))","hsl(var(--konfig-ink))","#78AD48","#F59E0B","#3B82F6","#8B5CF6"];function XV(t,e,n){const r=[[0,0],[0,n-1],[e-1,0],[e-1,n-1]],i=new Set;for(let s=0;s<t;s++){const[a,o]=r[s];i.add(`${a}_${o}`)}return i}function Nv(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`b_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function vDe({breite:t,laenge:e,grundTyp:n,ersatz:r,onChange:i,anzahlOhnePosition:s,onAnzahlOhnePositionChange:a}){const o=Math.max(1,Math.round(t*2)),l=Math.max(1,Math.round(e*2)),u=l*o,d=n==="Basic"?"Big":"Basic",h=d==="Big"?"Big Cable":"Basic",p=n==="Big"?"Big Cable":"Basic",[f,m]=E.useState("brush"),[x,v]=E.useState(null),[g,b]=E.useState(null),y=E.useRef(null),[S,A]=E.useState([]),[k,M]=E.useState(null),[T,C]=E.useState(0),[R,P]=E.useState(0),[j,G]=E.useState(0),[B,$]=E.useState(0),U=E.useRef(!1);E.useEffect(()=>{if(U.current)return;U.current=!0;const je=[];let We=0;if(r.length>0){const et=new Set;for(const Je of r)Je.r>=0&&Je.r<l&&Je.c>=0&&Je.c<o&&et.add(`${Je.r}_${Je.c}`);et.size>0&&(je.push({id:Nv(),kind:"freihand",cells:et,sealed:!0,visible:!0,color:Cv[We++%Cv.length],index:1}),C(1))}const xt=Math.max(0,Math.round(s??0));xt>0&&(je.push({id:Nv(),kind:"anzahl",anzahl:xt,cells:new Set,visible:!0,color:Cv[We++%Cv.length],index:1}),$(1)),je.length>0&&A(je)},[]);const Z=E.useMemo(()=>{const je=new Set;for(const We of S)if(We.visible)for(const xt of We.cells){const[et,Je]=xt.split("_").map(Number);et>=0&&et<l&&Je>=0&&Je<o&&je.add(xt)}return je},[S,l,o]),V=E.useRef("");E.useEffect(()=>{const je=Array.from(Z).sort(),We=je.join("|");if(We===V.current)return;V.current=We;const xt=je.map(et=>{const[Je,Ze]=et.split("_").map(Number);return{r:Je,c:Ze}});i(xt)},[Z,i]);const W=E.useMemo(()=>{let je=0;for(const We of S)We.visible&&We.kind==="anzahl"&&(je+=We.anzahl);return je},[S]),O=E.useRef(-1);E.useEffect(()=>{O.current!==W&&(O.current=W,a==null||a(W))},[W,a]);const Y=Z.size+W,z=u-Y,I=100,q=o/l,te=q>=1?I:I*q,se=q>=1?I/q:I,ie=te/o,le=se/l;function xe(je){return Cv[je%Cv.length]}function Ee(je,We){A(xt=>xt.map(et=>et.id===je?{...et,...We}:et))}function ae(je){A(We=>We.filter(xt=>xt.id!==je)),k===je&&M(null)}function Q(){A([]),M(null),v(null)}function we(){A(je=>je.map(We=>We.kind==="freihand"&&!We.sealed?{...We,sealed:!0}:We))}function Ae(){const je=S.find(et=>et.kind==="freihand"&&!et.sealed);if(je)return{id:je.id,isNew:!1};const We=T+1,xt=Nv();return C(We),A(et=>[...et,{id:xt,kind:"freihand",cells:new Set,sealed:!1,visible:!0,color:xe(et.length),index:We}]),{id:xt,isNew:!0}}function K(je,We,xt){const et=`${je}_${We}`,{id:Je}=Ae();A(Ze=>Ze.map(Me=>{if(Me.id!==Je||Me.kind!=="freihand")return Me;const Xe=new Set(Me.cells),ut=Xe.has(et);return(xt??(ut?"remove":"add"))==="add"?Xe.add(et):Xe.delete(et),{...Me,cells:Xe}}))}function pe(je,We,xt){if(xt.preventDefault(),f==="single")K(je,We);else if(f==="brush"){const et=Z.has(`${je}_${We}`);y.current=et?"remove":"add",K(je,We,y.current)}else if(f==="line"||f==="rect")if(!x)v({r:je,c:We});else{const et=x,Je={r:je,c:We},Ze=new Set;if(f==="line"){const Xe=Math.abs(et.r-Je.r);if(Math.abs(et.c-Je.c)>=Xe){const lt=Math.min(et.c,Je.c),Fe=Math.max(et.c,Je.c);for(let Le=lt;Le<=Fe;Le++)Ze.add(`${et.r}_${Le}`)}
811else{const lt=Math.min(et.r,Je.r),Fe=Math.max(et.r,Je.r);for(let Le=lt;Le<=Fe;Le++)Ze.add(`${Le}_${et.c}`)}}else{const Xe=Math.min(et.r,Je.r),ut=Math.max(et.r,Je.r),lt=Math.min(et.c,Je.c),Fe=Math.max(et.c,Je.c);for(let Le=Xe;Le<=ut;Le++)for(let bt=lt;bt<=Fe;bt++)Ze.add(`${Le}_${bt}`)}const{id:Me}=Ae();A(Xe=>Xe.map(ut=>{if(ut.id!==Me||ut.kind!=="freihand")return ut;const lt=new Set(ut.cells);for(const Fe of Ze)lt.add(Fe);return{...ut,cells:lt}})),v(null)}}function ye(je,We){b({r:je,c:We}),f==="brush"&&y.current&&K(je,We,y.current)}function Se(){y.current=null}function ee(je){we();const We=new Set;let xt;if(je==="Mittlere Reihe"){const Je=Math.floor(l/2);for(let Ze=0;Ze<o;Ze++)We.add(`${Je}_${Ze}`)}else if(je==="Mittlere Spalte"){const Je=Math.floor(o/2);for(let Ze=0;Ze<l;Ze++)We.add(`${Ze}_${Je}`)}else if(je==="Kreuz"){const Je=Math.floor(l/2),Ze=Math.floor(o/2);for(let Me=0;Me<o;Me++)We.add(`${Je}_${Me}`);for(let Me=0;Me<l;Me++)We.add(`${Me}_${Ze}`)}else if(je==="Ecken"){xt=4;for(const Je of XV(4,l,o))We.add(Je)}const et=R+1;P(et),A(Je=>[...Je,{id:Nv(),kind:"vorlage",name:je,cells:We,visible:!0,color:xe(Je.length),index:et,ecken:xt}])}function re(je,We){A(xt=>xt.map(et=>et.id!==je||et.kind!=="vorlage"||et.name!=="Ecken"?et:{...et,ecken:We,cells:XV(We,l,o),visible:!0}))}function me(je,We,xt,et,Je){const Ze=new Set,Me=Math.min(je,We),Xe=Math.max(je,We),ut=Math.min(xt,et),lt=Math.max(xt,et);for(let Fe=Me;Fe<=Xe;Fe++)for(let Le=ut;Le<=lt;Le++)Ze.add(`${Fe}_${Le}`);if(Je)A(Fe=>Fe.map(Le=>Le.id===Je&&Le.kind==="bereich"?{...Le,r1:Me,r2:Xe,c1:ut,c2:lt,cells:Ze,visible:!0}:Le)),M(null);else{we();const Fe=j+1;G(Fe),A(Le=>[...Le,{id:Nv(),kind:"bereich",r1:Me,r2:Xe,c1:ut,c2:lt,cells:Ze,visible:!0,color:xe(Le.length),index:Fe}])}}function Ge(je,We){const xt=Math.max(0,Math.min(u,Math.round(je))),et=new Set;if(We)A(Je=>Je.map(Ze=>Ze.id===We&&Ze.kind==="anzahl"?{...Ze,anzahl:xt,cells:et,visible:!0}:Ze)),M(null);else{we();const Je=B+1;$(Je),A(Ze=>[...Ze,{id:Nv(),kind:"anzahl",anzahl:xt,cells:et,visible:!0,color:xe(Ze.length),index:Je}])}}function He(je){A(We=>We.map(xt=>xt.id===je?{...xt,visible:!1}:xt)),M(je)}function _e(){k&&A(je=>je.map(We=>We.id===k?{...We,visible:!0}:We)),M(null)}E.useEffect(()=>{v(null)},[f,l,o]);const Ne=E.useMemo(()=>{if(!x||!g)return null;const je=new Set;if(f==="line"){const We=Math.abs(x.r-g.r);if(Math.abs(x.c-g.c)>=We){const et=Math.min(x.c,g.c),Je=Math.max(x.c,g.c);for(let Ze=et;Ze<=Je;Ze++)je.add(`${x.r}_${Ze}`)}else{const et=Math.min(x.r,g.r),Je=Math.max(x.r,g.r);for(let Ze=et;Ze<=Je;Ze++)je.add(`${Ze}_${x.c}`)}}else if(f==="rect"){const We=Math.min(x.r,g.r),xt=Math.max(x.r,g.r),et=Math.min(x.c,g.c),Je=Math.max(x.c,g.c);for(let Ze=We;Ze<=xt;Ze++)for(let Me=et;Me<=Je;Me++)je.add(`${Ze}_${Me}`)}return je},[x,g,f]),ue=({id:je,icon:We,label:xt})=>c.jsxs("button",{type:"button",onClick:()=>m(je),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm border transition ${f===je?"bg-[hsl(var(--konfig-ink))] text-white border-[hsl(var(--konfig-ink))]":"bg-white text-[hsl(var(--konfig-ink))] border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,title:xt,children:[c.jsx(We,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:xt})]}),Ce=u>200,Ke=k?S.find(je=>je.id===k)??null:null,Qe=S.find(je=>je.kind==="freihand"&&!je.sealed);return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ue,{id:"single",icon:x5,label:"Einzeln"}),c.jsx(ue,{id:"brush",icon:hJ,label:"Pinsel"}),c.jsx(ue,{id:"line",icon:y1,label:"Linie"}),c.jsx(ue,{id:"rect",icon:wJ,label:"Rechteck"}),Qe&&c.jsxs("button",{type:"button",onClick:we,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm border border-[hsl(var(--konfig-primary))] bg-white text-[hsl(var(--konfig-primary))] hover:bg-[#FBE4EB] transition",title:"Aktuellen Freihand-Block abschlieÃen",children:[c.jsx(ti,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Freihand abschlieÃen"})]}),c.jsxs("button",{type:"button",onClick:Q,disabled:S.length===0,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm border border-[#
811E0E0E0] bg-white text-[hsl(var(--konfig-ink))] hover:border-[hsl(var(--konfig-primary))] hover:text-[hsl(var(--konfig-primary))] disabled:opacity-40 disabled:cursor-not-allowed transition",title:"Alle Blöcke löschen",children:[c.jsx(b1,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Reset"})]}),c.jsxs("div",{className:"ml-auto text-sm text-[hsl(var(--konfig-ink))]",children:[c.jsx("span",{className:"font-bold",children:Y})," ",h,c.jsx("span",{className:"text-[#6B7280]",children:" · "}),c.jsx("span",{className:"font-bold",children:z})," ",p,c.jsxs("span",{className:"text-[#6B7280]",children:[" · Gesamt ",u]})]})]}),(f==="line"||f==="rect")&&c.jsx("div",{className:"text-xs text-[#6B7280] bg-[#F5F5F5] rounded px-3 py-2",children:x?`Startpunkt gesetzt (Reihe ${x.r+1}, Spalte ${x.c+1}). Klicken Sie auf den Endpunkt.`:`Klicken Sie auf den Startpunkt für ${f==="line"?"die Linie":"das Rechteck"}.`}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-xs text-[#6B7280] mr-1",children:"Vorlagen:"}),c.jsx("button",{type:"button",onClick:()=>ee("Mittlere Reihe"),className:"text-xs px-2.5 py-1 rounded-full bg-[#FBE4EB] text-[hsl(var(--konfig-primary))] hover:bg-[#F8D0E5] transition",children:"Mittlere Reihe"}),c.jsx("button",{type:"button",onClick:()=>ee("Mittlere Spalte"),className:"text-xs px-2.5 py-1 rounded-full bg-[#FBE4EB] text-[hsl(var(--konfig-primary))] hover:bg-[#F8D0E5] transition",children:"Mittlere Spalte"}),c.jsx("button",{type:"button",onClick:()=>ee("Kreuz"),className:"text-xs px-2.5 py-1 rounded-full bg-[#FBE4EB] text-[hsl(var(--konfig-primary))] hover:bg-[#F8D0E5] transition",children:"Kreuz"}),c.jsx("button",{type:"button",onClick:()=>ee("Ecken"),className:"text-xs px-2.5 py-1 rounded-full bg-[#FBE4EB] text-[hsl(var(--konfig-primary))] hover:bg-[#F8D0E5] transition",children:"Ecken"})]}),S.length>0&&c.jsx(yDe,{blocks:S,editingId:k,rows:l,cols:o,total:u,onToggleVisible:je=>{var We;return Ee(je,{visible:!((We=S.find(xt=>xt.id===je))!=null&&We.visible)})},onRemove:ae,onEdit:He,onClearAll:Q,onUpdateEcken:re,onCommitBereich:me,onCommitAnzahl:Ge,onCancelEdit:_e}),Ce&&c.jsxs("div",{className:"text-xs text-[hsl(var(--konfig-ink))] bg-[#FFF8E1] border border-[#FFE082] rounded px-3 py-2 leading-relaxed",children:[c.jsx("strong",{children:"Tipp für groÃe Flächen:"})," Nutzen Sie ",c.jsx("strong",{children:"Pinsel"}),", ",c.jsx("strong",{children:"Linie"})," oder ",c.jsx("strong",{children:"Rechteck"}),", um mehrere Platten in einem Zug zu markieren. Besonders empfehlenswert ist die ",c.jsx("strong",{children:"Bereichseingabe"})," unten â dort markieren Sie Zellbereiche gezielt per Zahleneingabe (Reihe/Spalte). Alternativ können Sie auch nur eine ",c.jsxs("strong",{children:["Anzahl an ",h,"-Platten"]})," eintragen: Diese wird in der Mengenberechnung und im Lieferumfang berücksichtigt, jedoch nicht im Raster dargestellt."]}),c.jsx("div",{className:"w-full bg-white border border-[#E0E0E0] rounded-lg p-2 sm:p-3 overflow-auto select-none",children:c.jsx("svg",{tabIndex:-1,focusable:"false",viewBox:`-1 -1 ${te+2} ${se+2}`,preserveAspectRatio:"xMidYMid meet",className:"w-full h-auto max-h-[60vh] touch-none outline-none focus:outline-none",style:{aspectRatio:`${te} / ${se}`,cursor:f==="single"||f==="brush"?"pointer":"crosshair"},onPointerUp:Se,onPointerLeave:()=>{Se(),b(null)},children:Array.from({length:l}).map((je,We)=>Array.from({length:o}).map((xt,et)=>{const Je=`${We}_${et}`,Ze=Z.has(Je),Me=Ne==null?void 0:Ne.has(Je),Xe=Ze?d==="Big"?ck:lk:n==="Big"?ck:lk;return c.jsxs("g",{children:[c.jsx("rect",{x:et*ie,y:We*le,width:ie,height:le,fill:Xe,stroke:"#FFFFFF",strokeWidth:Math.max(.15,Math.min(ie,le)*.04),onPointerDown:ut=>pe(We,et,ut),onPointerEnter:()=>ye(We,et),style:{cursor:"inherit"}}),(Ze&&d==="Big"||!Ze&&n==="Big")&&c.jsxs("g",{pointerEvents:"none",stroke:"#9AA5AD",strokeWidth:Math.min(ie,le)*.04,strokeLinecap:"round",children:[c.jsx("line",{x1:et*ie+ie*.35,y1:We*le+le*.5,x2:et*ie+ie*.65,y2:We*le+le*.5}),c.jsx("line",{x1:et*ie+ie*.5,y1:We*le+le*.35,x2:et*ie+ie*.5,y2:We*le+le*.65})]}),Ze&&c.jsx("rect",{pointerEvents:"none",x:et*ie+.15,y:We*le+.15,width:ie-.3,height:le-.3,fill:"none",stroke:Pj,strokeWidth:Math.max(.25,Math.min(ie,le)*.08)}),Me&&!Ze&&c.jsx("rect",{pointerEvents:"none",x:et*ie,y:We*le,width:ie,height:le,fill:Pj,fillOpacity:.35})]},Je)}))})}),!Ke&&c.jsx(wDe,{rows:l,cols:o,ersatzLabel:h,currentCount:Y,onCommitBereich:me,onCommitAnzahl:Ge}),c.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-[#6B7280]",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block w-4 h-4 rounded",style:{backgroundColor:n==="Big"?ck:lk}}),p," (Grund)"]}
811),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block w-4 h-4 rounded border-2",style:{backgroundColor:d==="Big"?ck:lk,borderColor:Pj}}),h," (Ersatz)"]})]})]})}function yDe({blocks:t,editingId:e,rows:n,cols:r,total:i,onToggleVisible:s,onRemove:a,onEdit:o,onClearAll:l,onUpdateEcken:u,onCommitBereich:d,onCommitAnzahl:h,onCancelEdit:p}){function f(x){if(x.kind==="vorlage"){if(x.name==="Ecken"){const v=x.ecken??4;return v===1?"1 Ecke":`${v} Ecken`}return x.name}return x.kind==="bereich"?`Bereich ${x.index}`:x.kind==="anzahl"?`Anzahl: ${x.anzahl}`:`Freihand ${x.index}${x.sealed?"":" (offen)"}`}function m(x){return x.kind==="bereich"?`R ${x.r1+1}â${x.r2+1}, S ${x.c1+1}â${x.c2+1}`:x.kind==="anzahl"?"ohne feste Position":x.kind==="vorlage"?"Vorlage":x.sealed?"abgeschlossen":"wird erweitert â¦"}return c.jsxs("div",{className:"border border-[#E0E0E0] rounded-lg bg-[#FAFAFA] p-3",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))]",children:["Ihre Auswahl-Blöcke ",c.jsxs("span",{className:"text-[#6B7280] font-normal",children:["(",t.length,")"]})]}),c.jsx("button",{type:"button",onClick:l,className:"text-xs text-[#6B7280] hover:text-[hsl(var(--konfig-primary))] transition",children:"Alle löschen"})]}),c.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 items-start",children:t.map(x=>{const v=e===x.id,g=x.kind==="bereich"||x.kind==="anzahl",b=x.kind==="vorlage"&&x.name==="Ecken",y=v?"w-[320px]":"w-[200px]";return c.jsxs("div",{className:`shrink-0 ${y} rounded-md border bg-white px-3 py-2 transition-all ${v?"border-[hsl(var(--konfig-primary))] ring-2 ring-[#FBE4EB]":"border-[#E0E0E0]"} ${!x.visible&&!v?"opacity-60":""}`,children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:x.color}}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] truncate",children:f(x)}),c.jsx("div",{className:"text-[10px] text-[#6B7280] truncate",children:m(x)})]}),c.jsx("div",{className:"text-[11px] text-[hsl(var(--konfig-ink))] font-bold shrink-0 tabular-nums",children:x.kind==="anzahl"?x.anzahl:x.cells.size})]}),b&&x.kind==="vorlage"&&c.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[c.jsx("span",{className:"text-[10px] text-[#6B7280] mr-1",children:"Anzahl:"}),[1,2,3,4].map(S=>{const A=(x.ecken??4)===S;return c.jsx("button",{type:"button",onClick:()=>u(x.id,S),className:`w-6 h-6 text-[11px] rounded border transition ${A?"bg-[hsl(var(--konfig-ink))] text-white border-[hsl(var(--konfig-ink))]":"bg-white text-[hsl(var(--konfig-ink))] border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,title:S===1?"Oben links":S===2?"Beide oben":S===3?"Beide oben + unten links":"Alle 4 Ecken",children:S},S)})]}),v&&(x.kind==="bereich"||x.kind==="anzahl")&&c.jsx(bDe,{block:x,rows:n,cols:r,total:i,onCommitBereich:d,onCommitAnzahl:h,onCancel:p}),!v&&c.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[c.jsx("button",{type:"button",onClick:()=>s(x.id),className:"p-1 rounded hover:bg-[#F5F5F5] text-[#6B7280] hover:text-[hsl(var(--konfig-ink))] transition",title:x.visible?"Block ausblenden":"Block einblenden",children:x.visible?c.jsx(Vo,{className:"w-3.5 h-3.5"}):c.jsx(mJ,{className:"w-3.5 h-3.5"})}),g&&c.jsx("button",{type:"button",onClick:()=>o(x.id),className:"p-1 rounded hover:bg-[#F5F5F5] text-[#6B7280] hover:text-[hsl(var(--konfig-ink))] transition",title:"Block bearbeiten",children:c.jsx(v5,{className:"w-3.5 h-3.5"})}),c.jsx("div",{className:"ml-auto"}),c.jsx("button",{type:"button",onClick:()=>a(x.id),className:"p-1 rounded hover:bg-[#FBE4EB] text-[#6B7280] hover:text-[hsl(var(--konfig-primary))] transition",title:"Block löschen",children:c.jsx(Bc,{className:"w-3.5 h-3.5"})})]})]},x.id)})})]})}function bDe({block:t,rows:e,cols:n,total:r,onCommitBereich:i,onCommitAnzahl:s,onCancel:a}){const o=t.kind==="bereich",l=t.kind==="anzahl",[u,d]=E.useState(o?String(t.r1+1):""),[h,p]=E.useState(o?String(t.r2+1):""),[f,m]=E.useState(o?String(t.c1+1):""),[x,v]=E.useState(o?String(t.c2+1):""),[g,b]=E.useState(l?String(t.anzahl):"");function y(){const A=Math.max(1,Math.min(e,Number(u)||1))-1,k=Math.max(1,Math.min(n,Number(f)||1))-1,M=Math.max(1,Math.min(e,Number(h)||1))-1,T=Math.max(1,Math.min(n,Number(x)||1))-1;i(A,M,k,T,t.id)}function S(){const A=Math.max(0,Math.min(r,Number(g)||0));s(A,t.id)}return c.jsxs("div",{className:"mt-2 pt-2 border-t border-[#FBE4EB] space-y-2",children:[l&&c.jsxs("label",{className:"block text-[10px] text-[#6B7280]",children:["Anzahl Platten",c.jsx("input",{type:"number",min:0,max:r,value:g,onChange:A=>b(A.target.value),className:"mt-1 w-full px-2 py-1 border border-[#
811E0E0E0] rounded text-xs",autoFocus:!0})]}),o&&c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("label",{className:"text-[10px] text-[#6B7280]",children:["Reihe von",c.jsx("input",{type:"number",min:1,max:e,value:u,onChange:A=>d(A.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded text-xs"})]}),c.jsxs("label",{className:"text-[10px] text-[#6B7280]",children:["bis",c.jsx("input",{type:"number",min:1,max:e,value:h,onChange:A=>p(A.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded text-xs"})]}),c.jsxs("label",{className:"text-[10px] text-[#6B7280]",children:["Spalte von",c.jsx("input",{type:"number",min:1,max:n,value:f,onChange:A=>m(A.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded text-xs"})]}),c.jsxs("label",{className:"text-[10px] text-[#6B7280]",children:["bis",c.jsx("input",{type:"number",min:1,max:n,value:x,onChange:A=>v(A.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded text-xs"})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",onClick:l?S:y,className:"flex-1 px-2 py-1 bg-[hsl(var(--konfig-ink))] text-white rounded text-xs font-medium hover:bg-[#0F2530] transition",children:"Speichern"}),c.jsx("button",{type:"button",onClick:a,className:"flex-1 px-2 py-1 bg-white border border-[#E0E0E0] text-[hsl(var(--konfig-ink))] rounded text-xs hover:border-[hsl(var(--konfig-primary))] transition",children:"Abbrechen"})]}),o&&c.jsxs("div",{className:"text-[10px] text-[#6B7280]",children:["Raster: ",e," à ",n]})]})}function wDe({rows:t,cols:e,ersatzLabel:n,currentCount:r,onCommitBereich:i,onCommitAnzahl:s}){const[a,o]=E.useState(""),[l,u]=E.useState(""),[d,h]=E.useState(""),[p,f]=E.useState(""),[m,x]=E.useState(""),v=t*e;if(v<100)return null;function g(){const y=Math.max(1,Math.min(t,Number(a)||1))-1,S=Math.max(1,Math.min(e,Number(d)||1))-1,A=Math.max(1,Math.min(t,Number(l)||1))-1,k=Math.max(1,Math.min(e,Number(p)||1))-1;i(y,A,S,k),o(""),u(""),h(""),f("")}function b(){const y=Math.max(0,Math.min(v,Number(m)||0));s(y),x("")}return c.jsxs("details",{className:"bg-[#F5F5F5] rounded p-3 text-sm",open:!0,children:[c.jsx("summary",{className:"cursor-pointer font-medium text-[hsl(var(--konfig-ink))]",children:"Bereich oder Anzahl per Eingabe markieren"}),c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:["Anzahl ",n,"-Platten festlegen (neuer Block)"]}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 items-end",children:[c.jsxs("label",{className:"text-xs text-[#6B7280] sm:col-span-2",children:["Anzahl",c.jsx("input",{type:"number",min:0,max:v,value:m,onChange:y=>x(y.target.value),placeholder:`0 â ${v}`,className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded"})]}),c.jsx("button",{type:"button",onClick:b,className:"px-3 py-1.5 bg-[hsl(var(--konfig-ink))] text-white rounded text-xs font-medium hover:bg-[#0F2530] transition",children:"Als Block hinzufügen"})]}),c.jsxs("div",{className:"text-xs text-[#6B7280] mt-2",children:["Die Platten werden gleichmäÃig im Raster verteilt. Aktuell sichtbar: ",c.jsx("strong",{children:r})," von ",v,"."]})]}),c.jsx("div",{className:"border-t border-[#E0E0E0] my-4"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Bereich gezielt markieren (neuer Block)"}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-2 items-end",children:[c.jsxs("label",{className:"text-xs text-[#6B7280]",children:["Reihe von",c.jsx("input",{type:"number",min:1,max:t,value:a,onChange:y=>o(y.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded"})]}),c.jsxs("label",{className:"text-xs text-[#6B7280]",children:["bis",c.jsx("input",{type:"number",min:1,max:t,value:l,onChange:y=>u(y.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded"})]}),c.jsxs("label",{className:"text-xs text-[#6B7280]",children:["Spalte von",c.jsx("input",{type:"number",min:1,max:e,value:d,onChange:y=>h(y.target.value),className:"mt-1 w-full px-2 py-1 border border-[#
811E0E0E0] rounded"})]}),c.jsxs("label",{className:"text-xs text-[#6B7280]",children:["bis",c.jsx("input",{type:"number",min:1,max:e,value:p,onChange:y=>f(y.target.value),className:"mt-1 w-full px-2 py-1 border border-[#E0E0E0] rounded"})]}),c.jsx("button",{type:"button",onClick:g,className:"px-3 py-1 bg-[hsl(var(--konfig-ink))] text-white rounded text-xs hover:bg-[#0F2530] transition",children:"Als Block"})]}),c.jsxs("div",{className:"text-xs text-[#6B7280] mt-2",children:["Raster: ",t," Reihen à ",e," Spalten"]})]})]})}const sN="boden-videos";async function _De(t){const{data:e,error:n}=await Ot.from("boden_videos").select("url").eq("schluessel",t).maybeSingle();return n||!e?null:e.url}async function SDe(){const{data:t,error:e}=await Ot.from("boden_videos").select("schluessel, url, storage_path, updated_at");return e?[]:t??[]}async function ADe(t,e){var u;const n=((u=e.name.split(".").pop())==null?void 0:u.toLowerCase())||"mp4",r=`${t}/${t}-${Date.now()}.${n}`,{error:i}=await Ot.storage.from(sN).upload(r,e,{upsert:!0,contentType:e.type||"video/mp4"});if(i)throw i;const{data:s}=Ot.storage.from(sN).getPublicUrl(r),a=s.publicUrl,{data:o}=await Ot.from("boden_videos").select("storage_path").eq("schluessel",t).maybeSingle(),{error:l}=await Ot.from("boden_videos").upsert({schluessel:t,url:a,storage_path:r},{onConflict:"schluessel"});if(l)throw l;return o!=null&&o.storage_path&&o.storage_path!==r&&await Ot.storage.from(sN).remove([o.storage_path]),a}async function EDe(t){const{data:e}=await Ot.from("boden_videos").select("storage_path").eq("schluessel",t).maybeSingle();e!=null&&e.storage_path&&await Ot.storage.from(sN).remove([e.storage_path]),await Ot.from("boden_videos").delete().eq("schluessel",t)}function _z({url:t,alt:e,caption:n,onClose:r}){return E.useEffect(()=>{function i(a){a.key==="Escape"&&r()}document.addEventListener("keydown",i);const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=s}},[r]),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":e,onClick:r,className:"fixed inset-0 z-[100] bg-black/80 backdrop-blur-sm flex flex-col items-center justify-center p-4 sm:p-8 cursor-zoom-out",children:[c.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),r()},"aria-label":"SchlieÃen",className:"absolute top-4 right-4 text-white/90 hover:text-white bg-white/10 hover:bg-white/20 rounded-full p-2 transition",children:c.jsx(Bc,{className:"w-6 h-6"})}),c.jsx("img",{src:t,alt:e,onClick:i=>i.stopPropagation(),className:"max-w-full max-h-[85vh] object-contain rounded-md shadow-2xl cursor-default"}),n&&c.jsx("div",{className:"mt-3 text-white/90 text-sm text-center max-w-2xl",children:n})]})}function kDe({url:t,alt:e,onOpen:n}){const[r,i]=E.useState(!1);return r?c.jsxs("div",{className:"aspect-square w-full bg-white border border-[#E0E0E0] rounded-md flex flex-col items-center justify-center gap-1 text-[#9CA3AF] text-xs",children:[c.jsx(v1,{className:"w-6 h-6"}),c.jsx("span",{className:"px-2 text-center leading-tight",children:"Bild folgt"})]}):c.jsxs("button",{type:"button",onClick:n,"aria-label":`${e} â vergröÃern`,className:"group relative aspect-square w-full bg-white border border-[#E0E0E0] rounded-md overflow-hidden flex items-center justify-center p-2 transition hover:border-[hsl(var(--konfig-ink))] hover:shadow-md cursor-zoom-in",children:[c.jsx("img",{src:t,alt:e,className:"max-w-full max-h-full object-contain transition group-hover:scale-[1.03]",onError:()=>i(!0)}),c.jsx("span",{className:"absolute bottom-1.5 right-1.5 bg-white/90 text-[hsl(var(--konfig-ink))] rounded-full p-1 shadow opacity-0 group-hover:opacity-100 transition",children:c.jsx(_J,{className:"w-3.5 h-3.5"})})]})}function CDe(){const[t,e]=E.useState("checking"),[n,r]=E.useState(null),[i,s]=E.useState(1),a=E.useRef(null);E.useEffect(()=>{let l=!0;return _De("klickverbinder").then(u=>{l&&(u?(r(u),e("ok")):e("missing"))}).catch(()=>{l&&e("missing")}),()=>{l=!1}},[]);function o(){const l=a.current;l&&l.videoWidth>0&&l.videoHeight>0&&s(l.videoWidth/l.videoHeight)}return t==="checking"?c.jsx("div",{className:"aspect-square w-full bg-[#F5F5F5] border border-[#
811E0E0E0] rounded-md animate-pulse"}):t==="missing"||!n?c.jsxs("div",{className:"aspect-square w-full bg-[#F5F5F5] border border-dashed border-[#CBD5D8] rounded-md flex flex-col items-center justify-center gap-2 text-[#6B7280] text-xs px-3 text-center",children:[c.jsx(qfe,{className:"w-8 h-8 text-[#9CA3AF]"}),c.jsx("span",{className:"font-medium text-[hsl(var(--konfig-ink))]",children:"Video folgt in Kürze"}),c.jsx("span",{className:"leading-tight",children:"Hier wird die Klickverbindung in Aktion gezeigt."})]}):c.jsx("div",{className:"w-full bg-black border border-[#E0E0E0] rounded-md overflow-hidden flex items-center justify-center",style:{aspectRatio:`${i}`},children:c.jsx("video",{ref:a,src:n,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0,preload:"metadata",onLoadedMetadata:o,className:"w-full h-full object-contain"})})}function NDe(){const t=V4e(),[e,n]=E.useState(!1);return c.jsxs("section",{"aria-label":"So werden die Bodenplatten verbunden",className:"rounded-lg border border-[#E0E0E0] bg-[#F8FAFA] p-4 sm:p-5",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx(pa,{className:"w-5 h-5 text-[hsl(var(--konfig-ink))]"}),c.jsx("h3",{className:"font-semibold text-[hsl(var(--konfig-ink))]",children:"So werden die Bodenplatten verbunden"})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[140px_minmax(0,1fr)] gap-4 lg:gap-5 items-start",children:[c.jsx("div",{children:c.jsx(kDe,{url:t,alt:"Klickverbinder â Detailansicht",onOpen:()=>n(!0)})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(CDe,{}),c.jsxs("p",{className:"text-sm text-[hsl(var(--konfig-ink))] leading-relaxed",children:["Die Bodenplatten, unabhängig von der ausgewählten Variante, werden zwischen allen inneren Plattenverbindungen mit ",c.jsx("strong",{children:"Klickverbindern"})," ","aneinander befestigt. So wird eine genaue Einhaltung der Bodenfläche gewährleistet. Durch leichtes Anheben einer Platte löst sich die Klickverbindung erneut. So lassen sich die Platten mühelos und schnell auf- und wieder abbauen."," ","Die Anzahl der benötigten Verbinder berechnet sich automatisch und wird im Lieferumfang aufgeführt. Ein Aufbau ohne Verwendung der Verbinder ist nicht möglich. Die Verpackungseinheit beträgt ",c.jsx("strong",{children:"25 Stück"}),"."]})]})]}),e&&c.jsx(_z,{url:t,alt:"Klickverbinder â Detailansicht",caption:"Klickverbinder â Detailansicht",onClose:()=>n(!1)})]})}const TDe=[{value:"Basic",titel:"Basic",desc:"Standard-Bodenplatte mit Kabeldurchführungen, Tragfähigkeit 3.600 kg/m²."},{value:"Big",titel:"Big Cable",desc:"Bodenplatte mit groÃen Kabelauslässen für dickere Kabel, Tragfähigkeit 3.600 kg/m²."}];function MDe({typ:t}){const[e,n]=E.useState(!1);return e?c.jsx("div",{className:"aspect-[4/3] bg-white rounded mb-3 flex items-center justify-center text-[#6B7280] text-sm",children:"Bild folgt"}):c.jsx("div",{className:"aspect-[4/3] bg-white rounded mb-3 overflow-hidden flex items-center justify-center p-2",children:c.jsx("img",{src:U4e(t),alt:t,className:"max-w-full max-h-full object-contain",onError:()=>n(!0)})})}function RDe({config:t,onChange:e}){const[n,r]=E.useState(!1),i=t.bodenplatteTyp?t.bodenplatteTyp==="Basic"?"Big":"Basic":null,s=i==="Big"?"Big Cable":"Basic",a=t.bodenplatteTyp==="Big"?"Big Cable":"Basic";return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Wählen Sie Ihre Bodenplatte"}),c.jsx("p",{className:"text-[#6B7280]",children:"Beide Varianten sind in Schwarz und ermöglichen die Kabeldurchführung. Sie können später einzelne Platten der jeweils anderen Variante einsetzen."})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:TDe.map(o=>{const l=t.bodenplatteTyp===o.value;return c.jsxs("button",{type:"button",onClick:()=>e({bodenplatteTyp:o.value}),className:`text-left rounded-lg border-2 p-4 transition ${l?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx(MDe,{typ:o.value}),c.jsx("div",{className:"text-lg font-bold text-[hsl(var(--konfig-ink))]",children:o.titel}),c.jsx("div",{className:"text-sm text-[#6B7280] mt-1",children:o.desc})]},o.value)})}),t.bodenplatteTyp&&i&&c.jsxs("div",{className:"border border-[#
811E0E0E0] rounded-lg overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"w-full flex items-center justify-between gap-3 px-4 py-3 bg-[#F5F5F5] hover:bg-[#EFEFEF] transition text-left",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx(Wfe,{className:"w-5 h-5 text-[hsl(var(--konfig-primary))] shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"font-medium text-[hsl(var(--konfig-ink))]",children:["Einzelne ",s,"-Platten platzieren ",c.jsx("span",{className:"text-[#6B7280] font-normal",children:"(optional, z. B. als Kabelweg)"})]}),(()=>{const o=t.ersatzPlatten.length+Math.max(0,Math.round(t.ersatzAnzahlOhnePosition??0));return o>0?c.jsxs("div",{className:"text-xs text-[hsl(var(--konfig-primary))] mt-0.5",children:[o," ",s,"-Platte",o===1?"":"n"," ausgewählt"]}):null})()]})]}),n?c.jsx(g1,{className:"w-5 h-5 text-[#6B7280] shrink-0"}):c.jsx(Su,{className:"w-5 h-5 text-[#6B7280] shrink-0"})]}),n&&c.jsxs("div",{className:"p-4 space-y-4 bg-white",children:[c.jsxs("div",{className:"text-sm text-[hsl(var(--konfig-ink))] bg-[#FFF8E1] border border-[#FFE082] rounded px-3 py-2 leading-relaxed",children:[c.jsx("strong",{children:"Wichtig:"})," Kabel können sich nur unter ",c.jsx("strong",{children:"Big Cable"}),"-Platten kreuzen oder übereinander laufen. Setzen Sie Big Cable-Platten gezielt entlang Ihres geplanten Kabelwegs oder an Schnittstellen ein, an denen mehrere Kabel zusammentreffen."]}),c.jsx(vDe,{breite:t.breite,laenge:t.laenge,grundTyp:t.bodenplatteTyp,ersatz:t.ersatzPlatten,onChange:o=>e({ersatzPlatten:o}),anzahlOhnePosition:t.ersatzAnzahlOhnePosition??0,onAnzahlOhnePositionChange:o=>e({ersatzAnzahlOhnePosition:o})}),c.jsxs("div",{className:"text-xs text-[#6B7280] border-t border-[#E0E0E0] pt-3",children:["Die Gesamtanzahl der Platten bleibt gleich (",t.breite*t.laenge*4," Stück). Pro markierter Platte wird eine ",a,"-Platte durch eine ",s,"-Platte ersetzt."]})]})]}),c.jsx(NDe,{})]})}function YV({d:t,selected:e,onClick:n}){const[r,i]=E.useState(!1);return c.jsxs("button",{type:"button",onClick:n,className:`rounded-lg border-2 overflow-hidden transition hover:scale-[1.02] ${e?"border-[hsl(var(--konfig-primary))]":"border-[#E0E0E0]"}`,children:[c.jsx("div",{className:"aspect-square relative",style:{background:t.farbe},children:!r&&c.jsx("img",{src:xd(t.schluessel),alt:t.bezeichnung,className:"absolute inset-0 w-full h-full object-cover",onError:()=>i(!0)})}),c.jsx("div",{className:"p-2 text-xs text-[hsl(var(--konfig-ink))] text-center bg-white",children:t.bezeichnung})]})}function jDe({value:t,onChange:e}){const n=new Set(["transparent"]),r=!!t&&fb.includes(t)&&!n.has(t),[i,s]=E.useState(!!t&&!r&&!n.has(t)),a=fb.filter(u=>!n.has(u)).map(u=>qm.find(d=>d.schluessel===u)).filter(u=>!!u),o=qm.filter(u=>!fb.includes(u.schluessel)&&!n.has(u.schluessel)),l=Array.from(new Set(o.map(u=>u.kategorie)));return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Beliebte Designs"}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:a.map(u=>c.jsx(YV,{d:u,selected:t===u.schluessel,onClick:()=>e(u.schluessel)},u.schluessel))})]}),c.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:"inline-flex items-center gap-1 text-sm font-medium text-[hsl(var(--konfig-ink))] hover:text-[hsl(var(--konfig-primary))] transition",children:[i?c.jsx(g1,{className:"w-4 h-4"}):c.jsx(Su,{className:"w-4 h-4"}),i?"Weitere Designs ausblenden":"Weitere Designs anzeigen"]}),i&&c.jsx("div",{className:"space-y-6 pt-1",children:l.map(u=>c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:u}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:o.filter(d=>d.kategorie===u).map(d=>c.jsx(YV,{d,selected:t===d.schluessel,onClick:()=>e(d.schluessel)},d.schluessel))})]},u))})]})}const uk=["hsl(var(--konfig-primary))","hsl(var(--konfig-ink))","#78AD48","#F59E0B","#3B82F6","#8B5CF6"];function JV(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`b_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function xp(t,e){return`${t}_${e}`}function PDe(t){const[e,n]=t.split("_").map(Number);return[e,n]}function Lj(t){if(!t)return!1;const e=t.replace("#","").trim();if(e.length!==6)return!1;const n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return[n,r,i].some(a=>Number.isNaN(a))?!1:(.2126*n+.7152*r+.0722*i)/255>=.85}function ZV({schluessel:t,selected:e,onClick:n}){const[r,i]=E.useState(!1),s=Ho(t);return s?c.jsxs("button",{type:"button",onClick:n,className:`rounded-md border-2 overflow-hidden transition hover:scale-[1.03] text-left bg-white ${e?"border-[hsl(var(--konfig-primary))] shadow":"border-[#
811E0E0E0]"}`,children:[c.jsx("div",{className:"aspect-square relative",style:{background:s.farbe},children:!r&&c.jsx("img",{src:xd(t),alt:s.bezeichnung,className:"absolute inset-0 w-full h-full object-cover",onError:()=>i(!0)})}),c.jsx("div",{className:"px-1.5 py-1 text-[11px] leading-tight text-center text-[hsl(var(--konfig-ink))] truncate",children:s.bezeichnung})]}):null}function LDe({selected:t,onSelect:e}){const n=Ho("transparent"),[r,i]=E.useState(0),s=r===0?H4e():r===1?xd("transparent"):"";return c.jsx("div",{className:`rounded-lg border-2 overflow-hidden bg-gradient-to-r from-[hsl(var(--konfig-primary-soft))] to-white transition ${t?"border-[hsl(var(--konfig-primary))] shadow":"border-[hsl(var(--konfig-primary))]/40"}`,children:c.jsxs("div",{className:"flex flex-col md:flex-row gap-4 p-4",children:[c.jsxs("button",{type:"button",onClick:e,"aria-label":"Transparent (50Ã50) auswählen",className:`shrink-0 rounded-md border-2 overflow-hidden transition hover:scale-[1.01] text-left bg-white w-full md:w-[260px] lg:w-[300px] ${t?"border-[hsl(var(--konfig-primary))]":"border-[#E0E0E0]"}`,children:[c.jsx("div",{className:"relative w-full",style:{background:(n==null?void 0:n.farbe)??"#F5F5F5"},children:s?c.jsx("img",{src:s,alt:"Transparent â Inspiration: Logo unter transparentem Cover",className:"block w-full h-auto",onError:()=>i(a=>a<2?a+1:2)}):c.jsx("div",{className:"aspect-square"})}),c.jsx("div",{className:"px-2 py-1.5 text-xs leading-tight text-center text-[hsl(var(--konfig-ink))] truncate",children:"Transparent (50Ã50)"})]}),c.jsxs("div",{className:"flex-1 min-w-0 text-sm text-[hsl(var(--konfig-ink))] leading-relaxed",children:[c.jsx("div",{className:"font-semibold text-[hsl(var(--konfig-primary))] mb-1.5",children:"Inspiration: Transparentes Cover für Logos & Grafiken"}),c.jsx("p",{children:"Legen Sie ein bedrucktes 50Ã50 cm Papier (z. B. Ihr Logo, ein Muster oder ein Foto) auf die Bodenplatte und decken es mit einem transparenten Cover ab. So lassen sich individuelle Akzente unsichtbar geschützt in den Boden einarbeiten â ideal an den Ecken oder an markanten Punkten Ihres Standes."})]})]})})}function IDe({value:t,onChange:e}){const n="transparent",r=fb.filter(u=>u!==n),i=r.includes(t),[s,a]=E.useState(!i&&t!==n),o=qm.filter(u=>!fb.includes(u.schluessel)&&u.schluessel!==n),l=Array.from(new Set(o.map(u=>u.kategorie)));return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] mb-1.5",children:"Beliebte Designs"}),c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-2",children:r.map(u=>c.jsx(ZV,{schluessel:u,selected:t===u,onClick:()=>e(u)},u))})]}),c.jsx(LDe,{selected:t===n,onSelect:()=>e(n)}),c.jsxs("button",{type:"button",onClick:()=>a(u=>!u),className:"inline-flex items-center gap-1 text-xs font-medium text-[hsl(var(--konfig-ink))] hover:text-[hsl(var(--konfig-primary))] transition",children:[s?c.jsx(g1,{className:"w-3.5 h-3.5"}):c.jsx(Su,{className:"w-3.5 h-3.5"}),s?"Weitere Designs ausblenden":"Weitere Designs anzeigen"]}),s&&c.jsx("div",{className:"space-y-3 pt-1",children:l.map(u=>c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] mb-1.5",children:u}),c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-2",children:o.filter(d=>d.kategorie===u).map(d=>c.jsx(ZV,{schluessel:d.schluessel,selected:t===d.schluessel,onClick:()=>e(d.schluessel)},d.schluessel))})]},u))})]})}function DDe({breite:t,laenge:e,basisDesign:n,bereiche:r,onChange:i}){var xe,Ee;const s=Math.max(1,Math.round(t*2)),a=Math.max(1,Math.round(e*2)),[o,l]=E.useState([]),u=E.useRef(!1);E.useEffect(()=>{if(u.current)return;u.current=!0;const ae=(r??[]).map((Q,we)=>{const Ae=new Set;for(const K of Q.platten)K.r>=0&&K.r<a&&K.c>=0&&K.c<s&&Ae.add(xp(K.r,K.c));return{id:Q.id||JV(),designSchluessel:Q.designSchluessel,cells:Ae,visible:!0,color:uk[we%uk.length],index:we+1}});ae.length>0&&l(ae)},[]),E.useEffect(()=>{const ae=o.filter(Q=>Q.cells.size>0).map(Q=>({id:Q.id,designSchluessel:Q.designSchluessel,platten:Array.from(Q.cells).map(we=>{const[Ae,K]=PDe(we);return{r:Ae,c:K}})}));JSON.stringify(ae)!==JSON.stringify(r??[])&&i(ae)},[o]);const[d,h]=E.useState(null),[p,f]=E.useState("single"),[m,x]=E.useState(null),[v,g]=E.useState(null),[b,y]=E.useState({r1:"",r2:"",c1:"",c2:""}),S=E.useRef(null),A=o.find(ae=>ae.id===d)??null;E.useEffect(()=>{x(null)},[p,d]);const k=E.useMemo(()=>{const ae=new Map;for(const Q of o)if(Q.visible)for(const we of Q.cells)ae.set(we,Q.designSchluessel);return ae},[o]);function M(){var Ae;const ae=fb.find(K=>K!==n)??((Ae=qm.find(K=>K.schluessel!==n))==null?void 0:Ae.schluessel)??qm[0].schluessel,Q=o.length+1,we={id:JV(),designSchluessel:ae,cells:new Set,visible:!0,color:uk[(Q-1)%uk.length],index:Q};l(K=>[...K,we]),h(we.id),f("brush"),y({r1:"",r2:"",c1:"",c2:""})}function T(ae,Q){l(we=>we.map(Ae=>Ae.id===ae?{...Ae,...Q}:Ae))}function C(ae){l(Q=>Q.filter(we=>we.id!==ae)),d===ae&&h(null)}function R(ae,Q){A&&l(we=>we.map(Ae=>{if(Ae.id===A.id){const K=new Set(Ae.cells);if(Q==="add")for(const pe of ae)K.add(pe);else for(const pe of ae)K.delete(pe);return{...Ae,cells:K}}if(Q==="add"){if(Ae.cells.size===0)return Ae;const K=new Set(Ae.cells);let pe=!1;for(const ye of ae)K.delete(ye)&&(pe=!0);return pe?{...Ae,cells:K}:Ae}return Ae}))}function P(ae,Q){const we=Math.min(ae.r,Q.r),Ae=Math.max(ae.r,Q.r),K=Math.min(ae.c,Q.c),pe=Math.max(ae.c,Q.c),ye=[];for(let Se=we;Se<=Ae;Se++)for(let ee=K;ee<=pe;ee++)ye.push(xp(Se,ee));return ye}function j(ae,Q){const we=Math.abs(ae.r-Q.r),Ae=Math.abs(ae.c-Q.c),K=[];if(Ae>=we){const pe=Math.min(ae.c,Q.c),ye=Math.max(ae.c,Q.c);for(let Se=pe;Se<=ye;Se++)K.push(xp(ae.r,Se))}else{const pe=Math.min(ae.r,Q.r),ye=Math.max(ae.r,Q.r);for(let Se=pe;Se<=ye;Se++)K.push(xp(Se,ae.c))}return K}function G(ae,Q,we){if(A){if(we.preventDefault(),p==="single"){const Ae=xp(ae,Q),K=A.cells.has(Ae);R([Ae],K?"remove":"add")}else if(p==="brush"){const Ae=xp(ae,Q),K=A.cells.has(Ae);S.current=K?"remove":"add",R([Ae],S.current)}else if(p==="line"||p==="rect")if(!m)x({r:ae,c:Q});else{const Ae=p==="line"?j(m,{r:ae,c:Q}):P(m,{r:ae,c:Q});R(Ae,"add"),x(null)}}}function B(ae,Q){g({r:ae,c:Q}),!(p!=="brush"||!A||!S.current)&&R([xp(ae,Q)],S.current)}function $(){S.current=null}const[U,Z]=E.useState(null);function V(){if(!A){Z("Bitte zuerst einen Bereich zum Bearbeiten auswählen.");return}const ae=parseInt(b.r1||"",10),Q=parseInt(b.r2||"",10),we=parseInt(b.c1||"",10),Ae=parseInt(b.c2||"",10);if([ae,Q,we,Ae].some(K=>Number.isNaN(K))){Z("Bitte alle vier Felder (R1, R2, S1, S2) ausfüllen.");return}if(ae<1||Q<1||we<1||Ae<1){Z("Werte müssen mindestens 1 sein.");return}if(ae>a||Q>a){Z(`Reihe darf höchstens ${a} sein (aktuelle GröÃe).`);return}if(we>s||Ae>s){Z(`Spalte darf höchstens ${s} sein (aktuelle GröÃe).`);return}
811Z(null),R(P({r:ae-1,c:we-1},{r:Q-1,c:Ae-1}),"add")}const W=100,O=t/e,Y=O>=1?W:W*O,z=O>=1?W/O:W,I=Y/s,q=z/a,te=((xe=Ho(n))==null?void 0:xe.farbe)??"#E0E0E0",se=E.useMemo(()=>!A||!m||!v?null:p==="line"?new Set(j(m,v)):p==="rect"?new Set(P(m,v)):null,[A,m,v,p]);function ie(ae){var pe,ye;const Q=ae.id===d,we=((pe=Ho(ae.designSchluessel))==null?void 0:pe.farbe)??"#E0E0E0",Ae=((ye=Ho(ae.designSchluessel))==null?void 0:ye.bezeichnung)??ae.designSchluessel,K=xd(ae.designSchluessel);return c.jsxs("div",{className:`rounded-lg border-2 p-3 bg-white transition w-[220px] flex flex-col ${Q?"border-[hsl(var(--konfig-primary))] shadow-md":"border-[#E0E0E0]"}`,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("span",{className:"inline-block w-3 h-3 rounded-full shrink-0",style:{backgroundColor:ae.color}}),c.jsxs("span",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))]",children:["Bereich ",ae.index]}),c.jsx("button",{type:"button",onClick:()=>T(ae.id,{visible:!ae.visible}),className:"ml-auto text-[#6B7280] hover:text-[hsl(var(--konfig-ink))]","aria-label":ae.visible?"Ausblenden":"Einblenden",children:ae.visible?c.jsx(Vo,{className:"w-4 h-4"}):c.jsx(mJ,{className:"w-4 h-4"})}),c.jsx("button",{type:"button",onClick:()=>C(ae.id),className:"text-[#6B7280] hover:text-red-600","aria-label":"Löschen",children:c.jsx(yo,{className:"w-4 h-4"})})]}),c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("span",{className:"inline-block w-9 h-9 rounded border border-[#E0E0E0] shrink-0 overflow-hidden bg-cover bg-center",style:{backgroundColor:we,backgroundImage:`url(${K})`},"aria-hidden":!0}),c.jsx("span",{className:"text-sm text-[hsl(var(--konfig-ink))] truncate",title:Ae,children:Ae})]}),c.jsxs("div",{className:"text-xs text-[#6B7280] mb-2",children:[ae.cells.size," Platte",ae.cells.size===1?"":"n"]}),c.jsx("button",{type:"button",onClick:()=>{h(Q?null:ae.id),f("brush"),x(null),y({r1:"",r2:"",c1:"",c2:""})},className:`mt-auto w-full inline-flex items-center justify-center gap-1 text-xs rounded px-2 py-1.5 border transition ${Q?"bg-[hsl(var(--konfig-primary))] text-white border-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))]":"border-[#E0E0E0] text-[hsl(var(--konfig-ink))] hover:bg-[#F8FAFA]"}`,children:Q?c.jsxs(c.Fragment,{children:[c.jsx(ti,{className:"w-3 h-3"})," Fertig"]}):c.jsxs(c.Fragment,{children:[c.jsx(v5,{className:"w-3 h-3"})," Bearbeiten"]})})]},ae.id)}const le=({id:ae,icon:Q,label:we})=>c.jsxs("button",{type:"button",onClick:()=>f(ae),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm border transition ${p===ae?"bg-[hsl(var(--konfig-ink))] text-white border-[hsl(var(--konfig-ink))]":"bg-white text-[hsl(var(--konfig-ink))] border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,title:we,children:[c.jsx(Q,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:we})]});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap gap-3",children:[o.map(ie),c.jsxs("button",{type:"button",onClick:M,className:"rounded-lg border-2 border-dashed border-[#E0E0E0] p-3 text-sm text-[hsl(var(--konfig-ink))] hover:border-[hsl(var(--konfig-ink))] inline-flex items-center justify-center gap-2 w-[220px] min-h-[140px]",children:[c.jsx(ph,{className:"w-4 h-4"})," Akzentbereich hinzufügen"]})]}),A&&c.jsxs("div",{className:"rounded-lg border-2 border-[hsl(var(--konfig-primary))] bg-white p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:A.color}}),c.jsxs("h3",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))]",children:["Bereich ",A.index," bearbeiten"]}),c.jsxs("button",{type:"button",onClick:()=>{h(null),x(null)},className:"ml-auto inline-flex items-center gap-1 text-xs rounded px-2.5 py-1.5 border border-[#E0E0E0] text-[hsl(var(--konfig-ink))] hover:bg-[#F8FAFA]",children:[c.jsx(Bc,{className:"w-3.5 h-3.5"})," Editor schlieÃen"]})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Design für diesen Bereich"}),c.jsx(IDe,{value:A.designSchluessel,onChange:ae=>T(A.id,{designSchluessel:ae})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))]",children:"Werkzeuge"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(le,{id:"single",icon:x5,label:"Einzeln"}),c.jsx(le,{id:"brush",icon:hJ,label:"Pinsel"}),c.jsx(le,{id:"line",icon:y1,label:"Linie"}),c.jsx(le,{id:"rect",icon:wJ,label:"Rechteck"})]}),(p==="line"||p==="rect")&&c.jsx("div",{className:"text-xs text-[#6B7280] bg-[#F5F5F5] rounded px-3 py-2",children:m?`Startpunkt gesetzt (Reihe ${m.r+1}, Spalte ${m.c+1}). Klicken Sie auf den Endpunkt.`:`Klicken Sie auf den Startpunkt für ${p==="line"?"die Linie":"das Rechteck"}.`}),p==="brush"&&c.jsx("div",{className:"text-xs text-[#6B7280] bg-[#F5F5F5] rounded px-3 py-2",children:"Pinsel: Klicken und ziehen Sie zum Markieren. Bereits markierte Platten werden beim erneuten Klicken entfernt."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))]",children:"Bereichseingabe (Reihe/Spalte, 1-basiert)"}),c.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[c.jsxs("div",{className:"grid grid-cols-4 gap-2 max-w-md",children:[c.jsx("input",{type:"number",min:1,max:a,placeholder:"R1",value:b.r1,onChange:ae=>{y({...b,r1:ae.target.value}),Z(null)}
811,className:"text-sm border border-[#E0E0E0] rounded px-2 py-1.5 w-full"}),c.jsx("input",{type:"number",min:1,max:a,placeholder:"R2",value:b.r2,onChange:ae=>{y({...b,r2:ae.target.value}),Z(null)},className:"text-sm border border-[#E0E0E0] rounded px-2 py-1.5 w-full"}),c.jsx("input",{type:"number",min:1,max:s,placeholder:"S1",value:b.c1,onChange:ae=>{y({...b,c1:ae.target.value}),Z(null)},className:"text-sm border border-[#E0E0E0] rounded px-2 py-1.5 w-full"}),c.jsx("input",{type:"number",min:1,max:s,placeholder:"S2",value:b.c2,onChange:ae=>{y({...b,c2:ae.target.value}),Z(null)},className:"text-sm border border-[#E0E0E0] rounded px-2 py-1.5 w-full"})]}),c.jsx("button",{type:"button",onClick:V,className:"text-sm rounded px-3 py-1.5 bg-[#78AD48] text-white hover:bg-[#6a9d3f]",children:"Bereich übernehmen"})]}),c.jsxs("div",{className:"text-[11px] text-[#6B7280]",children:["Gültiger Bereich: Reihen 1â",a,", Spalten 1â",s]}),U&&c.jsx("div",{className:"text-xs text-[#B91C1C] bg-[#FEE2E2] border border-[#FCA5A5] rounded px-3 py-1.5",children:U})]}),c.jsx("div",{className:"text-xs text-[hsl(var(--konfig-ink))] bg-[#FFF8E1] border border-[#FFE082] rounded px-3 py-2",children:"Eine Platte kann nur einem Bereich angehören â beim Hinzufügen wird sie automatisch aus anderen Bereichen entfernt."}),A.designSchluessel==="transparent"&&c.jsxs("div",{className:"text-xs text-[hsl(var(--konfig-ink))] bg-[hsl(var(--konfig-primary-soft))] border border-[hsl(var(--konfig-primary))]/40 rounded px-3 py-2",children:[c.jsx("span",{className:"font-semibold text-[hsl(var(--konfig-primary))]",children:"Tipp:"})," Bedrucktes Papier (50Ã50 cm) wird unter das transparente Cover gelegt. Druckdateien (Logo o. Ã.) klären wir individuell mit Ihrer Anfrage."]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[c.jsx("div",{className:"text-xs font-semibold text-[hsl(var(--konfig-ink))]",children:"Bodenraster â wählen Sie einen Bereich aus und markieren Sie die Platten"}),c.jsxs("div",{className:"text-[11px] text-[#6B7280]",children:[a," Reihen à ",s," Spalten"]})]}),c.jsx("div",{className:"w-full overflow-auto rounded-lg border border-[#CBD5D8] bg-white shadow-sm p-2",onPointerUp:$,onPointerLeave:()=>{$(),g(null)},children:c.jsxs("svg",{viewBox:`0 0 ${Y} ${z}`,preserveAspectRatio:"xMidYMid meet",className:"w-full h-auto max-h-[480px] select-none touch-none",style:{aspectRatio:`${Y} / ${z}`},onPointerUp:$,children:[c.jsx("defs",{children:Array.from(new Set([n,...o.map(ae=>ae.designSchluessel)])).map(ae=>{var Ae;const Q=((Ae=Ho(ae))==null?void 0:Ae.farbe)??"#E0E0E0",we=xd(ae);return c.jsxs("pattern",{id:`fmg-${ae.replace(/\s+/g,"_")}`,patternUnits:"userSpaceOnUse",width:I,height:q,children:[c.jsx("rect",{width:I,height:q,fill:Q}),c.jsx("image",{href:we,width:I,height:q,preserveAspectRatio:"xMidYMid slice"})]},ae)})}),Array.from({length:a}).map((ae,Q)=>Array.from({length:s}).map((we,Ae)=>{var _e;const K=xp(Q,Ae),pe=k.get(K)??n,ye=`url(#fmg-${pe.replace(/\s+/g,"_")})`,Se=(_e=Ho(pe))==null?void 0:_e.farbe,ee=Lj(Se)?"#CBD5D8":"#FFFFFF",re=A==null?void 0:A.cells.has(K),me=v&&v.r===Q&&v.c===Ae,Ge=m&&m.r===Q&&m.c===Ae,He=se==null?void 0:se.has(K);return c.jsxs("g",{children:[c.jsx("rect",{x:Ae*I,y:Q*q,width:I,height:q,fill:ye,onPointerDown:Ne=>G(Q,Ae,Ne),onPointerEnter:()=>B(Q,Ae),style:{cursor:A?"crosshair":"default"}}),c.jsx("rect",{x:Ae*I,y:Q*q,width:I,height:q,fill:"none",stroke:ee,strokeWidth:Math.max(.05,Math.min(I,q)*.04),pointerEvents:"none"}),re&&c.jsx("rect",{x:Ae*I+.1,y:Q*q+.1,width:I-.2,height:q-.2,fill:"none",stroke:A.color,strokeWidth:Math.max(.2,Math.min(I,q)*.08),pointerEvents:"none"}),He&&!re&&c.jsx("rect",{x:Ae*I,y:Q*q,width:I,height:q,fill:A.color,fillOpacity:.25,pointerEvents:"none"}),Ge&&c.jsx("circle",{cx:Ae*I+I/2,cy:Q*q+q/2,r:Math.min(I,q)*.18,fill:"hsl(var(--konfig-primary))",pointerEvents:"none"}),me&&A&&!He&&c.jsx("rect",{x:Ae*I,y:Q*q,width:I,height:q,fill:"hsl(var(--konfig-primary))",fillOpacity:.22,pointerEvents:"none"})]},K)}))]})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-[hsl(var(--konfig-ink))]",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:`inline-block w-4 h-4 rounded border ${Lj(te)?"border-[#9CA3AF]":"border-[#
811E0E0E0]"}`,style:{backgroundColor:te}}),c.jsxs("span",{children:["Basis: ",((Ee=Ho(n))==null?void 0:Ee.bezeichnung)??n]})]}),o.map(ae=>{var Ae,K;const Q=((Ae=Ho(ae.designSchluessel))==null?void 0:Ae.farbe)??"#E0E0E0",we=((K=Ho(ae.designSchluessel))==null?void 0:K.bezeichnung)??ae.designSchluessel;return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:`inline-block w-4 h-4 rounded border ${Lj(Q)?"border-[#9CA3AF]":"border-[#E0E0E0]"}`,style:{backgroundColor:Q}}),c.jsxs("span",{children:["Bereich ",ae.index,": ",we," (",ae.cells.size,")"]})]},ae.id)})]})]})}function BDe({config:t,onChange:e}){E.useEffect(()=>{t.finishBereiche||e({finishBereiche:[]})},[]);function n(r){e({finishBereiche:r})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Wählen Sie das Bodenfinish"}),c.jsx("p",{className:"text-[#6B7280]",children:"Wählen Sie ein Basisdesign â ergänzen Sie optional Akzentbereiche mit anderen Designs für eine individuelle Gestaltung."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))]",children:"1. Basisdesign â wird auf alle Platten ohne Akzentbereich angewendet"}),!t.plattendesign&&c.jsx("div",{className:"text-xs text-[hsl(var(--konfig-primary))] bg-[hsl(var(--konfig-primary-soft))] border border-[hsl(var(--konfig-primary))]/40 rounded px-3 py-2",children:"Bitte wählen Sie ein Basisdesign, um fortzufahren."}),c.jsx(jDe,{value:t.plattendesign,onChange:r=>e({bodenfinishKategorie:"Plattendesign",plattendesign:r})})]}),t.plattendesign&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))]",children:"2. Akzentbereiche (optional)"}),c.jsx("p",{className:"text-xs text-[#6B7280]",children:"Fügen Sie beliebig viele Bereiche hinzu, weisen Sie ihnen ein anderes Design zu und markieren Sie die Platten im Raster (Pinsel oder Rechteck) â oder geben Sie den Bereich per Reihe/Spalte ein. Jede Platte gehört zu höchstens einem Bereich."}),c.jsx(DDe,{breite:t.breite,laenge:t.laenge,basisDesign:t.plattendesign,bereiche:t.finishBereiche??[],onChange:n})]})]})}const FDe=["3000K","4000K","6000K"],aN="3000K",ODe={"3000K":"3000 K â warmweiÃ","4000K":"4000 K â neutralweiÃ","6000K":"6000 K â kaltweiÃ"};function Sz(){return{bodenVariante:"",cubeVariante:"",coverVariante:"",eckprofilFarbe:"weiÃ",mitBoden:!0}}function zDe(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`b_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Az(t,e,n,r,i){const s=new Map;for(const d of i)s.set(d.id,d);const a=d=>{if(r==="einzeln"&&d){const h=s.get(d);if(h)return{bodenVariante:h.bodenVariante,cubeVariante:h.cubeVariante,coverVariante:h.coverVariante,eckprofilFarbe:h.eckprofilFarbe||"weiÃ",mitBoden:h.mitBoden!==!1}
811}return{bodenVariante:n.bodenVariante,cubeVariante:n.cubeVariante,coverVariante:n.coverVariante,eckprofilFarbe:n.eckprofilFarbe||"weiÃ",mitBoden:n.mitBoden!==!1}},o=t.wuerfel.map(d=>{const{gx:h,gz:p}=bM(d),f=a(d.blockId);return{spalte:d.spalte,reihe:d.reihe,stapelIndex:d.stapelIndex,groesseX:h,groesseZ:p,cubeVariante:f.cubeVariante,coverVariante:f.coverVariante,eckprofilFarbe:f.eckprofilFarbe,blockId:d.blockId??null,istPlattform:d.istPlattform===!0}}),l=new Map;for(const d of t.wuerfel){const h=a(d.blockId),p=d.istPlattform!==!0;for(const f of Af(d)){const m=iN(f.spalte,f.reihe),x=l.get(m);x?(p&&(x.cubes+=1),d.stapelIndex===0&&(x.bodenBlockId=d.blockId??null)):l.set(m,{spalte:f.spalte,reihe:f.reihe,cubes:p?1:0,bodenBlockId:d.stapelIndex===0?d.blockId??null:null,cubeVariante:h.cubeVariante})}}const u={};for(const[d,h]of l.entries()){const p=a(h.bodenBlockId);u[d]={spalte:h.spalte,reihe:h.reihe,cubes:h.cubes,bodenVariante:p.bodenVariante,cubeVariante:p.cubeVariante,coverVariante:p.coverVariante,blockId:h.bodenBlockId,mitBoden:p.mitBoden}}return{hersteller:e,grundflaecheRasterX:t.grundflaecheRasterX,grundflaecheRasterZ:t.grundflaecheRasterZ,felder:u,module:o,global:n,mode:r,bloecke:i}}function UDe(t){const[e,n]=E.useState(Sz),[r,i]=E.useState("alle-gleich"),[s,a]=E.useState([]),[o,l]=E.useState(null),u=E.useRef(!1);return E.useEffect(()=>{if(u.current||!t.length)return;const d=(h,...p)=>{var f;for(const m of p){const x=t.find(v=>v.bestandteil===h&&v.variable===m);if(x)return x.variable}return((f=t.find(m=>m.bestandteil===h))==null?void 0:f.variable)??""};n(h=>({bodenVariante:h.bodenVariante||d("Boden","Basic","schwarz"),cubeVariante:h.cubeVariante||d("Cube","1x1","weiÃ","weiss"),coverVariante:h.coverVariante||d("Cover","black","schwarz"),eckprofilFarbe:h.eckprofilFarbe||"weiÃ",mitBoden:h.mitBoden!==!1}
811)),u.current=!0},[t]),E.useMemo(()=>({global:e,mode:r,bloecke:s,offenerBlockId:o,setGlobal:n,setMode:i,setBloecke:a,setOffenerBlockId:l,addBlock:d=>{const h=zDe(),p=s.reduce((x,v)=>Math.max(x,v.index),0)+1,f=(x,...v)=>{var g;for(const b of v){const y=t.find(S=>S.bestandteil===x&&S.variable===b);if(y)return y.variable}return((g=t.find(b=>b.bestandteil===x))==null?void 0:g.variable)??""},m={id:h,index:p,bodenVariante:(d==null?void 0:d.bodenVariante)??(e.bodenVariante||f("Boden","Basic","schwarz")),cubeVariante:(d==null?void 0:d.cubeVariante)??(e.cubeVariante||f("Cube","1x1","weiÃ","weiss")),coverVariante:(d==null?void 0:d.coverVariante)??(e.coverVariante||f("Cover","black","schwarz")),eckprofilFarbe:(d==null?void 0:d.eckprofilFarbe)??(e.eckprofilFarbe||"weiÃ"),mitBoden:(d==null?void 0:d.mitBoden)??e.mitBoden!==!1,abgeschlossen:!1};return a(x=>[...x,m]),l(h),h},updateBlock:(d,h)=>{a(p=>p.map(f=>f.id===d?{...f,...h}:f))},closeBlock:d=>{a(h=>h.map(p=>p.id===d?{...p,abgeschlossen:!0}:p)),l(h=>h===d?null:h)},removeBlock:d=>{a(h=>h.filter(p=>p.id!==d)),l(h=>h===d?null:h)},reset:()=>{a([]),l(null),i("alle-gleich")}}),[e,r,s,o,t])}function Zw(t,e,n){n<=0||t.set(e,(t.get(e)??0)+n)}const QV="1x1";function HDe(t){const e=new Map;for(const n of t.module){if(n.istPlattform)continue;const r=n.eckprofilFarbe||"weiÃ";Zw(e,c0("Cubeecke",r),4)}for(const n of Object.values(t.felder))n.mitBoden!==!1&&Zw(e,c0("Boden",n.bodenVariante),1),Zw(e,c0("Panel",QV),1),Zw(e,c0("Cover",n.coverVariante),1),n.cubes>0&&Zw(e,c0("Cube",QV),n.cubes);return e}const eW=["Boden","Panel","Cube","Cubeecke","Cover"];function gae(t,e){const n=new Map;for(const d of e)n.set(d.schluessel,d);const r=HDe(t),i=[],s=[],a=[...r.entries()].sort((d,h)=>{const p=d[0].split("\\")[0],f=h[0].split("\\")[0],m=eW.indexOf(p),x=eW.indexOf(f);return m!==x?m-x:d[0].localeCompare(h[0],"de")});for(const[d,h]of a){const p=d.split("\\")[0],f=d.split("\\").slice(1).join("\\"),m=n.get(d);if(p==="Cube"&&!m){const v=f.split("|")[0]??"1x1";i.push({schluessel:d,sku:"",name:`Würfelelement ${v}`,bestandteil:"Cube",variante:f,anzahl:h,einzelpreis:0,gesamtpreis:0,bild_url:null});continue}if(!m){s.push(d);continue}const x=m.preis*h;i.push({schluessel:d,sku:m.sku,name:m.name,bestandteil:m.bestandteil,variante:m.variable,anzahl:h,einzelpreis:m.preis,gesamtpreis:x,bild_url:m.bild_url})}const o=i.reduce((d,h)=>d+h.gesamtpreis,0),l=Object.keys(t.felder).length,u=t.module.length;return{positionen:i,gesamtpreis:o,anzahlFelder:l,anzahlCubesGesamt:u,fehlendeSchluessel:s}}const GDe=10,UT=50;function xae(t,e,n){let r=0;switch(t){case"Insel":r=2*e+2*n;break;case"Kopf":r=e+2*n;break;case"Eck":r=e+n;break;case"Reihe":r=e;break;default:return 0}return Math.ceil(r+1)}async function VDe(t,e,n=[]){await e.warmup();const r=[],i=[],s=new Set,a=Math.max(1,Math.round(t.breite*2)),o=Math.max(1,Math.round(t.laenge*2)),l=(t.wuerfelBereiche??[]).filter(le=>le.wuerfel.length>0);for(const le of l)for(const xe of le.wuerfel)if(xe.stapelIndex===0)for(const Ee of Af(xe)){const ae=le.spalte+Ee.spalte,Q=le.reihe+Ee.reihe;Q<0||Q>=o||ae<0||ae>=a||s.add(`${Q}_${ae}`)}function u(le,xe,Ee){if(Ee<=0)return;const ae=e.lookup(xe);if(!ae){i.push(`Artikel nicht gefunden für Schlüssel: "${xe}"`);return}r.push({typ:le,artikelname:ae.name,sku:ae.sku,variable:xe,anzahl:Ee,einzelpreis:ae.preis,gesamtpreis:Math.round(Ee*ae.preis*100)/100})}if(!t.bodenplatteTyp)return{bestandteile:[],gesamtpreis:0,warnungen:["Keine Bodenplatte gewählt"]};const d=!!t.bodenfinishKategorie;u("Trittschalldämmung","Dämmung",Math.ceil(t.breite*t.laenge));const h=t.breite*t.laenge*4,p=Math.max(1,Math.round(t.breite*2)),f=Math.max(1,Math.round(t.laenge*2)),m=(t.ersatzPlatten??[]).filter(le=>le.r>=0&&le.r<f&&le.c>=0&&le.c<p),x=new Set(m.map(le=>`${le.r}_${le.c}`)),v=Math.max(0,Math.round(t.ersatzAnzahlOhnePosition??0)),g=Math.min(h,x.size+v),b=h-g,y=t.bodenplatteTyp==="Basic"?"Big":"Basic";b>0&&u("Bodenplatte",t.bodenplatteTyp,b),g>0&&u("Bodenplatte (Mischung)",y,g);const S=t.breite*2,A=t.laenge*2,k=2*S*A-S-A;if(!(t.kantenprofileGewuenscht===!0&&!!t.standtyp&&t.kantentyp==="Rollstuhlfreundlich")){const le=Math.ceil(k/25);u("Klickverbinder","Verbinder",le)}const T=s.size;if(d&&t.bodenfinishKategorie==="Plattendesign"){if(!t.plattendesign)return i.push("Kein Plattendesign ausgewählt"),Ij(r,i);const le=new Map;for(let ae=0;ae<o;ae++)for(let Q=0;Q<a;Q++)s.has(`${ae}_${Q}`)||le.set(`${ae}_${Q}`,t.plattendesign);for(const ae of t.finishBereiche??[])for(const Q of ae.platten)s.has(`${Q.r}_${Q.c}`)||Q.r>=0&&Q.r<o&&Q.c>=0&&Q.c<a&&le.set(`${Q.r}_${Q.c}`,ae.designSchluessel);const xe=new Map;for(const[,ae]of le)xe.set(ae,(xe.get(ae)??0)+1);const Ee=[t.plattendesign,...Array.from(xe.keys()).filter(ae=>ae!==t.plattendesign)];for(const ae of Ee){const Q=xe.get(ae)??0;Q>0&&u("Bodenfinish",ae,Q)}}else if(d){const le=Math.max(0,h-T);le>0&&u("Bodenfinish","individuell",le)}if(!t.kantenprofileGewuenscht||!t.standtyp||!t.kantentyp)return Ij(r,i);const C=t.kantentyp,R=D4e[t.standtyp],P=R.anzahlEckprofile,j=R.anzahlSeiten;u("Eckprofil",`${C}|Ecke`,P);const G=t.kantentyp==="Rollstuhlfreundlich",B=B4e[j];let $,U;G?($=t.breite,U=t.laenge):($=t.breite-B.rlb,U=t.laenge-B.rls);let Z=0,V=0,W=$,O=U;G||(Z=Math.floor($/1),V=Math.floor(U/1),W=$-Z,O=U-V);const Y=Math.round(W/.5),z=Math.round(O/.5);let I=0,q=0;switch(j){case 1:I=Z,q=Y;break;case 2:I=Z+V,q=Y+z;break;case 3:I=Z+2*V,q=Y+2*z;break;case 4:I=2*Z+2*V,q=2*Y+2*z;break}G||u("Kantenprofil 100cm",`${C}|100`,I),u("Kantenprofil 50cm",`${C}|50`,q);const te=q+I*2+P*2;if(G){const le=Math.ceil((k+te)/25);u("Klickverbinder","Verbinder",le)}else{const le=Math.ceil(te/25);u("Verbinder Profil-Platte","VerbinderAlu",le)}const se=F4e[t.standtyp],ie=q+I+se;if(ie>0&&u("Verbinder Profil-Profil (gerade)","VerbinderGerade",ie),!G&&P>0&&u("Verbinder Profil-Profil (Ecke)","VerbinderEcke",P),t.kantentyp==="Alu LED"){const le=xae(t.standtyp,t.breite,t.laenge);if(le>UT)i.push(`Alu-LED ist nur bis ${UT} m Kantenstrecke verfügbar (benötigt: ${le} m).`);else{const xe=Math.max(GDe,le);if(u("Gummiabdeckung","rubber",xe),t.ledFarbvariante==="bunt"){const Ee=Math.max(20,Math.ceil(le/20)*20);u("LED-Streifen (RGB)","bunt",Ee)}else{const Ee=t.ledFarbtemperatur??aN;u(`LED-Streifen (weiÃ, ${Ee})`,`AluLED|${Ee}`,xe)}}}if(t.transportArt==="Transportbox"){const xe=t.breite*t.laenge*2,Ee=50,ae=25,Q=e.lookup("Transportbox50"),we=e.lookup("Transportbox25"),Ae=(Q==null?void 0:Q.preis)??Number.POSITIVE_INFINITY,K=(we==null?void 0:we.preis)??Number.POSITIVE_INFINITY,pe=Math.ceil(xe/ae)+1;let ye=0,Se=Math.ceil(xe/ae),ee=Se*K,re=Se;for(let me=0;me<=pe;me++){const Ge=Math.max(0,xe-me*ae),He=Math.ceil(Ge/Ee),_e=He*Ae+me*K,Ne=He+me;(_e<ee-.001||Math.abs(_e-ee)<.001&&Ne<re)&&(ee=_e,ye=He,Se=me,re=Ne)}ye>0&&u("Transportbox 50 m²","Transportbox50",ye),Se>0&&u("Transportbox 25 m²","Transportbox25",Se)}if(l.length>0){console.log("[Boden-Engine] SCHRITT 9 start",{bereicheCount:l.length,wuerfelProdukteCount:n.length,wuerfelProBereich:l.map(xe=>({id:xe.id,wuerfel:xe.wuerfel.length}))});const le=new Map;for(const xe of l){const Ee={grundflaecheRasterX:xe.breiteRaster,grundflaecheRasterZ:xe.tiefeRaster,wuerfel:xe.wuerfel},ae=Az(Ee,b0,xe.global,xe.mode,xe.bloecke),Q=gae(ae,n);console.log("[Boden-Engine] Bereich Lieferumfang",{bereichId:xe.id,positionen:Q.positionen.map(we=>({bestandteil:we.bestandteil,variante:we.variante,sku:we.sku,anzahl:we.anzahl})),fehlendeSchluessel:Q.fehlendeSchluessel}),Q.fehlendeSchluessel.length>0&&i.push(`Würfel-Bereich: ${Q.fehlendeSchluessel.length} Artikel nicht gefunden`);for(const we of Q.positionen){if(we.bestandteil==="Boden")continue;const Ae=`${we.bestandteil}|${we.variante}|${we.sku}`,K=le.get(Ae);K?(K.anzahl+=we.anzahl,K.gesamtpreis=Math.round(K.einzelpreis*K.anzahl*100)/100):le.set(Ae,{typ:`Würfel: ${we.bestandteil}`,artikelname:we.name,sku:we.sku,variable:we.variante,anzahl:we.anzahl,einzelpreis:we.einzelpreis,gesamtpreis:Math.round(we.einzelpreis*we.anzahl*100)/100})}}console.log("[Boden-Engine] SCHRITT 9 aggregat",{anzahlZeilen:le.size,zeilen:[...le.values()].map(xe=>({typ:xe.typ,sku:xe.sku,variable:xe.variable,anzahl:xe.anzahl}))});for(const xe of le.values())r.push(xe)}return Ij(r,i)}function Ij(t,e){const n=t.reduce((r,i)=>r+i.gesamtpreis,0);return{bestandteile:t,gesamtpreis:Math.round(n*100)/100,warnungen:e}}
811const WDe=["Insel","Kopf","Eck","Reihe"],vae="#9CA3AF",yae="hsl(var(--konfig-primary))";function $De({typ:t}){const e=CA[t].seitenMitRand,n=r=>e.includes(r)?vae:yae;return c.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",className:"mx-auto",children:[c.jsx("rect",{x:"14",y:"14",width:"52",height:"52",fill:"#F5F5F5",stroke:"#E0E0E0"}),c.jsx("line",{x1:"14",y1:"14",x2:"66",y2:"14",stroke:n("oben"),strokeWidth:"4"}),c.jsx("line",{x1:"14",y1:"66",x2:"66",y2:"66",stroke:n("unten"),strokeWidth:"4"}),c.jsx("line",{x1:"14",y1:"14",x2:"14",y2:"66",stroke:n("links"),strokeWidth:"4"}),c.jsx("line",{x1:"66",y1:"14",x2:"66",y2:"66",stroke:n("rechts"),strokeWidth:"4"})]})}function KDe(){const t=({color:e,text:n})=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{"aria-hidden":!0,className:"inline-block w-6 h-1.5 rounded-sm shrink-0",style:{background:e}}),c.jsx("span",{children:n})]});return c.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[hsl(var(--konfig-ink))] bg-[#F8FAFA] border border-[#E0E0E0] rounded-md px-3 py-2",children:[c.jsx("span",{className:"font-semibold",children:"Legende:"}),c.jsx(t,{color:vae,text:"Seite mit Kantenprofil"}),c.jsx(t,{color:yae,text:"Seite ohne Kantenprofil (grenzt direkt an Nachbarstand oder Wand)"})]})}function qDe({value:t,onChange:e}){return c.jsxs("div",{className:"space-y-3",children:[c.jsx(KDe,{}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:WDe.map(n=>{const r=CA[n],i=t===n;return c.jsxs("button",{onClick:()=>e(n),type:"button",className:`text-left rounded-lg border-2 p-4 transition ${i?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx($De,{typ:n}),c.jsx("div",{className:"mt-3 font-semibold text-[hsl(var(--konfig-ink))]",children:r.titel}),c.jsx("div",{className:"text-sm text-[#6B7280]",children:r.beschreibung})]},n)})})]})}function XDe({k:t}){const[e,n]=E.useState(!1);return e?c.jsx("div",{className:"h-24 bg-[#F5F5F5] rounded mb-2 flex items-center justify-center text-xs text-[#6B7280]",children:"Bild folgt"}):c.jsx("div",{className:"mb-2 flex items-center justify-center",children:c.jsx("img",{src:G4e(t.schluessel),alt:t.bezeichnung,className:"max-h-40 w-auto object-contain",onError:()=>n(!0)})})}function YDe({value:t,onChange:e,ausgeblendet:n=[]}){const r=vz.filter(i=>!n.includes(i.schluessel));return c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:r.map(i=>{const s=t===i.schluessel;return c.jsxs("button",{type:"button",onClick:()=>e(i.schluessel),className:`text-left rounded-lg border-2 p-4 transition ${s?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx(XDe,{k:i}),c.jsx("div",{className:"font-semibold text-[hsl(var(--konfig-ink))]",children:i.bezeichnung}),c.jsx("div",{className:"text-xs text-[#6B7280] mt-1",children:i.beschreibung})]},i.schluessel)})})}function tW({url:t,alt:e,caption:n,onOpen:r}){const[i,s]=E.useState(!1);return c.jsxs("figure",{className:"m-0 w-full",children:[c.jsx("button",{type:"button",onClick:i?void 0:r,disabled:i,"aria-label":i?n:`${n} â vergröÃern`,className:"group relative w-full h-32 sm:h-36 bg-white border border-[#E0E0E0] rounded-lg shadow-sm overflow-hidden flex items-center justify-center p-2 transition hover:border-[hsl(var(--konfig-ink))] hover:shadow-md disabled:cursor-default cursor-zoom-in",children:i?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-[#9CA3AF] text-xs",children:[c.jsx(v1,{className:"w-5 h-5"}),c.jsx("span",{className:"px-2 text-center leading-tight",children:"Bild folgt"})]}):c.jsxs(c.Fragment,{children:[c.jsx("img",{src:t,alt:e,className:"max-h-full max-w-full object-contain transition group-hover:scale-[1.03]",onError:()=>s(!0)}),c.jsx("span",{className:"absolute bottom-1.5 right-1.5 bg-white/90 text-[hsl(var(--konfig-ink))] rounded-full p-1 shadow opacity-0 group-hover:opacity-100 transition",children:c.jsx(_J,{className:"w-3.5 h-3.5"})})]})}),c.jsx("figcaption",{className:"text-[11px] text-[#6B7280] text-center mt-1.5 leading-tight",children:n})]})}function JDe(){const t=W4e(),e=$4e(),[n,r]=E.useState(null);return c.jsxs("section",{"aria-label":"So werden die Kantenprofile verbunden",className:"rounded-lg border border-[#
811E0E0E0] bg-[#F8FAFA] p-4 sm:p-5",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx(pa,{className:"w-5 h-5 text-[hsl(var(--konfig-ink))]"}),c.jsx("h3",{className:"font-semibold text-[hsl(var(--konfig-ink))]",children:"So werden die Kantenprofile verbunden"})]}),c.jsxs("div",{className:"sm:float-right sm:ml-5 sm:mb-2 sm:w-[360px] grid grid-cols-2 gap-3 mb-4",children:[c.jsx(tW,{url:t,alt:"Alu-Verbinder Kantenprofil",caption:"Alu-Verbinder",onOpen:()=>r({url:t,alt:"Alu-Verbinder Kantenprofil",caption:"Alu-Verbinder"})}),c.jsx(tW,{url:e,alt:"Beispielbild Kantenprofil Ecke",caption:"Beispielbild Kantenprofil Ecke",onOpen:()=>r({url:e,alt:"Beispielbild Kantenprofil Ecke",caption:"Beispielbild Kantenprofil Ecke"})})]}),c.jsxs("p",{className:"text-sm text-[hsl(var(--konfig-ink))] leading-relaxed",children:["Für die Kantenprofile werden ebenfalls Verbinder benötigt, welche automatisch in den Lieferumfang aufgenommen und berechnet werden. Für Kantenprofile aus Aluminium werden ",c.jsx("strong",{children:"Alu-Verbinder"})," benötigt, um die Profile mit den Bodenplatten zu verbinden. Bei dem rollstuhlfreundlichen Profil sind diese Teile die selben ",c.jsx("strong",{children:"Klickverbinder"})," wie bei den Bodenplatten in Schritt 2. In diesem Fall werden die Klickverbinder addiert und als eine Position aufgeführt. Darüber hinaus gibt es für jede Ecke ein weiteres Verbindungsstück und eines, um die Profilstücke untereinander fest aneinander zu befestigen. Für keine der Verbindungen wird Werkzeug benötigt."]}),c.jsx("div",{className:"clear-both"}),n&&c.jsx(_z,{url:n.url,alt:n.alt,caption:n.caption,onClose:()=>r(null)})]})}const ZDe=[{v:"weiss",t:"Nur WeiÃ",d:"Klassische, neutrale Beleuchtung. Mindestbestellung 10 m, danach in 1-m-Schritten bis 50 m."},{v:"bunt",t:"Alle Farben (RGB)",d:"Mehrfarbig steuerbar. Nur in 20-m-Rollen erhältlich â die benötigte Länge wird auf volle Rollen aufgerundet."}];function QDe({config:t,onChange:e}){const n=xae(t.standtyp,t.breite,t.laenge),r=n>0&&n<=UT,i=r?[]:["Alu LED"];E.useEffect(()=>{t.kantentyp==="Alu LED"&&!r&&e({kantentyp:"Alu gerade",ledFarbvariante:null,ledFarbtemperatur:null})},[r,t.kantentyp,e]);function s(o){const l={kantentyp:o};o==="Alu LED"?t.ledFarbvariante||(l.ledFarbvariante="weiss",l.ledFarbtemperatur=aN):(l.ledFarbvariante=null,l.ledFarbtemperatur=null),e(l)}function a(o){e({ledFarbvariante:o,ledFarbtemperatur:o==="weiss"?t.ledFarbtemperatur??aN:null})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Möchten Sie Kantenprofile?"}),c.jsx("p",{className:"text-[#6B7280]",children:"Kantenprofile sorgen für einen sauberen Abschluss am Rand Ihrer Bodenfläche."})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[{v:!0,t:"Ja, mit Kantenprofilen",d:"Sauberer Abschluss am Rand."},{v:!1,t:"Nein, ohne Kantenprofile",d:"Boden ohne abschlieÃende Profile."}].map(o=>c.jsxs("button",{type:"button",onClick:()=>e({kantenprofileGewuenscht:o.v,...o.v?{}:{standtyp:null,kantentyp:null,ledFarbvariante:null,ledFarbtemperatur:null}}),className:`text-left rounded-lg border-2 p-4 transition ${t.kantenprofileGewuenscht===o.v?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx("div",{className:"font-bold text-[hsl(var(--konfig-ink))]",children:o.t}),c.jsx("div",{className:"text-sm text-[#6B7280]",children:o.d})]},String(o.v)))}),t.kantenprofileGewuenscht&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Standtyp"}),c.jsx("p",{className:"text-sm text-[#6B7280] mb-3",children:"Wo wird Ihr Boden aufgestellt?"}),c.jsx(qDe,{value:t.standtyp,onChange:o=>e({standtyp:o})})]}),t.standtyp&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Kantentyp"}),c.jsx(YDe,{value:t.kantentyp,onChange:s,ausgeblendet:i}),!r&&c.jsxs("p",{className:"text-xs text-[#6B7280] mt-2",children:["Hinweis: Alu-LED ist nur bis ",UT," m umlaufende Kantenstrecke verfügbar (aktuell ",n," m)."]})]}),t.kantentyp==="Alu LED"&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"LED-Variante"}),c.jsx("p",{className:"text-sm text-[#6B7280] mb-3",children:"Welche Lichtfarbe möchten Sie? Der LED-Streifen wird in das Profil eingelegt und mit einer Gummiabdeckung verschlossen â beides ist im Lieferumfang enthalten."}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ZDe.map(o=>c.jsxs("button",{type:"button",onClick:()=>a(o.v),className:`text-left rounded-lg border-2 p-4 transition ${t.ledFarbvariante===o.v?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#
811E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx("div",{className:"font-bold text-[hsl(var(--konfig-ink))]",children:o.t}),c.jsx("div",{className:"text-sm text-[#6B7280]",children:o.d})]},o.v))}),t.ledFarbvariante==="weiss"&&c.jsxs("div",{className:"mt-4 max-w-sm",children:[c.jsx("h4",{className:"font-semibold text-[hsl(var(--konfig-ink))] mb-1",children:"Farbtemperatur"}),c.jsx("p",{className:"text-sm text-[#6B7280] mb-2",children:"Wie warm oder kalt soll das weiÃe Licht wirken?"}),c.jsxs(vl,{value:t.ledFarbtemperatur??aN,onValueChange:o=>e({ledFarbtemperatur:o}),children:[c.jsx(qo,{className:"bg-background",children:c.jsx(yl,{placeholder:"Farbtemperatur wählen"})}),c.jsx(Xo,{className:"bg-background z-50",children:FDe.map(o=>c.jsx(Us,{value:o,children:ODe[o]},o))})]})]})]}),c.jsx(JDe,{})]})]})}const eBe=[{value:"Palette",bildKey:"palette",titel:"Lieferung auf Palette",desc:"Standardlieferung auf Europalette. Geeignet für stationäre Aufbauten.",icon:ppe},{value:"Transportbox",bildKey:"transportbox",titel:"Trans
811portboxen / FlightCases",desc:"Robuste, stapelbare Boxen. Ideal für mobile Stände, Messen und häufigen Auf- und Abbau.",icon:Mf}];function tBe({config:t,ergebnis:e,pending:n=!1,onChange:r}){const[i,s]=E.useState(null),[a,o]=E.useState({}),l=rA(),u=e.bestandteile.filter(p=>p.typ.startsWith("Transportbox")),d=t.breite*t.laenge,h=d*2;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Wie soll Ihre Bestellung geliefert werden?"}),c.jsx("p",{className:"text-[#6B7280]",children:"Wählen Sie zwischen klassischer Palettenlieferung oder professionellen Transportboxen für mobilen Einsatz."})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:eBe.map(p=>{const f=t.transportArt===p.value,m=p.icon;return c.jsxs("button",{type:"button",onClick:()=>r({transportArt:p.value}),className:`text-left rounded-lg border-2 p-5 transition ${f?"border-[hsl(var(--konfig-primary))] bg-[#FBE4EB]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsx("div",{className:"relative aspect-[4/3] bg-white rounded mb-4 flex items-center justify-center overflow-hidden group",children:a[p.bildKey]?c.jsx(m,{className:"w-20 h-20 text-[hsl(var(--konfig-ink))]",strokeWidth:1.2}):c.jsxs(c.Fragment,{children:[c.jsx("img",{src:Nj(p.bildKey)+l,alt:p.titel,loading:"lazy",className:"w-full h-full object-contain",onError:()=>o(x=>({...x,[p.bildKey]:!0}))}),c.jsxs("span",{role:"button",tabIndex:0,"aria-label":`${p.titel} vergröÃern`,onClick:x=>{x.stopPropagation(),s({url:Nj(p.bildKey)+l,titel:p.titel})},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),s({url:Nj(p.bildKey)+l,titel:p.titel}))},className:"absolute bottom-2 right-2 inline-flex items-center gap-1 rounded-full bg-white/90 px-2.5 py-1 text-xs font-medium text-[hsl(var(--konfig-ink))] shadow-sm border border-[#E0E0E0] opacity-90 group-hover:opacity-100 hover:bg-white cursor-zoom-in",children:[c.jsx(xJ,{className:"w-3.5 h-3.5"})," VergröÃern"]})]})}),c.jsx("div",{className:"text-lg font-bold text-[hsl(var(--konfig-ink))]",children:p.titel}),c.jsx("div",{className:"text-sm text-[#6B7280] mt-1",children:p.desc}),p.value==="Palette"&&c.jsx("div",{className:"text-xs text-[#78AD48] font-semibold mt-2",children:"Im Standardpreis enthalten"})]},p.value)})}),t.transportArt==="Transportbox"&&n&&u.length===0&&c.jsx("div",{className:"rounded-lg border border-[#E0E0E0] bg-[#F9FAFB] p-4 text-sm text-[#6B7280]",children:"Box-Kombination wird berechnetâ¦"}),t.transportArt==="Transportbox"&&u.length>0&&c.jsxs("div",{className:"rounded-lg border border-[#E0E0E0] bg-[#F9FAFB] p-4",children:[c.jsx("div",{className:"text-sm font-semibold text-[hsl(var(--konfig-ink))] mb-2",children:"Empfohlene Box-Kombination für Ihre Konfiguration"}),c.jsx("ul",{className:"text-sm text-[hsl(var(--konfig-ink))] space-y-1",children:u.map(p=>c.jsxs("li",{className:"flex justify-between gap-4",children:[c.jsxs("span",{children:[c.jsxs("span",{className:"font-medium",children:[p.anzahl,"Ã"]})," ",p.artikelname]}),c.jsx("span",{className:"text-[#6B7280]",children:p.gesamtpreis.toLocaleString("de-DE",{style:"currency",currency:"EUR"})})]},p.variable))}),c.jsxs("div",{className:"text-xs text-[#6B7280] mt-3 border-t border-[#E0E0E0] pt-2",children:["Berechnung basiert auf"," ",h.toLocaleString("de-DE",{maximumFractionDigits:1})," m² Gesamtfläche (Bodenplatten ",d.toLocaleString("de-DE",{maximumFractionDigits:1})," m² + Coverplatten"," ",d.toLocaleString("de-DE",{maximumFractionDigits:1})," m²). Die Aufteilung wird automatisch wirtschaftlich optimal gewählt."]})]}),i&&c.jsx(_z,{url:i.url,alt:i.titel,caption:i.titel,onClose:()=>s(null)})]})}const nBe="standonfloor_produkte";function rBe(t){const e=t.trim().toLowerCase();return e.startsWith("cover|")?"Cover":e.startsWith("boden|")?"Boden":e.startsWith("cube|")?"Cube":e.startsWith("panel|")?"Panel":e.startsWith("acrylpanel|")?null:e.startsWith("cubeecke|")?"Cubeecke":null}function iBe(t){const e=t.indexOf("|");return e>=0?t.slice(e+1):t}let dk=null,nW=null,Dj=null;async function sBe(){const{data:t,error:e}=await Ot.from(nBe).select("artikelname, schluessel, sku, preis").order("artikelname",{ascending:!0});if(e)return{produkte:[],error:e.message};const n=[];for(const r of t??[]){const i=String(r.schluessel??""),s=rBe(i);if(!s)continue;const a=iBe(i);s==="Cover"&&a.trim().toLowerCase()==="individuell"||n.push({name:String(r.artikelname??""),variable:a,schluessel:c0(s,a),bestandteil:s,sku:String(r.sku??""),preis:Number(r.preis??0),bild_url:s==="Cover"?xd(a):null,produkt_url:null})}return{produkte:n,error:null}}function tw(){const[t,e]=E.useState(()=>dk?{produkte:dk,loading:!1,error:nW}:{produkte:[],loading:!0,error:null});return E.useEffect(()=>{if(dk)return;let n=!1;return Dj??(Dj=sBe()),Dj.then(r=>{dk=r.produkte,nW=r.error,Dj=null,!n&&e({produkte:r.produkte,loading:!1,error:r.error})}),()=>{n=!0}},[]),t}function Bj(t,e){return t.filter(n=>n.bestandteil===e)}/** 812 * @license 813 * Copyright 2010-2023 Three.js Authors 814 * SPDX-License-Identifier: MIT 815 */const NA="160",n0={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},ud={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},bae=0,Q4=1,wae=2,aBe=3,_ae=0,_M=1,c2=2,id=3,Nh=0,xl=1,bc=2,oBe=2,bh=0,W0=1,eD=2,tD=3,nD=4,Sae=5,Kp=100,Aae=101,Eae=102,rD=103,iD=104,kae=200,Cae=201,Nae=202,Tae=203,HT=2
vendor: 33,214 bytes, line 815
81504,GT=205,Mae=206,Rae=207,jae=208,Pae=209,Lae=210,Iae=211,Dae=212,Bae=213,Fae=214,Oae=0,zae=1,Uae=2,gS=3,Hae=4,Gae=5,Vae=6,Wae=7,TA=0,$ae=1,Kae=2,wh=0,qae=1,Xae=2,Yae=3,Ez=4,Jae=5,Zae=6,sD="attached",Qae="detached",Xm=300,Th=301,Ym=302,n1=303,xS=304,nw=306,Jm=1e3,Ji=1001,r1=1002,Bs=1003,vS=1004,lBe=1004,gb=1005,cBe=1005,zr=1006,SM=1007,uBe=1007,Mh=1008,aD=1008,Tc=1009,kz=1010,Cz=1011,AM=1012,EM=1013,dh=1014,Zs=1015,Na=1016,Nz=1017,Tz=1018,km=1020,eoe=1021,fa=1023,toe=1024,noe=1025,Cm=1026,yx=1027,Mz=1028,Rz=1029,roe=1030,jz=1031,Pz=1033,oN=33776,lN=33777,cN=33778,uN=33779,oD=35840,lD=35841,cD=35842,uD=35843,Lz=36196,dD=37492,hD=37496,fD=37808,pD=37809,mD=37810,gD=37811,xD=37812,vD=37813,yD=37814,bD=37815,wD=37816,_D=37817,SD=37818,AD=37819,ED=37820,kD=37821,dN=36492,CD=36494,ND=36495,ioe=36283,TD=36284,MD=36285,RD=36286,soe=2200,aoe=2201,ooe=2202,i1=2300,bx=2301,hN=2302,_0=2400,S0=2401,yS=2402,kM=2500,Iz=2501,loe=0,Dz=1,VT=2,Bz=3e3,Nm=3001,coe=3200,Fz=3201,dg=0,uoe=1,wc="",os="srgb",Pc="srgb-linear",CM="display-p3",MA="display-p3-linear",bS="linear",Oi="srgb",wS="rec709",_S="p3",dBe=0,r0=7680,hBe=7681,fBe=7682,pBe=7683,mBe=34055,gBe=34056,xBe=5386,vBe=512,yBe=513,bBe=514,wBe=515,_Be=516,SBe=517,ABe=518,jD=519,doe=512,hoe=513,foe=514,Oz=515,poe=516,moe=517,goe=518,xoe=519,SS=35044,EBe=35048,kBe=35040,CBe=35045,NBe=35049,TBe=35041,MBe=35046,RBe=35050,jBe=35042,PBe="100",PD="300 es",WT=1035,hd=2e3,s1=2001;let Zf=class{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}};const Bo=["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","55","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 rW=1234567;const $0=Math.PI/180,a1=180/Math.PI;function Mc(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Bo[t&255]+Bo[t>>8&255]+Bo[t>>16&255]+Bo[t>>24&255]+"-"+Bo[e&255]+Bo[e>>8&255]+"-"+Bo[e>>16&15|64]+Bo[e>>24&255]+"-"+Bo[n&63|128]+Bo[n>>8&255]+"-"+Bo[n>>16&255]+Bo[n>>24&255]+Bo[r&255]+Bo[r>>8&255]+Bo[r>>16&255]+Bo[r>>24&255]).toLowerCase()}function Fs(t,e,n){return Math.max(e,Math.min(n,t))}function zz(t,e){return(t%e+e)%e}function LBe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function IBe(t,e,n){return t!==e?(n-t)/(e-t):0}function u2(t,e,n){return(1-n)*t+n*e}function DBe(t,e,n,r){return u2(t,e,1-Math.exp(-n*r))}function BBe(t,e=1){return e-Math.abs(zz(t,e*2)-e)}function FBe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function OBe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function zBe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function UBe(t,e){return t+Math.random()*(e-t)}function HBe(t){return t*(.5-Math.random())}function GBe(t){t!==void 0&&(rW=t);let e=rW+=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 VBe(t){return t*$0}function WBe(t){return t*a1}function LD(t){return(t&t-1)===0&&t!==0}function $Be(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function $T(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function KBe(t,e,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((e+r)/2),d=a((e+r)/2),h=s((e-r)/2),p=a((e-r)/2),f=s((r-e)/2),m=a((r-e)/2);switch(i){case"XYX":t.set(o*d,l*h,l*p,o*u);break;case"YZY":t.set(l*p,o*d,l*h,o*u);break;case"ZXZ":t.set(l*h,l*p,o*d,o*u);break;case"XZX":t.set(o*d,l*m,l*f,o*u);break;case"YXY":t.set(l*f,o*d,l*m,o*u);break;case"ZYZ":t.set(l*m,l*f,o*d,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Gl(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Tr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const KT={DEG2RAD:$0,RAD2DEG:a1,generateUUID:Mc,clamp:Fs,euclideanModulo:zz,mapLinear:LBe,inverseLerp:IBe,lerp:u2,damp:DBe,pingpong:BBe,smoothstep:FBe,smootherstep:OBe,randInt:zBe,randFloat:UBe,randFloatSpread:HBe,seededRandom:GBe,degToRad:VBe,radToDeg:WBe,isPowerOfTwo:LD,ceilPowerOfTwo:$Be,floorPowerOfTwo:$T,setQuaternionFromProperEuler:KBe,normalize:Tr,denormalize:Gl};class Rt{constructor(e=0,n=0){Rt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fs(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),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}}class Nr{constructor(e,n,r,i,s,a,o,l,u){Nr.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,s,a,o,l,u)}set(e,n,r,i,s,a,o,l,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=o,d[3]=n,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 n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,s=this.elements,a=r[0],o=r[3],l=r[6],u=r[1],d=r[4],h=r[7],p=r[2],f=r[5],m=r[8],x=i[0],v=i[3],g=i[6],b=i[1],y=i[4],S=i[7],A=i[2],k=i[5],M=i[8];return s[0]=a*x+o*b+l*A,s[3]=a*v+o*y+l*k,s[6]=a*g+o*S+l*M,s[1]=u*x+d*b+h*A,s[4]=u*v+d*y+h*k,s[7]=u*g+d*S+h*M,s[2]=p*x+f*b+m*A,s[5]=p*v+f*y+m*k,s[8]=p*g+f*S+m*M,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8];return n*a*d-n*o*u-r*s*d+r*o*l+i*s*u-i*a*l}invert(){const e=this.elements,n=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,p=o*l-d*s,f=u*s-a*l,m=n*h+r*p+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/m;return e[0]=h*x,e[1]=(i*u-d*r)*x,e[2]=(o*r-i*a)*x,e[3]=p*x,e[4]=(d*n-i*l)*x,e[5]=(i*s-o*n)*x,e[6]=f*x,e[7]=(r*l-u*n)*x,e[8]=(a*n-r*s)*x,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,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+n,0,0,1),this}scale(e,n){return this.premultiply(Fj.makeScale(e,n)),this}rotate(e){return this.premultiply(Fj.makeRotation(-e)),this}translate(e,n){return this.premultiply(Fj.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Fj=new Nr;function voe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const qBe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Hy(t,e){return new qBe[t](e)}function AS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function yoe(){const t=AS("canvas");return t.style.display="block",t}const iW={};function d2(t){t in iW||(iW[t]=!0,console.warn(t))}const sW=new Nr().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),aW=new Nr().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),hk={[Pc]:{transfer:bS,primaries:wS,toReference:t=>t,fromReference:t=>t},[os]:{transfer:Oi,primaries:wS,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[MA]:{transfer:bS,primaries:_S,toReference:t=>t.applyMatrix3(aW),fromReference:t=>t.applyMatrix3(sW)},[CM]:{transfer:Oi,primaries:_S,toReference:t=>t.convertSRGBToLinear().applyMatrix3(aW),fromReference:t=>t.applyMatrix3(sW).convertLinearToSRGB()}},XBe=new Set([Pc,MA]),_i={enabled:!0,_workingColorSpace:Pc,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!XBe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=hk[e].toReference,i=hk[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return hk[t].primaries},getTransfer:function(t){return t===wc?bS:hk[t].transfer}};function xb(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Oj(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Tv;class Uz{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Tv===void 0&&(Tv=AS("canvas")),Tv.width=e.width,Tv.height=e.height;const r=Tv.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Tv}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=AS("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=xb(s[a]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){const n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(xb(n[r]/255)*255):n[r]=xb(n[r]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let YBe=0;class A0{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:YBe++}),this.uuid=Mc(),this.data=e,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const 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(zj(i[a].image)):s.push(zj(i[a]))}else s=zj(i);r.url=s}return n||(e.images[this.uuid]=r),r}}function zj(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?Uz.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let JBe=0;class ui extends Zf{constructor(e=ui.DEFAULT_IMAGE,n=ui.DEFAULT_MAPPING,r=Ji,i=Ji,s=zr,a=Mh,o=fa,l=Tc,u=ui.DEFAULT_ANISOTROPY,d=wc){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:JBe++}),this.uuid=Mc(),this.name="",this.source=new A0(e),this.mipmaps=[],this.mapping=n,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 Rt(0,0),this.repeat=new Rt(1,1),this.center=new Rt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof d=="string"?this.colorSpace=d:(d2("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=d===Nm?os:wc),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Xm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Jm:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case r1: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 Jm:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case r1: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)}get encoding(){return d2("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===os?Nm:Bz}set encoding(e){d2("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Nm?os:wc}}ui.DEFAULT_IMAGE=null;ui.DEFAULT_MAPPING=Xm;ui.DEFAULT_ANISOTROPY=1;class gi{constructor(e=0,n=0,r=0,i=1){gi.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*s,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*s,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*s,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,s;const l=e.elements,u=l[0],d=l[4],h=l[8],p=l[1],f=l[5],m=l[9],x=l[2],v=l[6],g=l[10];if(Math.abs(d-p)<.01&&Math.abs(h-x)<.01&&Math.abs(m-v)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+x)<.1&&Math.abs(m+v)<.1&&Math.abs(u+f+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const y=(u+1)/2,S=(f+1)/2,A=(g+1)/2,k=(d+p)/4,M=(h+x)/4,T=(m+v)/4;return y>S&&y>A?y<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(y),i=k/r,s=M/r):S>A?S<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),r=k/i,s=T/i):A<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(A),r=M/s,i=T/s),this.set(r,i,s,n),this}let b=Math.sqrt((v-m)*(v-m)+(h-x)*(h-x)+(p-d)*(p-d));return Math.abs(b)<.001&&(b=1),this.x=(v-m)/b,this.y=(h-x)/b,this.z=(p-d)/b,this.w=Math.acos((u+f+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class boe extends Zf{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new gi(0,0,e,n),this.scissorTest=!1,this.viewport=new gi(0,0,e,n);const i={width:e,height:n,depth:1};r.encoding!==void 0&&(d2("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Nm?os:wc),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new ui(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new A0(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Yo extends boe{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class NM extends ui{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Bs,this.minFilter=Bs,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ZBe extends Yo{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new NM(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class Hz extends ui{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Bs,this.minFilter=Bs,this.wrapR=Ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class QBe extends Yo{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new Hz(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class eFe extends Yo{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let a=0;a<r;a++)this.texture[a]=s.clone(),this.texture[a].isRenderTargetTexture=!0}setSize(e,n,r=1){if(this.width!==e||this.height!==n||this.depth!==r){this.width=e,this.height=n,this.depth=r;for(let i=0,s=this.texture.length;i<s;i++)this.texture[i].image.width=e,this.texture[i].image.height=n,this.texture[i].image.depth=r;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}copy(e){this.dispose(),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.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let n=0,r=e.texture.length;n<r;n++)this.texture[n]=e.texture[n].clone(),this.texture[n].isRenderTargetTexture=!0;return this}}class qa{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,s,a,o){let l=r[i+0],u=r[i+1],d=r[i+2],h=r[i+3];const p=s[a+0],f=s[a+1],m=s[a+2],x=s[a+3];if(o===0){e[n+0]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h;return}if(o===1){e[n+0]=p,e[n+1]=f,e[n+2]=m,e[n+3]=x;return}if(h!==x||l!==p||u!==f||d!==m){let v=1-o;const g=l*p+u*f+d*m+h*x,b=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){const A=Math.sqrt(y),k=Math.atan2(A,g*b);v=Math.sin(v*k)/A,o=Math.sin(o*k)/A}const S=o*b;if(l=l*v+p*S,u=u*v+f*S,d=d*v+m*S,h=h*v+x*S,v===1-o){const A=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=A,u*=A,d*=A,h*=A}}e[n]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h}static multiplyQuaternionsFlat(e,n,r,i,s,a){const o=r[i],l=r[i+1],u=r[i+2],d=r[i+3],h=s[a],p=s[a+1],f=s[a+2],m=s[a+3];return e[n]=o*m+d*h+l*f-u*p,e[n+1]=l*m+d*p+u*h-o*f,e[n+2]=u*m+d*f+o*p-l*h,e[n+3]=d*m-o*h-l*p-u*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,u=o(r/2),d=o(i/2),h=o(s/2),p=l(r/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=p*d*h+u*f*m,this._y=u*f*h-p*d*m,this._z=u*d*m+p*f*h,this._w=u*d*h-p*f*m;break;case"YXZ":this._x=p*d*h+u*f*m,this._y=u*f*h-p*d*m,this._z=u*d*m-p*f*h,this._w=u*d*h+p*f*m;break;case"ZXY":this._x=p*d*h-u*f*m,this._y=u*f*h+p*d*m,this._z=u*d*m+p*f*h,this._w=u*d*h-p*f*m;break;case"ZYX":this._x=p*d*h-u*f*m,this._y=u*f*h+p*d*m,this._z=u*d*m-p*f*h,this._w=u*d*h+p*f*m;break;case"YZX":this._x=p*d*h+u*f*m,this._y=u*f*h+p*d*m,this._z=u*d*m-p*f*h,this._w=u*d*h-p*f*m;break;case"XZY":this._x=p*d*h-u*f*m,this._y=u*f*h-p*d*m,this._z=u*d*m+p*f*h,this._w=u*d*h+p*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],s=n[8],a=n[1],o=n[5],l=n[9],u=n[2],d=n[6],h=n[10],p=r+o+h;if(p>0){const f=.5/Math.sqrt(p+1);this._w=.25/f,this._x=(d-l)*f,this._y=(s-u)*f,this._z=(a-i)*f}else if(r>o&&r>h){const f=2*Math.sqrt(1+r-o-h);this._w=(d-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+u)/f}else if(o>h){const f=2*Math.sqrt(1+o-r-h);this._w=(s-u)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+d)/f}else{const f=2*Math.sqrt(1+h-r-o);this._w=(a-i)/f,this._x=(s+u)/f,this._y=(l+d)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Fs(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}
vendor: 4,261 bytes, line 815
815conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,s=e._z,a=e._w,o=n._x,l=n._y,u=n._z,d=n._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,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,a=this._w;let o=a*e._w+r*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=r,this._y=i,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-n;return this._w=f*a+n*this._w,this._x=f*r+n*this._x,this._y=f*i+n*this._y,this._z=f*s+n*this._z,this.normalize(),this}const u=Math.sqrt(l),d=Math.atan2(u,o),h=Math.sin((1-n)*d)/u,p=Math.sin(n*d)/u;return this._w=a*h+this._w*p,this._x=r*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(s),r*Math.cos(s),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ie{constructor(e=0,n=0,r=0){Ie.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(oW.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(oW.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[3]*r+s[6]*i,this.y=s[1]*n+s[4]*r+s[7]*i,this.z=s[2]*n+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,s=e.elements,a=1/(s[3]*n+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*n+s[4]*r+s[8]*i+s[12])*a,this.y=(s[1]*n+s[5]*r+s[9]*i+s[13])*a,this.z=(s[2]*n+s[6]*r+s[10]*i+s[14])*a,this}
vendor: 46,756 bytes, line 815
815applyQuaternion(e){const n=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*n-s*i),h=2*(s*r-a*n);return this.x=n+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 n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i,this.y=s[1]*n+s[5]*r+s[9]*i,this.z=s[2]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,s=e.z,a=n.x,o=n.y,l=n.z;return this.x=i*l-s*o,this.y=s*a-r*l,this.z=r*o-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Uj.copy(this).projectOnVector(e),this.sub(Uj)}reflect(e){return this.sub(Uj.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fs(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Uj=new Ie,oW=new qa;class ma{constructor(e=new Ie(1/0,1/0,1/0),n=new Ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n+=3)this.expandByPoint(Xu.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,r=e.count;n<r;n++)this.expandByPoint(Xu.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=Xu.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Xu):Xu.fromBufferAttribute(s,a),Xu.applyMatrix4(e.matrixWorld),this.expandByPoint(Xu);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),fk.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),fk.copy(r.boundingBox)),fk.applyMatrix4(e.matrixWorld),this.union(fk)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],n);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Xu),Xu.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Qw),pk.subVectors(this.max,Qw),Mv.subVectors(e.a,Qw),Rv.subVectors(e.b,Qw),jv.subVectors(e.c,Qw),vp.subVectors(Rv,Mv),yp.subVectors(jv,Rv),Bg.subVectors(Mv,jv);let n=[0,-vp.z,vp.y,0,-yp.z,yp.y,0,-Bg.z,Bg.y,vp.z,0,-vp.x,yp.z,0,-yp.x,Bg.z,0,-Bg.x,-vp.y,vp.x,0,-yp.y,yp.x,0,-Bg.y,Bg.x,0];return!Hj(n,Mv,Rv,jv,pk)||(n=[1,0,0,0,1,0,0,0,1],!Hj(n,Mv,Rv,jv,pk))?!1:(mk.crossVectors(vp,yp),n=[mk.x,mk.y,mk.z],Hj(n,Mv,Rv,jv,pk))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Xu).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Xu).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:(Qh[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Qh[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Qh[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Qh[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Qh[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Qh[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Qh[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Qh[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Qh),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 Qh=[new Ie,new Ie,new Ie,new Ie,new Ie,new Ie,new Ie,new Ie],Xu=new Ie,fk=new ma,Mv=new Ie,Rv=new Ie,jv=new Ie,vp=new Ie,yp=new Ie,Bg=new Ie,Qw=new Ie,pk=new Ie,mk=new Ie,Fg=new Ie;function Hj(t,e,n,r,i){for(let s=0,a=t.length-3;s<=a;s+=3){Fg.fromArray(t,s);const o=i.x*Math.abs(Fg.x)+i.y*Math.abs(Fg.y)+i.z*Math.abs(Fg.z),l=e.dot(Fg),u=n.dot(Fg),d=r.dot(Fg);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>o)return!1}return!0}const tFe=new ma,e_=new Ie,Gj=new Ie;class Xa{constructor(e=new Ie,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):tFe.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 n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const r=this.center.distanceToSquared(e);return n.copy(e),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;e_.subVectors(e,this.center);const n=e_.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(e_,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):(Gj.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(e_.copy(e.center).add(Gj)),this.expandByPoint(e_.copy(e.center).sub(Gj))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ef=new Ie,Vj=new Ie,gk=new Ie,bp=new Ie,Wj=new Ie,xk=new Ie,$j=new Ie;class Dx{constructor(e=new Ie,n=new Ie(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ef)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ef.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ef.copy(this.origin).addScaledVector(this.direction,n),ef.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Vj.copy(e).add(n).multiplyScalar(.5),gk.copy(n).sub(e).normalize(),bp.copy(this.origin).sub(Vj);const s=e.distanceTo(n)*.5,a=-this.direction.dot(gk),o=bp.dot(this.direction),l=-bp.dot(gk),u=bp.lengthSq(),d=Math.abs(1-a*a);let h,p,f,m;if(d>0)if(h=a*l-o,p=a*o-l,m=s*d,h>=0)if(p>=-m)if(p<=m){const x=1/d;h*=x,p*=x,f=h*(h+a*p+2*o)+p*(a*h+p+2*l)+u}else p=s,h=Math.max(0,-(a*p+o)),f=-h*h+p*(p+2*l)+u;else p=-s,h=Math.max(0,-(a*p+o)),f=-h*h+p*(p+2*l)+u;else p<=-m?(h=Math.max(0,-(-a*s+o)),p=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+p*(p+2*l)+u):p<=m?(h=0,p=Math.min(Math.max(-s,-l),s),f=p*(p+2*l)+u):(h=Math.max(0,-(a*s+o)),p=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+p*(p+2*l)+u);else p=a>0?-s:s,h=Math.max(0,-(a*p+o)),f=-h*h+p*(p+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Vj).addScaledVector(gk,p),f}intersectSphere(e,n){ef.subVectors(e.center,this.origin);const r=ef.dot(this.direction),i=ef.dot(ef)-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,n):this.at(o,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,s,a,o,l;const u=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return u>=0?(r=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(r=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,a=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,a=(e.min.y-p.y)*d),r>a||s>i||((s>r||isNaN(r))&&(r=s),(a<i||isNaN(i))&&(i=a),h>=0?(o=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(o=(e.max.z-p.z)*h,l=(e.min.z-p.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,n)}intersectsBox(e){return this.intersectBox(e,ef)!==null}intersectTriangle(e,n,r,i,s){Wj.subVectors(n,e),xk.subVectors(r,e),$j.crossVectors(Wj,xk);let a=this.direction.dot($j),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;bp.subVectors(this.origin,e);const l=o*this.direction.dot(xk.crossVectors(bp,xk));if(l<0)return null;const u=o*this.direction.dot(Wj.cross(bp));if(u<0||l+u>a)return null;const d=-o*bp.dot($j);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 Wn{constructor(e,n,r,i,s,a,o,l,u,d,h,p,f,m,x,v){Wn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,s,a,o,l,u,d,h,p,f,m,x,v)}set(e,n,r,i,s,a,o,l,u,d,h,p,f,m,x,v){const g=this.elements;return g[0]=e,g[4]=n,g[8]=r,g[12]=i,g[1]=s,g[5]=a,g[9]=o,g[13]=l,g[2]=u,g[6]=d,g[10]=h,g[14]=p,g[3]=f,g[7]=m,g[11]=x,g[15]=v,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 Wn().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/Pv.setFromMatrixColumn(e,0).length(),s=1/Pv.setFromMatrixColumn(e,1).length(),a=1/Pv.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*s,n[5]=r[5]*s,n[6]=r[6]*s,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,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 p=a*d,f=a*h,m=o*d,x=o*h;n[0]=l*d,n[4]=-l*h,n[8]=u,n[1]=f+m*u,n[5]=p-x*u,n[9]=-o*l,n[2]=x-p*u,n[6]=m+f*u,n[10]=a*l}else if(e.order==="YXZ"){const p=l*d,f=l*h,m=u*d,x=u*h;n[0]=p+x*o,n[4]=m*o-f,n[8]=a*u,n[1]=a*h,n[5]=a*d,n[9]=-o,n[2]=f*o-m,n[6]=x+p*o,n[10]=a*l}else if(e.order==="ZXY"){const p=l*d,f=l*h,m=u*d,x=u*h;n[0]=p-x*o,n[4]=-a*h,n[8]=m+f*o,n[1]=f+m*o,n[5]=a*d,n[9]=x-p*o,n[2]=-a*u,n[6]=o,n[10]=a*l}else if(e.order==="ZYX"){const p=a*d,f=a*h,m=o*d,x=o*h;n[0]=l*d,n[4]=m*u-f,n[8]=p*u+x,n[1]=l*h,n[5]=x*u+p,n[9]=f*u-m,n[2]=-u,n[6]=o*l,n[10]=a*l}else if(e.order==="YZX"){const p=a*l,f=a*u,m=o*l,x=o*u;n[0]=l*d,n[4]=x-p*h,n[8]=m*h+f,n[1]=h,n[5]=a*d,n[9]=-o*d,n[2]=-u*d,n[6]=f*h+m,n[10]=p-x*h}else if(e.order==="XZY"){const p=a*l,f=a*u,m=o*l,x=o*u;n[0]=l*d,n[4]=-h,n[8]=u*d,n[1]=p*h+x,n[5]=a*d,n[9]=f*h-m,n[2]=m*h-f,n[6]=o*d,n[10]=x*h+p}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(nFe,e,rFe)}lookAt(e,n,r){const i=this.elements;return uc.subVectors(e,n),uc.lengthSq()===0&&(uc.z=1),uc.normalize(),wp.crossVectors(r,uc),wp.lengthSq()===0&&(Math.abs(r.z)===1?uc.x+=1e-4:uc.z+=1e-4,uc.normalize(),wp.crossVectors(r,uc)),wp.normalize(),vk.crossVectors(uc,wp),i[0]=wp.x,i[4]=vk.x,i[8]=uc.x,i[1]=wp.y,i[5]=vk.y,i[9]=uc.y,i[2]=wp.z,i[6]=vk.z,i[10]=uc.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,s=this.elements,a=r[0],o=r[4],l=r[8],u=r[12],d=r[1],h=r[5],p=r[9],f=r[13],m=r[2],x=r[6],v=r[10],g=r[14],b=r[3],y=r[7],S=r[11],A=r[15],k=i[0],M=i[4],T=i[8],C=i[12],R=i[1],P=i[5],j=i[9],G=i[13],B=i[2],$=i[6],U=i[10],Z=i[14],V=i[3],W=i[7],O=i[11],Y=i[15];return s[0]=a*k+o*R+l*B+u*V,s[4]=a*M+o*P+l*$+u*W,s[8]=a*T+o*j+l*U+u*O,s[12]=a*C+o*G+l*Z+u*Y,s[1]=d*k+h*R+p*B+f*V,s[5]=d*M+h*P+p*$+f*W,s[9]=d*T+h*j+p*U+f*O,s[13]=d*C+h*G+p*Z+f*Y,s[2]=m*k+x*R+v*B+g*V,s[6]=m*M+x*P+v*$+g*W,s[10]=m*T+x*j+v*U+g*O,s[14]=m*C+x*G+v*Z+g*Y,s[3]=b*k+y*R+S*B+A*V,s[7]=b*M+y*P+S*$+A*W,s[11]=b*T+y*j+S*U+A*O,s[15]=b*C+y*G+S*Z+A*Y,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],u=e[13],d=e[2],h=e[6],p=e[10],f=e[14],m=e[3],x=e[7],v=e[11],g=e[15];return m*(+s*l*h-i*u*h-s*o*p+r*u*p+i*o*f-r*l*f)+x*(+n*l*f-n*u*p+s*a*p-i*a*f+i*u*d-s*l*d)+v*(+n*u*h-n*o*f-s*a*h+r*a*f+s*o*d-r*u*d)+g*(-i*o*d-n*l*h+n*o*p+i*a*h-r*a*p+r*l*d)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],d=e[8],h=e[9],p=e[10],f=e[11],m=e[12],x=e[13],v=e[14],g=e[15],b=h*v*u-x*p*u+x*l*f-o*v*f-h*l*g+o*p*g,y=m*p*u-d*v*u-m*l*f+a*v*f+d*l*g-a*p*g,S=d*x*u-m*h*u+m*o*f-a*x*f-d*o*g+a*h*g,A=m*h*l-d*x*l-m*o*p+a*x*p+d*o*v-a*h*v,k=n*b+r*y+i*S+s*A;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/k;return e[0]=b*M,e[1]=(x*p*s-h*v*s-x*i*f+r*v*f+h*i*g-r*p*g)*M,e[2]=(o*v*s-x*l*s+x*i*u-r*v*u-o*i*g+r*l*g)*M,e[3]=(h*l*s-o*p*s-h*i*u+r*p*u+o*i*f-r*l*f)*M,e[4]=y*M,e[5]=(d*v*s-m*p*s+m*i*f-n*v*f-d*i*g+n*p*g)*M,e[6]=(m*l*s-a*v*s-m*i*u+n*v*u+a*i*g-n*l*g)*M,e[7]=(a*p*s-d*l*s+d*i*u-n*p*u-a*i*f+n*l*f)*M,e[8]=S*M,e[9]=(m*h*s-d*x*s-m*r*f+n*x*f+d*r*g-n*h*g)*M,e[10]=(a*x*s-m*o*s+m*r*u-n*x*u-a*r*g+n*o*g)*M,e[11]=(d*o*s-a*h*s-d*r*u+n*h*u+a*r*f-n*o*f)*M,e[12]=A*M,e[13]=(d*x*i-m*h*i+m*r*p-n*x*p-d*r*v+n*h*v)*M,e[14]=(m*o*i-a*x*i-m*r*l+n*x*l+a*r*v-n*o*v)*M,e[15]=(a*h*i-d*o*i+d*r*l-n*h*l-a*r*p+n*o*p)*M,this}scale(e){const n=this.elements,r=e.x,i=e.y,s=e.z;return n[0]*=r,n[4]*=i,n[8]*=s,n[1]*=r,n[5]*=i,n[9]*=s,n[2]*=r,n[6]*=i,n[10]*=s,n[3]*=r,n[7]*=i,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),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,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,s,a){return this.set(1,r,s,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,s=n._x,a=n._y,o=n._z,l=n._w,u=s+s,d=a+a,h=o+o,p=s*u,f=s*d,m=s*h,x=a*d,v=a*h,g=o*h,b=l*u,y=l*d,S=l*h,A=r.x,k=r.y,M=r.z;return i[0]=(1-(x+g))*A,i[1]=(f+S)*A,i[2]=(m-y)*A,i[3]=0,i[4]=(f-S)*k,i[5]=(1-(p+g))*k,i[6]=(v+b)*k,i[7]=0,i[8]=(m+y)*M,i[9]=(v-b)*M,i[10]=(1-(p+x))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let s=Pv.set(i[0],i[1],i[2]).length();const a=Pv.set(i[4],i[5],i[6]).length(),o=Pv.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Yu.copy(this);const u=1/s,d=1/a,h=1/o;return Yu.elements[0]*=u,Yu.elements[1]*=u,Yu.elements[2]*=u,Yu.elements[4]*=d,Yu.elements[5]*=d,Yu.elements[6]*=d,Yu.elements[8]*=h,Yu.elements[9]*=h,Yu.elements[10]*=h,n.setFromRotationMatrix(Yu),r.x=s,r.y=a,r.z=o,this}makePerspective(e,n,r,i,s,a,o=hd){const l=this.elements,u=2*s/(n-e),d=2*s/(r-i),h=(n+e)/(n-e),p=(r+i)/(r-i);let f,m;if(o===hd)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===s1)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,s,a,o=hd){const l=this.elements,u=1/(n-e),d=1/(r-i),h=1/(a-s),p=(n+e)*u,f=(r+i)*d;let m,x;if(o===hd)m=(a+s)*h,x=-2*h;else if(o===s1)m=s*h,x=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=x,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const Pv=new Ie,Yu=new Wn,nFe=new Ie(0,0,0),rFe=new Ie(1,1,1),wp=new Ie,vk=new Ie,uc=new Ie,lW=new Wn,cW=new qa;class RA{constructor(e=0,n=0,r=0,i=RA.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],u=i[5],d=i[9],h=i[2],p=i[6],f=i[10];switch(n){case"XYZ":this._y=Math.asin(Fs(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-d,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Fs(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Fs(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Fs(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(Fs(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,f));break;case"XZY":this._z=Math.asin(-Fs(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-d,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return lW.makeRotationFromQuaternion(e),this.setFromRotationMatrix(lW,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return cW.setFromEuler(this),this.setFromQuaternion(cW,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}RA.DEFAULT_ORDER="XYZ";class K0{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 iFe=0;const uW=new Ie,Lv=new qa,tf=new Wn,yk=new Ie,t_=new Ie,sFe=new Ie,aFe=new qa,dW=new Ie(1,0,0),hW=new Ie(0,1,0),fW=new Ie(0,0,1),oFe={type:"added"},lFe={type:"removed"};class Xr extends Zf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:iFe++}),this.uuid=Mc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xr.DEFAULT_UP.clone();const e=new Ie,n=new RA,r=new qa,i=new Ie(1,1,1);function s(){r.setFromEuler(n,!1)}function a(){n.setFromQuaternion(r,void 0,!1)}n._onChange(s),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Wn},normalMatrix:{value:new Nr}}),this.matrix=new Wn,this.matrixWorld=new Wn,this.matrixAutoUpdate=Xr.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Xr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new K0,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Lv.setFromAxisAngle(e,n),this.quaternion.multiply(Lv),this}rotateOnWorldAxis(e,n){return Lv.setFromAxisAngle(e,n),this.quaternion.premultiply(Lv),this}rotateX(e){return this.rotateOnAxis(dW,e)}rotateY(e){return this.rotateOnAxis(hW,e)}rotateZ(e){return this.rotateOnAxis(fW,e)}translateOnAxis(e,n){return uW.copy(e).applyQuaternion(this.quaternion),this.position.add(uW.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(dW,e)}translateY(e){return this.translateOnAxis(hW,e)}translateZ(e){return this.translateOnAxis(fW,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(tf.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?yk.copy(e):yk.set(e,n,r);const i=this.parent;this.updateWorldMatrix(!0,!1),t_.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?tf.lookAt(t_,yk,this.up):tf.lookAt(yk,t_,this.up),this.quaternion.setFromRotationMatrix(tf),i&&(tf.extractRotation(i.matrixWorld),Lv.setFromRotationMatrix(tf),this.quaternion.premultiply(Lv.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(oFe)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(lFe)),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),tf.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),tf.multiply(e.parent.matrixWorld)),e.applyMatrix4(tf),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){const a=this.children[r].getObjectByProperty(e,n);if(a!==void 0)return a}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t_,e,sFe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t_,aFe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let r=0,i=n.length;r<i;r++){const s=n[r];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,n){const r=this.parent;if(e===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),n===!0){const i=this.children;for(let s=0,a=i.length;s<a;s++){const o=i[s];o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!1,!0)}}}toJSON(e){const n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(o=>({boxInitialized:o.boxInitialized,boxMin:o.box.min.toArray(),boxMax:o.box.max.toArray(),sphereInitialized:o.sphereInitialized,sphereRadius:o.sphere.radius,sphereCenter:o.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));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(n){const o=a(e.geometries),l=a(e.materials),u=a(e.textures),d=a(e.images),h=a(e.shapes),p=a(e.skeletons),f=a(e.animations),m=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),p.length>0&&(r.skeletons=p),f.length>0&&(r.animations=f),m.length>0&&(r.nodes=m)}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,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}Xr.DEFAULT_UP=new Ie(0,1,0);Xr.DEFAULT_MATRIX_AUTO_UPDATE=!0;Xr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ju=new Ie,nf=new Ie,Kj=new Ie,rf=new Ie,Iv=new Ie,Dv=new Ie,pW=new Ie,qj=new Ie,Xj=new Ie,Yj=new Ie;let bk=!1;class Hl{constructor(e=new Ie,n=new Ie,r=new Ie){this.a=e,this.b=n,this.c=r}static getNormal(e,n,r,i){i.subVectors(r,n),Ju.subVectors(e,n),i.cross(Ju);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,n,r,i,s){Ju.subVectors(i,n),nf.subVectors(r,n),Kj.subVectors(e,n);const a=Ju.dot(Ju),o=Ju.dot(nf),l=Ju.dot(Kj),u=nf.dot(nf),d=nf.dot(Kj),h=a*u-o*o;if(h===0)return s.set(0,0,0),null;const p=1/h,f=(u*l-o*d)*p,m=(a*d-o*l)*p;return s.set(1-f-m,m,f)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,rf)===null?!1:rf.x>=0&&rf.y>=0&&rf.x+rf.y<=1}static getUV(e,n,r,i,s,a,o,l){return bk===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bk=!0),this.getInterpolation(e,n,r,i,s,a,o,l)}static getInterpolation(e,n,r,i,s,a,o,l){return this.getBarycoord(e,n,r,i,rf)===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,rf.x),l.addScaledVector(a,rf.y),l.addScaledVector(o,rf.z),l)}static isFrontFacing(e,n,r,i){return Ju.subVectors(r,n),nf.subVectors(e,n),Ju.cross(nf).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ju.subVectors(this.c,this.b),nf.subVectors(this.a,this.b),Ju.cross(nf).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Hl.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Hl.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,s){return bk===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),bk=!0),Hl.getInterpolation(e,this.a,this.b,this.c,n,r,i,s)}getInterpolation(e,n,r,i,s){return Hl.getInterpolation(e,this.a,this.b,this.c,n,r,i,s)}containsPoint(e){return Hl.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Hl.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,s=this.c;let a,o;Iv.subVectors(i,r),Dv.subVectors(s,r),qj.subVectors(e,r);const l=Iv.dot(qj),u=Dv.dot(qj);if(l<=0&&u<=0)return n.copy(r);Xj.subVectors(e,i);const d=Iv.dot(Xj),h=Dv.dot(Xj);if(d>=0&&h<=d)return n.copy(i);const p=l*h-d*u;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),n.copy(r).addScaledVector(Iv,a);Yj.subVectors(e,s);const f=Iv.dot(Yj),m=Dv.dot(Yj);if(m>=0&&f<=m)return n.copy(s);const x=f*u-l*m;if(x<=0&&u>=0&&m<=0)return o=u/(u-m),n.copy(r).addScaledVector(Dv,o);const v=d*m-f*h;if(v<=0&&h-d>=0&&f-m>=0)return pW.subVectors(s,i),o=(h-d)/(h-d+(f-m)),n.copy(i).addScaledVector(pW,o);const g=1/(v+x+p);return a=x*g,o=p*g,n.copy(r).addScaledVector(Iv,a).addScaledVector(Dv,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const woe={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},_p={h:0,s:0,l:0},wk={h:0,s:0,l:0};function Jj(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Qt{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=os){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,_i.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=_i.workingColorSpace){return this.r=e,this.g=n,this.b=r,_i.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=_i.workingColorSpace){if(e=zz(e,1),n=Fs(n,0,1),r=Fs(r,0,1),n===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+n):r+n-r*n,a=2*r-s;this.r=Jj(a,s,e+1/3),this.g=Jj(a,s,e),this.b=Jj(a,s,e-1/3)}return _i.toWorkingColorSpace(this,i),this}setStyle(e,n=os){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const 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,n);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,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:console.warn("THREE.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,n);if(a===6)return this.setHex(parseInt(s,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=os){const r=woe[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=xb(e.r),this.g=xb(e.g),this.b=xb(e.b),this}copyLinearToSRGB(e){return this.r=Oj(e.r),this.g=Oj(e.g),this.b=Oj(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=os){return _i.fromWorkingColorSpace(Fo.copy(this),e),Math.round(Fs(Fo.r*255,0,255))*65536+Math.round(Fs(Fo.g*255,0,255))*256+Math.round(Fs(Fo.b*255,0,255))}getHexString(e=os){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=_i.workingColorSpace){_i.fromWorkingColorSpace(Fo.copy(this),n);
vendor: 12,523 bytes, line 815
815const r=Fo.r,i=Fo.g,s=Fo.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,n=_i.workingColorSpace){return _i.fromWorkingColorSpace(Fo.copy(this),n),e.r=Fo.r,e.g=Fo.g,e.b=Fo.b,e}getStyle(e=os){_i.fromWorkingColorSpace(Fo.copy(this),e);const n=Fo.r,r=Fo.g,i=Fo.b;return e!==os?`color(${e} ${n.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,n,r){return this.getHSL(_p),this.setHSL(_p.h+e,_p.s+n,_p.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(_p),e.getHSL(wk);const r=u2(_p.h,wk.h,n),i=u2(_p.s,wk.s,n),s=u2(_p.l,wk.l,n);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 n=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*n+s[3]*r+s[6]*i,this.g=s[1]*n+s[4]*r+s[7]*i,this.b=s[2]*n+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Fo=new Qt;Qt.NAMES=woe;let cFe=0;class Ta extends Zf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:cFe++}),this.uuid=Mc(),this.name="",this.type="Material",this.blending=W0,this.side=Nh,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=HT,this.blendDst=GT,this.blendEquation=Kp,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Qt(0,0,0),this.blendAlpha=0,this.depthFunc=gS,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=jD,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=r0,this.stencilZFail=r0,this.stencilZPass=r0,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.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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&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.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.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!==W0&&(r.blending=this.blending),this.side!==Nh&&(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!==HT&&(r.blendSrc=this.blendSrc),this.blendDst!==GT&&(r.blendDst=this.blendDst),this.blendEquation!==Kp&&(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!==gS&&(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!==jD&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==r0&&(r.stencilFail=this.stencilFail),this.stencilZFail!==r0&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==r0&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(n){const s=i(e.textures),a=i(e.images);s.length>0&&(r.textures=s),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=n[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 12,347 bytes, line 815
815adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ml extends Ta{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Qt(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.combine=TA,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.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 gf=uFe();function uFe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),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);)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:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}function Bl(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Fs(t,-65504,65504),gf.floatView[0]=t;const e=gf.uint32View[0],n=e>>23&511;return gf.baseTable[n]+((e&8388607)>>gf.shiftTable[n])}function R_(t){const e=t>>10;return gf.uint32View[0]=gf.mantissaTable[gf.offsetTable[e]+(t&1023)]+gf.exponentTable[e],gf.floatView[0]}const E0={toHalfFloat:Bl,fromHalfFloat:R_},la=new Ie,_k=new Rt;class Yr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=SS,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Zs,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=n.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,r=this.count;n<r;n++)_k.fromBufferAttribute(this,n),_k.applyMatrix3(e),this.setXY(n,_k.x,_k.y);else if(this.itemSize===3)for(let n=0,r=this.count;n<r;n++)la.fromBufferAttribute(this,n),la.applyMatrix3(e),this.setXYZ(n,la.x,la.y,la.z);return this}applyMatrix4(e){for(let n=0,r=this.count;n<r;n++)la.fromBufferAttribute(this,n),la.applyMatrix4(e),this.setXYZ(n,la.x,la.y,la.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)la.fromBufferAttribute(this,n),la.applyNormalMatrix(e),this.setXYZ(n,la.x,la.y,la.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)la.fromBufferAttribute(this,n),la.transformDirection(e),this.setXYZ(n,la.x,la.y,la.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let r=this.array[e*this.itemSize+n];return this.normalized&&(r=Gl(r,this.array)),r}setComponent(e,n,r){return this.normalized&&(r=Tr(r,this.array)),this.array[e*this.itemSize+n]=r,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Gl(n,this.array)),n}setX(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Gl(n,this.array)),n}setY(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Gl(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Gl(n,this.array)),n}setW(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array)),this.array[e+0]=n,this.array[e+1]=r,this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,n,r,i,s){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array),s=Tr(s,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==SS&&(e.usage=this.usage),e}}class dFe extends Yr{constructor(e,n,r){super(new Int8Array(e),n,r)}}class hFe extends Yr{constructor(e,n,r){super(new Uint8Array(e),n,r)}}class fFe extends Yr{constructor(e,n,r){super(new Uint8ClampedArray(e),n,r)}}class pFe extends Yr{constructor(e,n,r){super(new Int16Array(e),n,r)}}class Gz extends Yr{constructor(e,n,r){super(new Uint16Array(e),n,r)}}class mFe extends Yr{constructor(e,n,r){super(new Int32Array(e),n,r)}}class Vz extends Yr{constructor(e,n,r){super(new Uint32Array(e),n,r)}}class gFe extends Yr{constructor(e,n,r){super(new Uint16Array(e),n,r),this.isFloat16BufferAttribute=!0}getX(e){let n=R_(this.array[e*this.itemSize]);return this.normalized&&(n=Gl(n,this.array)),n}setX(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize]=Bl(n),this}getY(e){let n=R_(this.array[e*this.itemSize+1]);return this.normalized&&(n=Gl(n,this.array)),n}setY(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+1]=Bl(n),this}getZ(e){let n=R_(this.array[e*this.itemSize+2]);return this.normalized&&(n=Gl(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+2]=Bl(n),this}getW(e){let n=R_(this.array[e*this.itemSize+3]);return this.normalized&&(n=Gl(n,this.array)),n}setW(e,n){return this.normalized&&(n=Tr(n,this.array)),this.array[e*this.itemSize+3]=Bl(n),this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array)),this.array[e+0]=Bl(n),this.array[e+1]=Bl(r),this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array)),this.array[e+0]=Bl(n),this.array[e+1]=Bl(r),this.array[e+2]=Bl(i),this}setXYZW(e,n,r,i,s){return e*=this.itemSize,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array),s=Tr(s,this.array)),this.array[e+0]=Bl(n),this.array[e+1]=Bl(r),this.array[e+2]=Bl(i),this.array[e+3]=Bl(s),this}}class _n extends Yr{constructor(e,n,r){super(new Float32Array(e),n,r)}}class xFe extends Yr{constructor(e,n,r){super(new Float64Array(e),n,r)}}let vFe=0;const tu=new Wn,Zj=new Xr,Bv=new Ie,dc=new ma,n_=new ma,Ga=new Ie;class or extends Zf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:vFe++}),this.uuid=Mc(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(voe(e)?Vz:Gz)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,r=0){this.groups.push({start:e,count:n,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new Nr().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return tu.makeRotationFromQuaternion(e),this.applyMatrix4(tu),this}rotateX(e){return tu.makeRotationX(e),this.applyMatrix4(tu),this}rotateY(e){return tu.makeRotationY(e),this.applyMatrix4(tu),this}rotateZ(e){return tu.makeRotationZ(e),this.applyMatrix4(tu),this}translate(e,n,r){return tu.makeTranslation(e,n,r),this.applyMatrix4(tu),this}scale(e,n,r){return tu.makeScale(e,n,r),this.applyMatrix4(tu),this}lookAt(e){return Zj.lookAt(e),Zj.updateMatrix(),this.applyMatrix4(Zj.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Bv).negate(),this.translate(Bv.x,Bv.y,Bv.z),this}setFromPoints(e){const n=[];for(let r=0,i=e.length;r<i;r++){const s=e[r];n.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new _n(n,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ma);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new Ie(-1/0,-1/0,-1/0),new Ie(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r<i;r++){const s=n[r];dc.setFromBufferAttribute(s),this.morphTargetsRelative?(Ga.addVectors(this.boundingBox.min,dc.min),this.boundingBox.expandByPoint(Ga),Ga.addVectors(this.boundingBox.max,dc.max),this.boundingBox.expandByPoint(Ga)):(this.boundingBox.expandByPoint(dc.min),this.boundingBox.expandByPoint(dc.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Xa);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
815se".',this),this.boundingSphere.set(new Ie,1/0);return}if(e){const r=this.boundingSphere.center;if(dc.setFromBufferAttribute(e),n)for(let s=0,a=n.length;s<a;s++){const o=n[s];n_.setFromBufferAttribute(o),this.morphTargetsRelative?(Ga.addVectors(dc.min,n_.min),dc.expandByPoint(Ga),Ga.addVectors(dc.max,n_.max),dc.expandByPoint(Ga)):(dc.expandByPoint(n_.min),dc.expandByPoint(n_.max))}dc.getCenter(r);let i=0;for(let s=0,a=e.count;s<a;s++)Ga.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Ga));if(n)for(let s=0,a=n.length;s<a;s++){const o=n[s],l=this.morphTargetsRelative;for(let u=0,d=o.count;u<d;u++)Ga.fromBufferAttribute(o,u),l&&(Bv.fromBufferAttribute(e,u),Ga.add(Bv)),i=Math.max(i,r.distanceToSquared(Ga))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=e.array,i=n.position.array,s=n.normal.array,a=n.uv.array,o=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Yr(new Float32Array(4*o),4));const l=this.getAttribute("tangent").array,u=[],d=[];for(let R=0;R<o;R++)u[R]=new Ie,d[R]=new Ie;const h=new Ie,p=new Ie,f=new Ie,m=new Rt,x=new Rt,v=new Rt,g=new Ie,b=new Ie;function y(R,P,j){h.fromArray(i,R*3),p.fromArray(i,P*3),f.fromArray(i,j*3),m.fromArray(a,R*2),x.fromArray(a,P*2),v.fromArray(a,j*2),p.sub(h),f.sub(h),x.sub(m),v.sub(m);const G=1/(x.x*v.y-v.x*x.y);isFinite(G)&&(g.copy(p).multiplyScalar(v.y).addScaledVector(f,-x.y).multiplyScalar(G),b.copy(f).multiplyScalar(x.x).addScaledVector(p,-v.x).multiplyScalar(G),u[R].add(g),u[P].add(g),u[j].add(g),d[R].add(b),d[P].add(b),d[j].add(b))}let S=this.groups;S.length===0&&(S=[{start:0,count:r.length}]);for(let R=0,P=S.length;R<P;++R){const j=S[R],G=j.start,B=j.count;for(let $=G,U=G+B;$<U;$+=3)y(r[$+0],r[$+1],r[$+2])}const A=new Ie,k=new Ie,M=new Ie,T=new Ie;function C(R){M.fromArray(s,R*3),T.copy(M);const P=u[R];A.copy(P),A.sub(M.multiplyScalar(M.dot(P))).normalize(),k.crossVectors(T,P);const G=k.dot(d[R])<0?-1:1;l[R*4]=A.x,l[R*4+1]=A.y,l[R*4+2]=A.z,l[R*4+3]=G}for(let R=0,P=S.length;R<P;++R){const j=S[R],G=j.start,B=j.count;for(let $=G,U=G+B;$<U;$+=3)C(r[$+0]),C(r[$+1]),C(r[$+2])}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new Yr(new Float32Array(n.count*3),3),this.setAttribute("normal",r);else for(let p=0,f=r.count;p<f;p++)r.setXYZ(p,0,0,0);const i=new Ie,s=new Ie,a=new Ie,o=new Ie,l=new Ie,u=new Ie,d=new Ie,h=new Ie;if(e)for(let p=0,f=e.count;p<f;p+=3){const m=e.getX(p+0),x=e.getX(p+1),v=e.getX(p+2);i.fromBufferAttribute(n,m),s.fromBufferAttribute(n,x),a.fromBufferAttribute(n,v),d.subVectors(a,s),h.subVectors(i,s),d.cross(h),o.fromBufferAttribute(r,m),l.fromBufferAttribute(r,x),u.fromBufferAttribute(r,v),o.add(d),l.add(d),u.add(d),r.setXYZ(m,o.x,o.y,o.z),r.setXYZ(x,l.x,l.y,l.z),r.setXYZ(v,u.x,u.y,u.z)}else for(let p=0,f=n.count;p<f;p+=3)i.fromBufferAttribute(n,p+0),s.fromBufferAttribute(n,p+1),a.fromBufferAttribute(n,p+2),d.subVectors(a,s),h.subVectors(i,s),d.cross(h),r.setXYZ(p+0,d.x,d.y,d.z),r.setXYZ(p+1,d.x,d.y,d.z),r.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,r=e.count;n<r;n++)Ga.fromBufferAttribute(e,n),Ga.normalize(),e.setXYZ(n,Ga.x,Ga.y,Ga.z)}toNonIndexed(){function e(o,l){const u=o.array,d=o.itemSize,h=o.normalized,p=new u.constructor(l.length*d);let f=0,m=0;for(let x=0,v=l.length;x<v;x++){o.isInterleavedBufferAttribute?f=l[x]*o.data.stride+o.offset:f=l[x]*d;for(let g=0;g<d;g++)p[m++]=u[f++]}return new Yr(p,d,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new or,r=this.index.array,i=this.attributes;for(const o in i){const l=i[o],u=e(l,r);n.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 p=u[d],f=e(p,r);l.push(f)}n.morphAttributes[o]=l}n.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const u=a[o];n.addGroup(u.start,u.count,u.materialIndex)}return n}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 26,232 bytes, lines 815-908
815if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const 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,p=u.length;h<p;h++){const f=u[h];d.push(f.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={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(n))}const s=e.morphAttributes;for(const u in s){const d=[],h=s[u];for(let p=0,f=h.length;p<f;p++)d.push(h[p].clone(n));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}dispose(){this.dispatchEvent({type:"dispose"})}}const mW=new Wn,Og=new Dx,Sk=new Xa,gW=new Ie,Fv=new Ie,Ov=new Ie,zv=new Ie,Qj=new Ie,Ak=new Ie,Ek=new Rt,kk=new Rt,Ck=new Rt,xW=new Ie,vW=new Ie,yW=new Ie,Nk=new Ie,Tk=new Ie;class Li extends Xr{constructor(e=new or,n=new ml){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[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,n){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,a=r.morphTargetsRelative;n.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Ak.set(0,0,0);for(let l=0,u=s.length;l<u;l++){const d=o[l],h=s[l];d!==0&&(Qj.fromBufferAttribute(h,e),a?Ak.addScaledVector(Qj,d):Ak.addScaledVector(Qj.sub(n),d))}n.add(Ak)}return n}raycast(e,n){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),Sk.copy(r.boundingSphere),Sk.applyMatrix4(s),Og.copy(e.ray).recast(e.near),!(Sk.containsPoint(Og.origin)===!1&&(Og.intersectSphere(Sk,gW)===null||Og.origin.distanceToSquared(gW)>(e.far-e.near)**2))&&(mW.copy(s).invert(),Og.copy(e.ray).applyMatrix4(mW),!(r.boundingBox!==null&&Og.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Og)))}_computeIntersections(e,n,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,p=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,x=p.length;m<x;m++){const v=p[m],g=a[v.materialIndex],b=Math.max(v.start,f.start),y=Math.min(o.count,Math.min(v.start+v.count,f.start+f.count));for(let S=b,A=y;S<A;S+=3){const k=o.getX(S),M=o.getX(S+1),T=o.getX(S+2);i=Mk(this,g,e,r,u,d,h,k,M,T),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=v.materialIndex,n.push(i))}}else{const m=Math.max(0,f.start),x=Math.min(o.count,f.start+f.count);for(let v=m,g=x;v<g;v+=3){const b=o.getX(v),y=o.getX(v+1),S=o.getX(v+2);i=Mk(this,a,e,r,u,d,h,b,y,S),i&&(i.faceIndex=Math.floor(v/3),n.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,x=p.length;m<x;m++){const v=p[m],g=a[v.materialIndex],b=Math.max(v.start,f.start),y=Math.min(l.count,Math.min(v.start+v.count,f.start+f.count));for(let S=b,A=y;S<A;S+=3){const k=S,M=S+1,T=S+2;i=Mk(this,g,e,r,u,d,h,k,M,T),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=v.materialIndex,n.push(i))}}else{const m=Math.max(0,f.start),x=Math.min(l.count,f.start+f.count);for(let v=m,g=x;v<g;v+=3){const b=v,y=v+1,S=v+2;i=Mk(this,a,e,r,u,d,h,b,y,S),i&&(i.faceIndex=Math.floor(v/3),n.push(i))}}}}function yFe(t,e,n,r,i,s,a,o){let l;if(e.side===xl?l=r.intersectTriangle(a,s,i,!0,o):l=r.intersectTriangle(i,s,a,e.side===Nh,o),l===null)return null;Tk.copy(o),Tk.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(Tk);return u<n.near||u>n.far?null:{distance:u,point:Tk.clone(),object:t}}function Mk(t,e,n,r,i,s,a,o,l,u){t.getVertexPosition(o,Fv),t.getVertexPosition(l,Ov),t.getVertexPosition(u,zv);const d=yFe(t,e,n,r,Fv,Ov,zv,Nk);if(d){i&&(Ek.fromBufferAttribute(i,o),kk.fromBufferAttribute(i,l),Ck.fromBufferAttribute(i,u),d.uv=Hl.getInterpolation(Nk,Fv,Ov,zv,Ek,kk,Ck,new Rt)),s&&(Ek.fromBufferAttribute(s,o),kk.fromBufferAttribute(s,l),Ck.fromBufferAttribute(s,u),d.uv1=Hl.getInterpolation(Nk,Fv,Ov,zv,Ek,kk,Ck,new Rt),d.uv2=d.uv1),a&&(xW.fromBufferAttribute(a,o),vW.fromBufferAttribute(a,l),yW.fromBufferAttribute(a,u),d.normal=Hl.getInterpolation(Nk,Fv,Ov,zv,xW,vW,yW,new Ie),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));const h={a:o,b:l,c:u,normal:new Ie,materialIndex:0};Hl.getNormal(Fv,Ov,zv,h.normal),d.face=h}return d}class Nd extends or{constructor(e=1,n=1,r=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,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 p=0,f=0;m("z","y","x",-1,-1,r,n,e,a,s,0),m("z","y","x",1,-1,r,n,-e,a,s,1),m("x","z","y",1,1,e,r,n,i,a,2),m("x","z","y",1,-1,e,r,-n,i,a,3),m("x","y","z",1,-1,e,n,r,i,s,4),m("x","y","z",-1,-1,e,n,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new _n(u,3)),this.setAttribute("normal",new _n(d,3)),this.setAttribute("uv",new _n(h,2));function m(x,v,g,b,y,S,A,k,M,T,C){const R=S/M,P=A/T,j=S/2,G=A/2,B=k/2,$=M+1,U=T+1;let Z=0,V=0;const W=new Ie;for(let O=0;O<U;O++){const Y=O*P-G;for(let z=0;z<$;z++){const I=z*R-j;W[x]=I*b,W[v]=Y*y,W[g]=B,u.push(W.x,W.y,W.z),W[x]=0,W[v]=0,W[g]=k>0?1:-1,d.push(W.x,W.y,W.z),h.push(z/M),h.push(1-O/T),Z+=1}}for(let O=0;O<T;O++)for(let Y=0;Y<M;Y++){const z=p+Y+$*O,I=p+Y+$*(O+1),q=p+(Y+1)+$*(O+1),te=p+(Y+1)+$*O;l.push(z,I,te),l.push(I,q,te),V+=6}o.addGroup(f,V,C),f+=V,p+=Z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nd(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function o1(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function al(t){const e={};for(let n=0;n<t.length;n++){const r=o1(t[n]);for(const i in r)e[i]=r[i]}return e}function bFe(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function _oe(t){return t.getRenderTarget()===null?t.outputColorSpace:_i.workingColorSpace}const Wz={clone:o1,merge:al};var wFe=`void main() { 816 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 817}`,_Fe=`void main() { 818 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 819}`;class bl extends Ta{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=wFe,this.fragmentShader=_Fe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!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=o1(e.uniforms),this.uniformsGroups=bFe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?n.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[i]={type:"m4",value:a.toArray()}:n.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class jA extends Xr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Wn,this.projectionMatrix=new Wn,this.projectionMatrixInverse=new Wn,this.coordinateSystem=hd}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let Os=class extends jA{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=a1*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan($0*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return a1*2*Math.atan(Math.tan($0*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,s,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=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 n=e*Math.tan($0*.5*this.fov)/this.zoom,r=2*n,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,n-=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,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const Uv=-90,Hv=1;class Soe extends Xr{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Os(Uv,Hv,e,n);i.layers=this.layers,this.add(i);const s=new Os(Uv,Hv,e,n);s.layers=this.layers,this.add(s);const a=new Os(Uv,Hv,e,n);a.layers=this.layers,this.add(a);const o=new Os(Uv,Hv,e,n);o.layers=this.layers,this.add(o);const l=new Os(Uv,Hv,e,n);l.layers=this.layers,this.add(l);const u=new Os(Uv,Hv,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,s,a,o,l]=n;for(const u of n)this.remove(u);if(e===hd)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===s1)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 n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,u,d]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const x=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,s),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,o),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=x,e.setRenderTarget(r,5,i),e.render(n,d),e.setRenderTarget(h,p,f),e.xr.enabled=m,r.texture.needsPMREMUpdate=!0}}class PA extends ui{constructor(e,n,r,i,s,a,o,l,u,d){e=e!==void 0?e:[],n=n!==void 0?n:Th,super(e,n,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 $z extends Yo{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];n.encoding!==void 0&&(d2("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Nm?os:wc),this.texture=new PA(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:zr}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` 820 821 varying vec3 vWorldDirection; 822 823 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 824 825 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 826 827 } 828 829 void main() { 830 831 vWorldDirection = transformDirection( position, modelMatrix ); 832 833 #include <begin_vertex> 834 #include <project_vertex> 835 836 } 837 `,fragmentShader:` 838 839 uniform sampler2D tEquirect; 840 841 varying vec3 vWorldDirection; 842 843 #include <common> 844 845 void main() { 846 847 vec3 direction = normalize( vWorldDirection ); 848 849 vec2 sampleUV = equirectUv( direction ); 850 851 gl_FragColor = texture2D( tEquirect, sampleUV ); 852 853 } 854 `},i=new Nd(5,5,5),s=new bl({name:"CubemapFromEquirect",uniforms:o1(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:xl,blending:bh});s.uniforms.tEquirect.value=n;const a=new Li(i,s),o=n.minFilter;return n.minFilter===Mh&&(n.minFilter=zr),new Soe(1,10,this).update(e,a),n.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,r,i){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(s)}}const eP=new Ie,SFe=new Ie,AFe=new Nr;class ff{constructor(e=new Ie(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=eP.subVectors(r,n).cross(SFe.subVectors(e,n)).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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(eP),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:n.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||AFe.getNormalMatrix(e),i=this.coplanarPoint(eP).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 zg=new Xa,Rk=new Ie;class LA{constructor(e=new ff,n=new ff,r=new ff,i=new ff,s=new ff,a=new ff){this.planes=[e,n,r,i,s,a]}set(e,n,r,i,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(r),o[3].copy(i),o[4].copy(s),o[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=hd){const r=this.planes,i=e.elements,s=i[0],a=i[1],o=i[2],l=i[3],u=i[4],d=i[5],h=i[6],p=i[7],f=i[8],m=i[9],x=i[10],v=i[11],g=i[12],b=i[13],y=i[14],S=i[15];if(r[0].setComponents(l-s,p-u,v-f,S-g).normalize(),r[1].setComponents(l+s,p+u,v+f,S+g).normalize(),r[2].setComponents(l+a,p+d,v+m,S+b).normalize(),r[3].setComponents(l-a,p-d,v-m,S-b).normalize(),r[4].setComponents(l-o,p-h,v-x,S-y).normalize(),n===hd)r[5].setComponents(l+o,p+h,v+x,S+y).normalize();else if(n===s1)r[5].setComponents(o,h,x,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),zg.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),zg.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(zg)}intersectsSprite(e){return zg.center.set(0,0,0),zg.radius=.7071067811865476,zg.applyMatrix4(e.matrixWorld),this.intersectsSphere(zg)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const n=this.planes;for(let r=0;r<6;r++){const i=n[r];if(Rk.x=i.normal.x>0?e.max.x:e.min.x,Rk.y=i.normal.y>0?e.max.y:e.min.y,Rk.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Rk)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Aoe(){let t=null,e=!1,n=null,r=null;function i(s,a){n(s,a),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function EFe(t,e){const n=e.isWebGL2,r=new WeakMap;function i(u,d){const h=u.array,p=u.usage,f=h.byteLength,m=t.createBuffer();t.bindBuffer(d,m),t.bufferData(d,h,p),u.onUploadCallback();let x;if(h instanceof Float32Array)x=t.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)x=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=t.UNSIGNED_SHORT;else if(h instanceof Int16Array)x=t.SHORT;else if(h instanceof Uint32Array)x=t.UNSIGNED_INT;else if(h instanceof Int32Array)x=t.INT;else if(h instanceof Int8Array)x=t.BYTE;else if(h instanceof Uint8Array)x=t.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)x=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:x,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:f}}function s(u,d,h){const p=d.array,f=d._updateRange,m=d.updateRanges;if(t.bindBuffer(h,u),f.count===-1&&m.length===0&&t.bufferSubData(h,0,p),m.length!==0){for(let x=0,v=m.length;x<v;x++){const g=m[x];n?t.bufferSubData(h,g.start*p.BYTES_PER_ELEMENT,p,g.start,g.count):t.bufferSubData(h,g.start*p.BYTES_PER_ELEMENT,p.subarray(g.start,g.start+g.count))}d.clearUpdateRanges()}f.count!==-1&&(n?t.bufferSubData(h,f.offset*p.BYTES_PER_ELEMENT,p,f.offset,f.count):t.bufferSubData(h,f.offset*p.BYTES_PER_ELEMENT,p.subarray(f.offset,f.offset+f.count)),f.count=-1),d.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function o(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=r.get(u);d&&(t.deleteBuffer(d.buffer),r.delete(u))}function l(u,d){if(u.isGLBufferAttribute){const p=r.get(u);(!p||p.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);const h=r.get(u);if(h===void 0)r.set(u,i(u,d));else if(h.version<u.version){if(h.size!==u.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.");s(h.buffer,u,d),h.version=u.version}}return{get:a,remove:o,update:l}}class Td extends or{constructor(e=1,n=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:r,heightSegments:i};const s=e/2,a=n/2,o=Math.floor(r),l=Math.floor(i),u=o+1,d=l+1,h=e/o,p=n/l,f=[],m=[],x=[],v=[];for(let g=0;g<d;g++){const b=g*p-a;for(let y=0;y<u;y++){const S=y*h-s;m.push(S,-b,0),x.push(0,0,1),v.push(y/o),v.push(1-g/l)}}for(let g=0;g<l;g++)for(let b=0;b<o;b++){const y=b+u*g,S=b+u*(g+1),A=b+1+u*(g+1),k=b+1+u*g;f.push(y,S,k),f.push(S,A,k)}this.setIndex(f),this.setAttribute("position",new _n(m,3)),this.setAttribute("normal",new _n(x,3)),this.setAttribute("uv",new _n(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Td(e.width,e.height,e.widthSegments,e.heightSegments)}}var kFe=`#ifdef USE_ALPHAHASH 855 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 856#endif`,CFe=`#ifdef USE_ALPHAHASH 857 const float ALPHA_HASH_SCALE = 0.05; 858 float hash2D( vec2 value ) { 859 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 860 } 861 float hash3D( vec3 value ) { 862 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 863 } 864 float getAlphaHashThreshold( vec3 position ) { 865 float maxDeriv = max( 866 length( dFdx( position.xyz ) ), 867 length( dFdy( position.xyz ) ) 868 ); 869 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 870 vec2 pixScales = vec2( 871 exp2( floor( log2( pixScale ) ) ), 872 exp2( ceil( log2( pixScale ) ) ) 873 ); 874 vec2 alpha = vec2( 875 hash3D( floor( pixScales.x * position.xyz ) ), 876 hash3D( floor( pixScales.y * position.xyz ) ) 877 ); 878 float lerpFactor = fract( log2( pixScale ) ); 879 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 880 float a = min( lerpFactor, 1.0 - lerpFactor ); 881 vec3 cases = vec3( 882 x * x / ( 2.0 * a * ( 1.0 - a ) ), 883 ( x - 0.5 * a ) / ( 1.0 - a ), 884 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 885 ); 886 float threshold = ( x < ( 1.0 - a ) ) 887 ? ( ( x < a ) ? cases.x : cases.y ) 888 : cases.z; 889 return clamp( threshold , 1.0e-6, 1.0 ); 890 } 891#endif`,NFe=`#ifdef USE_ALPHAMAP 892 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 893#endif`,TFe=`#ifdef USE_ALPHAMAP 894 uniform sampler2D alphaMap; 895#endif`,MFe=`#ifdef USE_ALPHATEST 896 if ( diffuseColor.a < alphaTest ) discard; 897#endif`,RFe=`#ifdef USE_ALPHATEST 898 uniform float alphaTest; 899#endif`,jFe=`#ifdef USE_AOMAP 900 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 901 reflectedLight.indirectDiffuse *= ambientOcclusion; 902 #if defined( USE_CLEARCOAT ) 903 clearcoatSpecularIndirect *= ambientOcclusion; 904 #endif 905 #if defined( USE_SHEEN ) 906 sheenSpecularIndirect *= ambientOcclusion; 907 #endif 908 #if defined( USE_ENVMAP ) && defined( STANDARD )
909 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 910 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 911 #endif 912#endif`,PFe=`#ifdef USE_AOMAP 913 uniform sampler2D aoMap; 914 uniform float aoMapIntensity; 915#endif`,LFe=`#ifdef USE_BATCHING 916 attribute float batchId; 917 uniform highp sampler2D batchingTexture; 918 mat4 getBatchingMatrix( const in float i ) { 919 int size = textureSize( batchingTexture, 0 ).x; 920 int j = int( i ) * 4; 921 int x = j % size; 922 int y = j / size; 923 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 924 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 925 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 926 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 927 return mat4( v1, v2, v3, v4 ); 928 } 929#endif`,IFe=`#ifdef USE_BATCHING 930 mat4 batchingMatrix = getBatchingMatrix( batchId ); 931#endif`,DFe=`vec3 transformed = vec3( position ); 932#ifdef USE_ALPHAHASH 933 vPosition = vec3( position ); 934#endif`,BFe=`vec3 objectNormal = vec3( normal ); 935#ifdef USE_TANGENT 936 vec3 objectTangent = vec3( tangent.xyz ); 937#endif`,FFe=`float G_BlinnPhong_Implicit( ) { 938 return 0.25; 939} 940float D_BlinnPhong( const in float shininess, const in float dotNH ) { 941 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 942} 943vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 944 vec3 halfDir = normalize( lightDir + viewDir ); 945 float dotNH = saturate( dot( normal, halfDir ) ); 946 float dotVH = saturate( dot( viewDir, halfDir ) ); 947 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 948 float G = G_BlinnPhong_Implicit( ); 949 float D = D_BlinnPhong( shininess, dotNH ); 950 return F * ( G * D ); 951} // validated`,OFe=`#ifdef USE_IRIDESCENCE 952 const mat3 XYZ_TO_REC709 = mat3( 953 3.2404542, -0.9692660, 0.0556434, 954 -1.5371385, 1.8760108, -0.2040259, 955 -0.4985314, 0.0415560, 1.0572252 956 ); 957 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 958 vec3 sqrtF0 = sqrt( fresnel0 ); 959 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 960 } 961 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 962 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 963 } 964 float IorToFresnel0( float transmittedIor, float incidentIor ) { 965 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 966 } 967 vec3 evalSensitivity( float OPD, vec3 shift ) { 968 float phase = 2.0 * PI * OPD * 1.0e-9; 969 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 970 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 971 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 972 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 973 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 ) ); 974 xyz /= 1.0685e-7; 975 vec3 rgb = XYZ_TO_REC709 * xyz; 976 return rgb; 977 } 978 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 979 vec3 I; 980 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 981 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 982 float cosTheta2Sq = 1.0 - sinTheta2Sq; 983 if ( cosTheta2Sq < 0.0 ) { 984 return vec3( 1.0 ); 985 } 986 float cosTheta2 = sqrt( cosTheta2Sq ); 987 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 988 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
989 float T121 = 1.0 - R12; 990 float phi12 = 0.0; 991 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 992 float phi21 = PI - phi12; 993 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 994 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 995 vec3 phi23 = vec3( 0.0 ); 996 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 997 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 998 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 999 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 1000 vec3 phi = vec3( phi21 ) + phi23; 1001 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 1002 vec3 r123 = sqrt( R123 ); 1003 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 1004 vec3 C0 = R12 + Rs; 1005 I = C0; 1006 vec3 Cm = Rs - T121; 1007 for ( int m = 1; m <= 2; ++ m ) { 1008 Cm *= r123; 1009 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 1010 I += Cm * Sm; 1011 } 1012 return max( I, vec3( 0.0 ) ); 1013 } 1014#endif`,zFe=`#ifdef USE_BUMPMAP 1015 uniform sampler2D bumpMap; 1016 uniform float bumpScale; 1017 vec2 dHdxy_fwd() { 1018 vec2 dSTdx = dFdx( vBumpMapUv ); 1019 vec2 dSTdy = dFdy( vBumpMapUv ); 1020 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 1021 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 1022 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 1023 return vec2( dBx, dBy ); 1024 } 1025 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 1026 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 1027 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 1028 vec3 vN = surf_norm; 1029 vec3 R1 = cross( vSigmaY, vN ); 1030 vec3 R2 = cross( vN, vSigmaX ); 1031 float fDet = dot( vSigmaX, R1 ) * faceDirection; 1032 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 1033 return normalize( abs( fDet ) * surf_norm - vGrad ); 1034 } 1035#endif`,UFe=`#if NUM_CLIPPING_PLANES > 0 1036 vec4 plane; 1037 #pragma unroll_loop_start 1038 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 1039 plane = clippingPlanes[ i ]; 1040 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 1041 } 1042 #pragma unroll_loop_end 1043 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 1044 bool clipped = true; 1045 #pragma unroll_loop_start 1046 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 1047 plane = clippingPlanes[ i ]; 1048 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 1049 } 1050 #pragma unroll_loop_end 1051 if ( clipped ) discard; 1052 #endif 1053#endif`,HFe=`#if NUM_CLIPPING_PLANES > 0 1054 varying vec3 vClipPosition; 1055 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 1056#endif`,GFe=`#if NUM_CLIPPING_PLANES > 0 1057 varying vec3 vClipPosition; 1058#endif`,VFe=`#if NUM_CLIPPING_PLANES > 0 1059 vClipPosition = - mvPosition.xyz; 1060#endif`,WFe=`#if defined( USE_COLOR_ALPHA ) 1061 diffuseColor *= vColor; 1062#elif defined( USE_COLOR ) 1063 diffuseColor.rgb *= vColor; 1064#endif`,$Fe=`#if defined( USE_COLOR_ALPHA ) 1065 varying vec4 vColor; 1066#elif defined( USE_COLOR ) 1067 varying vec3 vColor; 1068#endif`,KFe=`#if defined( USE_COLOR_ALPHA ) 1069 varying vec4 vColor; 1070#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 1071 varying vec3 vColor; 1072#endif`,qFe=`#if defined( USE_COLOR_ALPHA ) 1073 vColor = vec4( 1.0 ); 1074#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 1075 vColor = vec3( 1.0 ); 1076#endif 1077#ifdef USE_COLOR 1078 vColor *= color; 1079#endif 1080#ifdef USE_INSTANCING_COLOR 1081 vColor.xyz *= instanceColor.xyz; 1082#endif`,XFe=`#define PI 3.141592653589793 1083#define PI2 6.283185307179586 1084#define PI_HALF 1.5707963267948966 1085#define RECIPROCAL_PI 0.3183098861837907 1086#define RECIPROCAL_PI2 0.15915494309189535 1087#define EPSILON 1e-6 1088#ifndef saturate 1089#define saturate( a ) clamp( a, 0.0, 1.0 ) 1090#endif 1091#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 1092float pow2( const in float x ) { return x*x; } 1093vec3 pow2( const in vec3 x ) { return x*x; } 1094float pow3( const in float x ) { return x*x*x; } 1095float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 1096float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 1097float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 1098highp float rand( const in vec2 uv ) { 1099 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 1100 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 1101 return fract( sin( sn ) * c ); 1102} 1103#ifdef HIGH_PRECISION 1104 float precisionSafeLength( vec3 v ) { return length( v ); } 1105#else 1106 float precisionSafeLength( vec3 v ) { 1107 float maxComponent = max3( abs( v ) ); 1108 return length( v / maxComponent ) * maxComponent; 1109 } 1110#endif 1111struct IncidentLight { 1112 vec3 color; 1113 vec3 direction; 1114 bool visible; 1115}; 1116struct ReflectedLight { 1117 vec3 directDiffuse; 1118 vec3 directSpecular; 1119 vec3 indirectDiffuse; 1120 vec3 indirectSpecular; 1121}; 1122#ifdef USE_ALPHAHASH 1123 varying vec3 vPosition; 1124#endif 1125vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 1126 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 1127} 1128vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 1129 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 1130} 1131mat3 transposeMat3( const in mat3 m ) { 1132 mat3 tmp; 1133 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 1134 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 1135 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 1136 return tmp; 1137} 1138float luminance( const in vec3 rgb ) { 1139 const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); 1140 return dot( weights, rgb ); 1141} 1142bool isPerspectiveMatrix( mat4 m ) { 1143 return m[ 2 ][ 3 ] == - 1.0; 1144} 1145vec2 equirectUv( in vec3 dir ) { 1146 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 1147 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 1148 return vec2( u, v ); 1149}
1150vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 1151 return RECIPROCAL_PI * diffuseColor; 1152} 1153vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 1154 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 1155 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 1156} 1157float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 1158 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 1159 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 1160} // validated`,YFe=`#ifdef ENVMAP_TYPE_CUBE_UV 1161 #define cubeUV_minMipLevel 4.0 1162 #define cubeUV_minTileSize 16.0 1163 float getFace( vec3 direction ) { 1164 vec3 absDirection = abs( direction ); 1165 float face = - 1.0; 1166 if ( absDirection.x > absDirection.z ) { 1167 if ( absDirection.x > absDirection.y ) 1168 face = direction.x > 0.0 ? 0.0 : 3.0; 1169 else 1170 face = direction.y > 0.0 ? 1.0 : 4.0; 1171 } else { 1172 if ( absDirection.z > absDirection.y ) 1173 face = direction.z > 0.0 ? 2.0 : 5.0; 1174 else 1175 face = direction.y > 0.0 ? 1.0 : 4.0; 1176 } 1177 return face; 1178 } 1179 vec2 getUV( vec3 direction, float face ) { 1180 vec2 uv; 1181 if ( face == 0.0 ) { 1182 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 1183 } else if ( face == 1.0 ) { 1184 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 1185 } else if ( face == 2.0 ) { 1186 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 1187 } else if ( face == 3.0 ) { 1188 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 1189 } else if ( face == 4.0 ) { 1190 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 1191 } else { 1192 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 1193 } 1194 return 0.5 * ( uv + 1.0 ); 1195 } 1196 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 1197 float face = getFace( direction ); 1198 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 1199 mipInt = max( mipInt, cubeUV_minMipLevel ); 1200 float faceSize = exp2( mipInt ); 1201 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 1202 if ( face > 2.0 ) { 1203 uv.y += faceSize; 1204 face -= 3.0; 1205 } 1206 uv.x += face * faceSize; 1207 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 1208 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 1209 uv.x *= CUBEUV_TEXEL_WIDTH; 1210 uv.y *= CUBEUV_TEXEL_HEIGHT; 1211 #ifdef texture2DGradEXT 1212 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 1213 #else 1214 return texture2D( envMap, uv ).rgb; 1215 #endif 1216 } 1217 #define cubeUV_r0 1.0 1218 #define cubeUV_m0 - 2.0 1219 #define cubeUV_r1 0.8 1220 #define cubeUV_m1 - 1.0 1221 #define cubeUV_r4 0.4 1222 #define cubeUV_m4 2.0 1223 #define cubeUV_r5 0.305 1224 #define cubeUV_m5 3.0 1225 #define cubeUV_r6 0.21 1226 #define cubeUV_m6 4.0 1227 float roughnessToMip( float roughness ) { 1228 float mip = 0.0; 1229 if ( roughness >= cubeUV_r1 ) { 1230 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 1231 } else if ( roughness >= cubeUV_r4 ) { 1232 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 1233 } else if ( roughness >= cubeUV_r5 ) { 1234 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 1235 } else if ( roughness >= cubeUV_r6 ) { 1236 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 1237 } else { 1238 mip = - 2.0 * log2( 1.16 * roughness ); } 1239 return mip; 1240 } 1241 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 1242 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 1243 float mipF = fract( mip ); 1244 float mipInt = floor( mip ); 1245 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 1246 if ( mipF == 0.0 ) { 1247 return vec4( color0, 1.0 ); 1248 } else { 1249 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 1250 return vec4( mix( color0, color1, mipF ), 1.0 ); 1251 } 1252 } 1253#endif`,JFe=`vec3 transformedNormal = objectNormal; 1254#ifdef USE_TANGENT 1255 vec3 transformedTangent = objectTangent; 1256#endif 1257#ifdef USE_BATCHING 1258 mat3 bm = mat3( batchingMatrix ); 1259 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 1260 transformedNormal = bm * transformedNormal; 1261 #ifdef USE_TANGENT 1262 transformedTangent = bm * transformedTangent; 1263 #endif 1264#endif 1265#ifdef USE_INSTANCING 1266 mat3 im = mat3( instanceMatrix ); 1267 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 1268 transformedNormal = im * transformedNormal; 1269 #ifdef USE_TANGENT 1270 transformedTangent = im * transformedTangent; 1271 #endif 1272#endif 1273transformedNormal = normalMatrix * transformedNormal; 1274#ifdef FLIP_SIDED 1275 transformedNormal = - transformedNormal; 1276#endif 1277#ifdef USE_TANGENT 1278 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 1279 #ifdef FLIP_SIDED 1280 transformedTangent = - transformedTangent; 1281 #endif 1282#endif`,ZFe=`#ifdef USE_DISPLACEMENTMAP 1283 uniform sampler2D displacementMap; 1284 uniform float displacementScale; 1285 uniform float displacementBias; 1286#endif`,QFe=`#ifdef USE_DISPLACEMENTMAP 1287 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
1287placementBias ); 1288#endif`,eOe=`#ifdef USE_EMISSIVEMAP 1289 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 1290 totalEmissiveRadiance *= emissiveColor.rgb; 1291#endif`,tOe=`#ifdef USE_EMISSIVEMAP 1292 uniform sampler2D emissiveMap; 1293#endif`,nOe="gl_FragColor = linearToOutputTexel( gl_FragColor );",rOe=` 1294const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( 1295 vec3( 0.8224621, 0.177538, 0.0 ), 1296 vec3( 0.0331941, 0.9668058, 0.0 ), 1297 vec3( 0.0170827, 0.0723974, 0.9105199 ) 1298); 1299const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( 1300 vec3( 1.2249401, - 0.2249404, 0.0 ), 1301 vec3( - 0.0420569, 1.0420571, 0.0 ), 1302 vec3( - 0.0196376, - 0.0786361, 1.0982735 ) 1303); 1304vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { 1305 return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); 1306} 1307vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { 1308 return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); 1309} 1310vec4 LinearTransferOETF( in vec4 value ) { 1311 return value; 1312} 1313vec4 sRGBTransferOETF( in vec4 value ) { 1314 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 ); 1315} 1316vec4 LinearToLinear( in vec4 value ) { 1317 return value; 1318} 1319vec4 LinearTosRGB( in vec4 value ) { 1320 return sRGBTransferOETF( value ); 1321}`,iOe=`#ifdef USE_ENVMAP 1322 #ifdef ENV_WORLDPOS 1323 vec3 cameraToFrag; 1324 if ( isOrthographic ) { 1325 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 1326 } else { 1327 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 1328 } 1329 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 1330 #ifdef ENVMAP_MODE_REFLECTION 1331 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 1332 #else 1333 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 1334 #endif 1335 #else 1336 vec3 reflectVec = vReflect; 1337 #endif 1338 #ifdef ENVMAP_TYPE_CUBE 1339 vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 1340 #else 1341 vec4 envColor = vec4( 0.0 ); 1342 #endif 1343 #ifdef ENVMAP_BLENDING_MULTIPLY 1344 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 1345 #elif defined( ENVMAP_BLENDING_MIX ) 1346 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 1347 #elif defined( ENVMAP_BLENDING_ADD ) 1348 outgoingLight += envColor.xyz * specularStrength * reflectivity; 1349 #endif 1350#endif`,sOe=`#ifdef USE_ENVMAP 1351 uniform float envMapIntensity; 1352 uniform float flipEnvMap; 1353 #ifdef ENVMAP_TYPE_CUBE 1354 uniform samplerCube envMap; 1355 #else 1356 uniform sampler2D envMap; 1357 #endif 1358 1359#endif`,aOe=`#ifdef USE_ENVMAP 1360 uniform float reflectivity; 1361 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 1362 #define ENV_WORLDPOS 1363 #endif 1364 #ifdef ENV_WORLDPOS 1365 varying vec3 vWorldPosition; 1366 uniform float refractionRatio; 1367 #else 1368 varying vec3 vReflect; 1369 #endif 1370#endif`,oOe=`#ifdef USE_ENVMAP 1371 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 1372 #define ENV_WORLDPOS 1373 #endif 1374 #ifdef ENV_WORLDPOS 1375 1376 varying vec3 vWorldPosition; 1377 #else 1378 varying vec3 vReflect; 1379 uniform float refractionRatio; 1380 #endif 1381#endif`,lOe=`#ifdef USE_ENVMAP 1382 #ifdef ENV_WORLDPOS 1383 vWorldPosition = worldPosition.xyz; 1384 #else 1385 vec3 cameraToVertex; 1386 if ( isOrthographic ) { 1387 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 1388 } else {
1389 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 1390 } 1391 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1392 #ifdef ENVMAP_MODE_REFLECTION 1393 vReflect = reflect( cameraToVertex, worldNormal ); 1394 #else 1395 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 1396 #endif 1397 #endif 1398#endif`,cOe=`#ifdef USE_FOG 1399 vFogDepth = - mvPosition.z; 1400#endif`,uOe=`#ifdef USE_FOG 1401 varying float vFogDepth; 1402#endif`,dOe=`#ifdef USE_FOG 1403 #ifdef FOG_EXP2 1404 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 1405 #else 1406 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 1407 #endif 1408 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 1409#endif`,hOe=`#ifdef USE_FOG 1410 uniform vec3 fogColor; 1411 varying float vFogDepth; 1412 #ifdef FOG_EXP2 1413 uniform float fogDensity; 1414 #else 1415 uniform float fogNear; 1416 uniform float fogFar; 1417 #endif 1418#endif`,fOe=`#ifdef USE_GRADIENTMAP 1419 uniform sampler2D gradientMap; 1420#endif 1421vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 1422 float dotNL = dot( normal, lightDirection ); 1423 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 1424 #ifdef USE_GRADIENTMAP 1425 return vec3( texture2D( gradientMap, coord ).r ); 1426 #else 1427 vec2 fw = fwidth( coord ) * 0.5; 1428 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 1429 #endif 1430}`,pOe=`#ifdef USE_LIGHTMAP 1431 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1432 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1433 reflectedLight.indirectDiffuse += lightMapIrradiance; 1434#endif`,mOe=`#ifdef USE_LIGHTMAP 1435 uniform sampler2D lightMap; 1436 uniform float lightMapIntensity; 1437#endif`,gOe=`LambertMaterial material; 1438material.diffuseColor = diffuseColor.rgb; 1439material.specularStrength = specularStrength;`,xOe=`varying vec3 vViewPosition; 1440struct LambertMaterial { 1441 vec3 diffuseColor; 1442 float specularStrength; 1443}; 1444void 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 ) { 1445 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1446 vec3 irradiance = dotNL * directLight.color; 1447 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1448} 1449void 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 ) { 1450 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1451} 1452#define RE_Direct RE_Direct_Lambert 1453#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,vOe=`uniform bool receiveShadow; 1454uniform vec3 ambientLightColor; 1455#if defined( USE_LIGHT_PROBES ) 1456 uniform vec3 lightProbe[ 9 ]; 1457#endif 1458vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 1459 float x = normal.x, y = normal.y, z = normal.z; 1460 vec3 result = shCoefficients[ 0 ] * 0.886227; 1461 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 1462 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 1463 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 1464 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 1465 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 1466 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 1467 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 1468 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 1469 return result; 1470} 1471vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 1472 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 1473 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 1474 return irradiance; 1475} 1476vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 1477 vec3 irradiance = ambientLightColor; 1478 return irradiance; 1479} 1480float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 1481 #if defined ( LEGACY_LIGHTS ) 1482 if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { 1483 return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); 1484 } 1485 return 1.0; 1486 #else 1487 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 1488 if ( cutoffDistance > 0.0 ) { 1489 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 1490 } 1491 return distanceFalloff; 1492 #endif 1493} 1494float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 1495 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 1496} 1497#if NUM_DIR_LIGHTS > 0 1498 struct DirectionalLight { 1499 vec3 direction; 1500 vec3 color; 1501 }; 1502 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 1503 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 1504 light.color = directionalLight.color; 1505 light.direction = directionalLight.direction; 1506 light.visible = true; 1507 } 1508#endif 1509#if NUM_POINT_LIGHTS > 0 1510 struct PointLight { 1511 vec3 position; 1512 vec3 color; 1513 float distance; 1514 float decay; 1515 }; 1516 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 1517 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 1518 vec3 lVector = pointLight.position - geometryPosition; 1519 light.direction = normalize( lVector ); 1520 float lightDistance = length( lVector ); 1521 light.color = pointLight.color; 1522 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 1523 light.visible = ( light.color != vec3( 0.0 ) ); 1524 } 1525#endif
1526#if NUM_SPOT_LIGHTS > 0 1527 struct SpotLight { 1528 vec3 position; 1529 vec3 direction; 1530 vec3 color; 1531 float distance; 1532 float decay; 1533 float coneCos; 1534 float penumbraCos; 1535 }; 1536 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 1537 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 1538 vec3 lVector = spotLight.position - geometryPosition; 1539 light.direction = normalize( lVector ); 1540 float angleCos = dot( light.direction, spotLight.direction ); 1541 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 1542 if ( spotAttenuation > 0.0 ) { 1543 float lightDistance = length( lVector ); 1544 light.color = spotLight.color * spotAttenuation; 1545 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 1546 light.visible = ( light.color != vec3( 0.0 ) ); 1547 } else { 1548 light.color = vec3( 0.0 ); 1549 light.visible = false; 1550 } 1551 } 1552#endif 1553#if NUM_RECT_AREA_LIGHTS > 0 1554 struct RectAreaLight { 1555 vec3 color; 1556 vec3 position; 1557 vec3 halfWidth; 1558 vec3 halfHeight; 1559 }; 1560 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 1561 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 1562#endif 1563#if NUM_HEMI_LIGHTS > 0 1564 struct HemisphereLight { 1565 vec3 direction; 1566 vec3 skyColor; 1567 vec3 groundColor; 1568 }; 1569 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 1570 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 1571 float dotNL = dot( normal, hemiLight.direction ); 1572 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 1573 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 1574 return irradiance; 1575 } 1576#endif`,yOe=`#ifdef USE_ENVMAP 1577 vec3 getIBLIrradiance( const in vec3 normal ) { 1578 #ifdef ENVMAP_TYPE_CUBE_UV 1579 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 1580 vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); 1581 return PI * envMapColor.rgb * envMapIntensity; 1582 #else 1583 return vec3( 0.0 ); 1584 #endif 1585 } 1586 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 1587 #ifdef ENVMAP_TYPE_CUBE_UV 1588 vec3 reflectVec = reflect( - viewDir, normal ); 1589 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 1590 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 1591 vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); 1592 return envMapColor.rgb * envMapIntensity; 1593 #else 1594 return vec3( 0.0 ); 1595 #endif 1596 } 1597 #ifdef USE_ANISOTROPY 1598 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 1599 #ifdef ENVMAP_TYPE_CUBE_UV 1600 vec3 bentNormal = cross( bitangent, viewDir ); 1601 bentNormal = normalize( cross( bentNormal, bitangent ) ); 1602 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 1603 return getIBLRadiance( viewDir, bentNormal, roughness ); 1604 #else 1605 return vec3( 0.0 ); 1606 #endif 1607 } 1608 #endif 1609#endif`,bOe=`ToonMaterial material; 1610material.diffuseColor = diffuseColor.rgb;`,wOe=`varying vec3 vViewPosition; 1611struct ToonMaterial { 1612 vec3 diffuseColor; 1613}; 1614void 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 ) { 1615 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 1616 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1617} 1618void 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 ) { 1619 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1620} 1621#define RE_Direct RE_Direct_Toon 1622#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,_Oe=`BlinnPhongMaterial material; 1623material.diffuseColor = diffuseColor.rgb; 1624material.specularColor = specular; 1625material.specularShininess = shininess; 1626material.specularStrength = specularStrength;`,SOe=`varying vec3 vViewPosition; 1627struct BlinnPhongMaterial { 1628 vec3 diffuseColor; 1629 vec3 specularColor; 1630 float specularShininess; 1631 float specularStrength; 1632}; 1633void 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 ) {
1634 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1635 vec3 irradiance = dotNL * directLight.color; 1636 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1637 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 1638} 1639void 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 ) { 1640 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1641} 1642#define RE_Direct RE_Direct_BlinnPhong 1643#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,AOe=`PhysicalMaterial material; 1644material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 1645vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 1646float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 1647material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 1648material.roughness = min( material.roughness, 1.0 ); 1649#ifdef IOR 1650 material.ior = ior; 1651 #ifdef USE_SPECULAR 1652 float specularIntensityFactor = specularIntensity; 1653 vec3 specularColorFactor = specularColor; 1654 #ifdef USE_SPECULAR_COLORMAP 1655 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 1656 #endif 1657 #ifdef USE_SPECULAR_INTENSITYMAP 1658 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 1659 #endif 1660 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 1661 #else 1662 float specularIntensityFactor = 1.0; 1663 vec3 specularColorFactor = vec3( 1.0 ); 1664 material.specularF90 = 1.0; 1665 #endif 1666 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 1667#else 1668 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 1669 material.specularF90 = 1.0; 1670#endif 1671#ifdef USE_CLEARCOAT 1672 material.clearcoat = clearcoat; 1673 material.clearcoatRoughness = clearcoatRoughness; 1674 material.clearcoatF0 = vec3( 0.04 ); 1675 material.clearcoatF90 = 1.0; 1676 #ifdef USE_CLEARCOATMAP 1677 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 1678 #endif 1679 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 1680 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 1681 #endif 1682 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 1683 material.clearcoatRoughness += geometryRoughness; 1684 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 1685#endif 1686#ifdef USE_IRIDESCENCE 1687 material.iridescence = iridescence; 1688 material.iridescenceIOR = iridescenceIOR; 1689 #ifdef USE_IRIDESCENCEMAP 1690 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 1691 #endif 1692 #ifdef USE_IRIDESCENCE_THICKNESSMAP 1693 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 1694 #else 1695 material.iridescenceThickness = iridescenceThicknessMaximum; 1696 #endif 1697#endif 1698#ifdef USE_SHEEN 1699 material.sheenColor = sheenColor; 1700 #ifdef USE_SHEEN_COLORMAP 1701 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 1702 #endif 1703 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 1704 #ifdef USE_SHEEN_ROUGHNESSMAP 1705 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 1706 #endif 1707#endif 1708#ifdef USE_ANISOTROPY 1709 #ifdef USE_ANISOTROPYMAP 1710 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 1711 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 1712 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 1713 #else 1714 vec2 anisotropyV = anisotropyVector; 1715 #endif 1716 material.anisotropy = length( anisotropyV ); 1717 if( material.anisotropy == 0.0 ) { 1718 anisotropyV = vec2( 1.0, 0.0 ); 1719 } else { 1720 anisotropyV /= material.anisotropy; 1721 material.anisotropy = saturate( material.anisotropy ); 1722 } 1723 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1724 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 1725 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 1726#endif`,EOe=`struct PhysicalMaterial { 1727 vec3 diffuseColor; 1728 float roughness; 1729 vec3 specularColor; 1730 float specularF90
vendor: 14,563 bytes, lines 1730-2026
1730; 1731 #ifdef USE_CLEARCOAT 1732 float clearcoat; 1733 float clearcoatRoughness; 1734 vec3 clearcoatF0; 1735 float clearcoatF90; 1736 #endif 1737 #ifdef USE_IRIDESCENCE 1738 float iridescence; 1739 float iridescenceIOR; 1740 float iridescenceThickness; 1741 vec3 iridescenceFresnel; 1742 vec3 iridescenceF0; 1743 #endif 1744 #ifdef USE_SHEEN 1745 vec3 sheenColor; 1746 float sheenRoughness; 1747 #endif 1748 #ifdef IOR 1749 float ior; 1750 #endif 1751 #ifdef USE_TRANSMISSION 1752 float transmission; 1753 float transmissionAlpha; 1754 float thickness; 1755 float attenuationDistance; 1756 vec3 attenuationColor; 1757 #endif 1758 #ifdef USE_ANISOTROPY 1759 float anisotropy; 1760 float alphaT; 1761 vec3 anisotropyT; 1762 vec3 anisotropyB; 1763 #endif 1764}; 1765vec3 clearcoatSpecularDirect = vec3( 0.0 ); 1766vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 1767vec3 sheenSpecularDirect = vec3( 0.0 ); 1768vec3 sheenSpecularIndirect = vec3(0.0 ); 1769vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 1770 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 1771 float x2 = x * x; 1772 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 1773 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 1774} 1775float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 1776 float a2 = pow2( alpha ); 1777 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 1778 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 1779 return 0.5 / max( gv + gl, EPSILON ); 1780} 1781float D_GGX( const in float alpha, const in float dotNH ) { 1782 float a2 = pow2( alpha ); 1783 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 1784 return RECIPROCAL_PI * a2 / pow2( denom ); 1785} 1786#ifdef USE_ANISOTROPY 1787 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 ) { 1788 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 1789 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 1790 float v = 0.5 / ( gv + gl ); 1791 return saturate(v); 1792 } 1793 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 1794 float a2 = alphaT * alphaB; 1795 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 1796 highp float v2 = dot( v, v ); 1797 float w2 = a2 / v2; 1798 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 1799 } 1800#endif 1801#ifdef USE_CLEARCOAT 1802 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 1803 vec3 f0 = material.clearcoatF0; 1804 float f90 = material.clearcoatF90; 1805 float roughness = material.clearcoatRoughness; 1806 float alpha = pow2( roughness ); 1807 vec3 halfDir = normalize( lightDir + viewDir ); 1808 float dotNL = saturate( dot( normal, lightDir ) ); 1809 float dotNV = saturate( dot( normal, viewDir ) ); 1810 float dotNH = saturate( dot( normal, halfDir ) ); 1811 float dotVH = saturate( dot( viewDir, halfDir ) ); 1812 vec3 F = F_Schlick( f0, f90, dotVH ); 1813 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1814 float D = D_GGX( alpha, dotNH ); 1815 return F * ( V * D ); 1816 } 1817#endif 1818vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1819 vec3 f0 = material.specularColor; 1820 float f90 = material.specularF90; 1821 float roughness = material.roughness; 1822 float alpha = pow2( roughness ); 1823 vec3 halfDir = normalize( lightDir + viewDir ); 1824 float dotNL = saturate( dot( normal, lightDir ) ); 1825 float dotNV = saturate( dot( normal, viewDir ) ); 1826 float dotNH = saturate( dot( normal, halfDir ) ); 1827 float dotVH = saturate( dot( viewDir, halfDir ) ); 1828 vec3 F = F_Schlick( f0, f90, dotVH ); 1829 #ifdef USE_IRIDESCENCE 1830 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1831 #endif 1832 #ifdef USE_ANISOTROPY 1833 float dotTL = dot( material.anisotropyT, lightDir ); 1834 float dotTV = dot( material.anisotropyT, viewDir ); 1835 float dotTH = dot( material.anisotropyT, halfDir ); 1836 float dotBL = dot( material.anisotropyB, lightDir ); 1837 float dotBV = dot( material.anisotropyB, viewDir ); 1838 float dotBH = dot( material.anisotropyB, halfDir ); 1839 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1840 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1841 #else 1842 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1843 float D = D_GGX( alpha, dotNH ); 1844 #endif 1845 return F * ( V * D ); 1846} 1847vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1848 const float LUT_SIZE = 64.0; 1849 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1850 const float LUT_BIAS = 0.5 / LUT_SIZE; 1851 float dotNV = saturate( dot( N, V ) ); 1852 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1853 uv = uv * LUT_SCALE + LUT_BIAS; 1854 return uv; 1855} 1856float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1857 float l = length( f ); 1858 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1859} 1860vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1861 float x = dot( v1, v2 ); 1862 float y = abs( x ); 1863 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1864 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1865 float v = a / b; 1866 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1867 return cross( v1, v2 ) * theta_sintheta; 1868} 1869vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1870 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1871 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1872 vec3 lightNormal = cross( v1, v2 ); 1873 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1874 vec3 T1, T2; 1875 T1 = normalize( V - N * dot( V, N ) ); 1876 T2 = - cross( N, T1 ); 1877 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1878 vec3 coords[ 4 ]; 1879 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1880 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1881 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1882 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1883 coords[ 0 ] = normalize( coords[ 0 ] ); 1884 coords[ 1 ] = normalize( coords[ 1 ] ); 1885 coords[ 2 ] = normalize( coords[ 2 ] ); 1886 coords[ 3 ] = normalize( coords[ 3 ] ); 1887 vec3 vectorFormFactor = vec3( 0.0 ); 1888 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1889 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1890 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1891 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1892 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1893 return vec3( result ); 1894} 1895#if defined( USE_SHEEN ) 1896float D_Charlie( float roughness, float dotNH ) { 1897 float alpha = pow2( roughness ); 1898 float invAlpha = 1.0 / alpha; 1899 float cos2h = dotNH * dotNH; 1900 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1901 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1902} 1903float V_Neubelt( float dotNV, float dotNL ) { 1904 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1905} 1906vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1907 vec3 halfDir = normalize( lightDir + viewDir ); 1908 float dotNL = saturate( dot( normal, lightDir ) ); 1909 float dotNV = saturate( dot( normal, viewDir ) ); 1910 float dotNH = saturate( dot( normal, halfDir ) ); 1911 float D = D_Charlie( sheenRoughness, dotNH ); 1912 float V = V_Neubelt( dotNV, dotNL ); 1913 return sheenColor * ( D * V ); 1914} 1915#endif 1916float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1917 float dotNV = saturate( dot( normal, viewDir ) ); 1918 float r2 = roughness * roughness; 1919 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1920 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1921 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1922 return saturate( DG * RECIPROCAL_PI ); 1923} 1924vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1925 float dotNV = saturate( dot( normal, viewDir ) ); 1926 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1927 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1928 vec4 r = roughness * c0 + c1; 1929 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1930 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1931 return fab; 1932} 1933vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1934 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1935 return specularColor * fab.x + specularF90 * fab.y; 1936} 1937#ifdef USE_IRIDESCENCE 1938void 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 ) { 1939#else 1940void 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 ) { 1941#endif 1942 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1943 #ifdef USE_IRIDESCENCE 1944 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1945 #else 1946 vec3 Fr = specularColor; 1947 #endif 1948 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1949 float Ess = fab.x + fab.y; 1950 float Ems = 1.0 - Ess; 1951 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1952 singleScatter += FssEss; 1953 multiScatter += Fms * Ems; 1954} 1955#if NUM_RECT_AREA_LIGHTS > 0 1956 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 ) { 1957 vec3 normal = geometryNormal; 1958 vec3 viewDir = geometryViewDir; 1959 vec3 position = geometryPosition; 1960 vec3 lightPos = rectAreaLight.position; 1961 vec3 halfWidth = rectAreaLight.halfWidth; 1962 vec3 halfHeight = rectAreaLight.halfHeight; 1963 vec3 lightColor = rectAreaLight.color; 1964 float roughness = material.roughness; 1965 vec3 rectCoords[ 4 ]; 1966 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1967 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1968 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1969 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1970 vec4 t1 = texture2D( ltc_1, uv ); 1971 vec4 t2 = texture2D( ltc_2, uv ); 1972 mat3 mInv = mat3( 1973 vec3( t1.x, 0, t1.y ), 1974 vec3( 0, 1, 0 ), 1975 vec3( t1.z, 0, t1.w ) 1976 ); 1977 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1978 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1979 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1980 } 1981#endif 1982void 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 ) { 1983 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1984 vec3 irradiance = dotNL * directLight.color; 1985 #ifdef USE_CLEARCOAT 1986 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1987 vec3 ccIrradiance = dotNLcc * directLight.color; 1988 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1989 #endif 1990 #ifdef USE_SHEEN 1991 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1992 #endif 1993 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1994 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1995} 1996void 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 ) { 1997 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1998} 1999void 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) { 2000 #ifdef USE_CLEARCOAT 2001 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 2002 #endif 2003 #ifdef USE_SHEEN 2004 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 2005 #endif 2006 vec3 singleScattering = vec3( 0.0 ); 2007 vec3 multiScattering = vec3( 0.0 ); 2008 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 2009 #ifdef USE_IRIDESCENCE 2010 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 2011 #else 2012 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 2013 #endif 2014 vec3 totalScattering = singleScattering + multiScattering; 2015 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 2016 reflectedLight.indirectSpecular += radiance * singleScattering; 2017 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 2018 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 2019} 2020#define RE_Direct RE_Direct_Physical 2021#define RE_Direct_RectArea RE_Direct_RectArea_Physical 2022#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 2023#define RE_IndirectSpecular RE_IndirectSpecular_Physical 2024float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 2025 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 2026}`,
2026kOe=` 2027vec3 geometryPosition = - vViewPosition; 2028vec3 geometryNormal = normal; 2029vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 2030vec3 geometryClearcoatNormal = vec3( 0.0 ); 2031#ifdef USE_CLEARCOAT 2032 geometryClearcoatNormal = clearcoatNormal; 2033#endif 2034#ifdef USE_IRIDESCENCE 2035 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 2036 if ( material.iridescenceThickness == 0.0 ) { 2037 material.iridescence = 0.0; 2038 } else { 2039 material.iridescence = saturate( material.iridescence ); 2040 } 2041 if ( material.iridescence > 0.0 ) { 2042 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 2043 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 2044 } 2045#endif 2046IncidentLight directLight; 2047#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 2048 PointLight pointLight; 2049 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 2050 PointLightShadow pointLightShadow; 2051 #endif 2052 #pragma unroll_loop_start 2053 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 2054 pointLight = pointLights[ i ]; 2055 getPointLightInfo( pointLight, geometryPosition, directLight ); 2056 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 2057 pointLightShadow = pointLightShadows[ i ]; 2058 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 2059 #endif 2060 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2061 } 2062 #pragma unroll_loop_end 2063#endif 2064#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 2065 SpotLight spotLight; 2066 vec4 spotColor; 2067 vec3 spotLightCoord; 2068 bool inSpotLightMap; 2069 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 2070 SpotLightShadow spotLightShadow; 2071 #endif 2072 #pragma unroll_loop_start 2073 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 2074 spotLight = spotLights[ i ]; 2075 getSpotLightInfo( spotLight, geometryPosition, directLight ); 2076 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 2077 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 2078 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2079 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 2080 #else 2081 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 2082 #endif 2083 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 2084 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 2085 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 2086 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 2087 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 2088 #endif 2089 #undef SPOT_LIGHT_MAP_INDEX 2090 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2091 spotLightShadow = spotLightShadows[ i ]; 2092 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2093 #endif 2094 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2095 } 2096 #pragma unroll_loop_end 2097#endif 2098#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 2099 DirectionalLight directionalLight; 2100 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 2101 DirectionalLightShadow directionalLightShadow; 2102 #endif 2103 #pragma unroll_loop_start 2104 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 2105 directionalLight = directionalLights[ i ]; 2106 getDirectionalLightInfo( directionalLight, directLight ); 2107 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 2108 directionalLightShadow = directionalLightShadows[ i ]; 2109 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2110 #endif 2111 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2112 } 2113 #pragma unroll_loop_end 2114#endif 2115#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 2116 RectAreaLight rectAreaLight; 2117 #pragma unroll_loop_start 2118 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 2119 rectAreaLight = rectAreaLights[ i ]; 2120 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2121 } 2122 #pragma unroll_loop_end 2123#endif 2124#if defined( RE_IndirectDiffuse ) 2125 vec3 iblIrradiance = vec3( 0.0 ); 2126 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 2127 #if defined( USE_LIGHT_PROBES ) 2128 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 2129 #endif 2130 #if ( NUM_HEMI_LIGHTS > 0 ) 2131 #pragma unroll_loop_start 2132 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 2133 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 2134 } 2135 #pragma unroll_loop_end 2136 #endif 2137#endif 2138#if defined( RE_IndirectSpecular ) 2139 vec3 radiance = vec3( 0.0 ); 2140 vec3 clearcoatRadiance = vec3( 0.0 ); 2141#endif`,COe=`#if defined( RE_IndirectDiffuse ) 2142 #ifdef USE_LIGHTMAP 2143 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2144 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 2145 irradiance += lightMapIrradiance; 2146 #endif 2147 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 2148 iblIrradiance += getIBLIrradiance( geometryNormal ); 2149 #endif 2150#endif 2151#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 2152 #ifdef USE_ANISOTROPY 2153 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 2154 #else 2155 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 2156 #endif 2157 #ifdef USE_CLEARCOAT 2158 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 2159 #endif 2160#endif`,NOe=`#if defined( RE_IndirectDiffuse ) 2161 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2162#endif 2163#if defined( RE_IndirectSpecular ) 2164 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 2165#endif`,TOe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 2166 gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 2167#endif`,MOe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 2168 uniform float logDepthBufFC; 2169 varying float vFragDepth; 2170 varying float vIsPerspective; 2171#endif`,ROe=`#ifdef USE_LOGDEPTHBUF 2172 #ifdef USE_LOGDEPTHBUF_EXT 2173 varying float vFragDepth; 2174 varying float vIsPerspective; 2175 #else 2176 uniform float logDepthBufFC; 2177 #endif 2178#endif`,jOe=`#ifdef USE_LOGDEPTHBUF 2179 #ifdef USE_LOGDEPTHBUF_EXT 2180 vFragDepth = 1.0 + gl_Position.w; 2181 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 2182 #else 2183 if ( isPerspectiveMatrix( projectionMatrix ) ) { 2184 gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; 2185 gl_Position.z *= gl_Position.w; 2186 } 2187 #endif 2188#endif`,POe=`#ifdef USE_MAP 2189 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 2190 #ifdef DECODE_VIDEO_TEXTURE 2191 sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); 2192 2193 #endif 2194 diffuseColor *= sampledDiffuseColor; 2195#endif`,LOe=`#ifdef USE_MAP 2196 uniform sampler2D map; 2197#endif`,IOe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 2198 #if defined( USE_POINTS_UV ) 2199 vec2 uv = vUv; 2200 #else 2201 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 2202 #endif 2203#endif 2204#ifdef USE_MAP 2205 diffuseColor *= texture2D( map, uv ); 2206#endif 2207#ifdef USE_ALPHAMAP 2208 diffuseColor.a *= texture2D( alphaMap, uv ).g; 2209#endif`,DOe=`#if defined( USE_POINTS_UV ) 2210 varying vec2 vUv; 2211#else 2212 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 2213 uniform mat3 uvTransform; 2214 #endif 2215#endif 2216#ifdef USE_MAP 2217 uniform sampler2D map; 2218#endif 2219#ifdef USE_ALPHAMAP 2220 uniform sampler2D alphaMap; 2221#endif`,BOe=`float metalnessFactor = metalness; 2222#ifdef USE_METALNESSMAP 2223 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 2224 metalnessFactor *= texelMetalness.b; 2225#endif`,FOe=`#ifdef USE_METALNESSMAP 2226 uniform sampler2D metalnessMap; 2227#endif`,OOe=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) 2228 vColor *= morphTargetBaseInfluence; 2229 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 2230 #if defined( USE_COLOR_ALPHA ) 2231 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 2232 #elif defined( USE_COLOR ) 2233 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 2234 #endif 2235 } 2236#endif`,zOe=`#ifdef USE_MORPHNORMALS 2237 objectNormal *= morphTargetBaseInfluence; 2238 #ifdef MORPHTARGETS_TEXTURE 2239 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 2240 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 2241 } 2242 #else 2243 objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; 2244 objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; 2245 objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; 2246 objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; 2247 #endif 2248#endif`,UOe=`#ifdef USE_MORPHTARGETS 2249 uniform float morphTargetBaseInfluence; 2250 #ifdef MORPHTARGETS_TEXTURE 2251 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 2252 uniform sampler2DArray morphTargetsTexture; 2253 uniform ivec2 morphTargetsTextureSize; 2254 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 2255 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 2256 int y = texelIndex / morphTargetsTextureSize.x; 2257 int x = texelIndex - y * morphTargetsTextureSize.x; 2258 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 2259 return texelFetch( morphTargetsTexture, morphUV, 0 ); 2260 } 2261 #else 2262 #ifndef USE_MORPHNORMALS 2263 uniform float morphTargetInfluences[ 8 ]; 2264 #else 2265 uniform float morphTargetInfluences[ 4 ]; 2266 #endif 2267 #endif 2268#endif`,HOe=`#ifdef USE_MORPHTARGETS 2269 transformed *= morphTargetBaseInfluence; 2270 #ifdef MORPHTARGETS_TEXTURE 2271 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 2272 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 2273 } 2274 #else 2275 transformed += morphTarget0 * morphTargetInfluences[ 0 ]; 2276 transformed += morphTarget1 * morphTargetInfluences[ 1 ]; 2277 transformed += morphTarget2 * morphTargetInfluences[ 2 ]; 2278 transformed += morphTarget3 * morphTargetInfluences[ 3 ]; 2279 #ifndef USE_MORPHNORMALS 2280 transformed += morphTarget4 * morphTargetInfluences[ 4 ]; 2281 transformed += morphTarget5 * morphTargetInfluences[ 5 ]; 2282 transformed += morphTarget6 * morphTargetInfluences[ 6 ]; 2283 transformed += morphTarget7 * morphTargetInfluences[ 7 ]; 2284 #endif 2285 #endif 2286#endif`,GOe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 2287#ifdef FLAT_SHADED 2288 vec3 fdx = dFdx( vViewPosition ); 2289 vec3 fdy = dFdy( vViewPosition ); 2290 vec3 normal = normalize( cross( fdx, fdy ) ); 2291#else 2292 vec3 normal = normalize( vNormal ); 2293 #ifdef DOUBLE_SIDED 2294 normal *= faceDirection; 2295 #endif 2296#endif 2297#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 2298 #ifdef USE_TANGENT 2299 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 2300 #else 2301 mat3 tbn = getTangentFrame( - vViewPosition, normal, 2302 #if defined( USE_NORMALMAP ) 2303 vNormalMapUv 2304 #elif defined( USE_CLEARCOAT_NORMALMAP ) 2305 vClearcoatNormalMapUv 2306 #else 2307 vUv 2308 #endif 2309 ); 2310 #endif 2311 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 2312 tbn[0] *= faceDirection; 2313 tbn[1] *= faceDirection; 2314 #endif 2315#endif 2316#ifdef USE_CLEARCOAT_NORMALMAP 2317 #ifdef USE_TANGENT 2318 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 2319 #else 2320 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 2321 #endif 2322 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 2323 tbn2[0] *= faceDirection; 2324 tbn2[1] *= faceDirection; 2325 #endif 2326#endif 2327vec3 nonPerturbedNormal = normal;`,VOe=`#ifdef USE_NORMALMAP_OBJECTSPACE 2328 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 2329 #ifdef FLIP_SIDED 2330 normal = - normal; 2331 #endif 2332 #ifdef DOUBLE_SIDED 2333 normal = normal * faceDirection; 2334 #endif 2335 normal = normalize( normalMatrix * normal ); 2336#elif defined( USE_NORMALMAP_TANGENTSPACE ) 2337 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 2338 mapN.xy *= normalScale; 2339 normal = normalize( tbn * mapN ); 2340#elif defined( USE_BUMPMAP )
2341 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 2342#endif`,WOe=`#ifndef FLAT_SHADED 2343 varying vec3 vNormal; 2344 #ifdef USE_TANGENT 2345 varying vec3 vTangent; 2346 varying vec3 vBitangent; 2347 #endif 2348#endif`,$Oe=`#ifndef FLAT_SHADED 2349 varying vec3 vNormal; 2350 #ifdef USE_TANGENT 2351 varying vec3 vTangent; 2352 varying vec3 vBitangent; 2353 #endif 2354#endif`,KOe=`#ifndef FLAT_SHADED 2355 vNormal = normalize( transformedNormal ); 2356 #ifdef USE_TANGENT 2357 vTangent = normalize( transformedTangent ); 2358 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 2359 #endif 2360#endif`,qOe=`#ifdef USE_NORMALMAP 2361 uniform sampler2D normalMap; 2362 uniform vec2 normalScale; 2363#endif 2364#ifdef USE_NORMALMAP_OBJECTSPACE 2365 uniform mat3 normalMatrix; 2366#endif 2367#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 2368 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 2369 vec3 q0 = dFdx( eye_pos.xyz ); 2370 vec3 q1 = dFdy( eye_pos.xyz ); 2371 vec2 st0 = dFdx( uv.st ); 2372 vec2 st1 = dFdy( uv.st ); 2373 vec3 N = surf_norm; 2374 vec3 q1perp = cross( q1, N ); 2375 vec3 q0perp = cross( N, q0 ); 2376 vec3 T = q1perp * st0.x + q0perp * st1.x; 2377 vec3 B = q1perp * st0.y + q0perp * st1.y; 2378 float det = max( dot( T, T ), dot( B, B ) ); 2379 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 2380 return mat3( T * scale, B * scale, N ); 2381 } 2382#endif`,XOe=`#ifdef USE_CLEARCOAT 2383 vec3 clearcoatNormal = nonPerturbedNormal; 2384#endif`,YOe=`#ifdef USE_CLEARCOAT_NORMALMAP 2385 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 2386 clearcoatMapN.xy *= clearcoatNormalScale; 2387 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 2388#endif`,JOe=`#ifdef USE_CLEARCOATMAP 2389 uniform sampler2D clearcoatMap; 2390#endif 2391#ifdef USE_CLEARCOAT_NORMALMAP 2392 uniform sampler2D clearcoatNormalMap; 2393 uniform vec2 clearcoatNormalScale; 2394#endif 2395#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2396 uniform sampler2D clearcoatRoughnessMap; 2397#endif`,ZOe=`#ifdef USE_IRIDESCENCEMAP 2398 uniform sampler2D iridescenceMap; 2399#endif 2400#ifdef USE_IRIDESCENCE_THICKNESSMAP 2401 uniform sampler2D iridescenceThicknessMap; 2402#endif`,QOe=`#ifdef OPAQUE 2403diffuseColor.a = 1.0; 2404#endif 2405#ifdef USE_TRANSMISSION 2406diffuseColor.a *= material.transmissionAlpha; 2407#endif 2408gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,eze=`vec3 packNormalToRGB( const in vec3 normal ) { 2409 return normalize( normal ) * 0.5 + 0.5; 2410} 2411vec3 unpackRGBToNormal( const in vec3 rgb ) { 2412 return 2.0 * rgb.xyz - 1.0; 2413} 2414const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; 2415const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); 2416const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); 2417const float ShiftRight8 = 1. / 256.; 2418vec4 packDepthToRGBA( const in float v ) { 2419 vec4 r = vec4( fract( v * PackFactors ), v ); 2420 r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; 2421} 2422float unpackRGBAToDepth( const in vec4 v ) { 2423 return dot( v, UnpackFactors ); 2424} 2425vec2 packDepthToRG( in highp float v ) { 2426 return packDepthToRGBA( v ).yx; 2427} 2428float unpackRGToDepth( const in highp vec2 v ) { 2429 return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); 2430} 2431vec4 pack2HalfToRGBA( vec2 v ) { 2432 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 2433 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 2434} 2435vec2 unpackRGBATo2Half( vec4 v ) { 2436 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 2437} 2438float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 2439 return ( viewZ + near ) / ( near - far ); 2440} 2441float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 2442 return depth * ( near - far ) - near; 2443} 2444float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 2445 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 2446} 2447float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 2448 return ( near * far ) / ( ( far - near ) * depth - far ); 2449}`,tze=`#ifdef PREMULTIPLIED_ALPHA 2450 gl_FragColor.rgb *= gl_FragColor.a; 2451#endif`,nze=`vec4 mvPosition = vec4( transformed, 1.0 ); 2452#ifdef USE_BATCHING 2453 mvPosition = batchingMatrix * mvPosition; 2454#endif 2455#ifdef USE_INSTANCING 2456 mvPosition = instanceMatrix * mvPosition; 2457#endif 2458mvPosition = modelViewMatrix * mvPosition; 2459gl_Position = projectionMatrix * mvPosition;`,rze=`#ifdef DITHERING 2460 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 2461#endif`,ize=`#ifdef DITHERING 2462 vec3 dithering( vec3 color ) { 2463 float grid_position = rand( gl_FragCoord.xy ); 2464 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 2465 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 2466 return color + dither_shift_RGB; 2467 } 2468#endif`,sze=`float roughnessFactor = roughness; 2469#ifdef USE_ROUGHNESSMAP 2470 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 2471 roughnessFactor *= texelRoughness.g; 2472#endif`,aze=`#ifdef USE_ROUGHNESSMAP 2473 uniform sampler2D roughnessMap;
2474#endif`,oze=`#if NUM_SPOT_LIGHT_COORDS > 0 2475 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2476#endif 2477#if NUM_SPOT_LIGHT_MAPS > 0 2478 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 2479#endif 2480#ifdef USE_SHADOWMAP 2481 #if NUM_DIR_LIGHT_SHADOWS > 0 2482 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 2483 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2484 struct DirectionalLightShadow { 2485 float shadowBias; 2486 float shadowNormalBias; 2487 float shadowRadius; 2488 vec2 shadowMapSize; 2489 }; 2490 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2491 #endif 2492 #if NUM_SPOT_LIGHT_SHADOWS > 0 2493 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 2494 struct SpotLightShadow { 2495 float shadowBias; 2496 float shadowNormalBias; 2497 float shadowRadius; 2498 vec2 shadowMapSize; 2499 }; 2500 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2501 #endif 2502 #if NUM_POINT_LIGHT_SHADOWS > 0 2503 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 2504 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2505 struct PointLightShadow { 2506 float shadowBias; 2507 float shadowNormalBias; 2508 float shadowRadius; 2509 vec2 shadowMapSize; 2510 float shadowCameraNear; 2511 float shadowCameraFar; 2512 }; 2513 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2514 #endif 2515 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 2516 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 2517 } 2518 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 2519 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 2520 } 2521 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 2522 float occlusion = 1.0; 2523 vec2 distribution = texture2DDistribution( shadow, uv ); 2524 float hard_shadow = step( compare , distribution.x ); 2525 if (hard_shadow != 1.0 ) { 2526 float distance = compare - distribution.x ; 2527 float variance = max( 0.00000, distribution.y * distribution.y ); 2528 float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 2529 } 2530 return occlusion; 2531 } 2532 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 2533 float shadow = 1.0; 2534 shadowCoord.xyz /= shadowCoord.w; 2535 shadowCoord.z += shadowBias; 2536 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 2537 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 2538 if ( frustumTest ) { 2539 #if defined( SHADOWMAP_TYPE_PCF ) 2540 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2541 float dx0 = - texelSize.x * shadowRadius; 2542 float dy0 = - texelSize.y * shadowRadius; 2543 float dx1 = + texelSize.x * shadowRadius; 2544 float dy1 = + texelSize.y * shadowRadius; 2545 float dx2 = dx0 / 2.0; 2546 float dy2 = dy0 / 2.0; 2547 float dx3 = dx1 / 2.0; 2548 float dy3 = dy1 / 2.0; 2549 shadow = ( 2550 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 2551 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 2552 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 2553 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 2554 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 2555 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 2556 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 2557 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 2558 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 2559 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 2560 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 2561 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 2562 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 2563 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 2564 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 2565 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 2566 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 2567 ) * ( 1.0 / 17.0 ); 2568 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 2569 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 2570 float dx = texelSize.x; 2571 float dy = texelSize.y; 2572 vec2 uv = shadowCoord.xy;
2573 vec2 f = fract( uv * shadowMapSize + 0.5 ); 2574 uv -= f * texelSize; 2575 shadow = ( 2576 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 2577 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 2578 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 2579 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 2580 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 2581 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 2582 f.x ) + 2583 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 2584 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 2585 f.x ) + 2586 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 2587 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 2588 f.y ) + 2589 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 2590 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 2591 f.y ) + 2592 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 2593 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 2594 f.x ), 2595 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 2596 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 2597 f.x ), 2598 f.y ) 2599 ) * ( 1.0 / 9.0 ); 2600 #elif defined( SHADOWMAP_TYPE_VSM ) 2601 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 2602 #else 2603 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 2604 #endif 2605 } 2606 return shadow; 2607 } 2608 vec2 cubeToUV( vec3 v, float texelSizeY ) { 2609 vec3 absV = abs( v ); 2610 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 2611 absV *= scaleToCube; 2612 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 2613 vec2 planar = v.xy; 2614 float almostATexel = 1.5 * texelSizeY; 2615 float almostOne = 1.0 - almostATexel; 2616 if ( absV.z >= almostOne ) { 2617 if ( v.z > 0.0 ) 2618 planar.x = 4.0 - v.x; 2619 } else if ( absV.x >= almostOne ) { 2620 float signX = sign( v.x ); 2621 planar.x = v.z * signX + 2.0 * signX; 2622 } else if ( absV.y >= almostOne ) { 2623 float signY = sign( v.y ); 2624 planar.x = v.x + 2.0 * signY + 2.0; 2625 planar.y = v.z * signY - 2.0; 2626 } 2627 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 2628 } 2629 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 2630 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 2631 vec3 lightToPosition = shadowCoord.xyz; 2632 float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 2633 vec3 bd3D = normalize( lightToPosition ); 2634 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 2635 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 2636 return ( 2637 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 2638 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 2639 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 2640 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 2641 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 2642 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 2643 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 2644 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 2645 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 2646 ) * ( 1.0 / 9.0 ); 2647 #else 2648 return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 2649 #endif 2650 } 2651#endif`,lze=`#if NUM_SPOT_LIGHT_COORDS > 0 2652 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 2653 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 2654#endif 2655#ifdef USE_SHADOWMAP 2656 #if NUM_DIR_LIGHT_SHADOWS > 0 2657 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 2658 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 2659 struct DirectionalLightShadow { 2660 float shadowBias; 2661 float shadowNormalBias; 2662 float shadowRadius; 2663 vec2 shadowMapSize; 2664 }; 2665 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 2666 #endif
2667 #if NUM_SPOT_LIGHT_SHADOWS > 0 2668 struct SpotLightShadow { 2669 float shadowBias; 2670 float shadowNormalBias; 2671 float shadowRadius; 2672 vec2 shadowMapSize; 2673 }; 2674 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 2675 #endif 2676 #if NUM_POINT_LIGHT_SHADOWS > 0 2677 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 2678 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 2679 struct PointLightShadow { 2680 float shadowBias; 2681 float shadowNormalBias; 2682 float shadowRadius; 2683 vec2 shadowMapSize; 2684 float shadowCameraNear; 2685 float shadowCameraFar; 2686 }; 2687 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2688 #endif 2689#endif`,cze=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2690 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 2691 vec4 shadowWorldPosition; 2692#endif 2693#if defined( USE_SHADOWMAP ) 2694 #if NUM_DIR_LIGHT_SHADOWS > 0 2695 #pragma unroll_loop_start 2696 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2697 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2698 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2699 } 2700 #pragma unroll_loop_end 2701 #endif 2702 #if NUM_POINT_LIGHT_SHADOWS > 0 2703 #pragma unroll_loop_start 2704 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2705 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2706 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2707 } 2708 #pragma unroll_loop_end 2709 #endif 2710#endif 2711#if NUM_SPOT_LIGHT_COORDS > 0 2712 #pragma unroll_loop_start 2713 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2714 shadowWorldPosition = worldPosition; 2715 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2716 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2717 #endif 2718 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2719 } 2720 #pragma unroll_loop_end 2721#endif`,uze=`float getShadowMask() { 2722 float shadow = 1.0; 2723 #ifdef USE_SHADOWMAP 2724 #if NUM_DIR_LIGHT_SHADOWS > 0 2725 DirectionalLightShadow directionalLight; 2726 #pragma unroll_loop_start 2727 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2728 directionalLight = directionalLightShadows[ i ]; 2729 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2730 } 2731 #pragma unroll_loop_end 2732 #endif 2733 #if NUM_SPOT_LIGHT_SHADOWS > 0 2734 SpotLightShadow spotLight; 2735 #pragma unroll_loop_start 2736 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2737 spotLight = spotLightShadows[ i ]; 2738 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2739 } 2740 #pragma unroll_loop_end 2741 #endif 2742 #if NUM_POINT_LIGHT_SHADOWS > 0 2743 PointLightShadow pointLight; 2744 #pragma unroll_loop_start 2745 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2746 pointLight = pointLightShadows[ i ]; 2747 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2748 } 2749 #pragma unroll_loop_end 2750 #endif 2751 #endif 2752 return shadow; 2753}`,dze=`#ifdef USE_SKINNING 2754 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2755 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2756 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2757 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2758#endif`,hze=`#ifdef USE_SKINNING 2759 uniform mat4 bindMatrix; 2760 uniform mat4 bindMatrixInverse; 2761 uniform highp sampler2D boneTexture; 2762 mat4 getBoneMatrix( const in float i ) { 2763 int size = textureSize( boneTexture, 0 ).x; 2764 int j = int( i ) * 4; 2765 int x = j % size; 2766 int y = j / size; 2767 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2768 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2769 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2770 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2771 return mat4( v1, v2, v3, v4 ); 2772 } 2773#endif`,fze=`#ifdef USE_SKINNING 2774 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2775 vec4 skinned = vec4( 0.0 ); 2776 skinned += boneMatX * skinVertex * skinWeight.x; 2777 skinned += boneMatY * skinVertex * skinWeight.y; 2778 skinned += boneMatZ * skinVertex * skinWeight.z; 2779 skinned += boneMatW * skinVertex * skinWeight.w; 2780 transformed = ( bindMatrixInverse * skinned ).xyz; 2781#endif`,pze=`#ifdef USE_SKINNING 2782 mat4 skinMatrix = mat4( 0.0 ); 2783 skinMatrix += skinWeight.x * boneMatX; 2784 skinMatrix += skinWeight.y * boneMatY; 2785 skinMatrix += skinWeight.z * boneMatZ; 2786 skinMatrix += skinWeight.w * boneMatW; 2787 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2788 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2789 #ifdef USE_TANGENT 2790 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2791 #endif 2792#endif`,mze=`float specularStrength; 2793#ifdef USE_SPECULARMAP 2794 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2795 specularStrength = texelSpecular.r; 2796#else 2797 specularStrength = 1.0; 2798#endif`,gze=`#ifdef USE_SPECULARMAP 2799 uniform sampler2D specularMap; 2800#endif`,xze=`#if defined( TONE_MAPPING ) 2801 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2802#endif`,vze=`#ifndef saturate 2803#define saturate( a ) clamp( a, 0.0, 1.0 ) 2804#endif 2805uniform float toneMappingExposure; 2806vec3 LinearToneMapping( vec3 color ) { 2807 return saturate( toneMappingExposure * color ); 2808} 2809vec3 ReinhardToneMapping( vec3 color ) { 2810 color *= toneMappingExposure; 2811 return saturate( color / ( vec3( 1.0 ) + color ) ); 2812} 2813vec3 OptimizedCineonToneMapping( vec3 color ) { 2814 color *= toneMappingExposure; 2815 color = max( vec3( 0.0 ), color - 0.004 ); 2816 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2817} 2818vec3 RRTAndODTFit( vec3 v ) { 2819 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2820 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2821 return a / b; 2822} 2823vec3 ACESFilmicToneMapping( vec3 color ) { 2824 const mat3 ACESInputMat = mat3( 2825 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2826 vec3( 0.04823, 0.01566, 0.83777 ) 2827 ); 2828 const mat3 ACESOutputMat = mat3( 2829 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2830 vec3( -0.07367, -0.00605, 1.07602 ) 2831 ); 2832 color *= toneMappingExposure / 0.6; 2833 color = ACESInputMat * color; 2834 color = RRTAndODTFit( color ); 2835 color = ACESOutputMat * color; 2836 return saturate( color ); 2837} 2838const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2839 vec3( 1.6605, - 0.1246, - 0.0182 ), 2840 vec3( - 0.5876, 1.1329, - 0.1006 ), 2841 vec3( - 0.0728, - 0.0083, 1.1187 ) 2842); 2843const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2844 vec3( 0.6274, 0.0691, 0.0164 ), 2845 vec3( 0.3293, 0.9195, 0.0880 ), 2846 vec3( 0.0433, 0.0113, 0.8956 ) 2847); 2848vec3 agxDefaultContrastApprox( vec3 x ) { 2849 vec3 x2 = x * x; 2850 vec3 x4 = x2 * x2; 2851 return + 15.5 * x4 * x2 2852 - 40.14 * x4 * x 2853 + 31.96 * x4 2854 - 6.868 * x2 * x 2855 + 0.4298 * x2 2856 + 0.1191 * x 2857 - 0.00232; 2858} 2859vec3 AgXToneMapping( vec3 color ) { 2860 const mat3 AgXInsetMatrix = mat3( 2861 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2862 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2863 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2864 );
2865 const mat3 AgXOutsetMatrix = mat3( 2866 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2867 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2868 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2869 ); 2870 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2871 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2872 color *= toneMappingExposure; 2873 color = AgXInsetMatrix * color; 2874 color = max( color, 1e-10 ); color = log2( color ); 2875 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2876 color = clamp( color, 0.0, 1.0 ); 2877 color = agxDefaultContrastApprox( color ); 2878 color = AgXOutsetMatrix * color; 2879 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2880 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2881 return color; 2882} 2883vec3 CustomToneMapping( vec3 color ) { return color; }`,yze=`#ifdef USE_TRANSMISSION 2884 material.transmission = transmission; 2885 material.transmissionAlpha = 1.0; 2886 material.thickness = thickness; 2887 material.attenuationDistance = attenuationDistance; 2888 material.attenuationColor = attenuationColor; 2889 #ifdef USE_TRANSMISSIONMAP 2890 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2891 #endif 2892 #ifdef USE_THICKNESSMAP 2893 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2894 #endif 2895 vec3 pos = vWorldPosition; 2896 vec3 v = normalize( cameraPosition - pos ); 2897 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2898 vec4 transmitted = getIBLVolumeRefraction( 2899 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2900 pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, 2901 material.attenuationColor, material.attenuationDistance ); 2902 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2903 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2904#endif`,bze=`#ifdef USE_TRANSMISSION 2905 uniform float transmission; 2906 uniform float thickness; 2907 uniform float attenuationDistance; 2908 uniform vec3 attenuationColor; 2909 #ifdef USE_TRANSMISSIONMAP 2910 uniform sampler2D transmissionMap; 2911 #endif 2912 #ifdef USE_THICKNESSMAP 2913 uniform sampler2D thicknessMap; 2914 #endif 2915 uniform vec2 transmissionSamplerSize; 2916 uniform sampler2D transmissionSamplerMap; 2917 uniform mat4 modelMatrix; 2918 uniform mat4 projectionMatrix; 2919 varying vec3 vWorldPosition; 2920 float w0( float a ) { 2921 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2922 } 2923 float w1( float a ) { 2924 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2925 } 2926 float w2( float a ){ 2927 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2928 } 2929 float w3( float a ) { 2930 return ( 1.0 / 6.0 ) * ( a * a * a ); 2931 } 2932 float g0( float a ) { 2933 return w0( a ) + w1( a ); 2934 } 2935 float g1( float a ) { 2936 return w2( a ) + w3( a ); 2937 } 2938 float h0( float a ) { 2939 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2940 } 2941 float h1( float a ) { 2942 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2943 } 2944 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2945 uv = uv * texelSize.zw + 0.5; 2946 vec2 iuv = floor( uv ); 2947 vec2 fuv = fract( uv ); 2948 float g0x = g0( fuv.x ); 2949 float g1x = g1( fuv.x ); 2950 float h0x = h0( fuv.x ); 2951 float h1x = h1( fuv.x ); 2952 float h0y = h0( fuv.y ); 2953 float h1y = h1( fuv.y ); 2954 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2955 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2956 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2957 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2958 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2959 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2960 } 2961 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2962 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2963 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2964 vec2 fLodSizeInv = 1.0 / fLodSize; 2965 vec2 cLodSizeInv = 1.0 / cLodSize; 2966 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2967 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2968 return mix( fSample, cSample, fract( lod ) ); 2969 } 2970 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2971 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2972 vec3 modelScale; 2973 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2974 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2975 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2976 return normalize( refractionVector ) * thickness * modelScale; 2977 } 2978 float applyIorToRoughness( const in float roughness, const in float ior ) { 2979 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2980 } 2981 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2982 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2983 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2984 } 2985 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2986 if ( isinf( attenuationDistance ) ) { 2987 return vec3( 1.0 ); 2988 } else { 2989 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2990 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2991 } 2992 } 2993 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2994 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2995 const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, 2996 const in vec3 attenuationColor, const in float attenuationDistance ) { 2997 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2998 vec3 refractedRayExit = position + transmissionRay; 2999 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 3000 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 3001 refractionCoords += 1.0; 3002 refractionCoords /= 2.0; 3003 vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 3004 vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 3005 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 3006 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 3007 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 3008 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 3009 } 3010#endif`,wze=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 3011 varying vec2 vUv; 3012#endif 3013#ifdef USE_MAP 3014 varying vec2 vMapUv; 3015#endif 3016#ifdef USE_ALPHAMAP
3017 varying vec2 vAlphaMapUv; 3018#endif 3019#ifdef USE_LIGHTMAP 3020 varying vec2 vLightMapUv; 3021#endif 3022#ifdef USE_AOMAP 3023 varying vec2 vAoMapUv; 3024#endif 3025#ifdef USE_BUMPMAP 3026 varying vec2 vBumpMapUv; 3027#endif 3028#ifdef USE_NORMALMAP 3029 varying vec2 vNormalMapUv; 3030#endif 3031#ifdef USE_EMISSIVEMAP 3032 varying vec2 vEmissiveMapUv; 3033#endif 3034#ifdef USE_METALNESSMAP 3035 varying vec2 vMetalnessMapUv; 3036#endif 3037#ifdef USE_ROUGHNESSMAP 3038 varying vec2 vRoughnessMapUv; 3039#endif 3040#ifdef USE_ANISOTROPYMAP 3041 varying vec2 vAnisotropyMapUv; 3042#endif 3043#ifdef USE_CLEARCOATMAP 3044 varying vec2 vClearcoatMapUv; 3045#endif 3046#ifdef USE_CLEARCOAT_NORMALMAP 3047 varying vec2 vClearcoatNormalMapUv; 3048#endif 3049#ifdef USE_CLEARCOAT_ROUGHNESSMAP 3050 varying vec2 vClearcoatRoughnessMapUv; 3051#endif 3052#ifdef USE_IRIDESCENCEMAP 3053 varying vec2 vIridescenceMapUv; 3054#endif 3055#ifdef USE_IRIDESCENCE_THICKNESSMAP 3056 varying vec2 vIridescenceThicknessMapUv; 3057#endif 3058#ifdef USE_SHEEN_COLORMAP 3059 varying vec2 vSheenColorMapUv; 3060#endif 3061#ifdef USE_SHEEN_ROUGHNESSMAP 3062 varying vec2 vSheenRoughnessMapUv; 3063#endif 3064#ifdef USE_SPECULARMAP 3065 varying vec2 vSpecularMapUv; 3066#endif 3067#ifdef USE_SPECULAR_COLORMAP 3068 varying vec2 vSpecularColorMapUv; 3069#endif 3070#ifdef USE_SPECULAR_INTENSITYMAP 3071 varying vec2 vSpecularIntensityMapUv; 3072#endif 3073#ifdef USE_TRANSMISSIONMAP 3074 uniform mat3 transmissionMapTransform; 3075 varying vec2 vTransmissionMapUv; 3076#endif 3077#ifdef USE_THICKNESSMAP 3078 uniform mat3 thicknessMapTransform; 3079 varying vec2 vThicknessMapUv; 3080#endif`,_ze=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 3081 varying vec2 vUv; 3082#endif 3083#ifdef USE_MAP 3084 uniform mat3 mapTransform; 3085 varying vec2 vMapUv; 3086#endif 3087#ifdef USE_ALPHAMAP 3088 uniform mat3 alphaMapTransform; 3089 varying vec2 vAlphaMapUv; 3090#endif 3091#ifdef USE_LIGHTMAP 3092 uniform mat3 lightMapTransform; 3093 varying vec2 vLightMapUv; 3094#endif 3095#ifdef USE_AOMAP 3096 uniform mat3 aoMapTransform; 3097 varying vec2 vAoMapUv; 3098#endif 3099#ifdef USE_BUMPMAP 3100 uniform mat3 bumpMapTransform; 3101 varying vec2 vBumpMapUv; 3102#endif 3103#ifdef USE_NORMALMAP 3104 uniform mat3 normalMapTransform; 3105 varying vec2 vNormalMapUv; 3106#endif 3107#ifdef USE_DISPLACEMENTMAP 3108 uniform mat3 displacementMapTransform; 3109 varying vec2 vDisplacementMapUv; 3110#endif 3111#ifdef USE_EMISSIVEMAP 3112 uniform mat3 emissiveMapTransform; 3113 varying vec2 vEmissiveMapUv; 3114#endif 3115#ifdef USE_METALNESSMAP 3116 uniform mat3 metalnessMapTransform; 3117 varying vec2 vMetalnessMapUv; 3118#endif 3119#ifdef USE_ROUGHNESSMAP 3120 uniform mat3 roughnessMapTransform; 3121 varying vec2 vRoughnessMapUv; 3122#endif 3123#ifdef USE_ANISOTROPYMAP 3124 uniform mat3 anisotropyMapTransform; 3125 varying vec2 vAnisotropyMapUv; 3126#endif 3127#ifdef USE_CLEARCOATMAP 3128 uniform mat3 clearcoatMapTransform; 3129 varying vec2 vClearcoatMapUv; 3130#endif 3131#ifdef USE_CLEARCOAT_NORMALMAP 3132 uniform mat3 clearcoatNormalMapTransform; 3133 varying vec2 vClearcoatNormalMapUv; 3134#endif 3135#ifdef USE_CLEARCOAT_ROUGHNESSMAP 3136 uniform mat3 clearcoatRoughnessMapTransform; 3137 varying vec2 vClearcoatRoughnessMapUv; 3138#endif 3139#ifdef USE_SHEEN_COLORMAP 3140 uniform mat3 sheenColorMapTransform; 3141 varying vec2 vSheenColorMapUv; 3142#endif 3143#ifdef USE_SHEEN_ROUGHNESSMAP 3144 uniform mat3 sheenRoughnessMapTransform; 3145 varying vec2 vSheenRoughnessMapUv; 3146#endif 3147#ifdef USE_IRIDESCENCEMAP 3148 uniform mat3 iridescenceMapTransform; 3149 varying vec2 vIridescenceMapUv; 3150#endif 3151#ifdef USE_IRIDESCENCE_THICKNESSMAP 3152 uniform mat3 iridescenceThicknessMapTransform; 3153 varying vec2 vIridescenceThicknessMapUv; 3154#endif 3155#ifdef USE_SPECULARMAP 3156 uniform mat3 specularMapTransform; 3157 varying vec2 vSpecularMapUv; 3158#endif 3159#ifdef USE_SPECULAR_COLORMAP 3160 uniform mat3 specularColorMapTransform; 3161 varying vec2 vSpecularColorMapUv; 3162#endif 3163#ifdef USE_SPECULAR_INTENSITYMAP 3164 uniform mat3 specularIntensityMapTransform; 3165 varying vec2 vSpecularIntensityMapUv; 3166#endif 3167#ifdef USE_TRANSMISSIONMAP 3168 uniform mat3 transmissionMapTransform; 3169 varying vec2 vTransmissionMapUv; 3170#endif 3171#ifdef USE_THICKNESSMAP 3172 uniform mat3 thicknessMapTransform; 3173 varying vec2 vThicknessMapUv; 3174#endif`,Sze=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 3175 vUv = vec3( uv, 1 ).xy; 3176#endif 3177#ifdef USE_MAP 3178 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 3179#endif 3180#ifdef USE_ALPHAMAP 3181 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 3182#endif 3183#ifdef USE_LIGHTMAP 3184 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 3185#endif 3186#ifdef USE_AOMAP 3187 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 3188#endif 3189#ifdef USE_BUMPMAP 3190 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 3191#endif 3192#ifdef USE_NORMALMAP 3193 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 3194#endif 3195#ifdef USE_DISPLACEMENTMAP 3196 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 3197#endif 3198#ifdef USE_EMISSIVEMAP 3199 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 3200#endif 3201#ifdef USE_METALNESSMAP 3202 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 3203#endif 3204#ifdef USE_ROUGHNESSMAP 3205 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 3206#endif 3207#ifdef USE_ANISOTROPYMAP 3208 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 3209#endif 3210#ifdef USE_CLEARCOATMAP 3211 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 3212#endif 3213#ifdef USE_CLEARCOAT_NORMALMAP 3214 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 3215#endif 3216#ifdef USE_CLEARCOAT_ROUGHNESSMAP 3217 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 3218#endif
3219#ifdef USE_IRIDESCENCEMAP 3220 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 3221#endif 3222#ifdef USE_IRIDESCENCE_THICKNESSMAP 3223 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 3224#endif 3225#ifdef USE_SHEEN_COLORMAP 3226 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 3227#endif 3228#ifdef USE_SHEEN_ROUGHNESSMAP 3229 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 3230#endif 3231#ifdef USE_SPECULARMAP 3232 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 3233#endif 3234#ifdef USE_SPECULAR_COLORMAP 3235 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 3236#endif 3237#ifdef USE_SPECULAR_INTENSITYMAP 3238 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 3239#endif 3240#ifdef USE_TRANSMISSIONMAP 3241 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 3242#endif 3243#ifdef USE_THICKNESSMAP 3244 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 3245#endif`,Aze=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 3246 vec4 worldPosition = vec4( transformed, 1.0 ); 3247 #ifdef USE_BATCHING 3248 worldPosition = batchingMatrix * worldPosition; 3249 #endif 3250 #ifdef USE_INSTANCING 3251 worldPosition = instanceMatrix * worldPosition; 3252 #endif 3253 worldPosition = modelMatrix * worldPosition; 3254#endif`;const Eze=`varying vec2 vUv; 3255uniform mat3 uvTransform; 3256void main() { 3257 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3258 gl_Position = vec4( position.xy, 1.0, 1.0 ); 3259}`,kze=`uniform sampler2D t2D; 3260uniform float backgroundIntensity; 3261varying vec2 vUv; 3262void main() { 3263 vec4 texColor = texture2D( t2D, vUv ); 3264 #ifdef DECODE_VIDEO_TEXTURE 3265 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 ); 3266 #endif 3267 texColor.rgb *= backgroundIntensity; 3268 gl_FragColor = texColor; 3269 #include <tonemapping_fragment> 3270 #include <colorspace_fragment> 3271}`,Cze=`varying vec3 vWorldDirection; 3272#include <common> 3273void main() { 3274 vWorldDirection = transformDirection( position, modelMatrix ); 3275 #include <begin_vertex> 3276 #include <project_vertex> 3277 gl_Position.z = gl_Position.w; 3278}`,Nze=`#ifdef ENVMAP_TYPE_CUBE 3279 uniform samplerCube envMap; 3280#elif defined( ENVMAP_TYPE_CUBE_UV ) 3281 uniform sampler2D envMap; 3282#endif 3283uniform float flipEnvMap; 3284uniform float backgroundBlurriness; 3285uniform float backgroundIntensity; 3286varying vec3 vWorldDirection; 3287#include <cube_uv_reflection_fragment> 3288void main() { 3289 #ifdef ENVMAP_TYPE_CUBE 3290 vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 3291 #elif defined( ENVMAP_TYPE_CUBE_UV ) 3292 vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); 3293 #else 3294 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3295 #endif 3296 texColor.rgb *= backgroundIntensity; 3297 gl_FragColor = texColor; 3298 #include <tonemapping_fragment> 3299 #include <colorspace_fragment> 3300}`,Tze=`varying vec3 vWorldDirection; 3301#include <common> 3302void main() { 3303 vWorldDirection = transformDirection( position, modelMatrix ); 3304 #include <begin_vertex> 3305 #include <project_vertex> 3306 gl_Position.z = gl_Position.w; 3307}`,Mze=`uniform samplerCube tCube; 3308uniform float tFlip; 3309uniform float opacity; 3310varying vec3 vWorldDirection; 3311void main() { 3312 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 3313 gl_FragColor = texColor; 3314 gl_FragColor.a *= opacity; 3315 #include <tonemapping_fragment> 3316 #include <colorspace_fragment> 3317}`,Rze=`#include <common> 3318#include <batching_pars_vertex> 3319#include <uv_pars_vertex> 3320#include <displacementmap_pars_vertex> 3321#include <morphtarget_pars_vertex> 3322#include <skinning_pars_vertex> 3323#include <logdepthbuf_pars_vertex> 3324#include <clipping_planes_pars_vertex> 3325varying vec2 vHighPrecisionZW; 3326void main() { 3327 #include <uv_vertex> 3328 #include <batching_vertex> 3329 #include <skinbase_vertex> 3330 #ifdef USE_DISPLACEMENTMAP 3331 #include <beginnormal_vertex> 3332 #include <morphnormal_vertex> 3333 #include <skinnormal_vertex> 3334 #endif 3335 #include <begin_vertex> 3336 #include <morphtarget_vertex> 3337 #include <skinning_vertex> 3338 #include <displacementmap_vertex> 3339 #include <project_vertex> 3340 #include <logdepthbuf_vertex> 3341 #include <clipping_planes_vertex> 3342 vHighPrecisionZW = gl_Position.zw; 3343}`,jze=`#if DEPTH_PACKING == 3200 3344 uniform float opacity; 3345#endif 3346#include <common> 3347#include <packing> 3348#include <uv_pars_fragment> 3349#include <map_pars_fragment> 3350#include <alphamap_pars_fragment> 3351#include <alphatest_pars_fragment> 3352#include <alphahash_pars_fragment> 3353#include <logdepthbuf_pars_fragment> 3354#include <clipping_planes_pars_fragment> 3355varying vec2 vHighPrecisionZW; 3356void main() { 3357 #include <clipping_planes_fragment> 3358 vec4 diffuseColor = vec4( 1.0 ); 3359 #if DEPTH_PACKING == 3200 3360 diffuseColor.a = opacity; 3361 #endif 3362 #include <map_fragment> 3363 #include <alphamap_fragment> 3364 #include <alphatest_fragment> 3365 #include <alphahash_fragment> 3366 #include <logdepthbuf_fragment> 3367 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 3368 #if DEPTH_PACKING == 3200 3369 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 3370 #elif DEPTH_PACKING == 3201 3371 gl_FragColor = packDepthToRGBA( fragCoordZ ); 3372 #endif 3373}`,Pze=`#define DISTANCE 3374varying vec3 vWorldPosition; 3375#include <common> 3376#include <batching_pars_vertex> 3377#include <uv_pars_vertex> 3378#include <displacementmap_pars_vertex> 3379#include <morphtarget_pars_vertex> 3380#include <skinning_pars_vertex> 3381#include <clipping_planes_pars_vertex> 3382void main() { 3383 #include <uv_vertex> 3384 #include <batching_vertex> 3385 #include <skinbase_vertex> 3386 #ifdef USE_DISPLACEMENTMAP 3387 #include <beginnormal_vertex> 3388 #include <morphnormal_vertex> 3389 #include <skinnormal_vertex> 3390 #endif 3391 #include <begin_vertex> 3392 #include <morphtarget_vertex> 3393 #include <skinning_vertex> 3394 #include <displacementmap_vertex> 3395 #include <project_vertex> 3396 #include <worldpos_vertex> 3397 #include <clipping_planes_vertex> 3398 vWorldPosition = worldPosition.xyz; 3399}`,Lze=`#define DISTANCE 3400uniform vec3 referencePosition; 3401uniform float nearDistance; 3402uniform float farDistance; 3403varying vec3 vWorldPosition; 3404#include <common> 3405#include <packing> 3406#include <uv_pars_fragment> 3407#include <map_pars_fragment> 3408#include <alphamap_pars_fragment> 3409#include <alphatest_pars_fragment> 3410#include <alphahash_pars_fragment> 3411#include <clipping_planes_pars_fragment> 3412void main () { 3413 #include <clipping_planes_fragment> 3414 vec4 diffuseColor = vec4( 1.0 ); 3415 #include <map_fragment> 3416 #include <alphamap_fragment> 3417 #include <alphatest_fragment> 3418 #include <alphahash_fragment> 3419 float dist = length( vWorldPosition - referencePosition ); 3420 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 3421 dist = saturate( dist ); 3422 gl_FragColor = packDepthToRGBA( dist ); 3423}`,Ize=`varying vec3 vWorldDirection; 3424#include <common> 3425void main() { 3426 vWorldDirection = transformDirection( position, modelMatrix ); 3427 #include <begin_vertex> 3428 #include <project_vertex> 3429}`,Dze=`uniform sampler2D tEquirect; 3430varying vec3 vWorldDirection; 3431#include <common> 3432void main() { 3433 vec3 direction = normalize( vWorldDirection ); 3434 vec2 sampleUV = equirectUv( direction ); 3435 gl_FragColor = texture2D( tEquirect, sampleUV ); 3436 #include <tonemapping_fragment> 3437 #include <colorspace_fragment> 3438}`,Bze=`uniform float scale; 3439attribute float lineDistance; 3440varying float vLineDistance; 3441#include <common> 3442#include <uv_pars_vertex> 3443#include <color_pars_vertex> 3444#include <fog_pars_vertex> 3445#include <morphtarget_pars_vertex> 3446#include <logdepthbuf_pars_vertex> 3447#include <clipping_planes_pars_vertex> 3448void main() { 3449 vLineDistance = scale * lineDistance; 3450 #include <uv_vertex> 3451 #include <color_vertex> 3452 #include <morphcolor_vertex> 3453 #include <begin_vertex> 3454 #include <morphtarget_vertex> 3455 #include <project_vertex> 3456 #include <logdepthbuf_vertex> 3457 #include <clipping_planes_vertex> 3458 #include <fog_vertex> 3459}`,Fze=`uniform vec3 diffuse; 3460uniform float opacity; 3461uniform float dashSize; 3462uniform float totalSize; 3463varying float vLineDistance; 3464#include <common> 3465#include <color_pars_fragment> 3466#include <uv_pars_fragment> 3467#include <map_pars_fragment> 3468#include <fog_pars_fragment> 3469#include <logdepthbuf_pars_fragment> 3470#include <clipping_planes_pars_fragment> 3471void main() { 3472 #include <clipping_planes_fragment> 3473 if ( mod( vLineDistance, totalSize ) > dashSize ) { 3474 discard; 3475 } 3476 vec3 outgoingLight = vec3( 0.0 ); 3477 vec4 diffuseColor = vec4( diffuse, opacity ); 3478 #include <logdepthbuf_fragment> 3479 #include <map_fragment> 3480 #include <color_fragment> 3481 outgoingLight = diffuseColor.rgb; 3482 #include <opaque_fragment> 3483 #include <tonemapping_fragment> 3484 #include <colorspace_fragment> 3485 #include <fog_fragment> 3486 #include <premultiplied_alpha_fragment> 3487}`,Oze=`#include <common> 3488#include <batching_pars_vertex> 3489#include <uv_pars_vertex> 3490#include <envmap_pars_vertex> 3491#include <color_pars_vertex> 3492#include <fog_pars_vertex> 3493#include <morphtarget_pars_vertex> 3494#include <skinning_pars_vertex> 3495#include <logdepthbuf_pars_vertex> 3496#include <clipping_planes_pars_vertex> 3497void main() { 3498 #include <uv_vertex> 3499 #include <color_vertex> 3500 #include <morphcolor_vertex> 3501 #include <batching_vertex> 3502 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 3503 #include <beginnormal_vertex> 3504 #include <morphnormal_vertex> 3505 #include <skinbase_vertex> 3506 #include <skinnormal_vertex> 3507 #include <defaultnormal_vertex> 3508 #endif 3509 #include <begin_vertex> 3510 #include <morphtarget_vertex> 3511 #include <skinning_vertex> 3512 #include <project_vertex> 3513 #include <logdepthbuf_vertex> 3514 #include <clipping_planes_vertex> 3515 #include <worldpos_vertex> 3516 #include <envmap_vertex> 3517 #include <fog_vertex> 3518}`,zze=`uniform vec3 diffuse; 3519uniform float opacity; 3520#ifndef FLAT_SHADED 3521 varying vec3 vNormal; 3522#endif 3523#include <common> 3524#include <dithering_pars_fragment> 3525#include <color_pars_fragment> 3526#include <uv_pars_fragment> 3527#include <map_pars_fragment> 3528#include <alphamap_pars_fragment> 3529#include <alphatest_pars_fragment> 3530#include <alphahash_pars_fragment> 3531#include <aomap_pars_fragment> 3532#include <lightmap_pars_fragment> 3533#include <envmap_common_pars_fragment> 3534#include <envmap_pars_fragment> 3535#include <fog_pars_fragment> 3536#include <specularmap_pars_fragment> 3537#include <logdepthbuf_pars_fragment> 3538#include <clipping_planes_pars_fragment> 3539void main() { 3540 #include <clipping_planes_fragment> 3541 vec4 diffuseColor = vec4( diffuse, opacity ); 3542 #include <logdepthbuf_fragment> 3543 #include <map_fragment> 3544 #include <color_fragment> 3545 #include <alphamap_fragment> 3546 #include <alphatest_fragment> 3547 #include <alphahash_fragment> 3548 #include <specularmap_fragment> 3549 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3550 #ifdef USE_LIGHTMAP 3551 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 3552 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 3553 #else 3554 reflectedLight.indirectDiffuse += vec3( 1.0 ); 3555 #endif 3556 #include <aomap_fragment> 3557 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 3558 vec3 outgoingLight = reflectedLight.indirectDiffuse; 3559 #include <envmap_fragment> 3560 #include <opaque_fragment> 3561 #include <tonemapping_fragment> 3562 #include <colorspace_fragment> 3563 #include <fog_fragment> 3564 #include <premultiplied_alpha_fragment> 3565 #include <dithering_fragment> 3566}`,Uze=`#define LAMBERT 3567varying vec3 vViewPosition; 3568#include <common> 3569#include <batching_pars_vertex> 3570#include <uv_pars_vertex> 3571#include <displacementmap_pars_vertex> 3572#include <envmap_pars_vertex> 3573#include <color_pars_vertex> 3574#include <fog_pars_vertex> 3575#include <normal_pars_vertex> 3576#include <morphtarget_pars_vertex> 3577#include <skinning_pars_vertex> 3578#include <shadowmap_pars_vertex> 3579#include <logdepthbuf_pars_vertex> 3580#include <clipping_planes_pars_vertex> 3581void main() { 3582 #include <uv_vertex> 3583 #include <color_vertex> 3584 #include <morphcolor_vertex> 3585 #include <batching_vertex> 3586 #include <beginnormal_vertex> 3587 #include <morphnormal_vertex> 3588 #include <skinbase_vertex> 3589 #include <skinnormal_vertex> 3590 #include <defaultnormal_vertex> 3591 #include <normal_vertex> 3592 #include <begin_vertex> 3593 #include <morphtarget_vertex> 3594 #include <skinning_vertex> 3595 #include <displacementmap_vertex> 3596 #include <project_vertex> 3597 #include <logdepthbuf_vertex> 3598 #include <clipping_planes_vertex> 3599 vViewPosition = - mvPosition.xyz; 3600 #include <worldpos_vertex> 3601 #include <envmap_vertex> 3602 #include <shadowmap_vertex> 3603 #include <fog_vertex> 3604}`,Hze=`#define LAMBERT 3605uniform vec3 diffuse; 3606uniform vec3 emissive; 3607uniform float opacity; 3608#include <common> 3609#include <packing> 3610#include <dithering_pars_fragment> 3611#include <color_pars_fragment> 3612#include <uv_pars_fragment> 3613#include <map_pars_fragment> 3614#include <alphamap_pars_fragment> 3615#include <alphatest_pars_fragment> 3616#include <alphahash_pars_fragment> 3617#include <aomap_pars_fragment> 3618#include <lightmap_pars_fragment> 3619#include <emissivemap_pars_fragment> 3620#include <envmap_common_pars_fragment> 3621#include <envmap_pars_fragment> 3622#include <fog_pars_fragment> 3623#include <bsdfs> 3624#include <lights_pars_begin> 3625#include <normal_pars_fragment> 3626#include <lights_lambert_pars_fragment> 3627#include <shadowmap_pars_fragment> 3628#include <bumpmap_pars_fragment> 3629#include <normalmap_pars_fragment> 3630#include <specularmap_pars_fragment> 3631#include <logdepthbuf_pars_fragment> 3632#include <clipping_planes_pars_fragment> 3633void main() { 3634 #include <clipping_planes_fragment> 3635 vec4 diffuseColor = vec4( diffuse, opacity ); 3636 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3637 vec3 totalEmissiveRadiance = emissive; 3638 #include <logdepthbuf_fragment> 3639 #include <map_fragment> 3640 #include <color_fragment> 3641 #include <alphamap_fragment> 3642 #include <alphatest_fragment> 3643 #include <alphahash_fragment> 3644 #include <specularmap_fragment> 3645 #include <normal_fragment_begin> 3646 #include <normal_fragment_maps> 3647 #include <emissivemap_fragment> 3648 #include <lights_lambert_fragment> 3649 #include <lights_fragment_begin> 3650 #include <lights_fragment_maps> 3651 #include <lights_fragment_end> 3652 #include <aomap_fragment> 3653 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3654 #include <envmap_fragment> 3655 #include <opaque_fragment> 3656 #include <tonemapping_fragment> 3657 #include <colorspace_fragment> 3658 #include <fog_fragment> 3659 #include <premultiplied_alpha_fragment> 3660 #include <dithering_fragment> 3661}`,Gze=`#define MATCAP 3662varying vec3 vViewPosition; 3663#include <common> 3664#include <batching_pars_vertex> 3665#include <uv_pars_vertex> 3666#include <color_pars_vertex> 3667#include <displacementmap_pars_vertex> 3668#include <fog_pars_vertex> 3669#include <normal_pars_vertex> 3670#include <morphtarget_pars_vertex> 3671#include <skinning_pars_vertex> 3672#include <logdepthbuf_pars_vertex> 3673#include <clipping_planes_pars_vertex> 3674void main() { 3675 #include <uv_vertex> 3676 #include <color_vertex> 3677 #include <morphcolor_vertex> 3678 #include <batching_vertex> 3679 #include <beginnormal_vertex> 3680 #include <morphnormal_vertex> 3681 #include <skinbase_vertex> 3682 #include <skinnormal_vertex> 3683 #include <defaultnormal_vertex> 3684 #include <normal_vertex> 3685 #include <begin_vertex> 3686 #include <morphtarget_vertex> 3687 #include <skinning_vertex> 3688 #include <displacementmap_vertex> 3689 #include <project_vertex> 3690 #include <logdepthbuf_vertex> 3691 #include <clipping_planes_vertex> 3692 #include <fog_vertex> 3693 vViewPosition = - mvPosition.xyz; 3694}`,Vze=`#define MATCAP 3695uniform vec3 diffuse; 3696uniform float opacity; 3697uniform sampler2D matcap; 3698varying vec3 vViewPosition; 3699#include <common> 3700#include <dithering_pars_fragment> 3701#include <color_pars_fragment> 3702#include <uv_pars_fragment> 3703#include <map_pars_fragment> 3704#include <alphamap_pars_fragment> 3705#include <alphatest_pars_fragment> 3706#include <alphahash_pars_fragment> 3707#include <fog_pars_fragment> 3708#include <normal_pars_fragment> 3709#include <bumpmap_pars_fragment> 3710#include <normalmap_pars_fragment> 3711#include <logdepthbuf_pars_fragment> 3712#include <clipping_planes_pars_fragment> 3713void main() { 3714 #include <clipping_planes_fragment> 3715 vec4 diffuseColor = vec4( diffuse, opacity ); 3716 #include <logdepthbuf_fragment> 3717 #include <map_fragment> 3718 #include <color_fragment> 3719 #include <alphamap_fragment> 3720 #include <alphatest_fragment> 3721 #include <alphahash_fragment> 3722 #include <normal_fragment_begin> 3723 #include <normal_fragment_maps> 3724 vec3 viewDir = normalize( vViewPosition ); 3725 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3726 vec3
3726 y = cross( viewDir, x ); 3727 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3728 #ifdef USE_MATCAP 3729 vec4 matcapColor = texture2D( matcap, uv ); 3730 #else 3731 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3732 #endif 3733 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3734 #include <opaque_fragment> 3735 #include <tonemapping_fragment> 3736 #include <colorspace_fragment> 3737 #include <fog_fragment> 3738 #include <premultiplied_alpha_fragment> 3739 #include <dithering_fragment> 3740}`,Wze=`#define NORMAL 3741#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3742 varying vec3 vViewPosition; 3743#endif 3744#include <common> 3745#include <batching_pars_vertex> 3746#include <uv_pars_vertex> 3747#include <displacementmap_pars_vertex> 3748#include <normal_pars_vertex> 3749#include <morphtarget_pars_vertex> 3750#include <skinning_pars_vertex> 3751#include <logdepthbuf_pars_vertex> 3752#include <clipping_planes_pars_vertex> 3753void main() { 3754 #include <uv_vertex> 3755 #include <batching_vertex> 3756 #include <beginnormal_vertex> 3757 #include <morphnormal_vertex> 3758 #include <skinbase_vertex> 3759 #include <skinnormal_vertex> 3760 #include <defaultnormal_vertex> 3761 #include <normal_vertex> 3762 #include <begin_vertex> 3763 #include <morphtarget_vertex> 3764 #include <skinning_vertex> 3765 #include <displacementmap_vertex> 3766 #include <project_vertex> 3767 #include <logdepthbuf_vertex> 3768 #include <clipping_planes_vertex> 3769#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3770 vViewPosition = - mvPosition.xyz; 3771#endif 3772}`,$ze=`#define NORMAL 3773uniform float opacity; 3774#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3775 varying vec3 vViewPosition; 3776#endif 3777#include <packing> 3778#include <uv_pars_fragment> 3779#include <normal_pars_fragment> 3780#include <bumpmap_pars_fragment> 3781#include <normalmap_pars_fragment> 3782#include <logdepthbuf_pars_fragment> 3783#include <clipping_planes_pars_fragment> 3784void main() { 3785 #include <clipping_planes_fragment> 3786 #include <logdepthbuf_fragment> 3787 #include <normal_fragment_begin> 3788 #include <normal_fragment_maps> 3789 gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); 3790 #ifdef OPAQUE 3791 gl_FragColor.a = 1.0; 3792 #endif 3793}`,Kze=`#define PHONG 3794varying vec3 vViewPosition; 3795#include <common> 3796#include <batching_pars_vertex> 3797#include <uv_pars_vertex> 3798#include <displacementmap_pars_vertex> 3799#include <envmap_pars_vertex> 3800#include <color_pars_vertex> 3801#include <fog_pars_vertex> 3802#include <normal_pars_vertex> 3803#include <morphtarget_pars_vertex> 3804#include <skinning_pars_vertex> 3805#include <shadowmap_pars_vertex> 3806#include <logdepthbuf_pars_vertex> 3807#include <clipping_planes_pars_vertex> 3808void main() { 3809 #include <uv_vertex> 3810 #include <color_vertex> 3811 #include <morphcolor_vertex> 3812 #include <batching_vertex> 3813 #include <beginnormal_vertex> 3814 #include <morphnormal_vertex> 3815 #include <skinbase_vertex> 3816 #include <skinnormal_vertex> 3817 #include <defaultnormal_vertex> 3818 #include <normal_vertex> 3819 #include <begin_vertex> 3820 #include <morphtarget_vertex> 3821 #include <skinning_vertex> 3822 #include <displacementmap_vertex> 3823 #include <project_vertex> 3824 #include <logdepthbuf_vertex> 3825 #include <clipping_planes_vertex> 3826 vViewPosition = - mvPosition.xyz; 3827 #include <worldpos_vertex> 3828 #include <envmap_vertex> 3829 #include <shadowmap_vertex> 3830 #include <fog_vertex> 3831}`,qze=`#define PHONG 3832uniform vec3 diffuse; 3833uniform vec3 emissive; 3834uniform vec3 specular; 3835uniform float shininess; 3836uniform float opacity; 3837#include <common> 3838#include <packing> 3839#include <dithering_pars_fragment> 3840#include <color_pars_fragment> 3841#include <uv_pars_fragment> 3842#include <map_pars_fragment> 3843#include <alphamap_pars_fragment> 3844#include <alphatest_pars_fragment> 3845#include <alphahash_pars_fragment> 3846#include <aomap_pars_fragment> 3847#include <lightmap_pars_fragment> 3848#include <emissivemap_pars_fragment> 3849#include <envmap_common_pars_fragment> 3850#include <envmap_pars_fragment> 3851#include <fog_pars_fragment> 3852#include <bsdfs> 3853#include <lights_pars_begin> 3854#include <normal_pars_fragment> 3855#include <lights_phong_pars_fragment> 3856#include <shadowmap_pars_fragment> 3857#include <bumpmap_pars_fragment> 3858#include <normalmap_pars_fragment> 3859#include <specularmap_pars_fragment> 3860#include <logdepthbuf_pars_fragment> 3861#include <clipping_planes_pars_fragment> 3862void main() { 3863 #include <clipping_planes_fragment> 3864 vec4 diffuseColor = vec4( diffuse, opacity ); 3865 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3866 vec3 totalEmissiveRadiance = emissive; 3867 #include <logdepthbuf_fragment> 3868 #include <map_fragment> 3869 #include <color_fragment> 3870 #include <alphamap_fragment> 3871 #include <alphatest_fragment> 3872 #include <alphahash_fragment> 3873 #include <specularmap_fragment> 3874 #include <normal_fragment_begin> 3875 #include <normal_fragment_maps> 3876 #include <emissivemap_fragment> 3877 #include <lights_phong_fragment> 3878 #include <lights_fragment_begin> 3879 #include <lights_fragment_maps> 3880 #include <lights_fragment_end> 3881 #include <aomap_fragment> 3882 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3883 #include <envmap_fragment> 3884 #include <opaque_fragment> 3885 #include <tonemapping_fragment> 3886 #include <colorspace_fragment> 3887 #include <fog_fragment> 3888 #include <premultiplied_alpha_fragment> 3889 #include <dithering_fragment> 3890}`,Xze=`#define STANDARD 3891varying vec3 vViewPosition; 3892#ifdef USE_TRANSMISSION 3893 varying vec3 vWorldPosition; 3894#endif 3895#include <common> 3896#include <batching_pars_vertex> 3897#include <uv_pars_vertex> 3898#include <displacementmap_pars_vertex> 3899#include <color_pars_vertex> 3900#include <fog_pars_vertex> 3901#include <normal_pars_vertex> 3902#include <morphtarget_pars_vertex> 3903#include <skinning_pars_vertex> 3904#include <shadowmap_pars_vertex> 3905#include <logdepthbuf_pars_vertex> 3906#include <clipping_planes_pars_vertex> 3907void main() { 3908 #include <uv_vertex> 3909 #include <color_vertex> 3910 #include <morphcolor_vertex> 3911 #include <batching_vertex> 3912 #include <beginnormal_vertex> 3913 #include <morphnormal_vertex> 3914 #include <skinbase_vertex> 3915 #include <skinnormal_vertex> 3916 #include <defaultnormal_vertex> 3917 #include <normal_vertex> 3918 #include <begin_vertex> 3919 #include <morphtarget_vertex> 3920 #include <skinning_vertex> 3921 #include <displacementmap_vertex> 3922 #include <project_vertex> 3923 #include <logdepthbuf_vertex> 3924 #include <clipping_planes_vertex> 3925 vViewPosition = - mvPosition.xyz; 3926 #include <worldpos_vertex> 3927 #include <shadowmap_vertex> 3928 #include <fog_vertex> 3929#ifdef USE_TRANSMISSION 3930 vWorldPosition = worldPosition.xyz; 3931#endif 3932}`,Yze=`#define STANDARD 3933#ifdef PHYSICAL 3934 #define IOR 3935 #define USE_SPECULAR 3936#endif 3937uniform vec3 diffuse; 3938uniform vec3 emissive; 3939uniform float roughness; 3940uniform float metalness; 3941uniform float opacity; 3942#ifdef IOR 3943 uniform float ior; 3944#endif 3945#ifdef USE_SPECULAR 3946 uniform float specularIntensity; 3947 uniform vec3 specularColor; 3948 #ifdef USE_SPECULAR_COLORMAP 3949 uniform sampler2D specularColorMap; 3950 #endif 3951 #ifdef USE_SPECULAR_INTENSITYMAP 3952 uniform sampler2D specularIntensityMap; 3953 #endif 3954#endif 3955#ifdef USE_CLEARCOAT 3956 uniform float clearcoat; 3957 uniform float clearcoatRoughness; 3958#endif
3959#ifdef USE_IRIDESCENCE 3960 uniform float iridescence; 3961 uniform float iridescenceIOR; 3962 uniform float iridescenceThicknessMinimum; 3963 uniform float iridescenceThicknessMaximum; 3964#endif 3965#ifdef USE_SHEEN 3966 uniform vec3 sheenColor; 3967 uniform float sheenRoughness; 3968 #ifdef USE_SHEEN_COLORMAP 3969 uniform sampler2D sheenColorMap; 3970 #endif 3971 #ifdef USE_SHEEN_ROUGHNESSMAP 3972 uniform sampler2D sheenRoughnessMap; 3973 #endif 3974#endif 3975#ifdef USE_ANISOTROPY 3976 uniform vec2 anisotropyVector; 3977 #ifdef USE_ANISOTROPYMAP 3978 uniform sampler2D anisotropyMap; 3979 #endif 3980#endif 3981varying vec3 vViewPosition; 3982#include <common> 3983#include <packing> 3984#include <dithering_pars_fragment> 3985#include <color_pars_fragment> 3986#include <uv_pars_fragment> 3987#include <map_pars_fragment> 3988#include <alphamap_pars_fragment> 3989#include <alphatest_pars_fragment> 3990#include <alphahash_pars_fragment> 3991#include <aomap_pars_fragment> 3992#include <lightmap_pars_fragment> 3993#include <emissivemap_pars_fragment> 3994#include <iridescence_fragment> 3995#include <cube_uv_reflection_fragment> 3996#include <envmap_common_pars_fragment> 3997#include <envmap_physical_pars_fragment> 3998#include <fog_pars_fragment> 3999#include <lights_pars_begin> 4000#include <normal_pars_fragment> 4001#include <lights_physical_pars_fragment> 4002#include <transmission_pars_fragment> 4003#include <shadowmap_pars_fragment> 4004#include <bumpmap_pars_fragment> 4005#include <normalmap_pars_fragment> 4006#include <clearcoat_pars_fragment> 4007#include <iridescence_pars_fragment> 4008#include <roughnessmap_pars_fragment> 4009#include <metalnessmap_pars_fragment> 4010#include <logdepthbuf_pars_fragment> 4011#include <clipping_planes_pars_fragment> 4012void main() { 4013 #include <clipping_planes_fragment> 4014 vec4 diffuseColor = vec4( diffuse, opacity ); 4015 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 4016 vec3 totalEmissiveRadiance = emissive; 4017 #include <logdepthbuf_fragment> 4018 #include <map_fragment> 4019 #include <color_fragment> 4020 #include <alphamap_fragment> 4021 #include <alphatest_fragment> 4022 #include <alphahash_fragment> 4023 #include <roughnessmap_fragment> 4024 #include <metalnessmap_fragment> 4025 #include <normal_fragment_begin> 4026 #include <normal_fragment_maps> 4027 #include <clearcoat_normal_fragment_begin> 4028 #include <clearcoat_normal_fragment_maps> 4029 #include <emissivemap_fragment> 4030 #include <lights_physical_fragment> 4031 #include <lights_fragment_begin> 4032 #include <lights_fragment_maps> 4033 #include <lights_fragment_end> 4034 #include <aomap_fragment> 4035 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 4036 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 4037 #include <transmission_fragment> 4038 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 4039 #ifdef USE_SHEEN 4040 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 4041 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 4042 #endif 4043 #ifdef USE_CLEARCOAT 4044 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 4045 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 4046 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 4047 #endif 4048 #include <opaque_fragment> 4049 #include <tonemapping_fragment> 4050 #include <colorspace_fragment> 4051 #include <fog_fragment> 4052 #include <premultiplied_alpha_fragment> 4053 #include <dithering_fragment> 4054}`,Jze=`#define TOON 4055varying vec3 vViewPosition; 4056#include <common> 4057#include <batching_pars_vertex> 4058#include <uv_pars_vertex> 4059#include <displacementmap_pars_vertex> 4060#include <color_pars_vertex> 4061#include <fog_pars_vertex> 4062#include <normal_pars_vertex> 4063#include <morphtarget_pars_vertex> 4064#include <skinning_pars_vertex> 4065#include <shadowmap_pars_vertex> 4066#include <logdepthbuf_pars_vertex> 4067#include <clipping_planes_pars_vertex> 4068void main() { 4069 #include <uv_vertex> 4070 #include <color_vertex> 4071 #include <morphcolor_vertex> 4072 #include <batching_vertex> 4073 #include <beginnormal_vertex> 4074 #include <morphnormal_vertex> 4075 #include <skinbase_vertex> 4076 #include <skinnormal_vertex> 4077 #include <defaultnormal_vertex> 4078 #include <normal_vertex> 4079 #include <begin_vertex> 4080 #include <morphtarget_vertex> 4081 #include <skinning_vertex> 4082 #include <displacementmap_vertex> 4083 #include <project_vertex> 4084 #include <logdepthbuf_vertex> 4085 #include <clipping_planes_vertex> 4086 vViewPosition = - mvPosition.xyz; 4087 #include <worldpos_vertex> 4088 #include <shadowmap_vertex> 4089 #include <fog_vertex> 4090}`,Zze=`#define TOON 4091uniform vec3 diffuse; 4092uniform vec3 emissive; 4093uniform float opacity; 4094#include <common> 4095#include <packing> 4096#include <dithering_pars_fragment> 4097#include <color_pars_fragment> 4098#include <uv_pars_fragment> 4099#include <map_pars_fragment> 4100#include <alphamap_pars_fragment> 4101#include <alphatest_pars_fragment> 4102#include <alphahash_pars_fragment> 4103#include <aomap_pars_fragment> 4104#include <lightmap_pars_fragment> 4105#include <emissivemap_pars_fragment> 4106#include <gradientmap_pars_fragment> 4107#include <fog_pars_fragment> 4108#include <bsdfs> 4109#include <lights_pars_begin> 4110#include <normal_pars_fragment> 4111#include <lights_toon_pars_fragment> 4112#include <shadowmap_pars_fragment> 4113#include <bumpmap_pars_fragment> 4114#include <normalmap_pars_fragment> 4115#include <logdepthbuf_pars_fragment> 4116#include <clipping_planes_pars_fragment> 4117void main() { 4118 #include <clipping_planes_fragment> 4119 vec4 diffuseColor = vec4( diffuse, opacity ); 4120 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 4121 vec3 totalEmissiveRadiance = emissive; 4122 #include <logdepthbuf_fragment> 4123 #include <map_fragment> 4124 #include <color_fragment> 4125 #include <alphamap_fragment> 4126 #include <alphatest_fragment> 4127 #include <alphahash_fragment> 4128 #include <normal_fragment_begin> 4129 #include <normal_fragment_maps> 4130 #include <emissivemap_fragment> 4131 #include <lights_toon_fragment> 4132 #include <lights_fragment_begin> 4133 #include <lights_fragment_maps> 4134 #include <lights_fragment_end> 4135 #include <aomap_fragment> 4136 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 4137 #include <opaque_fragment> 4138 #include <tonemapping_fragment> 4139 #include <colorspace_fragment> 4140 #include <fog_fragment> 4141 #include <premultiplied_alpha_fragment> 4142 #include <dithering_fragment> 4143}`,Qze=`uniform float size; 4144uniform float scale; 4145#include <common> 4146#include <color_pars_vertex> 4147#include <fog_pars_vertex> 4148#include <morphtarget_pars_vertex> 4149#include <logdepthbuf_pars_vertex> 4150#include <clipping_planes_pars_vertex> 4151#ifdef USE_POINTS_UV 4152 varying vec2 vUv; 4153 uniform mat3 uvTransform; 4154#endif 4155void main() { 4156 #ifdef USE_POINTS_UV 4157 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 4158 #endif 4159 #include <color_vertex> 4160 #include <morphcolor_vertex> 4161 #include <begin_vertex> 4162 #include <morphtarget_vertex> 4163 #include <project_vertex> 4164 gl_PointSize = size; 4165 #ifdef USE_SIZEATTENUATION 4166 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 4167 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 4168 #endif 4169 #include <logdepthbuf_vertex> 4170 #include <clipping_planes_vertex> 4171 #include <worldpos_vertex> 4172 #include <fog_vertex> 4173}`,e6e=`uniform vec3 diffuse; 4174uniform float opacity; 4175#include <common> 4176#include <color_pars_fragment> 4177#include <map_particle_pars_fragment> 4178#include <alphatest_pars_fragment> 4179#include <alphahash_pars_fragment> 4180#include <fog_pars_fragment> 4181#include <logdepthbuf_pars_fragment> 4182#include <clipping_planes_pars_fragment> 4183void main() { 4184 #include <clipping_planes_fragment> 4185 vec3 outgoingLight = vec3( 0.0 ); 4186 vec4 diffuseColor = vec4( diffuse, opacity ); 4187 #include <logdepthbuf_fragment> 4188 #include <map_particle_fragment> 4189 #include <color_fragment> 4190 #include <alphatest_fragment> 4191 #include <alphahash_fragment> 4192 outgoingLight = diffuseColor.rgb; 4193 #include <opaque_fragment> 4194 #include <tonemapping_fragment> 4195 #include <colorspace_fragment> 4196 #include <fog_fragment> 4197 #include <premultiplied_alpha_fragment> 4198}`,t6e=`#include <common> 4199#include <batching_pars_vertex> 4200#include <fog_pars_vertex> 4201#include <morphtarget_pars_vertex> 4202#include <skinning_pars_vertex> 4203#include <logdepthbuf_pars_vertex> 4204#include <shadowmap_pars_vertex> 4205void main() { 4206 #include <batching_vertex> 4207 #include <beginnormal_vertex> 4208 #include <morphnormal_vertex> 4209 #include <skinbase_vertex> 4210 #include <skinnormal_vertex> 4211 #include <defaultnormal_vertex> 4212 #include <begin_vertex> 4213 #include <morphtarget_vertex> 4214 #include <skinning_vertex> 4215 #include <project_vertex> 4216 #include <logdepthbuf_vertex> 4217 #include <worldpos_vertex> 4218 #include <shadowmap_vertex> 4219 #include <fog_vertex> 4220}`,n6e=`uniform vec3 color; 4221uniform float opacity; 4222#include <common> 4223#include <packing> 4224#include <fog_pars_fragment> 4225#include <bsdfs> 4226#include <lights_pars_begin> 4227#include <logdepthbuf_pars_fragment> 4228#include <shadowmap_pars_fragment> 4229#include <shadowmask_pars_fragment> 4230void main() { 4231 #include <logdepthbuf_fragment> 4232 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 4233 #include <tonemapping_fragment> 4234 #include <colorspace_fragment> 4235 #include <fog_fragment> 4236}`,r6e=`uniform float rotation; 4237uniform vec2 center; 4238#include <common> 4239#include <uv_pars_vertex> 4240#include <fog_pars_vertex> 4241#include <logdepthbuf_pars_vertex> 4242#include <clipping_planes_pars_vertex> 4243void main() { 4244 #include <uv_vertex> 4245 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 4246 vec2 scale; 4247 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 4248 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 4249 #ifndef USE_SIZEATTENUATION 4250 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 4251 if ( isPerspective ) scale *= - mvPosition.z; 4252 #endif 4253 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 4254 vec2 rotatedPosition; 4255 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 4256 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 4257 mvPosition.xy += rotatedPosition; 4258 gl_Position = projectionMatrix * mvPosition; 4259 #include <logdepthbuf_vertex> 4260 #include <clipping_planes_vertex> 4261 #include <fog_vertex> 4262}`,i6e=`uniform vec3 diffuse; 4263uniform float opacity; 4264#include <common> 4265#include <uv_pars_fragment> 4266#include <map_pars_fragment> 4267#include <alphamap_pars_fragment> 4268#include <alphatest_pars_fragment> 4269#include <alphahash_pars_fragment> 4270#include <fog_pars_fragment> 4271#include <logdepthbuf_pars_fragment> 4272#include <clipping_planes_pars_fragment> 4273void main() { 4274 #include <clipping_planes_fragment> 4275 vec3 outgoingLight = vec3( 0.0 ); 4276 vec4 diffuseColor = vec4( diffuse, opacity ); 4277 #include <logdepthbuf_fragment> 4278 #include <map_fragment> 4279 #include <alphamap_fragment> 4280 #include <alphatest_fragment> 4281 #include <alphahash_fragment> 4282 outgoingLight = diffuseColor.rgb; 4283 #include <opaque_fragment> 4284 #include <tonemapping_fragment> 4285 #include <colorspace_fragment> 4286 #include <fog_fragment> 4287}`,_r={alphahash_fragment:kFe,alphahash_pars_fragment:CFe,alphamap_fragment:NFe,alphamap_pars_fragment:TFe,alphatest_fragment:MFe,alphatest_pars_fragment:RFe,aomap_fragment:jFe,aomap_pars_fragment:PFe,batching_pars_vertex:LFe,batching_vertex:IFe,begin_vertex:DFe,beginnormal_vertex:BFe,bsdfs:FFe,iridescence_fragment:OFe,bumpmap_pars_fragment:zFe,clipping_planes_fragment:UFe,clipping_planes_pars_fragment:HFe,clipping_planes_pars_vertex:GFe,clipping_planes_vertex:VFe,color_fragment:WFe,color_pars_fragment:$Fe,color_pars_vertex:KFe,color_vertex:qFe,common:XFe,cube_uv_reflection_fragment:YFe,defaultnormal_vertex:JFe,displacementmap_pars_vertex:ZFe,displacementmap_vertex:QFe,emissivemap_fragment:eOe,emissivemap_pars_fragment:tOe,colorspace_fragment:nOe,colorspace_pars_fragment:rOe,envmap_fragment:iOe,envmap_common_pars_fragment:sOe,envmap_pars_fragment:aOe,envmap_pars_vertex:oOe,envmap_physical_pars_fragment:yOe,envmap_vertex:lOe,fog_vertex:cOe,fog_pars_vertex:uOe,fog_fragment:dOe,fog_pars_fragment:hOe,gradientmap_pars_fragment:fOe,lightmap_fragment:pOe,lightmap_pars_fragment:mOe,lights_lambert_fragment:gOe,lights_lambert_pars_fragment:xOe,lights_pars_begin:vOe,lights_toon_fragment:bOe,lights_toon_pars_fragment:wOe,lights_phong_fragment:_Oe,lights_phong_pars_fragment:SOe,lights_physical_fragment:AOe,lights_physical_pars_fragment:EOe,lights_fragment_begin:kOe,lights_fragment_maps:COe,lights_fragment_end:NOe,logdepthbuf_fragment:TOe,logdepthbuf_pars_fragment:MOe,logdepthbuf_pars_vertex:ROe,logdepthbuf_vertex:jOe,map_fragment:POe,map_pars_fragment:LOe,map_particle_fragment:IOe,map_particle_pars_fragment:DOe,metalnessmap_fragment:BOe,metalnessmap_pars_fragment:FOe,morphcolor_vertex:OOe,morphnormal_vertex:zOe,morphtarget_pars_vertex:UOe,morphtarget_vertex:HOe,normal_fragment_begin:GOe,normal_fragment_maps:VOe,
vendor: 5,630 bytes, line 4287
4287normal_pars_fragment:WOe,normal_pars_vertex:$Oe,normal_vertex:KOe,normalmap_pars_fragment:qOe,clearcoat_normal_fragment_begin:XOe,clearcoat_normal_fragment_maps:YOe,clearcoat_pars_fragment:JOe,iridescence_pars_fragment:ZOe,opaque_fragment:QOe,packing:eze,premultiplied_alpha_fragment:tze,project_vertex:nze,dithering_fragment:rze,dithering_pars_fragment:ize,roughnessmap_fragment:sze,roughnessmap_pars_fragment:aze,shadowmap_pars_fragment:oze,shadowmap_pars_vertex:lze,shadowmap_vertex:cze,shadowmask_pars_fragment:uze,skinbase_vertex:dze,skinning_pars_vertex:hze,skinning_vertex:fze,skinnormal_vertex:pze,specularmap_fragment:mze,specularmap_pars_fragment:gze,tonemapping_fragment:xze,tonemapping_pars_fragment:vze,transmission_fragment:yze,transmission_pars_fragment:bze,uv_pars_fragment:wze,uv_pars_vertex:_ze,uv_vertex:Sze,worldpos_vertex:Aze,background_vert:Eze,background_frag:kze,backgroundCube_vert:Cze,backgroundCube_frag:Nze,cube_vert:Tze,cube_frag:Mze,depth_vert:Rze,depth_frag:jze,distanceRGBA_vert:Pze,distanceRGBA_frag:Lze,equirect_vert:Ize,equirect_frag:Dze,linedashed_vert:Bze,linedashed_frag:Fze,meshbasic_vert:Oze,meshbasic_frag:zze,meshlambert_vert:Uze,meshlambert_frag:Hze,meshmatcap_vert:Gze,meshmatcap_frag:Vze,meshnormal_vert:Wze,meshnormal_frag:$ze,meshphong_vert:Kze,meshphong_frag:qze,meshphysical_vert:Xze,meshphysical_frag:Yze,meshtoon_vert:Jze,meshtoon_frag:Zze,points_vert:Qze,points_frag:e6e,shadow_vert:t6e,shadow_frag:n6e,sprite_vert:r6e,sprite_frag:i6e},Zt={common:{diffuse:{value:new Qt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Nr},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Nr}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Nr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Nr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Nr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Nr},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Nr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Nr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Nr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Nr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Qt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Qt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0},uvTransform:{value:new Nr}},sprite:{diffuse:{value:new Qt(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Nr},alphaMap:{value:null},alphaMapTransform:{value:new Nr},alphaTest:{value:0}}},dd={basic:{uniforms:al([Zt.common,Zt.specularmap,Zt.envmap,Zt.aomap,Zt.lightmap,Zt.fog]),vertexShader:_r.meshbasic_vert,fragmentShader:_r.meshbasic_frag},lambert:{uniforms:al([Zt.common,Zt.specularmap,Zt.envmap,Zt.aomap,Zt.lightmap,Zt.emissivemap,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,Zt.fog,Zt.lights,{emissive:{value:new Qt(0)}}]),vertexShader:_r.meshlambert_vert,fragmentShader:_r.meshlambert_frag},phong:{uniforms:al([Zt.common,Zt.specularmap,Zt.envmap,Zt.aomap,Zt.lightmap,Zt.emissivemap,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,Zt.fog,Zt.lights,{emissive:{value:new Qt(0)},specular:{value:new Qt(1118481)},shininess:{value:30}}]),vertexShader:_r.meshphong_vert,fragmentShader:_r.meshphong_frag},standard:{uniforms:al([Zt.common,Zt.envmap,Zt.aomap,Zt.lightmap,Zt.emissivemap,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,Zt.roughnessmap,Zt.metalnessmap,Zt.fog,Zt.lights,{emissive:{value:new Qt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_r.meshphysical_vert,fragmentShader:_r.meshphysical_frag},toon:{uniforms:al([Zt.common,Zt.aomap,Zt.lightmap,Zt.emissivemap,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,Zt.gradientmap,Zt.fog,Zt.lights,{emissive:{value:new Qt(0)}}]),vertexShader:_r.meshtoon_vert,fragmentShader:_r.meshtoon_frag},matcap:{uniforms:al([Zt.common,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,Zt.fog,{matc
vendor: 4,624 bytes, line 4287
4287ap:{value:null}}]),vertexShader:_r.meshmatcap_vert,fragmentShader:_r.meshmatcap_frag},points:{uniforms:al([Zt.points,Zt.fog]),vertexShader:_r.points_vert,fragmentShader:_r.points_frag},dashed:{uniforms:al([Zt.common,Zt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_r.linedashed_vert,fragmentShader:_r.linedashed_frag},depth:{uniforms:al([Zt.common,Zt.displacementmap]),vertexShader:_r.depth_vert,fragmentShader:_r.depth_frag},normal:{uniforms:al([Zt.common,Zt.bumpmap,Zt.normalmap,Zt.displacementmap,{opacity:{value:1}}]),vertexShader:_r.meshnormal_vert,fragmentShader:_r.meshnormal_frag},sprite:{uniforms:al([Zt.sprite,Zt.fog]),vertexShader:_r.sprite_vert,fragmentShader:_r.sprite_frag},background:{uniforms:{uvTransform:{value:new Nr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_r.background_vert,fragmentShader:_r.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_r.backgroundCube_vert,fragmentShader:_r.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_r.cube_vert,fragmentShader:_r.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_r.equirect_vert,fragmentShader:_r.equirect_frag},distanceRGBA:{uniforms:al([Zt.common,Zt.displacementmap,{referencePosition:{value:new Ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_r.distanceRGBA_vert,fragmentShader:_r.distanceRGBA_frag},shadow:{uniforms:al([Zt.lights,Zt.fog,{color:{value:new Qt(0)},opacity:{value:1}}]),vertexShader:_r.shadow_vert,fragmentShader:_r.shadow_frag}};dd.physical={uniforms:al([dd.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Nr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Nr},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Nr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Nr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Nr},sheen:{value:0},sheenColor:{value:new Qt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Nr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Nr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Nr},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Nr},attenuationDistance:{value:0},attenuationColor:{value:new Qt(0)},specularColor:{value:new Qt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Nr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Nr},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Nr}}]),vertexShader:_r.meshphysical_vert,fragmentShader:_r.meshphysical_frag};const jk={r:0,b:0,g:0};function s6e(t,e,n,r,i,s,a){const o=new Qt(0);let l=s===!0?0:1,u,d,h=null,p=0,f=null;function m(v,g){let b=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?n:e).get(y)),y===null?x(o,l):y&&y.isColor&&(x(y,1),b=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?r.buffers.color.setClear(0,0,0,1,a):S==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||b)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===nw)?(d===void 0&&(d=new Li(new Nd(1,1,1),new bl({name:"BackgroundCubeMaterial",uniforms:o1(dd.backgroundCube.uniforms),vertexShader:dd.backgroundCube.vertexShader,fragmentShader:dd.backgroundCube.fragmentShader,side:xl,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(A,k,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),d.material.uniforms.envMap.value=y,d.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=_i.getTransfer(y.colorSpace)!==Oi,(h!==y||p!==y.version||f!==t.toneMapping)&&(
vendor: 4,702 bytes, line 4287
4287d.material.needsUpdate=!0,h=y,p=y.version,f=t.toneMapping),d.layers.enableAll(),v.unshift(d,d.geometry,d.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new Li(new Td(2,2),new bl({name:"BackgroundMaterial",uniforms:o1(dd.background.uniforms),vertexShader:dd.background.vertexShader,fragmentShader:dd.background.fragmentShader,side:Nh,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=_i.getTransfer(y.colorSpace)!==Oi,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(h!==y||p!==y.version||f!==t.toneMapping)&&(u.material.needsUpdate=!0,h=y,p=y.version,f=t.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null))}function x(v,g){v.getRGB(jk,_oe(t)),r.buffers.color.setClear(jk.r,jk.g,jk.b,g,a)}return{getClearColor:function(){return o},setClearColor:function(v,g=1){o.set(v),l=g,x(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,x(o,l)},render:m}}function a6e(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||s!==null,o={},l=v(null);let u=l,d=!1;function h(B,$,U,Z,V){let W=!1;if(a){const O=x(Z,U,$);u!==O&&(u=O,f(u.object)),W=g(B,Z,U,V),W&&b(B,Z,U,V)}else{const O=$.wireframe===!0;(u.geometry!==Z.id||u.program!==U.id||u.wireframe!==O)&&(u.geometry=Z.id,u.program=U.id,u.wireframe=O,W=!0)}V!==null&&n.update(V,t.ELEMENT_ARRAY_BUFFER),(W||d)&&(d=!1,T(B,$,U,Z),V!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(V).buffer))}function p(){return r.isWebGL2?t.createVertexArray():s.createVertexArrayOES()}function f(B){return r.isWebGL2?t.bindVertexArray(B):s.bindVertexArrayOES(B)}function m(B){return r.isWebGL2?t.deleteVertexArray(B):s.deleteVertexArrayOES(B)}function x(B,$,U){const Z=U.wireframe===!0;let V=o[B.id];V===void 0&&(V={},o[B.id]=V);let W=V[$.id];W===void 0&&(W={},V[$.id]=W);let O=W[Z];return O===void 0&&(O=v(p()),W[Z]=O),O}function v(B){const $=[],U=[],Z=[];for(let V=0;V<i;V++)$[V]=0,U[V]=0,Z[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:$,enabledAttributes:U,attributeDivisors:Z,object:B,attributes:{},index:null}}function g(B,$,U,Z){const V=u.attributes,W=$.attributes;let O=0;const Y=U.getAttributes();for(const z in Y)if(Y[z].location>=0){const q=V[z];let te=W[z];if(te===void 0&&(z==="instanceMatrix"&&B.instanceMatrix&&(te=B.instanceMatrix),z==="instanceColor"&&B.instanceColor&&(te=B.instanceColor)),q===void 0||q.attribute!==te||te&&q.data!==te.data)return!0;O++}return u.attributesNum!==O||u.index!==Z}function b(B,$,U,Z){const V={},W=$.attributes;let O=0;const Y=U.getAttributes();for(const z in Y)if(Y[z].location>=0){let q=W[z];q===void 0&&(z==="instanceMatrix"&&B.instanceMatrix&&(q=B.instanceMatrix),z==="instanceColor"&&B.instanceColor&&(q=B.instanceColor));const te={};te.attribute=q,q&&q.data&&(te.data=q.data),V[z]=te,O++}u.attributes=V,u.attributesNum=O,u.index=Z}function y(){const B=u.newAttributes;for(let $=0,U=B.length;$<U;$++)B[$]=0}function S(B){A(B,0)}function A(B,$){const U=u.newAttributes,Z=u.enabledAttributes,V=u.attributeDivisors;U[B]=1,Z[B]===0&&(t.enableVertexAttribArray(B),Z[B]=1),V[B]!==$&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](B,$),V[B]=$)}function k(){const B=u.newAttributes,$=u.enabledAttributes;for(let U=0,Z=$.length;U<Z;U++)$[U]!==B[U]&&(t.disableVertexAttribArray(U),$[U]=0)}function M(B,$,U,Z,V,W,O){O===!0?t.vertexAttribIPointer(B,$,U,V,W):t.vertexAttribPointer(B,$,U,Z,V,W)}function T(B,$,U,Z){if(r.isWebGL2===!1&&(B.isInstancedMesh||Z.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();const V=Z.attributes,W=U.getAttributes(),O=$.defaultAttributeValues;for(const Y in W){const z=W[Y];if(z.location>=0){let I=V[Y];if(I===void 0&&(Y==="instanceMatrix"&&B.instanceMatrix&&(I=B.instanceMatrix),Y==="instanceColor"&&B.instanceColor&&(I=B.instanceColor)),I!==void 0){const q=I.normalized,te=I.itemSize,se=n.get(I);if(se===void 0)continue;const ie=se.buffer,le=se.type,xe=se.bytesPerElement,Ee=r.isWebGL2===!0&&(le===t.INT||le===t.UNSIGNED_INT||I.gpuType===EM);if(I.isInterleavedBufferAttribute){const ae=I.data,Q=ae.stride,we=I.offset;if(ae.isInstancedInterleavedBuffer){for(let Ae=0;Ae<z.locationSize;Ae++)A(z.location+Ae,ae.meshPerAttribute);B.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let Ae=0;Ae<z.locationSize;Ae++)S(z.location+Ae);
vendor: 15,871 bytes, lines 4287-4362
4287t.bindBuffer(t.ARRAY_BUFFER,ie);for(let Ae=0;Ae<z.locationSize;Ae++)M(z.location+Ae,te/z.locationSize,le,q,Q*xe,(we+te/z.locationSize*Ae)*xe,Ee)}else{if(I.isInstancedBufferAttribute){for(let ae=0;ae<z.locationSize;ae++)A(z.location+ae,I.meshPerAttribute);B.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=I.meshPerAttribute*I.count)}else for(let ae=0;ae<z.locationSize;ae++)S(z.location+ae);t.bindBuffer(t.ARRAY_BUFFER,ie);for(let ae=0;ae<z.locationSize;ae++)M(z.location+ae,te/z.locationSize,le,q,te*xe,te/z.locationSize*ae*xe,Ee)}}else if(O!==void 0){const q=O[Y];if(q!==void 0)switch(q.length){case 2:t.vertexAttrib2fv(z.location,q);break;case 3:t.vertexAttrib3fv(z.location,q);break;case 4:t.vertexAttrib4fv(z.location,q);break;default:t.vertexAttrib1fv(z.location,q)}}}}k()}function C(){j();for(const B in o){const $=o[B];for(const U in $){const Z=$[U];for(const V in Z)m(Z[V].object),delete Z[V];delete $[U]}delete o[B]}}function R(B){if(o[B.id]===void 0)return;const $=o[B.id];for(const U in $){const Z=$[U];for(const V in Z)m(Z[V].object),delete Z[V];delete $[U]}delete o[B.id]}function P(B){for(const $ in o){const U=o[$];if(U[B.id]===void 0)continue;const Z=U[B.id];for(const V in Z)m(Z[V].object),delete Z[V];delete U[B.id]}}function j(){G(),d=!0,u!==l&&(u=l,f(u.object))}function G(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:j,resetDefaultState:G,dispose:C,releaseStatesOfGeometry:R,releaseStatesOfProgram:P,initAttributes:y,enableAttribute:S,disableUnusedAttributes:k}}function o6e(t,e,n,r){const i=r.isWebGL2;let s;function a(d){s=d}function o(d,h){t.drawArrays(s,d,h),n.update(h,s,1)}function l(d,h,p){if(p===0)return;let f,m;if(i)f=t,m="drawArraysInstanced";else if(f=e.get("ANGLE_instanced_arrays"),m="drawArraysInstancedANGLE",f===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}f[m](s,d,h,p),n.update(h,s,p)}function u(d,h,p){if(p===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<p;m++)this.render(d[m],h[m]);else{f.multiDrawArraysWEBGL(s,d,0,h,0,p);let m=0;for(let x=0;x<p;x++)m+=h[x];n.update(m,s,1)}}this.setMode=a,this.render=o,this.renderInstances=l,this.renderMultiDraw=u}function l6e(t,e,n){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const M=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(M.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(M){if(M==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let o=n.precision!==void 0?n.precision:"highp";const l=s(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const u=a||e.has("WEBGL_draw_buffers"),d=n.logarithmicDepthBuffer===!0,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),p=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),x=t.getParameter(t.MAX_VERTEX_ATTRIBS),v=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),b=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=p>0,S=a||e.has("OES_texture_float"),A=y&&S,k=a?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:f,maxCubemapSize:m,maxAttributes:x,maxVertexUniforms:v,maxVaryings:g,maxFragmentUniforms:b,vertexTextures:y,floatFragmentTextures:S,floatVertexTextures:A,maxSamples:k}}function c6e(t){const e=this;let n=null,r=0,i=!1,s=!1;const a=new ff,o=new Nr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const f=h.length!==0||p||r!==0||i;return i=p,r=h.length,f},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){n=d(h,p,0)},this.setState=function(h,p,f){const m=h.clippingPlanes,x=h.clipIntersection,v=h.clipShadows,g=t.get(h);if(!i||m===null||m.length===0||s&&!v)s?d(null):u();else{const b=s?0:r,y=b*4;let S=g.clippingState||null;l.value=S,S=d(m,p,y,f);for(let A=0;A!==y;++A)S[A]=n[A];g.clippingState=S,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=b}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(h,p,f,m){const x=h!==null?h.length:0;let v=null;if(x!==0){if(v=l.value,m!==!0||v===null){const g=f+x*4,b=p.matrixWorldInverse;o.getNormalMatrix(b),(v===null||v.length<g)&&(v=new Float32Array(g));for(let y=0,S=f;y!==x;++y,S+=4)a.copy(h[y]).applyMatrix4(b,o),a.normal.toArray(v,S),v[S+3]=a.constant}l.value=v,l.needsUpdate=!0}return e.numPlanes=x,e.numIntersection=0,v}}function u6e(t){let e=new WeakMap;function n(a,o){return o===n1?a.mapping=Th:o===xS&&(a.mapping=Ym),a}function r(a){if(a&&a.isTexture){const o=a.mapping;if(o===n1||o===xS)if(e.has(a)){const l=e.get(a).texture;return n(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const u=new $z(l.height/2);return u.fromEquirectangularTexture(t,a),e.set(a,u),a.addEventListener("dispose",i),n(u.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class _h extends jA{constructor(e=-1,n=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=n,this.top=r,this.bottom=i,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,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=n,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),n=(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+n,l=i-n;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.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const Gy=4,bW=[.125,.215,.35,.446,.526,.582],u0=20,tP=new _h,wW=new Qt;let nP=null,rP=0,iP=0;const i0=(1+Math.sqrt(5))/2,Gv=1/i0,_W=[new Ie(1,1,1),new Ie(-1,1,1),new Ie(1,1,-1),new Ie(-1,1,-1),new Ie(0,i0,Gv),new Ie(0,i0,-Gv),new Ie(Gv,0,i0),new Ie(-Gv,0,i0),new Ie(i0,Gv,0),new Ie(-i0,Gv,0)];class ID{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){nP=this._renderer.getRenderTarget(),rP=this._renderer.getActiveCubeFace(),iP=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),n>0&&this._blur(s,0,0,n),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=EW(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=AW(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(nP,rP,iP),e.scissorTest=!1,Pk(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Th||e.mapping===Ym?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),nP=this._renderer.getRenderTarget(),rP=this._renderer.getActiveCubeFace(),iP=this._renderer.getActiveMipmapLevel();const r=n||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,r={magFilter:zr,minFilter:zr,generateMipmaps:!1,type:Na,format:fa,colorSpace:Pc,depthBuffer:!1},i=SW(e,n,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=SW(e,n,r);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=d6e(s)),this._blurMaterial=h6e(s,e,n)}return i}_compileMaterial(e){const n=new Li(this._lodPlanes[0],e);this._renderer.compile(n,tP)}_sceneToCubeUV(e,n,r,i){const o=new Os(90,1,n,r),l=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],d=this._renderer,h=d.autoClear,p=d.toneMapping;d.getClearColor(wW),d.toneMapping=wh,d.autoClear=!1;const f=new ml({name:"PMREM.Background",side:xl,depthWrite:!1,depthTest:!1}),m=new Li(new Nd,f);let x=!1;const v=e.background;v?v.isColor&&(f.color.copy(v),e.background=null,x=!0):(f.color.copy(wW),x=!0);for(let g=0;g<6;g++){const b=g%3;b===0?(o.up.set(0,l[g],0),o.lookAt(u[g],0,0)):b===1?(o.up.set(0,0,l[g]),o.lookAt(0,u[g],0)):(o.up.set(0,l[g],0),o.lookAt(0,0,u[g]));const y=this._cubeSize;Pk(i,b*y,g>2?y:0,y,y),d.setRenderTarget(i),x&&d.render(m,o),d.render(e,o)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=v}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Th||e.mapping===Ym;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=EW()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=AW());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Li(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;Pk(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,tP)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),a=_W[(i-1)%_W.length];this._blur(e,i-1,i,s,a)}n.autoClear=r}_blur(e,n,r,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,n,r,i,"latitudinal",s),this._halfBlur(a,e,r,r,i,"longitudinal",s)}_halfBlur(e,n,r,i,s,a,o){const l=this._renderer,u=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,h=new Li(this._lodPlanes[i],u),p=u.uniforms,f=this._sizeLods[r]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*u0-1),x=s/m,v=isFinite(s)?1+Math.floor(d*x):u0;v>u0&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${u0}`);const g=[];let b=0;for(let M=0;M<u0;++M){const T=M/x,C=Math.exp(-T*T/2);g.push(C),M===0?b+=C:M<v&&(b+=2*C)}for(let M=0;M<g.length;M++)g[M]=g[M]/b;p.envMap.value=e.texture,p.samples.value=v,p.weights.value=g,p.latitudinal.value=a==="latitudinal",o&&(p.poleAxis.value=o);const{_lodMax:y}=this;p.dTheta.value=m,p.mipInt.value=y-r;const S=this._sizeLods[i],A=3*S*(i>y-Gy?i-y+Gy:0),k=4*(this._cubeSize-S);Pk(n,A,k,3*S,2*S),l.setRenderTarget(n),l.render(h,tP)}}function d6e(t){const e=[],n=[],r=[];let i=t;const s=t-Gy+1+bW.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);n.push(o);let l=1/o;a>t-Gy?l=bW[a-t+Gy-1]:a===0&&(l=0),r.push(l);const u=1/(o-2),d=-u,h=1+u,p=[d,d,h,d,h,h,d,d,h,h,d,h],f=6,m=6,x=3,v=2,g=1,b=new Float32Array(x*m*f),y=new Float32Array(v*m*f),S=new Float32Array(g*m*f);for(let k=0;k<f;k++){const M=k%3*2/3-1,T=k>2?0:-1,C=[M,T,0,M+2/3,T,0,M+2/3,T+1,0,M,T,0,M+2/3,T+1,0,M,T+1,0];b.set(C,x*m*k),y.set(p,v*m*k);const R=[k,k,k,k,k,k];S.set(R,g*m*k)}const A=new or;A.setAttribute("position",new Yr(b,x)),A.setAttribute("uv",new Yr(y,v)),A.setAttribute("faceIndex",new Yr(S,g)),e.push(A),i>Gy&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function SW(t,e,n){const r=new Yo(t,e,n);return r.texture.mapping=nw,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Pk(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function h6e(t,e,n){const r=new Float32Array(u0),i=new Ie(0,1,0);return new bl({name:"SphericalGaussianBlur",defines:{n:u0,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Kz(),fragmentShader:` 4288 4289 precision mediump float; 4290 precision mediump int; 4291 4292 varying vec3 vOutputDirection; 4293 4294 uniform sampler2D envMap; 4295 uniform int samples; 4296 uniform float weights[ n ]; 4297 uniform bool latitudinal; 4298 uniform float dTheta; 4299 uniform float mipInt; 4300 uniform vec3 poleAxis; 4301 4302 #define ENVMAP_TYPE_CUBE_UV 4303 #include <cube_uv_reflection_fragment> 4304 4305 vec3 getSample( float theta, vec3 axis ) { 4306 4307 float cosTheta = cos( theta ); 4308 // Rodrigues' axis-angle rotation 4309 vec3 sampleDirection = vOutputDirection * cosTheta 4310 + cross( axis, vOutputDirection ) * sin( theta ) 4311 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 4312 4313 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 4314 4315 } 4316 4317 void main() { 4318 4319 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 4320 4321 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 4322 4323 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 4324 4325 } 4326 4327 axis = normalize( axis ); 4328 4329 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 4330 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 4331 4332 for ( int i = 1; i < n; i++ ) { 4333 4334 if ( i >= samples ) { 4335 4336 break; 4337 4338 } 4339 4340 float theta = dTheta * float( i ); 4341 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 4342 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 4343 4344 } 4345 4346 } 4347 `,blending:bh,depthTest:!1,depthWrite:!1})}function AW(){return new bl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Kz(),fragmentShader:` 4348 4349 precision mediump float; 4350 precision mediump int; 4351 4352 varying vec3 vOutputDirection; 4353 4354 uniform sampler2D envMap; 4355 4356 #include <common> 4357 4358 void main() { 4359 4360 vec3 outputDirection = normalize( vOutputDirection ); 4361 vec2 uv = equirectUv( outputDirection ); 4362
4363 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 4364 4365 } 4366 `,blending:bh,depthTest:!1,depthWrite:!1})}function EW(){return new bl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Kz(),fragmentShader:` 4367 4368 precision mediump float; 4369 precision mediump int; 4370 4371 uniform float flipEnvMap; 4372 4373 varying vec3 vOutputDirection; 4374 4375 uniform samplerCube envMap; 4376 4377 void main() { 4378 4379 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 4380 4381 } 4382 `,blending:bh,depthTest:!1,depthWrite:!1})}function Kz(){return` 4383 4384 precision mediump float; 4385 precision mediump int; 4386 4387 attribute float faceIndex; 4388 4389 varying vec3 vOutputDirection; 4390 4391 // RH coordinate system; PMREM face-indexing convention 4392 vec3 getDirection( vec2 uv, float face ) { 4393 4394 uv = 2.0 * uv - 1.0; 4395 4396 vec3 direction = vec3( uv, 1.0 ); 4397 4398 if ( face == 0.0 ) { 4399 4400 direction = direction.zyx; // ( 1, v, u ) pos x 4401 4402 } else if ( face == 1.0 ) { 4403 4404 direction = direction.xzy; 4405 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 4406 4407 } else if ( face == 2.0 ) { 4408 4409 direction.x *= -1.0; // ( -u, v, 1 ) pos z 4410 4411 } else if ( face == 3.0 ) { 4412 4413 direction = direction.zyx; 4414 direction.xz *= -1.0; // ( -1, v, -u ) neg x 4415 4416 } else if ( face == 4.0 ) { 4417 4418 direction = direction.xzy; 4419 direction.xy *= -1.0; // ( -u, -1, v ) neg y 4420 4421 } else if ( face == 5.0 ) { 4422 4423 direction.z *= -1.0; // ( u, v, -1 ) neg z 4424 4425 } 4426 4427 return direction; 4428 4429 } 4430 4431 void main() { 4432 4433 vOutputDirection = getDirection( uv, faceIndex ); 4434 gl_Position = vec4( position, 1.0 ); 4435 4436 } 4437 `}function f6e(t){let e=new WeakMap,n=null;function r(o){if(o&&o.isTexture){const l=o.mapping,u=l===n1||l===xS,d=l===Th||l===Ym;if(u||d)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let h=e.get(o);return n===null&&(n=new ID(t)),h=u?n.fromEquirectangular(o,h):n.fromCubemap(o,h),e.set(o,h),h.texture}else{if(e.has(o))return e.get(o).texture;{const h=o.image;if(u&&h&&h.height>0||d&&h&&i(h)){n===null&&(n=new ID(t));const p=u?n.fromEquirectangular(o):n.fromCubemap(o);return e.set(o,p),o.addEventListener("dispose",s),p.texture}else return null}}}return o}function i(o){let l=0;const u=6;for(let d=0;d<u;d++)o[d]!==void 0&&l++;return l===u}function s(o){const l=o.target;l.removeEventListener("dispose",s);const u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function a(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:a}}function p6e(t){const e={};function n(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(r){return n(r)!==null},init:function(r){r.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(r){const i=n(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function m6e(t,e,n,r){const i={},s=new WeakMap;function a(h){const p=h.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);for(const m in p.morphAttributes){const x=p.morphAttributes[m];for(let v=0,g=x.length;v<g;v++)e.remove(x[v])}p.removeEventListener("dispose",a),delete i[p.id];const f=s.get(p);f&&(e.remove(f),s.delete(p)),r.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,n.memory.geometries--}function o(h,p){return i[p.id]===!0||(p.addEventListener("dispose",a),i[p.id]=!0,n.memory.geometries++),p}function l(h){const p=h.attributes;for(const m in p)e.update(p[m],t.ARRAY_BUFFER);const f=h.morphAttributes;for(const m in f){const x=f[m];for(let v=0,g=x.length;v<g;v++)e.update(x[v],t.ARRAY_BUFFER)}}function u(h){const p=[],f=h.index,m=h.attributes.position;let x=0;if(f!==null){const b=f.array;
vendor: 6,677 bytes, line 4437
4437x=f.version;for(let y=0,S=b.length;y<S;y+=3){const A=b[y+0],k=b[y+1],M=b[y+2];p.push(A,k,k,M,M,A)}}else if(m!==void 0){const b=m.array;x=m.version;for(let y=0,S=b.length/3-1;y<S;y+=3){const A=y+0,k=y+1,M=y+2;p.push(A,k,k,M,M,A)}}else return;const v=new(voe(p)?Vz:Gz)(p,1);v.version=x;const g=s.get(h);g&&e.remove(g),s.set(h,v)}function d(h){const p=s.get(h);if(p){const f=h.index;f!==null&&p.version<f.version&&u(h)}else u(h);return s.get(h)}return{get:o,update:l,getWireframeAttribute:d}}function g6e(t,e,n,r){const i=r.isWebGL2;let s;function a(f){s=f}let o,l;function u(f){o=f.type,l=f.bytesPerElement}function d(f,m){t.drawElements(s,m,o,f*l),n.update(m,s,1)}function h(f,m,x){if(x===0)return;let v,g;if(i)v=t,g="drawElementsInstanced";else if(v=e.get("ANGLE_instanced_arrays"),g="drawElementsInstancedANGLE",v===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}v[g](s,m,o,f*l,x),n.update(m,s,x)}function p(f,m,x){if(x===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let g=0;g<x;g++)this.render(f[g]/l,m[g]);else{v.multiDrawElementsWEBGL(s,m,0,o,f,0,x);let g=0;for(let b=0;b<x;b++)g+=m[b];n.update(g,s,1)}}this.setMode=a,this.setIndex=u,this.render=d,this.renderInstances=h,this.renderMultiDraw=p}function x6e(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,a,o){switch(n.calls++,a){case t.TRIANGLES:n.triangles+=o*(s/3);break;case t.LINES:n.lines+=o*(s/2);break;case t.LINE_STRIP:n.lines+=o*(s-1);break;case t.LINE_LOOP:n.lines+=o*s;break;case t.POINTS:n.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:i,update:r}}function v6e(t,e){return t[0]-e[0]}function y6e(t,e){return Math.abs(e[1])-Math.abs(t[1])}function b6e(t,e,n){const r={},i=new Float32Array(8),s=new WeakMap,a=new gi,o=[];for(let u=0;u<8;u++)o[u]=[u,0];function l(u,d,h){const p=u.morphTargetInfluences;if(e.isWebGL2===!0){const f=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,m=f!==void 0?f.length:0;let x=s.get(d);if(x===void 0||x.count!==m){let B=function(){j.dispose(),s.delete(d),d.removeEventListener("dispose",B)};x!==void 0&&x.texture.dispose();const b=d.morphAttributes.position!==void 0,y=d.morphAttributes.normal!==void 0,S=d.morphAttributes.color!==void 0,A=d.morphAttributes.position||[],k=d.morphAttributes.normal||[],M=d.morphAttributes.color||[];let T=0;b===!0&&(T=1),y===!0&&(T=2),S===!0&&(T=3);let C=d.attributes.position.count*T,R=1;C>e.maxTextureSize&&(R=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const P=new Float32Array(C*R*4*m),j=new NM(P,C,R,m);j.type=Zs,j.needsUpdate=!0;const G=T*4;for(let $=0;$<m;$++){const U=A[$],Z=k[$],V=M[$],W=C*R*4*$;for(let O=0;O<U.count;O++){const Y=O*G;b===!0&&(a.fromBufferAttribute(U,O),P[W+Y+0]=a.x,P[W+Y+1]=a.y,P[W+Y+2]=a.z,P[W+Y+3]=0),y===!0&&(a.fromBufferAttribute(Z,O),P[W+Y+4]=a.x,P[W+Y+5]=a.y,P[W+Y+6]=a.z,P[W+Y+7]=0),S===!0&&(a.fromBufferAttribute(V,O),P[W+Y+8]=a.x,P[W+Y+9]=a.y,P[W+Y+10]=a.z,P[W+Y+11]=V.itemSize===4?a.w:1)}}x={count:m,texture:j,size:new Rt(C,R)},s.set(d,x),d.addEventListener("dispose",B)}let v=0;for(let b=0;b<p.length;b++)v+=p[b];const g=d.morphTargetsRelative?1:1-v;h.getUniforms().setValue(t,"morphTargetBaseInfluence",g),h.getUniforms().setValue(t,"morphTargetInfluences",p),h.getUniforms().setValue(t,"morphTargetsTexture",x.texture,n),h.getUniforms().setValue(t,"morphTargetsTextureSize",x.size)}else{const f=p===void 0?0:p.length;let m=r[d.id];if(m===void 0||m.length!==f){m=[];for(let y=0;y<f;y++)m[y]=[y,0];r[d.id]=m}for(let y=0;y<f;y++){const S=m[y];S[0]=y,S[1]=p[y]}m.sort(y6e);for(let y=0;y<8;y++)y<f&&m[y][1]?(o[y][0]=m[y][0],o[y][1]=m[y][1]):(o[y][0]=Number.MAX_SAFE_INTEGER,o[y][1]=0);o.sort(v6e);const x=d.morphAttributes.position,v=d.morphAttributes.normal;let g=0;for(let y=0;y<8;y++){const S=o[y],A=S[0],k=S[1];A!==Number.MAX_SAFE_INTEGER&&k?(x&&d.getAttribute("morphTarget"+y)!==x[A]&&d.setAttribute("morphTarget"+y,x[A]),v&&d.getAttribute("morphNormal"+y)!==v[A]&&d.setAttribute("morphNormal"+y,v[A]),i[y]=k,g+=k):(x&&d.hasAttribute("morphTarget"+y)===!0&&d.deleteAttribute("morphTarget"+y),v&&d.hasAttribute("morphNormal"+y)===!0&&d.deleteAttribute("morphNormal"+y),i[y]=0)}const b=d.morphTargetsRelative?1:1-g;h.getUniforms().setValue(t,"morphTargetBaseInfluence",b),h.getUniforms().setValue(t,"morphTargetInfluences",i)}}return{update:l}}function w6e(t,e,n,r){let i=new WeakMap;function s(l){const u=r.render.frame,d=l.geometry,h=e.get(l,d);if(i.get(h)!==u&&(e.update(h),i.set(h,u)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==u&&(n.update(l.instanceMatrix,t.ARRAY_BUFFER),l.instanceColor!==null&&n.update(l.instanceColor,t.ARRAY_BUFFER),i.set(l,u))),l.isSkinnedMesh){const p=l.skeleton;i.get(p)!==u&&(p.update(),i.set(p,u))}return h}function a(){i=new WeakMap}function o(l){const u=l.target;u.removeEventListener("dispose",o),n.remove(u.instanceMatrix),u.instanceColor!==null&&n.remove(u.instanceColor)}return{update:s,dispose:a}}class TM extends ui{constructor(e,n,r,i,s,a,o,l,u,d){if(d=d!==void 0?d:Cm,d!==Cm&&d!==yx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===Cm&&(r=dh),r===void 0&&d===yx&&(r=km),super(null,i,s,a,o,l,d,r,u),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=o!==void 0?o:Bs,this.minFilter=l!==void 0?l:Bs,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}const Eoe=new ui,koe=new TM(1,1);koe.compareFunction=Oz;const Coe=new NM,Noe=new Hz,Toe=new PA,kW=[],CW=[],NW=new Float32Array(16),TW=new Float32Array(9),MW=new Float32Array(4);function rw(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let s=kW[i];if(s===void 0&&(s=new Float32Array(i),kW[i]=s),e!==0){r.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=n,t[a].toArray(s,o)}return s}function Ma(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Ra(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function MM(t,e){let n=CW[e];n===void 0&&(n=new Int32Array(e),CW[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function _6e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function S6e(t,e){const n=this.cache;
vendor: 14,458 bytes, lines 4437-4455
4437if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ma(n,e))return;t.uniform2fv(this.addr,e),Ra(n,e)}}function A6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Ma(n,e))return;t.uniform3fv(this.addr,e),Ra(n,e)}}function E6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ma(n,e))return;t.uniform4fv(this.addr,e),Ra(n,e)}}function k6e(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Ma(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ra(n,e)}else{if(Ma(n,r))return;MW.set(r),t.uniformMatrix2fv(this.addr,!1,MW),Ra(n,r)}}function C6e(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Ma(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ra(n,e)}else{if(Ma(n,r))return;TW.set(r),t.uniformMatrix3fv(this.addr,!1,TW),Ra(n,r)}}function N6e(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(Ma(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ra(n,e)}else{if(Ma(n,r))return;NW.set(r),t.uniformMatrix4fv(this.addr,!1,NW),Ra(n,r)}}function T6e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function M6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ma(n,e))return;t.uniform2iv(this.addr,e),Ra(n,e)}}function R6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Ma(n,e))return;t.uniform3iv(this.addr,e),Ra(n,e)}}function j6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ma(n,e))return;t.uniform4iv(this.addr,e),Ra(n,e)}}function P6e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function L6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ma(n,e))return;t.uniform2uiv(this.addr,e),Ra(n,e)}}function I6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Ma(n,e))return;t.uniform3uiv(this.addr,e),Ra(n,e)}}function D6e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ma(n,e))return;t.uniform4uiv(this.addr,e),Ra(n,e)}}function B6e(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);const s=this.type===t.SAMPLER_2D_SHADOW?koe:Eoe;n.setTexture2D(e||s,i)}function F6e(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Noe,i)}function O6e(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||Toe,i)}function z6e(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||Coe,i)}function U6e(t){switch(t){case 5126:return _6e;case 35664:return S6e;case 35665:return A6e;case 35666:return E6e;case 35674:return k6e;case 35675:return C6e;case 35676:return N6e;case 5124:case 35670:return T6e;case 35667:case 35671:return M6e;case 35668:case 35672:return R6e;case 35669:case 35673:return j6e;case 5125:return P6e;case 36294:return L6e;case 36295:return I6e;case 36296:return D6e;case 35678:case 36198:case 36298:case 36306:case 35682:return B6e;case 35679:case 36299:case 36307:return F6e;case 35680:case 36300:case 36308:case 36293:return O6e;case 36289:case 36303:case 36311:case 36292:return z6e}}function H6e(t,e){t.uniform1fv(this.addr,e)}function G6e(t,e){const n=rw(e,this.size,2);t.uniform2fv(this.addr,n)}function V6e(t,e){const n=rw(e,this.size,3);t.uniform3fv(this.addr,n)}function W6e(t,e){const n=rw(e,this.size,4);t.uniform4fv(this.addr,n)}function $6e(t,e){const n=rw(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function K6e(t,e){const n=rw(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function q6e(t,e){const n=rw(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function X6e(t,e){t.uniform1iv(this.addr,e)}function Y6e(t,e){t.uniform2iv(this.addr,e)}function J6e(t,e){t.uniform3iv(this.addr,e)}function Z6e(t,e){t.uniform4iv(this.addr,e)}function Q6e(t,e){t.uniform1uiv(this.addr,e)}function eUe(t,e){t.uniform2uiv(this.addr,e)}function tUe(t,e){t.uniform3uiv(this.addr,e)}function nUe(t,e){t.uniform4uiv(this.addr,e)}function rUe(t,e,n){const r=this.cache,i=e.length,s=MM(n,i);Ma(r,s)||(t.uniform1iv(this.addr,s),Ra(r,s));for(let a=0;a!==i;++a)n.setTexture2D(e[a]||Eoe,s[a])}function iUe(t,e,n){const r=this.cache,i=e.length,s=MM(n,i);Ma(r,s)||(t.uniform1iv(this.addr,s),Ra(r,s));for(let a=0;a!==i;++a)n.setTexture3D(e[a]||Noe,s[a])}function sUe(t,e,n){const r=this.cache,i=e.length,s=MM(n,i);Ma(r,s)||(t.uniform1iv(this.addr,s),Ra(r,s));for(let a=0;a!==i;++a)n.setTextureCube(e[a]||Toe,s[a])}function aUe(t,e,n){const r=this.cache,i=e.length,s=MM(n,i);Ma(r,s)||(t.uniform1iv(this.addr,s),Ra(r,s));for(let a=0;a!==i;++a)n.setTexture2DArray(e[a]||Coe,s[a])}function oUe(t){switch(t){case 5126:return H6e;case 35664:return G6e;case 35665:return V6e;case 35666:return W6e;case 35674:return $6e;case 35675:return K6e;case 35676:return q6e;case 5124:case 35670:return X6e;case 35667:case 35671:return Y6e;case 35668:case 35672:return J6e;case 35669:case 35673:return Z6e;case 5125:return Q6e;case 36294:return eUe;case 36295:return tUe;case 36296:return nUe;case 35678:case 36198:case 36298:case 36306:case 35682:return rUe;case 35679:case 36299:case 36307:return iUe;case 35680:case 36300:case 36308:case 36293:return sUe;case 36289:case 36303:case 36311:case 36292:return aUe}}class lUe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.setValue=U6e(n.type)}}class cUe{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=oUe(n.type)}}class uUe{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,r){const i=this.seq;for(let s=0,a=i.length;s!==a;++s){const o=i[s];o.setValue(e,n[o.id],r)}}}const sP=/(\w+)(\])?(\[|\.)?/g;function RW(t,e){t.seq.push(e),t.map[e.id]=e}function dUe(t,e,n){const r=t.name,i=r.length;for(sP.lastIndex=0;;){const s=sP.exec(r),a=sP.lastIndex;let o=s[1];const l=s[2]==="]",u=s[3];if(l&&(o=o|0),u===void 0||u==="["&&a+2===i){RW(n,u===void 0?new lUe(o,t,e):new cUe(o,t,e));break}else{let h=n.map[o];h===void 0&&(h=new uUe(o),RW(n,h)),n=h}}}class fN{constructor(e,n){this.seq=[],this.map={};const r=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const s=e.getActiveUniform(n,i),a=e.getUniformLocation(n,s.name);dUe(s,a,this)}}setValue(e,n,r,i){const s=this.map[n];s!==void 0&&s.setValue(e,r,i)}setOptional(e,n,r){const i=n[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,n,r,i){for(let s=0,a=n.length;s!==a;++s){const o=n[s],l=r[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,n){const r=[];for(let i=0,s=e.length;i!==s;++i){const a=e[i];a.id in n&&r.push(a)}return r}}function jW(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const hUe=37297;let fUe=0;function pUe(t,e){const n=t.split(` 4438`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let a=i;a<s;a++){const o=a+1;r.push(`${o===e?">":" "} ${o}: ${n[a]}`)}return r.join(` 4439`)}function mUe(t){const e=_i.getPrimaries(_i.workingColorSpace),n=_i.getPrimaries(t);let r;switch(e===n?r="":e===_S&&n===wS?r="LinearDisplayP3ToLinearSRGB":e===wS&&n===_S&&(r="LinearSRGBToLinearDisplayP3"),t){case Pc:case MA:return[r,"LinearTransferOETF"];case os:case CM:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function PW(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const a=parseInt(s[1]);return n.toUpperCase()+` 4440 4441`+i+` 4442 4443`+pUe(t.getShaderSource(e),a)}else return i}function gUe(t,e){const n=mUe(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function xUe(t,e){let n;switch(e){case qae:n="Linear";break;case Xae:n="Reinhard";break;case Yae:n="OptimizedCineon";break;case Ez:n="ACESFilmic";break;case Zae:n="AgX";break;case Jae:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function vUe(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Vy).join(` 4444`)}function yUe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(Vy).join(` 4445`)}function bUe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` 4446`)}function wUe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=t.getActiveAttrib(e,i),a=s.name;let o=1;s.type===t.FLOAT_MAT2&&(o=2),s.type===t.FLOAT_MAT3&&(o=3),s.type===t.FLOAT_MAT4&&(o=4),n[a]={type:s.type,location:t.getAttribLocation(e,a),locationSize:o}}return n}function Vy(t){return t!==""}function LW(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function IW(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const _Ue=/^[ \t]*#include +<([\w\d./]+)>/gm;function DD(t){return t.replace(_Ue,AUe)}const SUe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function AUe(t,e){let n=_r[e];if(n===void 0){const r=SUe.get(e);if(r!==void 0)n=_r[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return DD(n)}const EUe=/#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 DW(t){return t.replace(EUe,kUe)}function kUe(t,e,n,r){let i="";for(let s=parseInt(e);s<parseInt(n);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function BW(t){let e="precision "+t.precision+` float; 4447precision `+t.precision+" int;";return t.precision==="highp"?e+=` 4448#define HIGH_PRECISION`:t.precision==="mediump"?e+=` 4449#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=` 4450#define LOW_PRECISION`),e}function CUe(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===_M?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===c2?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===id&&(e="SHADOWMAP_TYPE_VSM"),e}function NUe(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Th:case Ym:e="ENVMAP_TYPE_CUBE";break;case nw:e="ENVMAP_TYPE_CUBE_UV";break}return e}function TUe(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Ym:e="ENVMAP_MODE_REFRACTION";break}return e}function MUe(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case TA:e="ENVMAP_BLENDING_MULTIPLY";break;case $ae:e="ENVMAP_BLENDING_MIX";break;case Kae:e="ENVMAP_BLENDING_ADD";break}return e}function RUe(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:r,maxMip:n}}function jUe(t,e,n,r){const i=t.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=CUe(n),u=NUe(n),d=TUe(n),h=MUe(n),p=RUe(n),f=n.isWebGL2?"":vUe(n),m=yUe(n),x=bUe(s),v=i.createProgram();let g,b,y=n.glslVersion?"#version "+n.glslVersion+` 4451`:"";n.isRawShaderMaterial?(g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(Vy).join(` 4452`),g.length>0&&(g+=` 4453`),b=[f,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(Vy).join(` 4454`),b.length>0&&(b+=` 4455`)):(g=[BW(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IR
4455IDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 4456`].filter(Vy).join(` 4457`),b=[f,BW(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IR
4457IDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==wh?"#define TONE_MAPPING":"",n.toneMapping!==wh?_r.tonemapping_pars_fragment:"",n.toneMapping!==wh?xUe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",_r.colorspace_pars_fragment,gUe("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` 4458`].filter(Vy).join(` 4459`)),a=DD(a),a=LW(a,n),a=IW(a,n),o=DD(o),o=LW(o,n),o=IW(o,n),a=DW(a),o=DW(o),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es 4460`,g=[m,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` 4461`)+` 4462`+g,b=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===PD?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===PD?"":"#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(` 4463`)+` 4464`+b);const S=y+g+a,A=y+b+o,k=jW(i,i.VERTEX_SHADER,S),M=jW(i,i.FRAGMENT_SHADER,A);i.attachShader(v,k),i.attachShader(v,M),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(j){if(t.debug.checkShaderErrors){const G=i.getProgramInfoLog(v).trim(),B=i.getShaderInfoLog(k).trim(),$=i.getShaderInfoLog(M).trim();let U=!0,Z=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,k,M);else{const V=PW(i,k,"vertex"),W=PW(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` 4465 4466Program Info Log: `+G+` 4467`+V+` 4468`+W)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(B===""||$==="")&&(Z=!1);Z&&(j.diagnostics={runnable:U,programLog:G,vertexShader:{log:B,prefix:g},fragmentShader:{log:$,prefix:b}})}i.deleteShader(k),i.deleteShader(M),C=new fN(i,v),R=wUe(i,v)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let R;this.getAttributes=function(){return R===void 0&&T(this),R};let P=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=i.getProgramParameter(v,hUe)),P},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=fUe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=k,this.fragmentShader=M,this}let PUe=0;class LUe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),s=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new IUe(e),n.set(e,r)),r}}class IUe{constructor(e){this.id=PUe++,this.code=e,this.usedTimes=0}}function DUe(t,e,n,r,i,s,a){const o=new K0,l=new LUe,u=[],d=i.isWebG
vendor: 19,952 bytes, lines 4468-4474
4468L2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(C){return C===0?"uv":`uv${C}`}function v(C,R,P,j,G){const B=j.fog,$=G.geometry,U=C.isMeshStandardMaterial?j.environment:null,Z=(C.isMeshStandardMaterial?n:e).get(C.envMap||U),V=Z&&Z.mapping===nw?Z.image.height:null,W=m[C.type];C.precision!==null&&(f=i.getMaxPrecision(C.precision),f!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",f,"instead."));const O=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,Y=O!==void 0?O.length:0;let z=0;$.morphAttributes.position!==void 0&&(z=1),$.morphAttributes.normal!==void 0&&(z=2),$.morphAttributes.color!==void 0&&(z=3);let I,q,te,se;if(W){const Mt=dd[W];I=Mt.vertexShader,q=Mt.fragmentShader}else I=C.vertexShader,q=C.fragmentShader,l.update(C),te=l.getVertexShaderID(C),se=l.getFragmentShaderID(C);const ie=t.getRenderTarget(),le=G.isInstancedMesh===!0,xe=G.isBatchedMesh===!0,Ee=!!C.map,ae=!!C.matcap,Q=!!Z,we=!!C.aoMap,Ae=!!C.lightMap,K=!!C.bumpMap,pe=!!C.normalMap,ye=!!C.displacementMap,Se=!!C.emissiveMap,ee=!!C.metalnessMap,re=!!C.roughnessMap,me=C.anisotropy>0,Ge=C.clearcoat>0,He=C.iridescence>0,_e=C.sheen>0,Ne=C.transmission>0,ue=me&&!!C.anisotropyMap,Ce=Ge&&!!C.clearcoatMap,Ke=Ge&&!!C.clearcoatNormalMap,Qe=Ge&&!!C.clearcoatRoughnessMap,je=He&&!!C.iridescenceMap,We=He&&!!C.iridescenceThicknessMap,xt=_e&&!!C.sheenColorMap,et=_e&&!!C.sheenRoughnessMap,Je=!!C.specularMap,Ze=!!C.specularColorMap,Me=!!C.specularIntensityMap,Xe=Ne&&!!C.transmissionMap,ut=Ne&&!!C.thicknessMap,lt=!!C.gradientMap,Fe=!!C.alphaMap,Le=C.alphaTest>0,bt=!!C.alphaHash,dt=!!C.extensions,Nt=!!$.attributes.uv1,_t=!!$.attributes.uv2,Lt=!!$.attributes.uv3;let Dt=wh;return C.toneMapped&&(ie===null||ie.isXRRenderTarget===!0)&&(Dt=t.toneMapping),{isWebGL2:d,shaderID:W,shaderType:C.type,shaderName:C.name,vertexShader:I,fragmentShader:q,defines:C.defines,customVertexShaderID:te,customFragmentShaderID:se,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:f,batching:xe,instancing:le,instancingColor:le&&G.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:ie===null?t.outputColorSpace:ie.isXRRenderTarget===!0?ie.texture.colorSpace:Pc,map:Ee,matcap:ae,envMap:Q,envMapMode:Q&&Z.mapping,envMapCubeUVHeight:V,aoMap:we,lightMap:Ae,bumpMap:K,normalMap:pe,displacementMap:p&&ye,emissiveMap:Se,normalMapObjectSpace:pe&&C.normalMapType===uoe,normalMapTangentSpace:pe&&C.normalMapType===dg,metalnessMap:ee,roughnessMap:re,anisotropy:me,anisotropyMap:ue,clearcoat:Ge,clearcoatMap:Ce,clearcoatNormalMap:Ke,clearcoatRoughnessMap:Qe,iridescence:He,iridescenceMap:je,iridescenceThicknessMap:We,sheen:_e,sheenColorMap:xt,sheenRoughnessMap:et,specularMap:Je,specularColorMap:Ze,specularIntensityMap:Me,transmission:Ne,transmissionMap:Xe,thicknessMap:ut,gradientMap:lt,opaque:C.transparent===!1&&C.blending===W0,alphaMap:Fe,alphaTest:Le,alphaHash:bt,combine:C.combine,mapUv:Ee&&x(C.map.channel),aoMapUv:we&&x(C.aoMap.channel),lightMapUv:Ae&&x(C.lightMap.channel),bumpMapUv:K&&x(C.bumpMap.channel),normalMapUv:pe&&x(C.normalMap.channel),displacementMapUv:ye&&x(C.displacementMap.channel),emissiveMapUv:Se&&x(C.emissiveMap.channel),metalnessMapUv:ee&&x(C.metalnessMap.channel),roughnessMapUv:re&&x(C.roughnessMap.channel),anisotropyMapUv:ue&&x(C.anisotropyMap.channel),clearcoatMapUv:Ce&&x(C.clearcoatMap.channel),clearcoatNormalMapUv:Ke&&x(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Qe&&x(C.clearcoatRoughnessMap.channel),iridescenceMapUv:je&&x(C.iridescenceMap.channel),iridescenceThicknessMapUv:We&&x(C.iridescenceThicknessMap.channel),sheenColorMapUv:xt&&x(C.sheenColorMap.channel),sheenRoughnessMapUv:et&&x(C.sheenRoughnessMap.channel),specularMapUv:Je&&x(C.specularMap.channel),specularColorMapUv:Ze&&x(C.specularColorMap.channel),specularIntensityMapUv:Me&&x(C.specularIntensityMap.channel),transmissionMapUv:Xe&&x(C.transmissionMap.channel),thicknessMapUv:ut&&x(C.thicknessMap.channel),alphaMapUv:Fe&&x(C.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(pe||me),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUv1s:Nt,vertexUv2s:_t,vertexUv3s:Lt,pointsUvs:G.isPoints===!0&&!!$.attributes.uv&&(Ee||Fe),fog:!!B,useFog:C.fog===!0,fogExp2:B&&B.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:G.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:z,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:Dt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:Ee&&C.map.isVideoTexture===!0&&_i.getTransfer(C.map.colorSpace)===Oi,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===bc,flipSided:C.side===xl,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:dt&&C.extensions.derivatives===!0,extensionFragDepth:dt&&C.extensions.fragDepth===!0,extensionDrawBuffers:dt&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:dt&&C.extensions.shaderTextureLOD===!0,extensionClipCullDistance:dt&&C.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),rendererExtensionFragDepth:d||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const R=[];if(C.shaderID?R.push(C.shaderID):(R.push(C.customVertexShaderID),R.push(C.customFragmentShaderID)),C.defines!==void 0)for(const P in C.defines)R.push(P),R.push(C.defines[P]);return C.isRawShaderMaterial===!1&&(b(R,C),y(R,C),R.push(t.outputColorSpace)),R.push(C.customProgramCacheKey),R.join()}function b(C,R){C.push(R.precision),C.push(R.outputColorSpace),C.push(R.envMapMode),C.push(R.envMapCubeUVHeight),C.push(R.mapUv),C.push(R.alphaMapUv),C.push(R.lightMapUv),C.push(R.aoMapUv),C.push(R.bumpMapUv),C.push(R.normalMapUv),C.push(R.displacementMapUv),C.push(R.emissiveMapUv),C.push(R.metalnessMapUv),C.push(R.roughnessMapUv),C.push(R.anisotropyMapUv),C.push(R.clearcoatMapUv),C.push(R.clearcoatNormalMapUv),C.push(R.clearcoatRoughnessMapUv),C.push(R.iridescenceMapUv),C.push(R.iridescenceThicknessMapUv),C.push(R.sheenColorMapUv),C.push(R.sheenRoughnessMapUv),C.push(R.specularMapUv),C.push(R.specularColorMapUv),C.push(R.specularIntensityMapUv),C.push(R.transmissionMapUv),C.push(R.thicknessMapUv),C.push(R.combine),C.push(R.fogExp2),C.push(R.sizeAttenuation),C.push(R.morphTargetsCount),C.push(R.morphAttributeCount),C.push(R.numDirLights),C.push(R.numPointLights),C.push(R.numSpotLights),C.push(R.numSpotLightMaps),C.push(R.numHemiLights),C.push(R.numRectAreaLights),C.push(R.numDirLightShadows),C.push(R.numPointLightShadows),C.push(R.numSpotLightShadows),C.push(R.numSpotLightShadowsWithMaps),C.push(R.numLightProbes),C.push(R.shadowMapType),C.push(R.toneMapping),C.push(R.numClippingPlanes),C.push(R.numClipIntersection),C.push(R.depthPacking)}function y(C,R){o.disableAll(),R.isWebGL2&&o.enable(0),R.supportsVertexTextures&&o.enable(1),R.instancing&&o.enable(2),R.instancingColor&&o.enable(3),R.matcap&&o.enable(4),R.envMap&&o.enable(5),R.normalMapObjectSpace&&o.enable(6),R.normalMapTangentSpace&&o.enable(7),R.clearcoat&&o.enable(8),R.iridescence&&o.enable(9),R.alphaTest&&o.enable(10),R.vertexColors&&o.enable(11),R.vertexAlphas&&o.enable(12),R.vertexUv1s&&o.enable(13),R.vertexUv2s&&o.enable(14),R.vertexUv3s&&o.enable(15),R.vertexTangents&&o.enable(16),R.anisotropy&&o.enable(17),R.alphaHash&&o.enable(18),R.batching&&o.enable(19),C.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.skinning&&o.enable(4),R.morphTargets&&o.enable(5),R.morphNormals&&o.enable(6),R.morphColors&&o.enable(7),R.premultipliedAlpha&&o.enable(8),R.shadowMapEnabled&&o.enable(9),R.useLegacyLights&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),C.push(o.mask)}function S(C){const R=m[C.type];let P;if(R){const j=dd[R];P=Wz.clone(j.uniforms)}else P=C.uniforms;return P}function A(C,R){let P;for(let j=0,G=u.length;j<G;j++){const B=u[j];if(B.cacheKey===R){P=B,++P.usedTimes;break}}return P===void 0&&(P=new jUe(t,R,C,s),u.push(P)),P}function k(C){if(--C.usedTimes===0){const R=u.indexOf(C);u[R]=u[u.length-1],u.pop(),C.destroy()}}function M(C){l.remove(C)}function T(){l.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:S,acquireProgram:A,releaseProgram:k,releaseShaderCache:M,programs:u,dispose:T}}function BUe(){let t=new WeakMap;function e(s){let a=t.get(s);return a===void 0&&(a={},t.set(s,a)),a}function n(s){t.delete(s)}function r(s,a,o){t.get(s)[a]=o}function i(){t=new WeakMap}return{get:e,remove:n,update:r,dispose:i}}function FUe(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function FW(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function OW(){const t=[];let e=0;const n=[],r=[],i=[];function s(){e=0,n.length=0,r.length=0,i.length=0}function a(h,p,f,m,x,v){let g=t[e];return g===void 0?(g={id:h.id,object:h,geometry:p,material:f,groupOrder:m,renderOrder:h.renderOrder,z:x,group:v},t[e]=g):(g.id=h.id,g.object=h,g.geometry=p,g.material=f,g.groupOrder=m,g.renderOrder=h.renderOrder,g.z=x,g.group=v),e++,g}function o(h,p,f,m,x,v){const g=a(h,p,f,m,x,v);f.transmission>0?r.push(g):f.transparent===!0?i.push(g):n.push(g)}function l(h,p,f,m,x,v){const g=a(h,p,f,m,x,v);f.transmission>0?r.unshift(g):f.transparent===!0?i.unshift(g):n.unshift(g)}function u(h,p){n.length>1&&n.sort(h||FUe),r.length>1&&r.sort(p||FW),i.length>1&&i.sort(p||FW)}function d(){for(let h=e,p=t.length;h<p;h++){const f=t[h];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:n,transmissive:r,transparent:i,init:s,push:o,unshift:l,finish:d,sort:u}}function OUe(){let t=new WeakMap;function e(r,i){const s=t.get(r);let a;return s===void 0?(a=new OW,t.set(r,[a])):i>=s.length?(a=new OW,s.push(a)):a=s[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function zUe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Ie,color:new Qt};break;case"SpotLight":n={position:new Ie,direction:new Ie,color:new Qt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ie,color:new Qt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ie,skyColor:new Qt,groundColor:new Qt};break;case"RectAreaLight":n={color:new Qt,position:new Ie,halfWidth:new Ie,halfHeight:new Ie};break}return t[e.id]=n,n}}}function UUe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let HUe=0;function GUe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function VUe(t,e){const n=new zUe,r=UUe(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)i.probe.push(new Ie);const s=new Ie,a=new Wn,o=new Wn;function l(d,h){let p=0,f=0,m=0;for(let j=0;j<9;j++)i.probe[j].set(0,0,0);let x=0,v=0,g=0,b=0,y=0,S=0,A=0,k=0,M=0,T=0,C=0;d.sort(GUe);const R=h===!0?Math.PI:1;for(let j=0,G=d.length;j<G;j++){const B=d[j],$=B.color,U=B.intensity,Z=B.distance,V=B.shadow&&B.shadow.map?B.shadow.map.texture:null;if(B.isAmbientLight)p+=$.r*U*R,f+=$.g*U*R,m+=$.b*U*R;else if(B.isLightProbe){for(let W=0;W<9;W++)i.probe[W].addScaledVector(B.sh.coefficients[W],U);C++}else if(B.isDirectionalLight){const W=n.get(B);if(W.color.copy(B.color).multiplyScalar(B.intensity*R),B.castShadow){const O=B.shadow,Y=r.get(B);Y.shadowBias=O.bias,Y.shadowNormalBias=O.normalBias,Y.shadowRadius=O.radius,Y.shadowMapSize=O.mapSize,i.directionalShadow[x]=Y,i.directionalShadowMap[x]=V,i.directionalShadowMatrix[x]=B.shadow.matrix,S++}i.directional[x]=W,x++}else if(B.isSpotLight){const W=n.get(B);W.position.setFromMatrixPosition(B.matrixWorld),W.color.copy($).multiplyScalar(U*R),W.distance=Z,W.coneCos=Math.cos(B.angle),W.penumbraCos=Math.cos(B.angle*(1-B.penumbra)),W.decay=B.decay,i.spot[g]=W;const O=B.shadow;if(B.map&&(i.spotLightMap[M]=B.map,M++,O.updateMatrices(B),B.castShadow&&T++),i.spotLightMatrix[g]=O.matrix,B.castShadow){const Y=r.get(B);Y.shadowBias=O.bias,Y.shadowNormalBias=O.normalBias,Y.shadowRadius=O.radius,Y.shadowMapSize=O.mapSize,i.spotShadow[g]=Y,i.spotShadowMap[g]=V,k++}g++}else if(B.isRectAreaLight){const W=n.get(B);W.color.copy($).multiplyScalar(U),W.halfWidth.set(B.width*.5,0,0),W.halfHeight.set(0,B.height*.5,0),i.rectArea[b]=W,b++}else if(B.isPointLight){const W=n.get(B);if(W.color.copy(B.color).multiplyScalar(B.intensity*R),W.distance=B.distance,W.decay=B.decay,B.castShadow){const O=B.shadow,Y=r.get(B);Y.shadowBias=O.bias,Y.shadowNormalBias=O.normalBias,Y.shadowRadius=O.radius,Y.shadowMapSize=O.mapSize,Y.shadowCameraNear=O.camera.near,Y.shadowCameraFar=O.camera.far,i.pointShadow[v]=Y,i.pointShadowMap[v]=V,i.pointShadowMatrix[v]=B.shadow.matrix,A++}i.point[v]=W,v++}else if(B.isHemisphereLight){const W=n.get(B);W.skyColor.copy(B.color).multiplyScalar(U*R),W.groundColor.copy(B.groundColor).multiplyScalar(U*R),i.hemi[y]=W,y++}}b>0&&(e.isWebGL2?t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Zt.LTC_FLOAT_1,i.rectAreaLTC2=Zt.LTC_FLOAT_2):(i.rectAreaLTC1=Zt.LTC_HALF_1,i.rectAreaLTC2=Zt.LTC_HALF_2):t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Zt.LTC_FLOAT_1,i.rectAreaLTC2=Zt.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Zt.LTC_HALF_1,i.rectAreaLTC2=Zt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=f,i.ambient[2]=m;const P=i.hash;(P.directionalLength!==x||P.pointLength!==v||P.spotLength!==g||P.rectAreaLength!==b||P.hemiLength!==y||P.numDirectionalShadows!==S||P.numPointShadows!==A||P.numSpotShadows!==k||P.numSpotMaps!==M||P.numLightProbes!==C)&&(i.directional.length=x,i.spot.length=g,i.rectArea.length=b,i.point.length=v,i.hemi.length=y,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=k,i.spotShadowMap.length=k,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=k+M-T,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=C,P.directionalLength=x,P.pointLength=v,P.spotLength=g,P.rectAreaLength=b,P.hemiLength=y,P.numDirectionalShadows=S,P.numPointShadows=A,P.numSpotShadows=k,P.numSpotMaps=M,P.numLightProbes=C,i.version=HUe++)}function u(d,h){let p=0,f=0,m=0,x=0,v=0;const g=h.matrixWorldInverse;for(let b=0,y=d.length;b<y;b++){const S=d[b];if(S.isDirectionalLight){const A=i.directional[p];A.direction.setFromMatrixPosition(S.matrixWorld),s.setFromMatrixPosition(S.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),p++}else if(S.isSpotLight){const A=i.spot[m];A.position.setFromMatrixPosition(S.matrixWorld),A.position.applyMatrix4(g),A.direction.setFromMatrixPosition(S.matrixWorld),s.setFromMatrixPosition(S.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(g),m++}else if(S.isRectAreaLight){const A=i.rectArea[x];A.position.setFromMatrixPosition(S.matrixWorld),A.position.applyMatrix4(g),o.identity(),a.copy(S.matrixWorld),a.premultiply(g),o.extractRotation(a),A.halfWidth.set(S.width*.5,0,0),A.halfHeight.set(0,S.height*.5,0),A.halfWidth.applyMatrix4(o),A.halfHeight.applyMatrix4(o),x++}else if(S.isPointLight){const A=i.point[f];A.position.setFromMatrixPosition(S.matrixWorld),A.position.applyMatrix4(g),f++}else if(S.isHemisphereLight){const A=i.hemi[v];A.direction.setFromMatrixPosition(S.matrixWorld),A.direction.transformDirection(g),v++}}}return{setup:l,setupView:u,state:i}}function zW(t,e){const n=new VUe(t,e),r=[],i=[];function s(){r.length=0,i.length=0}function a(h){r.push(h)}function o(h){i.push(h)}function l(h){n.setup(r,h)}function u(h){n.setupView(r,h)}return{init:s,state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:l,setupLightsView:u,pushLight:a,pushShadow:o}}function WUe(t,e){let n=new WeakMap;function r(s,a=0){const o=n.get(s);let l;return o===void 0?(l=new zW(t,e),n.set(s,[l])):a>=o.length?(l=new zW(t,e),o.push(l)):l=o[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class IA extends Ta{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=coe,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 RM extends Ta{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}}const $Ue=`void main() { 4469 gl_Position = vec4( position, 1.0 ); 4470}`,KUe=`uniform sampler2D shadow_pass; 4471uniform vec2 resolution; 4472uniform float radius; 4473#include <packing> 4474void main() {
4475 const float samples = float( VSM_SAMPLES ); 4476 float mean = 0.0; 4477 float squared_mean = 0.0; 4478 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4479 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4480 for ( float i = 0.0; i < samples; i ++ ) { 4481 float uvOffset = uvStart + i * uvStride; 4482 #ifdef HORIZONTAL_PASS 4483 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 4484 mean += distribution.x; 4485 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4486 #else 4487 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 4488 mean += depth; 4489 squared_mean += depth * depth; 4490 #endif 4491 } 4492 mean = mean / samples; 4493 squared_mean = squared_mean / samples; 4494 float std_dev = sqrt( squared_mean - mean * mean ); 4495 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 4496}`;function qUe(t,e,n){let r=new LA;const i=new Rt,s=new Rt,a=new gi,o=new IA({depthPacking:Fz}),l=new RM,u={},d=n.maxTextureSize,h={[Nh]:xl,[xl]:Nh,[bc]:bc},p=new bl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:$Ue,fragmentShader:KUe}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const m=new or;m.setAttribute("position",new Yr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Li(m,p),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_M;let g=this.type;this.render=function(k,M,T){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||k.length===0)return;const C=t.getRenderTarget(),R=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),j=t.state;j.setBlending(bh),j.buffers.color.setClear(1,1,1,1),j.buffers.depth.setTest(!0),j.setScissorTest(!1);const G=g!==id&&this.type===id,B=g===id&&this.type!==id;for(let $=0,U=k.length;$<U;$++){const Z=k[$],V=Z.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",Z,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const W=V.getFrameExtents();if(i.multiply(W),s.copy(V.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/W.x),i.x=s.x*W.x,V.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/W.y),i.y=s.y*W.y,V.mapSize.y=s.y)),V.map===null||G===!0||B===!0){const Y=this.type!==id?{minFilter:Bs,magFilter:Bs}:{};V.map!==null&&V.map.dispose(),V.map=new Yo(i.x,i.y,Y),V.map.texture.name=Z.name+".shadowMap",V.camera.updateProjectionMatrix()}
vendor: 5,992 bytes, line 4496
4496t.setRenderTarget(V.map),t.clear();const O=V.getViewportCount();for(let Y=0;Y<O;Y++){const z=V.getViewport(Y);a.set(s.x*z.x,s.y*z.y,s.x*z.z,s.y*z.w),j.viewport(a),V.updateMatrices(Z,Y),r=V.getFrustum(),S(M,T,V.camera,Z,this.type)}V.isPointLightShadow!==!0&&this.type===id&&b(V,T),V.needsUpdate=!1}g=this.type,v.needsUpdate=!1,t.setRenderTarget(C,R,P)};function b(k,M){const T=e.update(x);p.defines.VSM_SAMPLES!==k.blurSamples&&(p.defines.VSM_SAMPLES=k.blurSamples,f.defines.VSM_SAMPLES=k.blurSamples,p.needsUpdate=!0,f.needsUpdate=!0),k.mapPass===null&&(k.mapPass=new Yo(i.x,i.y)),p.uniforms.shadow_pass.value=k.map.texture,p.uniforms.resolution.value=k.mapSize,p.uniforms.radius.value=k.radius,t.setRenderTarget(k.mapPass),t.clear(),t.renderBufferDirect(M,null,T,p,x,null),f.uniforms.shadow_pass.value=k.mapPass.texture,f.uniforms.resolution.value=k.mapSize,f.uniforms.radius.value=k.radius,t.setRenderTarget(k.map),t.clear(),t.renderBufferDirect(M,null,T,f,x,null)}function y(k,M,T,C){let R=null;const P=T.isPointLight===!0?k.customDistanceMaterial:k.customDepthMaterial;if(P!==void 0)R=P;else if(R=T.isPointLight===!0?l:o,t.localClippingEnabled&&M.clipShadows===!0&&Array.isArray(M.clippingPlanes)&&M.clippingPlanes.length!==0||M.displacementMap&&M.displacementScale!==0||M.alphaMap&&M.alphaTest>0||M.map&&M.alphaTest>0){const j=R.uuid,G=M.uuid;let B=u[j];B===void 0&&(B={},u[j]=B);let $=B[G];$===void 0&&($=R.clone(),B[G]=$,M.addEventListener("dispose",A)),R=$}if(R.visible=M.visible,R.wireframe=M.wireframe,C===id?R.side=M.shadowSide!==null?M.shadowSide:M.side:R.side=M.shadowSide!==null?M.shadowSide:h[M.side],R.alphaMap=M.alphaMap,R.alphaTest=M.alphaTest,R.map=M.map,R.clipShadows=M.clipShadows,R.clippingPlanes=M.clippingPlanes,R.clipIntersection=M.clipIntersection,R.displacementMap=M.displacementMap,R.displacementScale=M.displacementScale,R.displacementBias=M.displacementBias,R.wireframeLinewidth=M.wireframeLinewidth,R.linewidth=M.linewidth,T.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const j=t.properties.get(R);j.light=T}return R}function S(k,M,T,C,R){if(k.visible===!1)return;if(k.layers.test(M.layers)&&(k.isMesh||k.isLine||k.isPoints)&&(k.castShadow||k.receiveShadow&&R===id)&&(!k.frustumCulled||r.intersectsObject(k))){k.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,k.matrixWorld);const G=e.update(k),B=k.material;if(Array.isArray(B)){const $=G.groups;for(let U=0,Z=$.length;U<Z;U++){const V=$[U],W=B[V.materialIndex];if(W&&W.visible){const O=y(k,W,C,R);k.onBeforeShadow(t,k,M,T,G,O,V),t.renderBufferDirect(T,null,G,O,k,V),k.onAfterShadow(t,k,M,T,G,O,V)}}}else if(B.visible){const $=y(k,B,C,R);k.onBeforeShadow(t,k,M,T,G,$,null),t.renderBufferDirect(T,null,G,$,k,null),k.onAfterShadow(t,k,M,T,G,$,null)}}const j=k.children;for(let G=0,B=j.length;G<B;G++)S(j[G],M,T,C,R)}function A(k){k.target.removeEventListener("dispose",A);for(const T in u){const C=u[T],R=k.target.uuid;R in C&&(C[R].dispose(),delete C[R])}}}function XUe(t,e,n){const r=n.isWebGL2;function i(){let Le=!1;const bt=new gi;let dt=null;const Nt=new gi(0,0,0,0);return{setMask:function(_t){dt!==_t&&!Le&&(t.colorMask(_t,_t,_t,_t),dt=_t)},setLocked:function(_t){Le=_t},setClear:function(_t,Lt,Dt,en,Mt){Mt===!0&&(_t*=en,Lt*=en,Dt*=en),bt.set(_t,Lt,Dt,en),Nt.equals(bt)===!1&&(t.clearColor(_t,Lt,Dt,en),Nt.copy(bt))},reset:function(){Le=!1,dt=null,Nt.set(-1,0,0,0)}}}function s(){let Le=!1,bt=null,dt=null,Nt=null;return{setTest:function(_t){_t?xe(t.DEPTH_TEST):Ee(t.DEPTH_TEST)},setMask:function(_t){bt!==_t&&!Le&&(t.depthMask(_t),bt=_t)},setFunc:function(_t){if(dt!==_t){switch(_t){case Oae:t.depthFunc(t.NEVER);break;case zae:t.depthFunc(t.ALWAYS);break;case Uae:t.depthFunc(t.LESS);break;case gS:t.depthFunc(t.LEQUAL);break;case Hae:t.depthFunc(t.EQUAL);break;case Gae:t.depthFunc(t.GEQUAL);break;case Vae:t.depthFunc(t.GREATER);break;case Wae:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}dt=_t}},setLocked:function(_t){Le=_t},setClear:function(_t){Nt!==_t&&(t.clearDepth(_t),Nt=_t)},reset:function(){Le=!1,bt=null,dt=null,Nt=null}}}function a(){let Le=!1,bt=null,dt=null,Nt=null,_t=null,Lt=null,Dt=null,en=null,Mt=null;return{setTest:function(nn){Le||(nn?xe(t.STENCIL_TEST):Ee(t.STENCIL_TEST))},setMask:function(nn){bt!==nn&&!Le&&(t.stencilMask(nn),bt=nn)},setFunc:function(nn,Tn,Fn){(dt!==nn||Nt!==Tn||_t!==Fn)&&(t.stencilFunc(nn,Tn,Fn),dt=nn,Nt=Tn,_t=Fn)},setOp:function(nn,Tn,Fn){(Lt!==nn||Dt!==Tn||en!==Fn)&&(t.stencilOp(nn,Tn,Fn),Lt=nn,Dt=Tn,en=Fn)},setLocked:function(nn){Le=nn},setClear:function(nn){Mt!==nn&&(t.clearStencil(nn),Mt=nn)},reset:function(){Le=!1,bt=null,dt=null,Nt=null,_t=null,Lt=null,Dt=null,en=null,Mt=null}}}const o=new i,l=new s,u=new a,d=new WeakMap,h=new WeakMap;let p={},f={},m=new WeakMap,x=[],v=null,g=!1,b=null,y=null,S=null,A=null,k=null,M=null,T=null,C=new Qt(0,0,0),R=0,P=!1,j=null,G=null,B=null,$=null,U=null;const Z=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,W=0;const O=t.getParameter(t.VERSION);O.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(O)[1]),V=W>=1):O.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),V=W>=2);let Y=null,z={};const I=t.getParameter(t.SCISSOR_BOX),q=t.getParameter(t.VIEWPORT),te=new gi().fromArray(I),se=new gi().fromArray(q);function ie(Le,bt,dt,Nt){const _t=new Uint8Array(4),Lt=t.createTexture();t.bindTexture(Le,Lt),t.texParameteri(Le,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Le,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Dt=0;Dt<dt;Dt++)r&&(Le===t.TEXTURE_3D||Le===t.TEXTURE_2D_ARRAY)?t.texImage3D(bt,0,t.RGBA,1,1,Nt,0,t.RGBA,t.UNSIGNED_BYTE,_t):t.texImage2D(bt+Dt,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,_t);return Lt}const le={};le[t.TEXTURE_2D]=ie(t.TEXTURE_2D,t.TEXTURE_2D,1),le[t.TEXTURE_CUBE_MAP]=ie(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(le[t.TEXTURE_2D_ARRAY]=ie(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),le[t.TEXTURE_3D]=ie(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),o.setClear(0,0,0,1),l.setClear(1),u.setClear(0),xe(t.DEPTH_TEST),l.setFu
vendor: 5,040 bytes, line 4496
4496nc(gS),Se(!1),ee(Q4),xe(t.CULL_FACE),pe(bh);function xe(Le){p[Le]!==!0&&(t.enable(Le),p[Le]=!0)}function Ee(Le){p[Le]!==!1&&(t.disable(Le),p[Le]=!1)}function ae(Le,bt){return f[Le]!==bt?(t.bindFramebuffer(Le,bt),f[Le]=bt,r&&(Le===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=bt),Le===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=bt)),!0):!1}function Q(Le,bt){let dt=x,Nt=!1;if(Le)if(dt=m.get(bt),dt===void 0&&(dt=[],m.set(bt,dt)),Le.isWebGLMultipleRenderTargets){const _t=Le.texture;if(dt.length!==_t.length||dt[0]!==t.COLOR_ATTACHMENT0){for(let Lt=0,Dt=_t.length;Lt<Dt;Lt++)dt[Lt]=t.COLOR_ATTACHMENT0+Lt;dt.length=_t.length,Nt=!0}}else dt[0]!==t.COLOR_ATTACHMENT0&&(dt[0]=t.COLOR_ATTACHMENT0,Nt=!0);else dt[0]!==t.BACK&&(dt[0]=t.BACK,Nt=!0);Nt&&(n.isWebGL2?t.drawBuffers(dt):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(dt))}function we(Le){return v!==Le?(t.useProgram(Le),v=Le,!0):!1}const Ae={[Kp]:t.FUNC_ADD,[Aae]:t.FUNC_SUBTRACT,[Eae]:t.FUNC_REVERSE_SUBTRACT};if(r)Ae[rD]=t.MIN,Ae[iD]=t.MAX;else{const Le=e.get("EXT_blend_minmax");Le!==null&&(Ae[rD]=Le.MIN_EXT,Ae[iD]=Le.MAX_EXT)}const K={[kae]:t.ZERO,[Cae]:t.ONE,[Nae]:t.SRC_COLOR,[HT]:t.SRC_ALPHA,[Lae]:t.SRC_ALPHA_SATURATE,[jae]:t.DST_COLOR,[Mae]:t.DST_ALPHA,[Tae]:t.ONE_MINUS_SRC_COLOR,[GT]:t.ONE_MINUS_SRC_ALPHA,[Pae]:t.ONE_MINUS_DST_COLOR,[Rae]:t.ONE_MINUS_DST_ALPHA,[Iae]:t.CONSTANT_COLOR,[Dae]:t.ONE_MINUS_CONSTANT_COLOR,[Bae]:t.CONSTANT_ALPHA,[Fae]:t.ONE_MINUS_CONSTANT_ALPHA};function pe(Le,bt,dt,Nt,_t,Lt,Dt,en,Mt,nn){if(Le===bh){g===!0&&(Ee(t.BLEND),g=!1);return}if(g===!1&&(xe(t.BLEND),g=!0),Le!==Sae){if(Le!==b||nn!==P){if((y!==Kp||k!==Kp)&&(t.blendEquation(t.FUNC_ADD),y=Kp,k=Kp),nn)switch(Le){case W0:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case eD:t.blendFunc(t.ONE,t.ONE);break;case tD:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case nD:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",Le);break}else switch(Le){case W0:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case eD:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case tD:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case nD:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",Le);break}S=null,A=null,M=null,T=null,C.set(0,0,0),R=0,b=Le,P=nn}return}_t=_t||bt,Lt=Lt||dt,Dt=Dt||Nt,(bt!==y||_t!==k)&&(t.blendEquationSeparate(Ae[bt],Ae[_t]),y=bt,k=_t),(dt!==S||Nt!==A||Lt!==M||Dt!==T)&&(t.blendFuncSeparate(K[dt],K[Nt],K[Lt],K[Dt]),S=dt,A=Nt,M=Lt,T=Dt),(en.equals(C)===!1||Mt!==R)&&(t.blendColor(en.r,en.g,en.b,Mt),C.copy(en),R=Mt),b=Le,P=!1}function ye(Le,bt){Le.side===bc?Ee(t.CULL_FACE):xe(t.CULL_FACE);let dt=Le.side===xl;bt&&(dt=!dt),Se(dt),Le.blending===W0&&Le.transparent===!1?pe(bh):pe(Le.blending,Le.blendEquation,Le.blendSrc,Le.blendDst,Le.blendEquationAlpha,Le.blendSrcAlpha,Le.blendDstAlpha,Le.blendColor,Le.blendAlpha,Le.premultipliedAlpha),l.setFunc(Le.depthFunc),l.setTest(Le.depthTest),l.setMask(Le.depthWrite),o.setMask(Le.colorWrite);const Nt=Le.stencilWrite;u.setTest(Nt),Nt&&(u.setMask(Le.stencilWriteMask),u.setFunc(Le.stencilFunc,Le.stencilRef,Le.stencilFuncMask),u.setOp(Le.stencilFail,Le.stencilZFail,Le.stencilZPass)),me(Le.polygonOffset,Le.polygonOffsetFactor,Le.polygonOffsetUnits),Le.alphaToCoverage===!0?xe(t.SAMPLE_ALPHA_TO_COVERAGE):Ee(t.SAMPLE_ALPHA_TO_COVERAGE)}function Se(Le){j!==Le&&(Le?t.frontFace(t.CW):t.frontFace(t.CCW),j=Le)}function ee(Le){Le!==bae?(xe(t.CULL_FACE),Le!==G&&(Le===Q4?t.cullFace(t.BACK):Le===wae?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Ee(t.CULL_FACE),G=Le}function re(Le){Le!==B&&(V&&t.lineWidth(Le),B=Le)}function me(Le,bt,dt){Le?(xe(t.POLYGON_OFFSET_FILL),($!==bt||U!==dt)&&(t.polygonOffset(bt,dt),$=bt,U=dt)):Ee(t.POLYGON_OFFSET_FILL)}function Ge(Le){Le?xe(t.SCISSOR_TEST):Ee(t.SCISSOR_TEST)}function He(Le){Le===void 0&&(Le=t.TEXTURE0+Z-1),Y!==Le&&(t.activeTexture(Le),Y=Le)}function _e(Le,bt,dt){dt===void 0&&(Y===null?dt=t.TEXTURE0+Z-1:dt=Y);let Nt=z[dt];Nt===void 0&&(Nt={type:void 0,texture:void 0},z[dt]=Nt),(Nt.type!==Le||Nt.texture!==bt)&&(Y!==dt&&(t.activeTexture(dt),Y=dt),t.bindTexture(Le,bt||le[Le]),Nt.type=Le,Nt.texture=bt)}function Ne(){const Le=z[Y];Le!==void 0&&Le.type!==void 0&&(t.bindTexture(Le.type,null),Le.type=void 0,Le.texture=void 0)}function ue(){try{t.compressedTexImage2D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Ce(){try{t.compressedTexImage3D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Ke(){try{t.texSubImage2D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Qe(){try{t.texSubImage3D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function je(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function We(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}
vendor: 11,517 bytes, line 4496
4496function xt(){try{t.texStorage2D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function et(){try{t.texStorage3D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Je(){try{t.texImage2D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Ze(){try{t.texImage3D.apply(t,arguments)}catch(Le){console.error("THREE.WebGLState:",Le)}}function Me(Le){te.equals(Le)===!1&&(t.scissor(Le.x,Le.y,Le.z,Le.w),te.copy(Le))}function Xe(Le){se.equals(Le)===!1&&(t.viewport(Le.x,Le.y,Le.z,Le.w),se.copy(Le))}function ut(Le,bt){let dt=h.get(bt);dt===void 0&&(dt=new WeakMap,h.set(bt,dt));let Nt=dt.get(Le);Nt===void 0&&(Nt=t.getUniformBlockIndex(bt,Le.name),dt.set(Le,Nt))}function lt(Le,bt){const Nt=h.get(bt).get(Le);d.get(bt)!==Nt&&(t.uniformBlockBinding(bt,Nt,Le.__bindingPointIndex),d.set(bt,Nt))}function Fe(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),r===!0&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),p={},Y=null,z={},f={},m=new WeakMap,x=[],v=null,g=!1,b=null,y=null,S=null,A=null,k=null,M=null,T=null,C=new Qt(0,0,0),R=0,P=!1,j=null,G=null,B=null,$=null,U=null,te.set(0,0,t.canvas.width,t.canvas.height),se.set(0,0,t.canvas.width,t.canvas.height),o.reset(),l.reset(),u.reset()}return{buffers:{color:o,depth:l,stencil:u},enable:xe,disable:Ee,bindFramebuffer:ae,drawBuffers:Q,useProgram:we,setBlending:pe,setMaterial:ye,setFlipSided:Se,setCullFace:ee,setLineWidth:re,setPolygonOffset:me,setScissorTest:Ge,activeTexture:He,bindTexture:_e,unbindTexture:Ne,compressedTexImage2D:ue,compressedTexImage3D:Ce,texImage2D:Je,texImage3D:Ze,updateUBOMapping:ut,uniformBlockBinding:lt,texStorage2D:xt,texStorage3D:et,texSubImage2D:Ke,texSubImage3D:Qe,compressedTexSubImage2D:je,compressedTexSubImage3D:We,scissor:Me,viewport:Xe,reset:Fe}}function YUe(t,e,n,r,i,s,a){const o=i.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new WeakMap;let h;const p=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(ee,re){return f?new OffscreenCanvas(ee,re):AS("canvas")}function x(ee,re,me,Ge){let He=1;if((ee.width>Ge||ee.height>Ge)&&(He=Ge/Math.max(ee.width,ee.height)),He<1||re===!0)if(typeof HTMLImageElement<"u"&&ee instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ee instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ee instanceof ImageBitmap){const _e=re?$T:Math.floor,Ne=_e(He*ee.width),ue=_e(He*ee.height);h===void 0&&(h=m(Ne,ue));const Ce=me?m(Ne,ue):h;return Ce.width=Ne,Ce.height=ue,Ce.getContext("2d").drawImage(ee,0,0,Ne,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ee.width+"x"+ee.height+") to ("+Ne+"x"+ue+")."),Ce}else return"data"in ee&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ee.width+"x"+ee.height+")."),ee;return ee}function v(ee){return LD(ee.width)&&LD(ee.height)}function g(ee){return o?!1:ee.wrapS!==Ji||ee.wrapT!==Ji||ee.minFilter!==Bs&&ee.minFilter!==zr}function b(ee,re){return ee.generateMipmaps&&re&&ee.minFilter!==Bs&&ee.minFilter!==zr}function y(ee){t.generateMipmap(ee)}function S(ee,re,me,Ge,He=!1){if(o===!1)return re;if(ee!==null){if(t[ee]!==void 0)return t[ee];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ee+"'")}let _e=re;if(re===t.RED&&(me===t.FLOAT&&(_e=t.R32F),me===t.HALF_FLOAT&&(_e=t.R16F),me===t.UNSIGNED_BYTE&&(_e=t.R8)),re===t.RED_INTEGER&&(me===t.UNSIGNED_BYTE&&(_e=t.R8UI),me===t.UNSIGNED_SHORT&&(_e=t.R16UI),me===t.UNSIGNED_INT&&(_e=t.R32UI),me===t.BYTE&&(_e=t.R8I),me===t.SHORT&&(_e=t.R16I),me===t.INT&&(_e=t.R32I)),re===t.RG&&(me===t.FLOAT&&(_e=t.RG32F),me===t.HALF_FLOAT&&(_e=t.RG16F),me===t.UNSIGNED_BYTE&&(_e=t.RG8)),re===t.RGBA){const Ne=He?bS:_i.getTransfer(Ge);me===t.FLOAT&&(_e=t.RGBA32F),me===t.HALF_FLOAT&&(_e=t.RGBA16F),me===t.UNSIGNED_BYTE&&(_e=Ne===Oi?t.SRGB8_ALPHA8:t.RGBA8),me===t.UNSIGNED_SHORT_4_4_4_4&&(_e=t.RGBA4),me===t.UNSIGNED_SHORT_5_5_5_1&&(_e=t.RGB5_A1)}return(_e===t.R16F||_e===t.R32F||_e===t.RG16F||_e===t.RG32F||_e===t.RGBA16F||_e===t.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function A(ee,re,me){return b(ee,me)===!0||ee.isFramebufferTexture&&ee.minFilter!==Bs&&ee.minFilter!==zr?Math.log2(Math.max(re.width,re.height))+1:ee.mipmaps!==void 0&&ee.mipmaps.length>0?ee.mipmaps.length:ee.isCompressedTexture&&Array.isArray(ee.image)?re.mipmaps.length:1}function k(ee){return ee===Bs||ee===vS||ee===gb?t.NEAREST:t.LINEAR}function M(ee){const re=ee.target;re.removeEventListener("dispose",M),C(re),re.isVideoTexture&&d.delete(re)}function T(ee){const re=ee.target;re.removeEventListener("dispose",T),P(re)}function C(ee){const re=r.get(ee);if(re.__webglInit===void 0)return;const me=ee.source,Ge=p.get(me);if(Ge){const He=Ge[re.__cacheKey];He.usedTimes--,He.usedTimes===0&&R(ee),Object.keys(Ge).length===0&&p.delete(me)}r.remove(ee)}function R(ee){const re=r.get(ee);t.deleteTexture(re.__webglTexture);const me=ee.source,Ge=p.get(me);delete Ge[re.__cacheKey],a.memory.textures--}function P(ee){const re=ee.texture,me=r.get(ee),Ge=r.get(re);if(Ge.__webglTexture!==void 0&&(t.deleteTexture(Ge.__webglTexture),a.memory.textures--),ee.depthTexture&&ee.depthTexture.dispose(),ee.isWebGLCubeRenderTarget)for(let He=0;He<6;He++){if(Array.isArray(me.__webglFramebuffer[He]))for(let _e=0;_e<me.__webglFramebuffer[He].length;_e++)t.deleteFramebuffer(me.__webglFramebuffer[He][_e]);else t.deleteFramebuffer(me.__webglFramebuffer[He]);me.__webglDepthbuffer&&t.deleteRenderbuffer(me.__webglDepthbuffer[He])}else{if(Array.isArray(me.__webglFramebuffer))for(let He=0;He<me.__webglFramebuffer.length;He++)t.deleteFramebuffer(me.__webglFramebuffer[He]);else t.deleteFramebuffer(me.__webglFramebuffer);if(me.__webglDepthbuffer&&t.deleteRenderbuffer(me.__webglDepthbuffer),me.__webglMultisampledFramebuffer&&t.deleteFramebuffer(me.__webglMultisampledFramebuffer),me.__webglColorRenderbuffer)for(let He=0;He<me.__webglColorRenderbuffer.length;He++)me.__webglColorRenderbuffer[He]&&t.deleteRenderbuffer(me.__webglColorRenderbuffer[He]);me.__webglDepthRenderbuffer&&t.deleteRenderbuffer(me.__webglDepthRenderbuffer)}if(ee.isWebGLMultipleRenderTargets)for(let He=0,_e=re.length;He<_e;He++){const Ne=r.get(re[He]);Ne.__webglTexture&&(t.deleteTexture(Ne.__webglTexture),a.memory.textures--),r.remove(re[He])}r.remove(re),r.remove(ee)}let j=0;function G(){j=0}function B(){const ee=j;return ee>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ee+" texture units while this GPU supports only "+i.maxTextures),j+=1,ee}function $(ee){const re=[];return re.push(ee.wrapS),re.push(ee.wrapT),re.push(ee.wrapR||0),re.push(ee.magFilter),re.push(ee.minFilter),re.push(ee.anisotropy),re.push(ee.internalFormat),re.push(ee.format),re.push(ee.type),re.push(ee.generateMipmaps),re.push(ee.premultiplyAlpha),re.push(ee.flipY),re.push(ee.unpackAlignment),re.push(ee.colorSpace),re.join()}function U(ee,re){const me=r.get(ee);if(ee.isVideoTexture&&ye(ee),ee.isRenderTargetTexture===!1&&ee.version>0&&me.__version!==ee.version){const Ge=ee.image;if(Ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(me,ee,re);return}}n.bindTexture(t.TEXTURE_2D,me.__webglTexture,t.TEXTURE0+re)}function Z(ee,re){const me=r.get(ee);if(ee.version>0&&me.__version!==ee.version){te(me,ee,re);return}n.bindTexture(t.TEXTURE_2D_ARRAY,me.__webglTexture,t.TEXTURE0+re)}function V(ee,re){const me=r.get(ee);if(ee.version>0&&me.__version!==ee.version){te(me,ee,re);return}n.bindTexture(t.TEXTURE_3D,me.__webglTexture,t.TEXTURE0+re)}function W(ee,re){const me=r.get(ee);if(ee.version>0&&me.__version!==ee.version){se(me,ee,re);return}n.bindTexture(t.TEXTURE_CUBE_MAP,me.__webglTexture,t.TEXTURE0+re)}const O={[Jm]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[r1]:t.MIRRORED_REPEAT},Y={[Bs]:t.NEAREST,[vS]:t.NEAREST_MIPMAP_NEAREST,[gb]:t.NEAREST_MIPMAP_LINEAR,[zr]:t.LINEAR,[SM]:t.LINEAR_MIPMAP_NEAREST,[Mh]:t.LINEAR_MIPMAP_LINEAR},z={[doe]:t.NEVER,[xoe]:t.ALWAYS,[hoe]:t.LESS,[Oz]:t.LEQUAL,[foe]:t.EQUAL,[goe]:t.GEQUAL,[poe]:t.GREATER,[moe]:t.NOTEQUAL};function I(ee,re,me){if(me?(t.texParameteri(ee,t.TEXTURE_WRAP_S,O[re.wrapS]),t.texParameteri(ee,t.TEXTURE_WRAP_T,O[re.wrapT]),(ee===t.TEXTURE_3D||ee===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ee,t.TEXTURE_WRAP_R,O[re.wrapR]),t.texParameteri(ee,t.TEXTURE_MAG_FILTER,Y[re.magFilter]),t.texParameteri(ee,t.TEXTURE_MIN_FILTER,Y[re.minFilter])):(t.texParameteri(ee,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(ee,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(ee===t.TEXTURE_3D||ee===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ee,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(re.wrapS!==Ji||re.wrapT!==Ji)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(ee,t.TEXTURE_MAG_FILTER,k(re.magFilter)),t.texParameteri(ee,t.TEXTURE_MIN_FILTER,k(re.minFilter)),re.minFilter!==Bs&&re.minFilter!==zr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),re.compareFunction&&(t.texParameteri(ee,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ee,t.TEXTURE_COMPARE_FUNC,z[re.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Ge=e.get("EXT_texture_filter_anisotropic");if(re.magFilter===Bs||re.minFilter!==gb&&re.minFilter!==Mh||re.type===Zs&&e.has("OES_texture_float_linear")===!1||o===!1&&re.type===Na&&e.has("OES_texture_half_float_linear")===!1)return;(re.anisotropy>1||r.get(re).__currentAnisotropy)&&(t.texParameterf(ee,Ge.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(re.anisotropy,i.getMaxAnisotropy())),r.get(re).__currentAnisotropy=re.anisotropy)}}function q(ee,re){let me=!1;ee.__webglInit===void 0&&(ee.__webglInit=!0,re.addEventListener("dispose",M));const Ge=re.source;let He=p.get(Ge);He===void 0&&(He={},p.set(Ge,He));const _e=$(re);if(_e!==ee.__cacheKey){He[_e]===void 0&&(He[_e]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,me=!0),He[_e].usedTimes++;const Ne=He[ee.__cacheKey];Ne!==void 0&&(He[ee.__cacheKey].usedTimes--,Ne.usedTimes===0&&R(re)),ee.__cacheKey=_e,ee.__webglTexture=He[_e].texture}return me}function te(ee,re,me){let Ge=t.TEXTURE_2D;(re.isDataArrayTexture||re.isCompressedArrayTexture)&&(Ge=t.TEXTURE_2D_ARRAY),re.isData3DTexture&&(Ge=t.TEXTURE_3D);const He=q(ee,re),_e=re.source;n.bindTexture(Ge,ee.__webglTexture,t.TEXTURE0+me);const Ne=r.get(_e);if(_e.version!==Ne.__version||He===!0){n.activeTexture(t.TEXTURE0+me);
4496const ue=_i.getPrimaries(_i.workingColorSpace),Ce=re.colorSpace===wc?null:_i.getPrimaries(re.colorSpace),Ke=re.colorSpace===wc||ue===Ce?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,re.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,re.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ke);const Qe=g(re)&&v(re.image)===!1;let je=x(re.image,Qe,!1,i.maxTextureSize);je=Se(re,je);const We=v(je)||o,xt=s.convert(re.format,re.colorSpace);let et=s.convert(re.type),Je=S(re.internalFormat,xt,et,re.colorSpace,re.isVideoTexture);I(Ge,re,We);let Ze;const Me=re.mipmaps,Xe=o&&re.isVideoTexture!==!0&&Je!==Lz,ut=Ne.__version===void 0||He===!0,lt=A(re,je,We);if(re.isDepthTexture)Je=t.DEPTH_COMPONENT,o?re.type===Zs?Je=t.DEPTH_COMPONENT32F:re.type===dh?Je=t.DEPTH_COMPONENT24:re.type===km?Je=t.DEPTH24_STENCIL8:Je=t.DEPTH_COMPONENT16:re.type===Zs&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),re.format===Cm&&Je===t.DEPTH_COMPONENT&&re.type!==AM&&re.type!==dh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),re.type=dh,et=s.convert(re.type)),re.format===yx&&Je===t.DEPTH_COMPONENT&&(Je=t.DEPTH_STENCIL,re.type!==km&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),re.type=km,et=s.convert(re.type))),ut&&(Xe?n.texStorage2D(t.TEXTURE_2D,1,Je,je.width,je.height):n.texImage2D(t.TEXTURE_2D,0,Je,je.width,je.height,0,xt,et,null));else if(re.isDataTexture)if(Me.length>0&&We){Xe&&ut&&n.texStorage2D(t.TEXTURE_2D,lt,Je,Me[0].width,Me[0].height);for(let Fe=0,Le=Me.length;Fe<Le;Fe++)Ze=Me[Fe],Xe?n.texSubImage2D(t.TEXTURE_2D,Fe,0,0,Ze.width,Ze.height,xt,et,Ze.data):n.texImage2D(t.TEXTURE_2D,Fe,Je,Ze.width,Ze.height,0,xt,et,Ze.data);re.generateMipmaps=!1}else Xe?(ut&&n.texStorage2D(t.TEXTURE_2D,lt,Je,je.width,je.height),n.texSubImage2D(t.TEXTURE_2D,0,0,0,je.width,je.height,xt,et,je.data)):n.texImage2D(t.TEXTURE_2D,0,Je,je.width,je.height,0,xt,et,je.data);else if(re.isCompressedTexture)if(re.isCompressedArrayTexture){Xe&&ut&&n.texStorage3D(t.TEXTURE_2D_ARRAY,lt,Je,Me[0].width,Me[0].height,je.depth);for(let Fe=0,Le=Me.length;Fe<Le;Fe++)Ze=Me[Fe],re.format!==fa?xt!==null?Xe?n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Fe,0,0,0,Ze.width,Ze.height,je.depth,xt,Ze.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Fe,Je,Ze.width,Ze.height,je.depth,0,Ze.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Xe?n.texSubImage3D(t.TEXTURE_2D_ARRAY,Fe,0,0,0,Ze.width,Ze.height,je.depth,xt,et,Ze.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Fe,Je,Ze.width,Ze.height,je.depth,0,xt,et,Ze.data)}else{Xe&&ut&&n.texStorage2D(t.TEXTURE_2D,lt,Je,Me[0].width,Me[0].height);for(let Fe=0,Le=Me.length;Fe<Le;Fe++)Ze=Me[Fe],re.format!==fa?xt!==null?Xe?n.compressedTexSubImage2D(t.TEXTURE_2D,Fe,0,0,Ze.width,Ze.height,xt,Ze.data):n.compressedTexImage2D(t.TEXTURE_2D,Fe,Je,Ze.width,Ze.height,0,Ze.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Xe?n.texSubImage2D(t.TEXTURE_2D,Fe,0,0,Ze.width,Ze.height,xt,et,Ze.data):n.texImage2D(t.TEXTURE_2D,Fe,Je,Ze.width,Ze.height,0,xt,et,Ze.data)}else if(re.isDataArrayTexture)Xe?(ut&&n.texStorage3D(t.TEXTURE_2D_ARRAY,lt,Je,je.width,je.height,je.depth),n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,je.width,je.height,je.depth,xt,et,je.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,Je,je.width,je.height,je.depth,0,xt,et,je.data);else if(re.isData3DTexture)Xe?(ut&&n.texStorage3D(t.TEXTURE_3D,lt,Je,je.width,je.height,je.depth),n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,je.width,je.height,je.depth,xt,et,je.data)):n.texImage3D(t.TEXTURE_3D,0,Je,je.width,je.height,je.depth,0,xt,et,je.data);else if(re.isFramebufferTexture){if(ut)if(Xe)n.texStorage2D(t.TEXTURE_2D,lt,Je,je.width,je.height);else{let Fe=je.width,Le=je.height;for(let bt=0;bt<lt;bt++)n.texImage2D(t.TEXTURE_2D,bt,Je,Fe,Le,0,xt,et,null),Fe>>=1,Le>>=1}}else if(Me.length>0&&We){Xe&&ut&&n.texStorage2D(t.TEXTURE_2D,lt,Je,Me[0].width,Me[0].height);for(let Fe=0,Le=Me.length;Fe<Le;Fe++)Ze=Me[Fe],Xe?n.texSubImage2D(t.TEXTURE_2D,Fe,0,0,xt,et,Ze):n.texImage2D(t.TEXTURE_2D,Fe,Je,xt,et,Ze);re.generateMipmaps=!1}else Xe?(ut&&n.texStorage2D(t.TEXTURE_2D,lt,Je,je.width,je.height),n.texSubImage2D(t.TEXTURE_2D,0,0,0,xt,et,je)):n.texImage2D(t.TEXTURE_2D,0,Je,xt,et,je);b(re,We)&&y(Ge),Ne.__version=_e.version,re.onUpdate&&re.onUpdate(re)}ee.__version=re.version}function se(ee,re,me){if(re.image.length!==6)return;const Ge=q(ee,re),He=re.source;n.bindTexture(t.TEXTURE_CUBE_MAP,ee.__webglTexture,t.TEXTURE0+me);const _e=r.get(He);if(He.version!==_e.__version||Ge===!0){n.activeTexture(t.TEXTURE0+me);
4496const Ne=_i.getPrimaries(_i.workingColorSpace),ue=re.colorSpace===wc?null:_i.getPrimaries(re.colorSpace),Ce=re.colorSpace===wc||Ne===ue?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,re.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,re.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ce);const Ke=re.isCompressedTexture||re.image[0].isCompressedTexture,Qe=re.image[0]&&re.image[0].isDataTexture,je=[];for(let Fe=0;Fe<6;Fe++)!Ke&&!Qe?je[Fe]=x(re.image[Fe],!1,!0,i.maxCubemapSize):je[Fe]=Qe?re.image[Fe].image:re.image[Fe],je[Fe]=Se(re,je[Fe]);const We=je[0],xt=v(We)||o,et=s.convert(re.format,re.colorSpace),Je=s.convert(re.type),Ze=S(re.internalFormat,et,Je,re.colorSpace),Me=o&&re.isVideoTexture!==!0,Xe=_e.__version===void 0||Ge===!0;let ut=A(re,We,xt);I(t.TEXTURE_CUBE_MAP,re,xt);let lt;if(Ke){Me&&Xe&&n.texStorage2D(t.TEXTURE_CUBE_MAP,ut,Ze,We.width,We.height);for(let Fe=0;Fe<6;Fe++){lt=je[Fe].mipmaps;for(let Le=0;Le<lt.length;Le++){const bt=lt[Le];re.format!==fa?et!==null?Me?n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le,0,0,bt.width,bt.height,et,bt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le,Ze,bt.width,bt.height,0,bt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Me?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le,0,0,bt.width,bt.height,et,Je,bt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le,Ze,bt.width,bt.height,0,et,Je,bt.data)}}}else{lt=re.mipmaps,Me&&Xe&&(lt.length>0&&ut++,n.texStorage2D(t.TEXTURE_CUBE_MAP,ut,Ze,je[0].width,je[0].height));for(let Fe=0;Fe<6;Fe++)if(Qe){Me?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,0,0,0,je[Fe].width,je[Fe].height,et,Je,je[Fe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,0,Ze,je[Fe].width,je[Fe].height,0,et,Je,je[Fe].data);for(let Le=0;Le<lt.length;Le++){const dt=lt[Le].image[Fe].image;Me?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le+1,0,0,dt.width,dt.height,et,Je,dt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le+1,Ze,dt.width,dt.height,0,et,Je,dt.data)}}else{Me?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,0,0,0,et,Je,je[Fe]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,0,Ze,et,Je,je[Fe]);for(let Le=0;Le<lt.length;Le++){const bt=lt[Le];Me?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le+1,0,0,et,Je,bt.image[Fe]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,Le+1,Ze,et,Je,bt.image[Fe])}}}b(re,xt)&&y(t.TEXTURE_CUBE_MAP),_e.__version=He.version,re.onUpdate&&re.onUpdate(re)}ee.__version=re.version}function ie(ee,re,me,Ge,He,_e){const Ne=s.convert(me.format,me.colorSpace),ue=s.convert(me.type),Ce=S(me.internalFormat,Ne,ue,me.colorSpace);if(!r.get(re).__hasExternalTextures){const Qe=Math.max(1,re.width>>_e),je=Math.max(1,re.height>>_e);He===t.TEXTURE_3D||He===t.TEXTURE_2D_ARRAY?n.texImage3D(He,_e,Ce,Qe,je,re.depth,0,Ne,ue,null):n.texImage2D(He,_e,Ce,Qe,je,0,Ne,ue,null)}n.bindFramebuffer(t.FRAMEBUFFER,ee),pe(re)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Ge,He,r.get(me).__webglTexture,0,K(re)):(He===t.TEXTURE_2D||He>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&He<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Ge,He,r.get(me).__webglTexture,_e),n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(ee,re,me){if(t.bindRenderbuffer(t.RENDERBUFFER,ee),re.depthBuffer&&!re.stencilBuffer){let Ge=o===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(me||pe(re)){const He=re.depthTexture;He&&He.isDepthTexture&&(He.type===Zs?Ge=t.DEPTH_COMPONENT32F:He.type===dh&&(Ge=t.DEPTH_COMPONENT24));const _e=K(re);pe(re)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,_e,Ge,re.width,re.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,_e,Ge,re.width,re.height)}else t.renderbufferStorage(t.RENDERBUFFER,Ge,re.width,re.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,ee)}else if(re.depthBuffer&&re.stencilBuffer){const Ge=K(re);me&&pe(re)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ge,t.DEPTH24_STENCIL8,re.width,re.height):pe(re)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ge,t.DEPTH24_STENCIL8,re.width,re.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,re.width,re.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,ee)}else{const Ge=re.isWebGLMultipleRenderTargets===!0?re.texture:[re.texture];for(let He=0;He<Ge.length;He++){const _e=Ge[He],Ne=s.convert(_e.format,_e.colorSpace),ue=s.convert(_e.type),Ce=S(_e.internalFormat,Ne,ue,_e.colorSpace),Ke=K(re);me&&pe(re)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ke,Ce,re.width,re.height):pe(re)?l.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ke,Ce,re.width,re.height):t.renderbufferStorage(t.RENDERBUFFER,Ce,re.width,re.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}
4496function xe(ee,re){if(re&&re.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,ee),!(re.depthTexture&&re.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(re.depthTexture).__webglTexture||re.depthTexture.image.width!==re.width||re.depthTexture.image.height!==re.height)&&(re.depthTexture.image.width=re.width,re.depthTexture.image.height=re.height,re.depthTexture.needsUpdate=!0),U(re.depthTexture,0);const Ge=r.get(re.depthTexture).__webglTexture,He=K(re);if(re.depthTexture.format===Cm)pe(re)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ge,0,He):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ge,0);else if(re.depthTexture.format===yx)pe(re)?l.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ge,0,He):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ge,0);else throw new Error("Unknown depthTexture format")}function Ee(ee){const re=r.get(ee),me=ee.isWebGLCubeRenderTarget===!0;if(ee.depthTexture&&!re.__autoAllocateDepthBuffer){if(me)throw new Error("target.depthTexture not supported in Cube render targets");xe(re.__webglFramebuffer,ee)}else if(me){re.__webglDepthbuffer=[];for(let Ge=0;Ge<6;Ge++)n.bindFramebuffer(t.FRAMEBUFFER,re.__webglFramebuffer[Ge]),re.__webglDepthbuffer[Ge]=t.createRenderbuffer(),le(re.__webglDepthbuffer[Ge],ee,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,re.__webglFramebuffer),re.__webglDepthbuffer=t.createRenderbuffer(),le(re.__webglDepthbuffer,ee,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(ee,re,me){const Ge=r.get(ee);re!==void 0&&ie(Ge.__webglFramebuffer,ee,ee.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),me!==void 0&&Ee(ee)}function Q(ee){const re=ee.texture,me=r.get(ee),Ge=r.get(re);ee.addEventListener("dispose",T),ee.isWebGLMultipleRenderTargets!==!0&&(Ge.__webglTexture===void 0&&(Ge.__webglTexture=t.createTexture()),Ge.__version=re.version,a.memory.textures++);const He=ee.isWebGLCubeRenderTarget===!0,_e=ee.isWebGLMultipleRenderTargets===!0,Ne=v(ee)||o;if(He){me.__webglFramebuffer=[];for(let ue=0;ue<6;ue++)if(o&&re.mipmaps&&re.mipmaps.length>0){me.__webglFramebuffer[ue]=[];for(let Ce=0;Ce<re.mipmaps.length;Ce++)me.__webglFramebuffer[ue][Ce]=t.createFramebuffer()}else me.__webglFramebuffer[ue]=t.createFramebuffer()}else{if(o&&re.mipmaps&&re.mipmaps.length>0){me.__webglFramebuffer=[];for(let ue=0;ue<re.mipmaps.length;ue++)me.__webglFramebuffer[ue]=t.createFramebuffer()}else me.__webglFramebuffer=t.createFramebuffer();if(_e)if(i.drawBuffers){const ue=ee.texture;for(let Ce=0,Ke=ue.length;Ce<Ke;Ce++){const Qe=r.get(ue[Ce]);Qe.__webglTexture===void 0&&(Qe.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&ee.samples>0&&pe(ee)===!1){const ue=_e?re:[re];me.__webglMultisampledFramebuffer=t.createFramebuffer(),me.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,me.__webglMultisampledFramebuffer);for(let Ce=0;Ce<ue.length;Ce++){const Ke=ue[Ce];me.__webglColorRenderbuffer[Ce]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,me.__webglColorRenderbuffer[Ce]);const Qe=s.convert(Ke.format,Ke.colorSpace),je=s.convert(Ke.type),We=S(Ke.internalFormat,Qe,je,Ke.colorSpace,ee.isXRRenderTarget===!0),xt=K(ee);t.renderbufferStorageMultisample(t.RENDERBUFFER,xt,We,ee.width,ee.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ce,t.RENDERBUFFER,me.__webglColorRenderbuffer[Ce])}t.bindRenderbuffer(t.RENDERBUFFER,null),ee.depthBuffer&&(me.__webglDepthRenderbuffer=t.createRenderbuffer(),le(me.__webglDepthRenderbuffer,ee,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(He){n.bindTexture(t.TEXTURE_CUBE_MAP,Ge.__webglTexture),I(t.TEXTURE_CUBE_MAP,re,Ne);for(let ue=0;ue<6;ue++)if(o&&re.mipmaps&&re.mipmaps.length>0)for(let Ce=0;Ce<re.mipmaps.length;Ce++)ie(me.__webglFramebuffer[ue][Ce],ee,re,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ue,Ce);else ie(me.__webglFramebuffer[ue],ee,re,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0);b(re,Ne)&&y(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(_e){const ue=ee.texture;for(let Ce=0,Ke=ue.length;Ce<Ke;Ce++){const Qe=ue[Ce],je=r.get(Qe);n.bindTexture(t.TEXTURE_2D,je.__webglTexture),I(t.TEXTURE_2D,Qe,Ne),ie(me.__webglFramebuffer,ee,Qe,t.COLOR_ATTACHMENT0+Ce,t.TEXTURE_2D,0),b(Qe,Ne)&&y(t.TEXTURE_2D)}n.unbindTexture()}else{let ue=t.TEXTURE_2D;if((ee.isWebGL3DRenderTarget||ee.isWebGLArrayRenderTarget)&&(o?ue=ee.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(ue,Ge.__webglTexture),I(ue,re,Ne),o&&re.mipmaps&&re.mipmaps.length>0)for(let Ce=0;Ce<re.mipmaps.length;Ce++)ie(me.__webglFramebuffer[Ce],ee,re,t.COLOR_ATTACHMENT0,ue,Ce);else ie(me.__webglFramebuffer,ee,re,t.COLOR_ATTACHMENT0,ue,0);b(re,Ne)&&y(ue),n.unbindTexture()}ee.depthBuffer&&Ee(ee)}function we(ee){const re=v(ee)||o,me=ee.isWebGLMultipleRenderTargets===!0?ee.texture:[ee.texture];for(let Ge=0,He=me.length;Ge<He;Ge++){const _e=me[Ge];
4496if(b(_e,re)){const Ne=ee.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,ue=r.get(_e).__webglTexture;n.bindTexture(Ne,ue),y(Ne),n.unbindTexture()}}}function Ae(ee){if(o&&ee.samples>0&&pe(ee)===!1){const re=ee.isWebGLMultipleRenderTargets?ee.texture:[ee.texture],me=ee.width,Ge=ee.height;let He=t.COLOR_BUFFER_BIT;const _e=[],Ne=ee.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ue=r.get(ee),Ce=ee.isWebGLMultipleRenderTargets===!0;if(Ce)for(let Ke=0;Ke<re.length;Ke++)n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ke,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ke,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,ue.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,ue.__webglFramebuffer);for(let Ke=0;Ke<re.length;Ke++){_e.push(t.COLOR_ATTACHMENT0+Ke),ee.depthBuffer&&_e.push(Ne);const Qe=ue.__ignoreDepthValues!==void 0?ue.__ignoreDepthValues:!1;if(Qe===!1&&(ee.depthBuffer&&(He|=t.DEPTH_BUFFER_BIT),ee.stencilBuffer&&(He|=t.STENCIL_BUFFER_BIT)),Ce&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,ue.__webglColorRenderbuffer[Ke]),Qe===!0&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[Ne]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[Ne])),Ce){const je=r.get(re[Ke]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,je,0)}t.blitFramebuffer(0,0,me,Ge,0,0,me,Ge,He,t.NEAREST),u&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,_e)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),Ce)for(let Ke=0;Ke<re.length;Ke++){n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ke,t.RENDERBUFFER,ue.__webglColorRenderbuffer[Ke]);const Qe=r.get(re[Ke]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ke,t.TEXTURE_2D,Qe,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,ue.__webglMultisampledFramebuffer)}}function K(ee){return Math.min(i.maxSamples,ee.samples)}function pe(ee){const re=r.get(ee);return o&&ee.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&re.__useRenderToTexture!==!1}function ye(ee){const re=a.render.frame;d.get(ee)!==re&&(d.set(ee,re),ee.update())}function Se(ee,re){const me=ee.colorSpace,Ge=ee.format,He=ee.type;return ee.isCompressedTexture===!0||ee.isVideoTexture===!0||ee.format===WT||me!==Pc&&me!==wc&&(_i.getTransfer(me)===Oi?o===!1?e.has("EXT_sRGB")===!0&&Ge===fa?(ee.format=WT,ee.minFilter=zr,ee.generateMipmaps=!1):re=Uz.sRGBToLinear(re):(Ge!==fa||He!==Tc)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",me)),re}this.allocateTextureUnit=B,this.resetTextureUnits=G,this.setTexture2D=U,this.setTexture2DArray=Z,this.setTexture3D=V,this.setTextureCube=W,this.rebindTextures=ae,this.setupRenderTarget=Q,this.updateRenderTargetMipmap=we,this.updateMultisampleRenderTarget=Ae,this.setupDepthRenderbuffer=Ee,this.setupFrameBufferTexture=ie,this.useMultisampledRTT=pe}function Moe(t,e,n){const r=n.isWebGL2;function i(s,a=wc){let o;const l=_i.getTransfer(a);if(s===Tc)return t.UNSIGNED_BYTE;if(s===Nz)return t.UNSIGNED_SHORT_4_4_4_4;if(s===Tz)return t.UNSIGNED_SHORT_5_5_5_1;if(s===kz)return t.BYTE;if(s===Cz)return t.SHORT;if(s===AM)return t.UNSIGNED_SHORT;if(s===EM)return t.INT;if(s===dh)return t.UNSIGNED_INT;if(s===Zs)return t.FLOAT;if(s===Na)return r?t.HALF_FLOAT:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===eoe)return t.ALPHA;if(s===fa)return t.RGBA;if(s===toe)return t.LUMINANCE;if(s===noe)return t.LUMINANCE_ALPHA;if(s===Cm)return t.DEPTH_COMPONENT;if(s===yx)return t.DEPTH_STENCIL;if(s===WT)return o=e.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===Mz)return t.RED;if(s===Rz)return t.RED_INTEGER;if(s===roe)return t.RG;if(s===jz)return t.RG_INTEGER;if(s===Pz)return t.RGBA_INTEGER;if(s===oN||s===lN||s===cN||s===uN)if(l===Oi)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===oN)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===lN)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===cN)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===uN)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===oN)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===lN)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===cN)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===uN)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===oD||s===lD||s===cD||s===uD)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===oD)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===lD)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===cD)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===uD)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Lz)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===dD||s===hD)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(s===dD)return l===Oi?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===hD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===fD||s===pD||s===mD||s===gD||s===xD||s===vD||s===yD||s===bD||s===wD||s===_D||s===SD||s===AD||s===ED||s===kD)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(s===fD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===pD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===mD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===gD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===xD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===vD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===yD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===bD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===wD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===_D)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===SD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===AD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ED)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===kD)return l===Oi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===dN||s===CD||s===ND)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(s===dN)return l===Oi?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===CD)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===ND)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===ioe||s===TD||s===MD||s===RD)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(s===dN)return o.COMPRESSED_RED_RGT
vendor: 105,231 bytes, line 4496
4496C1_EXT;if(s===TD)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===MD)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===RD)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===km?r?t.UNSIGNED_INT_24_8:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):t[s]!==void 0?t[s]:null}return{convert:i}}class Roe extends Os{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class wf extends Xr{constructor(){super(),this.isGroup=!0,this.type="Group"}}const JUe={type:"move"};class aP{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new wf,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 wf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new wf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,s=null,a=null;const o=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){a=!0;for(const x of e.hand.values()){const v=n.getJointPose(x,r),g=this._getHandJoint(u,x);v!==null&&(g.matrix.fromArray(v.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=v.radius),g.visible=v!==null}const d=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],p=d.position.distanceTo(h.position),f=.02,m=.005;u.inputState.pinching&&p>f+m?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=f-m&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.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));o!==null&&(i=n.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(JUe)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new wf;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class ZUe extends Zf{constructor(e,n){super();const r=this;let i=null,s=1,a=null,o="local-floor",l=1,u=null,d=null,h=null,p=null,f=null,m=null;const x=n.getContextAttributes();let v=null,g=null;const b=[],y=[],S=new Rt;let A=null;const k=new Os;k.layers.enable(1),k.viewport=new gi;const M=new Os;M.layers.enable(2),M.viewport=new gi;const T=[k,M],C=new Roe;C.layers.enable(1),C.layers.enable(2);let R=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let q=b[I];return q===void 0&&(q=new aP,b[I]=q),q.getTargetRaySpace()},this.getControllerGrip=function(I){let q=b[I];return q===void 0&&(q=new aP,b[I]=q),q.getGripSpace()},this.getHand=function(I){let q=b[I];return q===void 0&&(q=new aP,b[I]=q),q.getHandSpace()};function j(I){const q=y.indexOf(I.inputSource);if(q===-1)return;const te=b[q];te!==void 0&&(te.update(I.inputSource,I.frame,u||a),te.dispatchEvent({type:I.type,data:I.inputSource}))}function G(){i.removeEventListener("select",j),i.removeEventListener("selectstart",j),i.removeEventListener("selectend",j),i.removeEventListener("squeeze",j),i.removeEventListener("squeezestart",j),i.removeEventListener("squeezeend",j),i.removeEventListener("end",G),i.removeEventListener("inputsourceschange",B);for(let I=0;I<b.length;I++){const q=y[I];q!==null&&(y[I]=null,b[I].disconnect(q))}R=null,P=null,e.setRenderTarget(v),f=null,p=null,h=null,i=null,g=null,z.stop(),r.isPresenting=!1,e.setPixelRatio(A),e.setSize(S.width,S.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){s=I,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){o=I,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||a},this.setReferenceSpace=function(I){u=I},this.getBaseLayer=function(){return p!==null?p:f},this.getBinding=function(){return h},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(I){if(i=I,i!==null){if(v=e.getRenderTarget(),i.addEventListener("select",j),i.addEventListener("selectstart",j),i.addEventListener("selectend",j),i.addEventListener("squeeze",j),i.addEventListener("squeezestart",j),i.addEventListener("squeezeend",j),i.addEventListener("end",G),i.addEventListener("inputsourceschange",B),x.xrCompatible!==!0&&await n.makeXRCompatible(),A=e.getPixelRatio(),e.getSize(S),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const q={antialias:i.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,n,q),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),g=new Yo(f.framebufferWidth,f.framebufferHeight,{format:fa,type:Tc,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil})}else{let q=null,te=null,se=null;x.depth&&(se=x.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,q=x.stencil?yx:Cm,te=x.stencil?km:dh);const ie={colorFormat:n.RGBA8,depthFormat:se,scaleFactor:s};h=new XRWebGLBinding(i,n),p=h.createProjectionLayer(ie),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),g=new Yo(p.textureWidth,p.textureHeight,{format:fa,type:Tc,depthTexture:new TM(p.textureWidth,p.textureHeight,te,void 0,void 0,void 0,void 0,void 0,void 0,q),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:x.antialias?4:0});const le=e.properties.get(g);le.__ignoreDepthValues=p.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(l),u=null,a=await i.requestReferenceSpace(o),z.setContext(i),z.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function B(I){for(let q=0;q<I.removed.length;q++){const te=I.removed[q],se=y.indexOf(te);se>=0&&(y[se]=null,b[se].disconnect(te))}for(let q=0;q<I.added.length;q++){const te=I.added[q];let se=y.indexOf(te);if(se===-1){for(let le=0;le<b.length;le++)if(le>=y.length){y.push(te),se=le;break}else if(y[le]===null){y[le]=te,se=le;break}if(se===-1)break}const ie=b[se];ie&&ie.connect(te)}}const $=new Ie,U=new Ie;function Z(I,q,te){$.setFromMatrixPosition(q.matrixWorld),U.setFromMatrixPosition(te.matrixWorld);const se=$.distanceTo(U),ie=q.projectionMatrix.elements,le=te.projectionMatrix.elements,xe=ie[14]/(ie[10]-1),Ee=ie[14]/(ie[10]+1),ae=(ie[9]+1)/ie[5],Q=(ie[9]-1)/ie[5],we=(ie[8]-1)/ie[0],Ae=(le[8]+1)/le[0],K=xe*we,pe=xe*Ae,ye=se/(-we+Ae),Se=ye*-we;q.matrixWorld.decompose(I.position,I.quaternion,I.scale),I.translateX(Se),I.translateZ(ye),I.matrixWorld.compose(I.position,I.quaternion,I.scale),I.matrixWorldInverse.copy(I.matrixWorld).invert();const ee=xe+ye,re=Ee+ye,me=K-Se,Ge=pe+(se-Se),He=ae*Ee/re*ee,_e=Q*Ee/re*ee;I.projectionMatrix.makePerspective(me,Ge,He,_e,ee,re),I.projectionMatrixInverse.copy(I.projectionMatrix).invert()}function V(I,q){q===null?I.matrixWorld.copy(I.matrix):I.matrixWorld.multiplyMatrices(q.matrixWorld,I.matrix),I.matrixWorldInverse.copy(I.matrixWorld).invert()}this.updateCamera=function(I){if(i===null)return;C.near=M.near=k.near=I.near,C.far=M.far=k.far=I.far,(R!==C.near||P!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),R=C.near,P=C.far);const q=I.parent,te=C.cameras;V(C,q);for(let se=0;se<te.length;se++)V(te[se],q);te.length===2?Z(C,k,M):C.projectionMatrix.copy(k.projectionMatrix),W(I,C,q)};function W(I,q,te){te===null?I.matrix.copy(q.matrixWorld):(I.matrix.copy(te.matrixWorld),I.matrix.invert(),I.matrix.multiply(q.matrixWorld)),I.matrix.decompose(I.position,I.quaternion,I.scale),I.updateMatrixWorld(!0),I.projectionMatrix.copy(q.projectionMatrix),I.projectionMatrixInverse.copy(q.projectionMatrixInverse),I.isPerspectiveCamera&&(I.fov=a1*2*Math.atan(1/I.projectionMatrix.elements[5]),I.zoom=1)}this.getCamera=function(){return C},this.getFoveation=function(){if(!(p===null&&f===null))return l},this.setFoveation=function(I){l=I,p!==null&&(p.fixedFoveation=I),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=I)};let O=null;function Y(I,q){if(d=q.getViewerPose(u||a),m=q,d!==null){const te=d.views;f!==null&&(e.setRenderTargetFramebuffer(g,f.framebuffer),e.setRenderTarget(g));let se=!1;te.length!==C.cameras.length&&(C.cameras.length=0,se=!0);for(let ie=0;ie<te.length;ie++){const le=te[ie];let xe=null;if(f!==null)xe=f.getViewport(le);else{const ae=h.getViewSubImage(p,le);xe=ae.viewport,ie===0&&(e.setRenderTargetTextures(g,ae.colorTexture,p.ignoreDepthValues?void 0:ae.depthStencilTexture),e.setRenderTarget(g))}let Ee=T[ie];Ee===void 0&&(Ee=new Os,Ee.layers.enable(ie),Ee.viewport=new gi,T[ie]=Ee),Ee.matrix.fromArray(le.transform.matrix),Ee.matrix.decompose(Ee.position,Ee.quaternion,Ee.scale),Ee.projectionMatrix.fromArray(le.projectionMatrix),Ee.projectionMatrixInverse.copy(Ee.projectionMatrix).invert(),Ee.viewport.set(xe.x,xe.y,xe.width,xe.height),ie===0&&(C.matrix.copy(Ee.matrix),C.matrix.decompose(C.position,C.quaternion,C.scale)),se===!0&&C.cameras.push(Ee)}}for(let te=0;te<b.length;te++){const se=y[te],ie=b[te];se!==null&&ie!==void 0&&ie.update(se,q,u||a)}O&&O(I,q),q.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:q}),m=null}const z=new Aoe;z.setAnimationLoop(Y),this.setAnimationLoop=function(I){O=I},this.dispose=function(){}}}function QUe(t,e){function n(v,g){v.matrixAutoUpdate===!0&&v.updateMatrix(),g.value.copy(v.matrix)}function r(v,g){g.color.getRGB(v.fogColor.value,_oe(t)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function i(v,g,b,y,S){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(v,g):g.isMeshToonMaterial?(s(v,g),h(v,g)):g.isMeshPhongMaterial?(s(v,g),d(v,g)):g.isMeshStandardMaterial?(s(v,g),p(v,g),g.isMeshPhysicalMaterial&&f(v,g,S)):g.isMeshMatcapMaterial?(s(v,g),m(v,g)):g.isMeshDepthMaterial?s(v,g):g.isMeshDistanceMaterial?(s(v,g),x(v,g)):g.isMeshNormalMaterial?s(v,g):g.isLineBasicMaterial?(a(v,g),g.isLineDashedMaterial&&o(v,g)):g.isPointsMaterial?l(v,g,b,y):g.isSpriteMaterial?u(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,n(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,n(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,n(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,g.side===xl&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,n(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===xl&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,n(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,n(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,n(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const b=e.get(g).envMap;if(b&&(v.envMap.value=b,v.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap){v.lightMap.value=g.lightMap;const y=t._useLegacyLights===!0?Math.PI:1;v.lightMapIntensity.value=g.lightMapIntensity*y,n(g.lightMap,v.lightMapTransform)}g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,v.aoMapTransform))}function a(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,n(g.map,v.mapTransform))}function o(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function l(v,g,b,y){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*b,v.scale.value=y*.5,g.map&&(v.map.value=g.map,n(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,n(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function u(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,n(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,n(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function d(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}function h(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}function p(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,v.roughnessMapTransform)),e.get(g).envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function f(v,g,b){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===xl&&v.clearcoatNormalScale.value.negate())),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=b.texture,v.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,v.specularIntensityMapTransform))}function m(v,g){g.matcap&&(v.matcap.value=g.matcap)}function x(v,g){const b=e.get(g).light;v.referencePosition.value.setFromMatrixPosition(b.matrixWorld),v.nearDistance.value=b.shadow.camera.near,v.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function e8e(t,e,n,r){let i={},s={},a=[];const o=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(b,y){const S=y.program;r.uniformBlockBinding(b,S)}function u(b,y){let S=i[b.id];S===void 0&&(m(b),S=d(b),i[b.id]=S,b.addEventListener("dispose",v));const A=y.program;r.updateUBOMapping(b,A);const k=e.render.frame;s[b.id]!==k&&(p(b),s[b.id]=k)}function d(b){const y=h();b.__bindingPointIndex=y;const S=t.createBuffer(),A=b.__size,k=b.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,A,k),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,y,S),S}function h(){for(let b=0;b<o;b++)if(a.indexOf(b)===-1)return a.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(b){const y=i[b.id],S=b.uniforms,A=b.__cache;t.bindBuffer(t.UNIFORM_BUFFER,y);for(let k=0,M=S.length;k<M;k++){const T=Array.isArray(S[k])?S[k]:[S[k]];for(let C=0,R=T.length;C<R;C++){const P=T[C];if(f(P,k,C,A)===!0){const j=P.__offset,G=Array.isArray(P.value)?P.value:[P.value];let B=0;for(let $=0;$<G.length;$++){const U=G[$],Z=x(U);typeof U=="number"||typeof U=="boolean"?(P.__data[0]=U,t.bufferSubData(t.UNIFORM_BUFFER,j+B,P.__data)):U.isMatrix3?(P.__data[0]=U.elements[0],P.__data[1]=U.elements[1],P.__data[2]=U.elements[2],P.__data[3]=0,P.__data[4]=U.elements[3],P.__data[5]=U.elements[4],P.__data[6]=U.elements[5],P.__data[7]=0,P.__data[8]=U.elements[6],P.__data[9]=U.elements[7],P.__data[10]=U.elements[8],P.__data[11]=0):(U.toArray(P.__data,B),B+=Z.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,j,P.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function f(b,y,S,A){const k=b.value,M=y+"_"+S;if(A[M]===void 0)return typeof k=="number"||typeof k=="boolean"?A[M]=k:A[M]=k.clone(),!0;{const T=A[M];if(typeof k=="number"||typeof k=="boolean"){if(T!==k)return A[M]=k,!0}else if(T.equals(k)===!1)return T.copy(k),!0}return!1}function m(b){const y=b.uniforms;let S=0;const A=16;for(let M=0,T=y.length;M<T;M++){const C=Array.isArray(y[M])?y[M]:[y[M]];for(let R=0,P=C.length;R<P;R++){const j=C[R],G=Array.isArray(j.value)?j.value:[j.value];for(let B=0,$=G.length;B<$;B++){const U=G[B],Z=x(U),V=S%A;V!==0&&A-V<Z.boundary&&(S+=A-V),j.__data=new Float32Array(Z.storage/Float32Array.BYTES_PER_ELEMENT),j.__offset=S,S+=Z.storage}}}const k=S%A;return k>0&&(S+=A-k),b.__size=S,b.__cache={},this}function x(b){const y={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(y.boundary=4,y.storage=4):b.isVector2?(y.boundary=8,y.storage=8):b.isVector3||b.isColor?(y.boundary=16,y.storage=12):b.isVector4?(y.boundary=16,y.storage=16):b.isMatrix3?(y.boundary=48,y.storage=48):b.isMatrix4?(y.boundary=64,y.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),y}function v(b){const y=b.target;y.removeEventListener("dispose",v);const S=a.indexOf(y.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[y.id]),delete i[y.id],delete s[y.id]}function g(){for(const b in i)t.deleteBuffer(i[b]);a=[],i={},s={}}return{bind:l,update:u,dispose:g}}class jM{constructor(e={}){const{canvas:n=yoe(),context:r=null,depth:i=!0,stencil:s=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;r!==null?p=r.getContextAttributes().alpha:p=a;const f=new Uint32Array(4),m=new Int32Array(4);let x=null,v=null;const g=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=os,this._useLegacyLights=!1,this.toneMapping=wh,this.toneMappingExposure=1;const y=this;let S=!1,A=0,k=0,M=null,T=-1,C=null;const R=new gi,P=new gi;let j=null;const G=new Qt(0);let B=0,$=n.width,U=n.height,Z=1,V=null,W=null;const O=new gi(0,0,$,U),Y=new gi(0,0,$,U);let z=!1;const I=new LA;let q=!1,te=!1,se=null;const ie=new Wn,le=new Rt,xe=new Ie,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return M===null?Z:1}let Q=r;function we(ce,Pe){for(let De=0;De<ce.length;De++){const qe=ce[De],$e=n.getContext(qe,Pe);if($e!==null)return $e}return null}try{const ce={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:h};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${NA}`),n.addEventListener("webglcontextlost",Fe,!1),n.addEventListener("webglcontextrestored",Le,!1),n.addEventListener("webglcontextcreationerror",bt,!1),Q===null){const Pe=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&Pe.shift(),Q=we(Pe,ce),Q===null)throw we(Pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&Q instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),Q.getShaderPrecisionFormat===void 0&&(Q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ce){throw console.error("THREE.WebGLRenderer: "+ce.message),ce}let Ae,K,pe,ye,Se,ee,re,me,Ge,He,_e,Ne,ue,Ce,Ke,Qe,je,We,xt,et,Je,Ze,Me,Xe;function ut(){Ae=new p6e(Q),K=new l6e(Q,Ae,e),Ae.init(K),Ze=new Moe(Q,Ae,K),pe=new XUe(Q,Ae,K),ye=new x6e(Q),Se=new BUe,ee=new YUe(Q,Ae,pe,Se,K,Ze,ye),re=new u6e(y),me=new f6e(y),Ge=new EFe(Q,K),Me=new a6e(Q,Ae,Ge,K),He=new m6e(Q,Ge,ye,Me),_e=new w6e(Q,He,Ge,ye),xt=new b6e(Q,K,ee),Qe=new c6e(Se),Ne=new DUe(y,re,me,Ae,K,Me,Qe),ue=new QUe(y,Se),Ce=new OUe,Ke=new WUe(Ae,K),We=new s6e(y,re,me,pe,_e,p,l),je=new qUe(y,_e,K),Xe=new e8e(Q,ye,K,pe),et=new o6e(Q,Ae,ye,K),Je=new g6e(Q,Ae,ye,K),ye.programs=Ne.programs,y.capabilities=K,y.extensions=Ae,y.properties=Se,y.renderLists=Ce,y.shadowMap=je,y.state=pe,y.info=ye}ut();const lt=new ZUe(y,Q);this.xr=lt,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const ce=Ae.get("WEBGL_lose_context");ce&&ce.loseContext()},this.forceContextRestore=function(){const ce=Ae.get("WEBGL_lose_context");ce&&ce.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(ce){ce!==void 0&&(Z=ce,this.setSize($,U,!1))},this.getSize=function(ce){return ce.set($,U)},this.setSize=function(ce,Pe,De=!0){if(lt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=ce,U=Pe,n.width=Math.floor(ce*Z),n.height=Math.floor(Pe*Z),De===!0&&(n.style.width=ce+"px",n.style.height=Pe+"px"),this.setViewport(0,0,ce,Pe)},this.getDrawingBufferSize=function(ce){return ce.set($*Z,U*Z).floor()},this.setDrawingBufferSize=function(ce,Pe,De){$=ce,U=Pe,Z=De,n.width=Math.floor(ce*De),n.height=Math.floor(Pe*De),this.setViewport(0,0,ce,Pe)},this.getCurrentViewport=function(ce){return ce.copy(R)},this.getViewport=function(ce){return ce.copy(O)},this.setViewport=function(ce,Pe,De,qe){ce.isVector4?O.set(ce.x,ce.y,ce.z,ce.w):O.set(ce,Pe,De,qe),pe.viewport(R.copy(O).multiplyScalar(Z).floor())},this.getScissor=function(ce){return ce.copy(Y)},this.setScissor=function(ce,Pe,De,qe){ce.isVector4?Y.set(ce.x,ce.y,ce.z,ce.w):Y.set(ce,Pe,De,qe),pe.scissor(P.copy(Y).multiplyScalar(Z).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(ce){pe.setScissorTest(z=ce)},this.setOpaqueSort=function(ce){V=ce},this.setTransparentSort=function(ce){W=ce},this.getClearColor=function(ce){return ce.copy(We.getClearColor())},this.setClearColor=function(){We.setClearColor.apply(We,arguments)},this.getClearAlpha=function(){return We.getClearAlpha()},this.setClearAlpha=function(){We.setClearAlpha.apply(We,arguments)},this.clear=function(ce=!0,Pe=!0,De=!0){let qe=0;if(ce){let $e=!1;if(M!==null){const mt=M.texture.format;$e=mt===Pz||mt===jz||mt===Rz}if($e){const mt=M.texture.type,vt=mt===Tc||mt===dh||mt===AM||mt===km||mt===Nz||mt===Tz,wt=We.getClearColor(),nt=We.getClearAlpha(),Xt=wt.r,ft=wt.g,ve=wt.b;vt?(f[0]=Xt,f[1]=ft,f[2]=ve,f[3]=nt,Q.clearBufferuiv(Q.COLOR,0,f)):(m[0]=Xt,m[1]=ft,m[2]=ve,m[3]=nt,Q.clearBufferiv(Q.COLOR,0,m))}else qe|=Q.COLOR_BUFFER_BIT}Pe&&(qe|=Q.DEPTH_BUFFER_BIT),De&&(qe|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Q.clear(qe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Fe,!1),n.removeEventListener("webglcontextrestored",Le,!1),n.removeEventListener("webglcontextcreationerror",bt,!1),Ce.dispose(),Ke.dispose(),Se.dispose(),re.dispose(),me.dispose(),_e.dispose(),Me.dispose(),Xe.dispose(),Ne.dispose(),lt.dispose(),lt.removeEventListener("sessionstart",Mt),lt.removeEventListener("sessionend",nn),se&&(se.dispose(),se=null),Tn.stop()};function Fe(ce){ce.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Le(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;const ce=ye.autoReset,Pe=je.enabled,De=je.autoUpdate,qe=je.needsUpdate,$e=je.type;ut(),ye.autoReset=ce,je.enabled=Pe,je.autoUpdate=De,je.needsUpdate=qe,je.type=$e}function bt(ce){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ce.statusMessage)}function dt(ce){const Pe=ce.target;Pe.removeEventListener("dispose",dt),Nt(Pe)}function Nt(ce){_t(ce),Se.remove(ce)}function _t(ce){const Pe=Se.get(ce).programs;Pe!==void 0&&(Pe.forEach(function(De){Ne.releaseProgram(De)}),ce.isShaderMaterial&&Ne.releaseShaderCache(ce))}this.renderBufferDirect=function(ce,Pe,De,qe,$e,mt){Pe===null&&(Pe=Ee);const vt=$e.isMesh&&$e.matrixWorld.determinant()<0,wt=de(ce,Pe,De,qe,$e);pe.setMaterial(qe,vt);let nt=De.index,Xt=1;if(qe.wireframe===!0){if(nt=He.getWireframeAttribute(De),nt===void 0)return;Xt=2}const ft=De.drawRange,ve=De.attributes.position;let rt=ft.start*Xt,At=(ft.start+ft.count)*Xt;mt!==null&&(rt=Math.max(rt,mt.start*Xt),At=Math.min(At,(mt.start+mt.count)*Xt)),nt!==null?(rt=Math.max(rt,0),At=Math.min(At,nt.count)):ve!=null&&(rt=Math.max(rt,0),At=Math.min(At,ve.count));const Gt=At-rt;if(Gt<0||Gt===1/0)return;Me.setup($e,qe,wt,De,nt);let Wt,zt=et;if(nt!==null&&(Wt=Ge.get(nt),zt=Je,zt.setIndex(Wt)),$e.isMesh)qe.wireframe===!0?(pe.setLineWidth(qe.wireframeLinewidth*ae()),zt.setMode(Q.LINES)):zt.setMode(Q.TRIANGLES);else if($e.isLine){let Ut=qe.linewidth;Ut===void 0&&(Ut=1),pe.setLineWidth(Ut*ae()),$e.isLineSegments?zt.setMode(Q.LINES):$e.isLineLoop?zt.setMode(Q.LINE_LOOP):zt.setMode(Q.LINE_STRIP)}else $e.isPoints?zt.setMode(Q.POINTS):$e.isSprite&&zt.setMode(Q.TRIANGLES);if($e.isBatchedMesh)zt.renderMultiDraw($e._multiDrawStarts,$e._multiDrawCounts,$e._multiDrawCount);else if($e.isInstancedMesh)zt.renderInstances(rt,Gt,$e.count);else if(De.isInstancedBufferGeometry){const Ut=De._maxInstanceCount!==void 0?De._maxInstanceCount:1/0,pn=Math.min(De.instanceCount,Ut);zt.renderInstances(rt,Gt,pn)}else zt.render(rt,Gt)};function Lt(ce,Pe,De){ce.transparent===!0&&ce.side===bc&&ce.forceSinglePass===!1?(ce.side=xl,ce.needsUpdate=!0,sn(ce,Pe,De),ce.side=Nh,ce.needsUpdate=!0,sn(ce,Pe,De),ce.side=bc):sn(ce,Pe,De)}this.compile=function(ce,Pe,De=null){De===null&&(De=ce),v=Ke.get(De),v.init(),b.push(v),De.traverseVisible(function($e){$e.isLight&&$e.layers.test(Pe.layers)&&(v.pushLight($e),$e.castShadow&&v.pushShadow($e))}),ce!==De&&ce.traverseVisible(function($e){$e.isLight&&$e.layers.test(Pe.layers)&&(v.pushLight($e),$e.castShadow&&v.pushShadow($e))}),v.setupLights(y._useLegacyLights);const qe=new Set;return ce.traverse(function($e){const mt=$e.material;if(mt)if(Array.isArray(mt))for(let vt=0;vt<mt.length;vt++){const wt=mt[vt];Lt(wt,De,$e),qe.add(wt)}else Lt(mt,De,$e),qe.add(mt)}),b.pop(),v=null,qe},this.compileAsync=function(ce,Pe,De=null){const qe=this.compile(ce,Pe,De);return new Promise($e=>{function mt(){if(qe.forEach(function(vt){Se.get(vt).currentProgram.isReady()&&qe.delete(vt)}),qe.size===0){$e(ce);return}setTimeout(mt,10)}Ae.get("KHR_parallel_shader_compile")!==null?mt():setTimeout(mt,10)})};let Dt=null;function en(ce){Dt&&Dt(ce)}function Mt(){Tn.stop()}function nn(){Tn.start()}const Tn=new Aoe;Tn.setAnimationLoop(en),typeof self<"u"&&Tn.setContext(self),this.setAnimationLoop=function(ce){Dt=ce,lt.setAnimationLoop(ce),ce===null?Tn.stop():Tn.start()},lt.addEventListener("sessionstart",Mt),lt.addEventListener("sessionend",nn),this.render=function(ce,Pe){if(Pe!==void 0&&Pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;ce.matrixWorldAutoUpdate===!0&&ce.updateMatrixWorld(),Pe.parent===null&&Pe.matrixWorldAutoUpdate===!0&&Pe.updateMatrixWorld(),lt.enabled===!0&<.isPresenting===!0&&(lt.cameraAutoUpdate===!0&<.updateCamera(Pe),Pe=lt.getCamera()),ce.isScene===!0&&ce.onBeforeRender(y,ce,Pe,M),v=Ke.get(ce,b.length),v.init(),b.push(v),ie.multiplyMatrices(Pe.projectionMatrix,Pe.matrixWorldInverse),I.setFromProjectionMatrix(ie),te=this.localClippingEnabled,q=Qe.init(this.clippingPlanes,te),x=Ce.get(ce,g.length),x.init(),g.push(x),Fn(ce,Pe,0,y.sortObjects),x.finish(),y.sortObjects===!0&&x.sort(V,W),this.info.render.frame++,q===!0&&Qe.beginShadows();const De=v.state.shadowsArray;if(je.render(De,ce,Pe),q===!0&&Qe.endShadows(),this.info.autoReset===!0&&this.info.reset(),We.render(x,ce),v.setupLights(y._useLegacyLights),Pe.isArrayCamera){const qe=Pe.cameras;for(let $e=0,mt=qe.length;$e<mt;$e++){const vt=qe[$e];lr(x,ce,vt,vt.viewport)}}else lr(x,ce,Pe);M!==null&&(ee.updateMultisampleRenderTarget(M),ee.updateRenderTargetMipmap(M)),ce.isScene===!0&&ce.onAfterRender(y,ce,Pe),Me.resetDefaultState(),T=-1,C=null,b.pop(),b.length>0?v=b[b.length-1]:v=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function Fn(ce,Pe,De,qe){if(ce.visible===!1)return;if(ce.layers.test(Pe.layers)){if(ce.isGroup)De=ce.renderOrder;else if(ce.isLOD)ce.autoUpdate===!0&&ce.update(Pe);else if(ce.isLight)v.pushLight(ce),ce.castShadow&&v.pushShadow(ce);else if(ce.isSprite){if(!ce.frustumCulled||I.intersectsSprite(ce)){qe&&xe.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(ie);const vt=_e.update(ce),wt=ce.material;wt.visible&&x.push(ce,vt,wt,De,xe.z,null)}}else if((ce.isMesh||ce.isLine||ce.isPoints)&&(!ce.frustumCulled||I.intersectsObject(ce))){const vt=_e.update(ce),wt=ce.material;if(qe&&(ce.boundingSphere!==void 0?(ce.boundingSphere===null&&ce.computeBoundingSphere(),xe.copy(ce.boundingSphere.center)):(vt.boundingSphere===null&&vt.computeBoundingSphere(),xe.copy(vt.boundingSphere.center)),xe.applyMatrix4(ce.matrixWorld).applyMatrix4(ie)),Array.isArray(wt)){const nt=vt.groups;for(let Xt=0,ft=nt.length;Xt<ft;Xt++){const ve=nt[Xt],rt=wt[ve.materialIndex];rt&&rt.visible&&x.push(ce,vt,rt,De,xe.z,ve)}}else wt.visible&&x.push(ce,vt,wt,De,xe.z,null)}}const mt=ce.children;for(let vt=0,wt=mt.length;vt<wt;vt++)Fn(mt[vt],Pe,De,qe)}function lr(ce,Pe,De,qe){const $e=ce.opaque,mt=ce.transmissive,vt=ce.transparent;v.setupLightsView(De),q===!0&&Qe.setGlobalState(y.clippingPlanes,De),mt.length>0&&mr($e,mt,Pe,De),qe&&pe.viewport(R.copy(qe)),$e.length>0&&gr($e,Pe,De),mt.length>0&&gr(mt,Pe,De),vt.length>0&&gr(vt,Pe,De),pe.buffers.depth.setTest(!0),pe.buffers.depth.setMask(!0),pe.buffers.color.setMask(!0),pe.setPolygonOffset(!1)}function mr(ce,Pe,De,qe){if((De.isScene===!0?De.overrideMaterial:null)!==null)return;const mt=K.isWebGL2;se===null&&(se=new Yo(1,1,{generateMipmaps:!0,type:Ae.has("EXT_color_buffer_half_float")?Na:Tc,minFilter:Mh,samples:mt?4:0})),y.getDrawingBufferSize(le),mt?se.setSize(le.x,le.y):se.setSize($T(le.x),$T(le.y));const vt=y.getRenderTarget();y.setRenderTarget(se),y.getClearColor(G),B=y.getClearAlpha(),B<1&&y.setClearColor(16777215,.5),y.clear();const wt=y.toneMapping;y.toneMapping=wh,gr(ce,De,qe),ee.updateMultisampleRenderTarget(se),ee.updateRenderTargetMipmap(se);let nt=!1;for(let Xt=0,ft=Pe.length;Xt<ft;Xt++){const ve=Pe[Xt],rt=ve.object,At=ve.geometry,Gt=ve.material,Wt=ve.group;if(Gt.side===bc&&rt.layers.test(qe.layers)){const zt=Gt.side;Gt.side=xl,Gt.needsUpdate=!0,br(rt,De,qe,At,Gt,Wt),Gt.side=zt,Gt.needsUpdate=!0,nt=!0}}nt===!0&&(ee.updateMultisampleRenderTarget(se),ee.updateRenderTargetMipmap(se)),y.setRenderTarget(vt),y.setClearColor(G,B),y.toneMapping=wt}function gr(ce,Pe,De){const qe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let $e=0,mt=ce.length;$e<mt;$e++){const vt=ce[$e],wt=vt.object,nt=vt.geometry,Xt=qe===null?vt.material:qe,ft=vt.group;wt.layers.test(De.layers)&&br(wt,Pe,De,nt,Xt,ft)}}function br(ce,Pe,De,qe,$e,mt){ce.onBeforeRender(y,Pe,De,qe,$e,mt),ce.modelViewMatrix.multiplyMatrices(De.matrixWorldInverse,ce.matrixWorld),ce.normalMatrix.getNormalMatrix(ce.modelViewMatrix),$e.onBeforeRender(y,Pe,De,qe,ce,mt),$e.transparent===!0&&$e.side===bc&&$e.forceSinglePass===!1?($e.side=xl,$e.needsUpdate=!0,y.renderBufferDirect(De,Pe,qe,$e,ce,mt),$e.side=Nh,$e.needsUpdate=!0,y.renderBufferDirect(De,Pe,qe,$e,ce,mt),$e.side=bc):y.renderBufferDirect(De,Pe,qe,$e,ce,mt),ce.onAfterRender(y,Pe,De,qe,$e,mt)}function sn(ce,Pe,De){Pe.isScene!==!0&&(Pe=Ee);const qe=Se.get(ce),$e=v.state.lights,mt=v.state.shadowsArray,vt=$e.state.version,wt=Ne.getParameters(ce,$e.state,mt,Pe,De),nt=Ne.getProgramCacheKey(wt);let Xt=qe.programs;qe.environment=ce.isMeshStandardMaterial?Pe.environment:null,qe.fog=Pe.fog,qe.envMap=(ce.isMeshStandardMaterial?me:re).get(ce.envMap||qe.environment),Xt===void 0&&(ce.addEventListener("dispose",dt),Xt=new Map,qe.programs=Xt);let ft=Xt.get(nt);if(ft!==void 0){if(qe.currentProgram===ft&&qe.lightsStateVersion===vt)return yi(ce,wt),ft}else wt.uniforms=Ne.getUniforms(ce),ce.onBuild(De,wt,y),ce.onBeforeCompile(wt,y),ft=Ne.acquireProgram(wt,nt),Xt.set(nt,ft),qe.uniforms=wt.uniforms;const ve=qe.uniforms;return(!ce.isShaderMaterial&&!ce.isRawShaderMaterial||ce.clipping===!0)&&(ve.clippingPlanes=Qe.uniform),yi(ce,wt),qe.needsLights=Ye(ce),qe.lightsStateVersion=vt,qe.needsLights&&(ve.ambientLightColor.value=$e.state.ambient,ve.lightProbe.value=$e.state.probe,ve.directionalLights.value=$e.state.directional,ve.directionalLightShadows.value=$e.state.directionalShadow,ve.spotLights.value=$e.state.spot,ve.spotLightShadows.value=$e.state.spotShadow,ve.rectAreaLights.value=$e.state.rectArea,ve.ltc_1.value=$e.state.rectAreaLTC1,ve.ltc_2.value=$e.state.rectAreaLTC2,ve.pointLights.value=$e.state.point,ve.pointLightShadows.value=$e.state.pointShadow,ve.hemisphereLights.value=$e.state.hemi,ve.directionalShadowMap.value=$e.state.directionalShadowMap,ve.directionalShadowMatrix.value=$e.state.directionalShadowMatrix,ve.spotShadowMap.value=$e.state.spotShadowMap,ve.spotLightMatrix.value=$e.state.spotLightMatrix,ve.spotLightMap.value=$e.state.spotLightMap,ve.pointShadowMap.value=$e.state.pointShadowMap,ve.pointShadowMatrix.value=$e.state.pointShadowMatrix),qe.currentProgram=ft,qe.uniformsList=null,ft}function Mr(ce){if(ce.uniformsList===null){const Pe=ce.currentProgram.getUniforms();ce.uniformsList=fN.seqWithValue(Pe.seq,ce.uniforms)}return ce.uniformsList}function yi(ce,Pe){const De=Se.get(ce);De.outputColorSpace=Pe.outputColorSpace,De.batching=Pe.batching,De.instancing=Pe.instancing,De.instancingColor=Pe.instancingColor,De.skinning=Pe.skinning,De.morphTargets=Pe.morphTargets,De.morphNormals=Pe.morphNormals,De.morphColors=Pe.morphColors,De.morphTargetsCount=Pe.morphTargetsCount,De.numClippingPlanes=Pe.numClippingPlanes,De.numIntersection=Pe.numClipIntersection,De.vertexAlphas=Pe.vertexAlphas,De.vertexTangents=Pe.vertexTangents,De.toneMapping=Pe.toneMapping}function de(ce,Pe,De,qe,$e){Pe.isScene!==!0&&(Pe=Ee),ee.resetTextureUnits();const mt=Pe.fog,vt=qe.isMeshStandardMaterial?Pe.environment:null,wt=M===null?y.outputColorSpace:M.isXRRenderTarget===!0?M.texture.colorSpace:Pc,nt=(qe.isMeshStandardMaterial?me:re).get(qe.envMap||vt),Xt=qe.vertexColors===!0&&!!De.attributes.color&&De.attributes.color.itemSize===4,ft=!!De.attributes.tangent&&(!!qe.normalMap||qe.anisotropy>0),ve=!!De.morphAttributes.position,rt=!!De.morphAttributes.normal,At=!!De.morphAttributes.color;let Gt=wh;qe.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(Gt=y.toneMapping);const Wt=De.morphAttributes.position||De.morphAttributes.normal||De.morphAttributes.color,zt=Wt!==void 0?Wt.length:0,Ut=Se.get(qe),pn=v.state.lights;if(q===!0&&(te===!0||ce!==C)){const zn=ce===C&&qe.id===T;Qe.setState(qe,ce,zn)}let an=!1;qe.version===Ut.__version?(Ut.needsLights&&Ut.lightsStateVersion!==pn.state.version||Ut.outputColorSpace!==wt||$e.isBatchedMesh&&Ut.batching===!1||!$e.isBatchedMesh&&Ut.batching===!0||$e.isInstancedMesh&&Ut.instancing===!1||!$e.isInstancedMesh&&Ut.instancing===!0||$e.isSkinnedMesh&&Ut.skinning===!1||!$e.isSkinnedMesh&&Ut.skinning===!0||$e.isInstancedMesh&&Ut.instancingColor===!0&&$e.instanceColor===null||$e.isInstancedMesh&&Ut.instancingColor===!1&&$e.instanceColor!==null||Ut.envMap!==nt||qe.fog===!0&&Ut.fog!==mt||Ut.numClippingPlanes!==void 0&&(Ut.numClippingPlanes!==Qe.numPlanes||Ut.numIntersection!==Qe.numIntersection)||Ut.vertexAlphas!==Xt||Ut.vertexTangents!==ft||Ut.morphTargets!==ve||Ut.morphNormals!==rt||Ut.morphColors!==At||Ut.toneMapping!==Gt||K.isWebGL2===!0&&Ut.morphTargetsCount!==zt)&&(an=!0):(an=!0,Ut.__version=qe.version);let Cn=Ut.currentProgram;an===!0&&(Cn=sn(qe,Pe,$e));let on=!1,Hr=!1,wr=!1;const Jn=Cn.getUniforms(),Zn=Ut.uniforms;if(pe.useProgram(Cn.program)&&(on=!0,Hr=!0,wr=!0),qe.id!==T&&(T=qe.id,Hr=!0),on||C!==ce){Jn.setValue(Q,"projectionMatrix",ce.projectionMatrix),Jn.setValue(Q,"viewMatrix",ce.matrixWorldInverse);const zn=Jn.map.cameraPosition;zn!==void 0&&zn.setValue(Q,xe.setFromMatrixPosition(ce.matrixWorld)),K.logarithmicDepthBuffer&&Jn.setValue(Q,"logDepthBufFC",2/(Math.log(ce.far+1)/Math.LN2)),(qe.isMeshPhongMaterial||qe.isMeshToonMaterial||qe.isMeshLambertMaterial||qe.isMeshBasicMaterial||qe.isMeshStandardMaterial||qe.isShaderMaterial)&&Jn.setValue(Q,"isOrthographic",ce.isOrthographicCamera===!0),C!==ce&&(C=ce,Hr=!0,wr=!0)}if($e.isSkinnedMesh){Jn.setOptional(Q,$e,"bindMatrix"),Jn.setOptional(Q,$e,"bindMatrixInverse");const zn=$e.skeleton;zn&&(K.floatVertexTextures?(zn.boneTexture===null&&zn.computeBoneTexture(),Jn.setValue(Q,"boneTexture",zn.boneTexture,ee)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}$e.isBatchedMesh&&(Jn.setOptional(Q,$e,"batchingTexture"),Jn.setValue(Q,"batchingTexture",$e._matricesTexture,ee));const Sr=De.morphAttributes;if((Sr.position!==void 0||Sr.normal!==void 0||Sr.color!==void 0&&K.isWebGL2===!0)&&xt.update($e,De,Cn),(Hr||Ut.receiveShadow!==$e.receiveShadow)&&(Ut.receiveShadow=$e.receiveShadow,Jn.setValue(Q,"receiveShadow",$e.receiveShadow)),qe.isMeshGouraudMaterial&&qe.envMap!==null&&(Zn.envMap.value=nt,Zn.flipEnvMap.value=nt.isCubeTexture&&nt.isRenderTargetTexture===!1?-1:1),Hr&&(Jn.setValue(Q,"toneMappingExposure",y.toneMappingExposure),Ut.needsLights&&ke(Zn,wr),mt&&qe.fog===!0&&ue.refreshFogUniforms(Zn,mt),ue.refreshMaterialUniforms(Zn,qe,Z,U,se),fN.upload(Q,Mr(Ut),Zn,ee)),qe.isShaderMaterial&&qe.uniformsNeedUpdate===!0&&(fN.upload(Q,Mr(Ut),Zn,ee),qe.uniformsNeedUpdate=!1),qe.isSpriteMaterial&&Jn.setValue(Q,"center",$e.center),Jn.setValue(Q,"modelViewMatrix",$e.modelViewMatrix),Jn.setValue(Q,"normalMatrix",$e.normalMatrix),Jn.setValue(Q,"modelMatrix",$e.matrixWorld),qe.isShaderMaterial||qe.isRawShaderMaterial){const zn=qe.uniformsGroups;for(let Ln=0,rr=zn.length;Ln<rr;Ln++)if(K.isWebGL2){const Cs=zn[Ln];Xe.update(Cs,Cn),Xe.bind(Cs,Cn)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Cn}function ke(ce,Pe){ce.ambientLightColor.needsUpdate=Pe,ce.lightProbe.needsUpdate=Pe,ce.directionalLights.needsUpdate=Pe,ce.directionalLightShadows.needsUpdate=Pe,ce.pointLights.needsUpdate=Pe,ce.pointLightShadows.needsUpdate=Pe,ce.spotLights.needsUpdate=Pe,ce.spotLightShadows.needsUpdate=Pe,ce.rectAreaLights.needsUpdate=Pe,ce.hemisphereLights.needsUpdate=Pe}function Ye(ce){return ce.isMeshLambertMaterial||ce.isMeshToonMaterial||ce.isMeshPhongMaterial||ce.isMeshStandardMaterial||ce.isShadowMaterial||ce.isShaderMaterial&&ce.lights===!0}this.getActiveCubeFace=function(){return A},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(ce,Pe,De){Se.get(ce.texture).__webglTexture=Pe,Se.get(ce.depthTexture).__webglTexture=De;const qe=Se.get(ce);qe.__hasExternalTextures=!0,qe.__hasExternalTextures&&(qe.__autoAllocateDepthBuffer=De===void 0,qe.__autoAllocateDepthBuffer||Ae.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),qe.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(ce,Pe){const De=Se.get(ce);De.__webglFramebuffer=Pe,De.__useDefaultFramebuffer=Pe===void 0},this.setRenderTarget=function(ce,Pe=0,De=0){M=ce,A=Pe,k=De;let qe=!0,$e=null,mt=!1,vt=!1;if(ce){const nt=Se.get(ce);nt.__useDefaultFramebuffer!==void 0?(pe.bindFramebuffer(Q.FRAMEBUFFER,null),qe=!1):nt.__webglFramebuffer===void 0?ee.setupRenderTarget(ce):nt.__hasExternalTextures&&ee.rebindTextures(ce,Se.get(ce.texture).__webglTexture,Se.get(ce.depthTexture).__webglTexture);const Xt=ce.texture;(Xt.isData3DTexture||Xt.isDataArrayTexture||Xt.isCompressedArrayTexture)&&(vt=!0);const ft=Se.get(ce).__webglFramebuffer;ce.isWebGLCubeRenderTarget?(Array.isArray(ft[Pe])?$e=ft[Pe][De]:$e=ft[Pe],mt=!0):K.isWebGL2&&ce.samples>0&&ee.useMultisampledRTT(ce)===!1?$e=Se.get(ce).__webglMultisampledFramebuffer:Array.isArray(ft)?$e=ft[De]:$e=ft,R.copy(ce.viewport),P.copy(ce.scissor),j=ce.scissorTest}else R.copy(O).multiplyScalar(Z).floor(),P.copy(Y).multiplyScalar(Z).floor(),j=z;if(pe.bindFramebuffer(Q.FRAMEBUFFER,$e)&&K.drawBuffers&&qe&&pe.drawBuffers(ce,$e),pe.viewport(R),pe.scissor(P),pe.setScissorTest(j),mt){const nt=Se.get(ce.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+Pe,nt.__webglTexture,De)}else if(vt){const nt=Se.get(ce.texture),Xt=Pe||0;Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,nt.__webglTexture,De||0,Xt)}T=-1},this.readRenderTargetPixels=function(ce,Pe,De,qe,$e,mt,vt){if(!(ce&&ce.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let wt=Se.get(ce).__webglFramebuffer;if(ce.isWebGLCubeRenderTarget&&vt!==void 0&&(wt=wt[vt]),wt){pe.bindFramebuffer(Q.FRAMEBUFFER,wt);try{const nt=ce.texture,Xt=nt.format,ft=nt.type;if(Xt!==fa&&Ze.convert(Xt)!==Q.getParameter(Q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ve=ft===Na&&(Ae.has("EXT_color_buffer_half_float")||K.isWebGL2&&Ae.has("EXT_color_buffer_float"));if(ft!==Tc&&Ze.convert(ft)!==Q.getParameter(Q.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ft===Zs&&(K.isWebGL2||Ae.has("OES_texture_float")||Ae.has("WEBGL_color_buffer_float")))&&!ve){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Pe>=0&&Pe<=ce.width-qe&&De>=0&&De<=ce.height-$e&&Q.readPixels(Pe,De,qe,$e,Ze.convert(Xt),Ze.convert(ft),mt)}finally{const nt=M!==null?Se.get(M).__webglFramebuffer:null;pe.bindFramebuffer(Q.FRAMEBUFFER,nt)}}},this.copyFramebufferToTexture=function(ce,Pe,De=0){const qe=Math.pow(2,-De),$e=Math.floor(Pe.image.width*qe),mt=Math.floor(Pe.image.height*qe);ee.setTexture2D(Pe,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,De,0,0,ce.x,ce.y,$e,mt),pe.unbindTexture()},this.copyTextureToTexture=function(ce,Pe,De,qe=0){const $e=Pe.image.width,mt=Pe.image.height,vt=Ze.convert(De.format),wt=Ze.convert(De.type);ee.setTexture2D(De,0),Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,De.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,De.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,De.unpackAlignment),Pe.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,qe,ce.x,ce.y,$e,mt,vt,wt,Pe.image.data):Pe.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,qe,ce.x,ce.y,Pe.mipmaps[0].width,Pe.mipmaps[0].height,vt,Pe.mipmaps[0].data):Q.texSubImage2D(Q.TEXTURE_2D,qe,ce.x,ce.y,vt,wt,Pe.image),qe===0&&De.generateMipmaps&&Q.generateMipmap(Q.TEXTURE_2D),pe.unbindTexture()},this.copyTextureToTexture3D=function(ce,Pe,De,qe,$e=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const mt=ce.max.x-ce.min.x+1,vt=ce.max.y-ce.min.y+1,wt=ce.max.z-ce.min.z+1,nt=Ze.convert(qe.format),Xt=Ze.convert(qe.type);let ft;if(qe.isData3DTexture)ee.setTexture3D(qe,0),ft=Q.TEXTURE_3D;else if(qe.isDataArrayTexture||qe.isCompressedArrayTexture)ee.setTexture2DArray(qe,0),ft=Q.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,qe.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,qe.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,qe.unpackAlignment);const ve=Q.getParameter(Q.UNPACK_ROW_LENGTH),rt=Q.getParameter(Q.UNPACK_IMAGE_HEIGHT),At=Q.getParameter(Q.UNPACK_SKIP_PIXELS),Gt=Q.getParameter(Q.UNPACK_SKIP_ROWS),Wt=Q.getParameter(Q.UNPACK_SKIP_IMAGES),zt=De.isCompressedTexture?De.mipmaps[$e]:De.image;Q.pixelStorei(Q.UNPACK_ROW_LENGTH,zt.width),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,zt.height),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,ce.min.x),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,ce.min.y),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,ce.min.z),De.isDataTexture||De.isData3DTexture?Q.texSubImage3D(ft,$e,Pe.x,Pe.y,Pe.z,mt,vt,wt,nt,Xt,zt.data):De.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Q.compressedTexSubImage3D(ft,$e,Pe.x,Pe.y,Pe.z,mt,vt,wt,nt,zt.data)):Q.texSubImage3D(ft,$e,Pe.x,Pe.y,Pe.z,mt,vt,wt,nt,Xt,zt),Q.pixelStorei(Q.UNPACK_ROW_LENGTH,ve),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,rt),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,At),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,Gt),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,Wt),$e===0&&qe.generateMipmaps&&Q.generateMipmap(ft),pe.unbindTexture()},this.initTexture=function(ce){ce.isCubeTexture?ee.setTextureCube(ce,0):ce.isData3DTexture?ee.setTexture3D(ce,0):ce.isDataArrayTexture||ce.isCompressedArrayTexture?ee.setTexture2DArray(ce,0):ee.setTexture2D(ce,0),pe.unbindTexture()},this.resetState=function(){A=0,k=0,M=null,pe.reset(),Me.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hd}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===CM?"display-p3":"srgb",n.unpackColorSpace=_i.workingColorSpace===MA?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===os?Nm:Bz}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Nm?os:Pc}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class joe extends jM{}joe.prototype.isWebGL1Renderer=!0;class PM{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Qt(e),this.density=n}clone(){return new PM(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class LM{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new Qt(e),this.near=n,this.far=r}clone(){return new LM(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class DA extends Xr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class BA{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=SS,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Mc()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=n.array[r+i];return this}set(e,n=0){return this.array.set(e,n),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Mc()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(n,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=Mc()),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 sl=new Ie;class Zm{constructor(e,n,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=n,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 n=0,r=this.data.count;n<r;n++)sl.fromBufferAttribute(this,n),sl.applyMatrix4(e),this.setXYZ(n,sl.x,sl.y,sl.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)sl.fromBufferAttribute(this,n),sl.applyNormalMatrix(e),this.setXYZ(n,sl.x,sl.y,sl.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)sl.fromBufferAttribute(this,n),sl.transformDirection(e),this.setXYZ(n,sl.x,sl.y,sl.z);return this}setX(e,n){return this.normalized&&(n=Tr(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=Tr(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=Tr(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=Tr(n,this.array)),this.data.array[e*this.data.stride+this.offset+3]=n,this}getX(e){let n=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(n=Gl(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=Gl(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=Gl(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=Gl(n,this.array)),n}setXY(e,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this}setXYZ(e,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,n,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(n=Tr(n,this.array),r=Tr(r,this.array),i=Tr(i,this.array),s=Tr(s,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)n.push(this.data.array[i+s])}return new Yr(new this.array.constructor(n),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 Zm(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)n.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:n,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class qz extends Ta{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Qt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Vv;const r_=new Ie,Wv=new Ie,$v=new Ie,Kv=new Rt,i_=new Rt,Poe=new Wn,Lk=new Ie,s_=new Ie,Ik=new Ie,UW=new Rt,oP=new Rt,HW=new Rt;class Loe extends Xr{constructor(e=new qz){if(super(),this.isSprite=!0,this.type="Sprite",Vv===void 0){Vv=new or;const n=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new BA(n,5);Vv.setIndex([0,1,2,0,2,3]),Vv.setAttribute("position",new Zm(r,3,0,!1)),Vv.setAttribute("uv",new Zm(r,2,3,!1))}this.geometry=Vv,this.material=e,this.center=new Rt(.5,.5)}raycast(e,n){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Wv.setFromMatrixScale(this.matrixWorld),Poe.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),$v.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Wv.multiplyScalar(-$v.z);const r=this.material.rotation;let i,s;r!==0&&(s=Math.cos(r),i=Math.sin(r));const a=this.center;Dk(Lk.set(-.5,-.5,0),$v,a,Wv,i,s),Dk(s_.set(.5,-.5,0),$v,a,Wv,i,s),Dk(Ik.set(.5,.5,0),$v,a,Wv,i,s),UW.set(0,0),oP.set(1,0),HW.set(1,1);let o=e.ray.intersectTriangle(Lk,s_,Ik,!1,r_);if(o===null&&(Dk(s_.set(-.5,.5,0),$v,a,Wv,i,s),oP.set(0,1),o=e.ray.intersectTriangle(Lk,Ik,s_,!1,r_),o===null))return;const l=e.ray.origin.distanceTo(r_);l<e.near||l>e.far||n.push({distance:l,point:r_.clone(),uv:Hl.getInterpolation(r_,Lk,s_,Ik,UW,oP,HW,new Rt),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Dk(t,e,n,r,i,s){Kv.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(i_.x=s*Kv.x-i*Kv.y,i_.y=i*Kv.x+s*Kv.y):i_.copy(Kv),t.copy(e),t.x+=i_.x,t.y+=i_.y,t.applyMatrix4(Poe)}const Bk=new Ie,GW=new Ie;class Ioe extends Xr{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let r=0,i=n.length;r<i;r++){const s=n[r];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,n=0,r=0){n=Math.abs(n);const i=this.levels;let s;for(s=0;s<i.length&&!(n<i[s].distance);s++);return i.splice(s,0,{distance:n,hysteresis:r,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const n=this.levels;if(n.length>0){let r,i;for(r=1,i=n.length;r<i;r++){let s=n[r].distance;if(n[r].object.visible&&(s-=s*n[r].hysteresis),e<s)break}return n[r-1].object}return null}raycast(e,n){if(this.levels.length>0){Bk.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Bk);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Bk.setFromMatrixPosition(e.matrixWorld),GW.setFromMatrixPosition(this.matrixWorld);const r=Bk.distanceTo(GW)/e.zoom;n[0].object.visible=!0;let i,s;for(i=1,s=n.length;i<s;i++){let a=n[i].distance;if(n[i].object.visible&&(a-=a*n[i].hysteresis),r>=a)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<s;i++)n[i].object.visible=!1}}toJSON(e){const n=super.toJSON(e);this.autoUpdate===!1&&(n.object.autoUpdate=!1),n.object.levels=[];const r=this.levels;for(let i=0,s=r.length;i<s;i++){const a=r[i];n.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return n}}const VW=new Ie,WW=new gi,$W=new gi,t8e=new Ie,KW=new Wn,Fk=new Ie,lP=new Xa,qW=new Wn,cP=new Dx;class Xz extends Li{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=sD,this.bindMatrix=new Wn,this.bindMatrixInverse=new Wn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ma),this.boundingBox.makeEmpty();const n=e.getAttribute("position");for(let r=0;r<n.count;r++)this.getVertexPosition(r,Fk),this.boundingBox.expandByPoint(Fk)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Xa),this.boundingSphere.makeEmpty();const n=e.getAttribute("position");for(let r=0;r<n.count;r++)this.getVertexPosition(r,Fk),this.boundingSphere.expandByPoint(Fk)}copy(e,n){return super.copy(e,n),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,n){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),lP.copy(this.boundingSphere),lP.applyMatrix4(i),e.ray.intersectsSphere(lP)!==!1&&(qW.copy(i).invert(),cP.copy(e.ray).applyMatrix4(qW),!(this.boundingBox!==null&&cP.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,n,cP)))}getVertexPosition(e,n){return super.getVertexPosition(e,n),this.applyBoneTransform(e,n),n}bind(e,n){this.skeleton=e,n===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.copy(n).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new gi,n=this.geometry.attributes.skinWeight;for(let r=0,i=n.count;r<i;r++){e.fromBufferAttribute(n,r);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),n.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===sD?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Qae?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,n){const r=this.skeleton,i=this.geometry;WW.fromBufferAttribute(i.attributes.skinIndex,e),$W.fromBufferAttribute(i.attributes.skinWeight,e),VW.copy(n).applyMatrix4(this.bindMatrix),n.set(0,0,0);for(let s=0;s<4;s++){const a=$W.getComponent(s);if(a!==0){const o=WW.getComponent(s);KW.multiplyMatrices(r.bones[o].matrixWorld,r.boneInverses[o]),n.addScaledVector(t8e.copy(VW).applyMatrix4(KW),a)}}return n.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,n){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,n)}}class IM extends Xr{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Tm extends ui{constructor(e=null,n=1,r=1,i,s,a,o,l,u=Bs,d=Bs,h,p){super(null,a,o,l,u,d,i,s,h,p),this.isDataTexture=!0,this.image={data:e,width:n,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const XW=new Wn,n8e=new Wn;class FA{constructor(e=[],n=[]){this.uuid=Mc(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,n=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),n.length===0)this.calculateInverses();else if(e.length!==n.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new Wn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const r=new Wn;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,n=this.bones.length;e<n;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,n=this.bones.length;e<n;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,n=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let s=0,a=e.length;s<a;s++){const o=e[s]?e[s].matrixWorld:n8e;XW.multiplyMatrices(o,n[s]),XW.toArray(r,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new FA(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4);n.set(this.boneMatrices);const r=new Tm(n,e,e,fa,Zs);return r.needsUpdate=!0,this.boneMatrices=n,this.boneTexture=r,this}getBoneByName(e){for(let n=0,r=this.bones.length;n<r;n++){const i=this.bones[n];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,n){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const s=e.bones[r];let a=n[s];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),a=new IM),this.bones.push(a),this.boneInverses.push(new Wn().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const n=this.bones,r=this.boneInverses;for(let i=0,s=n.length;i<s;i++){const a=n[i];e.bones.push(a.uuid);const o=r[i];e.boneInverses.push(o.toArray())}return e}}class Qm extends Yr{constructor(e,n,r,i=1){super(e,n,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 qv=new Wn,YW=new Wn,Ok=[],JW=new ma,r8e=new Wn,a_=new Li,o_=new Xa;class Yz extends Li{constructor(e,n,r){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new Qm(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,r8e)}computeBoundingBox(){const e=this.geometry,n=this.count;this.boundingBox===null&&(this.boundingBox=new ma),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<n;r++)this.getMatrixAt(r,qv),JW.copy(e.boundingBox).applyMatrix4(qv),this.boundingBox.union(JW)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Xa),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<n;r++)this.getMatrixAt(r,qv),o_.copy(e.boundingSphere).applyMatrix4(qv),this.boundingSphere.union(o_)}copy(e,n){return super.copy(e,n),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,n){n.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,n){n.fromArray(this.instanceMatrix.array,e*16)}raycast(e,n){const r=this.matrixWorld,i=this.count;if(a_.geometry=this.geometry,a_.material=this.material,a_.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),o_.copy(this.boundingSphere),o_.applyMatrix4(r),e.ray.intersectsSphere(o_)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,qv),YW.multiplyMatrices(r,qv),a_.matrixWorld=YW,a_.raycast(e,Ok);for(let a=0,o=Ok.length;a<o;a++){const l=Ok[a];l.instanceId=s,l.object=this,n.push(l)}Ok.length=0}}setColorAt(e,n){this.instanceColor===null&&(this.instanceColor=new Qm(new Float32Array(this.instanceMatrix.count*3),3)),n.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,n){n.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function i8e(t,e){return t.z-e.z}function s8e(t,e){return e.z-t.z}class a8e{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,n){const r=this.pool,i=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1});const s=r[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=n}reset(){this.list.length=0,this.index=0}}const Xv="batchId",Sp=new Wn,ZW=new Wn,o8e=new Wn,QW=new Wn,uP=new LA,zk=new ma,Ug=new Xa,l_=new Ie,dP=new a8e,Oo=new Li,Uk=[];function l8e(t,e,n=0){const r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const i=t.count;for(let s=0;s<i;s++)for(let a=0;a<r;a++)e.setComponent(s+n,a,t.getComponent(s,a))}else e.array.set(t.array,n*r);e.needsUpdate=!0}class Doe extends Li{get maxGeometryCount(){return this._maxGeometryCount}constructor(e,n,r=n*2,i){super(new or,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=e,this._maxVertexCount=n,this._maxIndexCount=r,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let e=Math.sqrt(this._maxGeometryCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4),r=new Tm(n,e,e,fa,Zs);this._matricesTexture=r}_initializeGeometry(e){const n=this.geometry,r=this._maxVertexCount,i=this._maxGeometryCount,s=this._maxIndexCount;if(this._geometryInitialized===!1){for(const o in e.attributes){const l=e.getAttribute(o),{array:u,itemSize:d,normalized:h}=l,p=new u.constructor(r*d),f=new l.constructor(p,d,h);f.setUsage(l.usage),n.setAttribute(o,f)}if(e.getIndex()!==null){const o=r>65536?new Uint32Array(s):new Uint16Array(s);n.setIndex(new Yr(o,1))}const a=i>65536?new Uint32Array(r):new Uint16Array(r);n.setAttribute(Xv,new Yr(a,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(Xv))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Xv}"`);const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in n.attributes){if(r===Xv)continue;if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),s=n.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ma);const e=this._geometryCount,n=this.boundingBox,r=this._active;n.makeEmpty();for(let i=0;i<e;i++)r[i]!==!1&&(this.getMatrixAt(i,Sp),this.getBoundingBoxAt(i,zk).applyMatrix4(Sp),n.union(zk))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Xa);const e=this._geometryCount,n=this.boundingSphere,r=this._active;n.makeEmpty();for(let i=0;i<e;i++)r[i]!==!1&&(this.getMatrixAt(i,Sp),this.getBoundingSphereAt(i,Ug).applyMatrix4(Sp),n.union(Ug))}addGeometry(e,n=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const a=this._reservedRanges,o=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=a[a.length-1]),n===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=n,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),d=u!==null;if(d&&(r===-1?i.indexCount=u.count:i.indexCount=r,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,p=this._active,f=this._matricesTexture,m=this._matricesTexture.image.data;h.push(!0),p.push(!0);const x=this._geometryCount;this._geometryCount++,o8e.toArray(m,x*16),f.needsUpdate=!0,a.push(i),o.push({start:d?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new ma,sphereInitialized:!1,sphere:new Xa});const v=this.geometry.getAttribute(Xv);for(let g=0;g<i.vertexCount;g++)v.setX(i.vertexStart+g,x);return v.needsUpdate=!0,this.setGeometryAt(x,e),x}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const r=this.geometry,i=r.getIndex()!==null,s=r.getIndex(),a=n.getIndex(),o=this._reservedRanges[e];if(i&&a.count>o.indexCount||n.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,u=o.vertexCount;for(const f in r.attributes){if(f===Xv)continue;const m=n.getAttribute(f),x=r.getAttribute(f);l8e(m,x,l);const v=m.itemSize;for(let g=m.count,b=u;g<b;g++){const y=l+g;for(let S=0;S<v;S++)x.setComponent(y,S,0)}x.needsUpdate=!0}if(i){const f=o.indexStart;for(let m=0;m<a.count;m++)s.setX(f+m,l+a.getX(m));for(let m=a.count,x=o.indexCount;m<x;m++)s.setX(f+m,l);s.needsUpdate=!0}const d=this._bounds[e];n.boundingBox!==null?(d.box.copy(n.boundingBox),d.boxInitialized=!0):d.boxInitialized=!1,n.boundingSphere!==null?(d.sphere.copy(n.boundingSphere),d.sphereInitialized=!0):d.sphereInitialized=!1;const h=this._drawRanges[e],p=n.getAttribute("position");return h.count=i?a.count:p.count,this._visibilityChanged=!0,e}deleteGeometry(e){const n=this._active;return e>=n.length||n[e]===!1?this:(n[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,n){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.box,a=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const o=a.index,l=a.attributes.position,u=this._drawRanges[e];for(let d=u.start,h=u.start+u.count;d<h;d++){let p=d;o&&(p=o.getX(p)),s.expandByPoint(l_.fromBufferAttribute(l,p))}i.boxInitialized=!0}return n.copy(s),n}getBoundingSphereAt(e,n){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.sphere,a=this.geometry;if(i.sphereInitialized===!1){s.makeEmpty(),this.getBoundingBoxAt(e,zk),zk.getCenter(s.center);const o=a.index,l=a.attributes.position,u=this._drawRanges[e];let d=0;for(let h=u.start,p=u.start+u.count;h<p;h++){let f=h;o&&(f=o.getX(f)),l_.fromBufferAttribute(l,f),d=Math.max(d,s.center.distanceToSquared(l_))}s.radius=Math.sqrt(d),i.sphereInitialized=!0}return n.copy(s),n}setMatrixAt(e,n){const r=this._active,i=this._matricesTexture,s=this._matricesTexture.image.data,a=this._geometryCount;return e>=a||r[e]===!1?this:(n.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,n){const r=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||r[e]===!1?null:n.fromArray(i,e*16)}setVisibleAt(e,n){const r=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||r[e]===n?this:(r[e]=n,this._visibilityChanged=!0,this)}getVisibleAt(e){const n=this._visibility,r=this._active,i=this._geometryCount;return e>=i||r[e]===!1?!1:n[e]}raycast(e,n){const r=this._visibility,i=this._active,s=this._drawRanges,a=this._geometryCount,o=this.matrixWorld,l=this.geometry;Oo.material=this.material,Oo.geometry.index=l.index,Oo.geometry.attributes=l.attributes,Oo.geometry.boundingBox===null&&(Oo.geometry.boundingBox=new ma),Oo.geometry.boundingSphere===null&&(Oo.geometry.boundingSphere=new Xa);for(let u=0;u<a;u++){if(!r[u]||!i[u])continue;const d=s[u];Oo.geometry.setDrawRange(d.start,d.count),this.getMatrixAt(u,Oo.matrixWorld).premultiply(o),this.getBoundingBoxAt(u,Oo.geometry.boundingBox),this.getBoundingSphereAt(u,Oo.geometry.boundingSphere),Oo.raycast(e,Uk);for(let h=0,p=Uk.length;h<p;h++){const f=Uk[h];f.object=this,f.batchId=u,n.push(f)}Uk.length=0}Oo.material=null,Oo.geometry.index=null,Oo.geometry.attributes={},Oo.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._drawRanges=e._drawRanges.map(n=>({...n})),this._reservedRanges=e._reservedRanges.map(n=>({...n})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(n=>({boxInitialized:n.boxInitialized,box:n.box.clone(),sphereInitialized:n.sphereInitialized,sphere:n.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,n,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=i.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,l=this._visibility,u=this._multiDrawStarts,d=this._multiDrawCounts,h=this._drawRanges,p=this.perObjectFrustumCulled;p&&(QW.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),uP.setFromProjectionMatrix(QW,e.isWebGPURenderer?s1:hd));let f=0;if(this.sortObjects){ZW.copy(this.matrixWorld).invert(),l_.setFromMatrixPosition(r.matrixWorld).applyMatrix4(ZW);for(let v=0,g=l.length;v<g;v++)if(l[v]){this.getMatrixAt(v,Sp),this.getBoundingSphereAt(v,Ug).applyMatrix4(Sp);let b=!1;if(p&&(b=!uP.intersectsSphere(Ug)),!b){const y=l_.distanceTo(Ug.center);dP.push(h[v],y)}}const m=dP.list,x=this.customSort;x===null?m.sort(s.transparent?s8e:i8e):x.call(this,m,r);for(let v=0,g=m.length;v<g;v++){const b=m[v];u[f]=b.start*o,d[f]=b.count,f++}dP.reset()}else for(let m=0,x=l.length;m<x;m++)if(l[m]){let v=!1;if(p&&(this.getMatrixAt(m,Sp),this.getBoundingSphereAt(m,Ug).applyMatrix4(Sp),v=!uP.intersectsSphere(Ug)),!v){const g=h[m];u[f]=g.start*o,d[f]=g.count,f++}}this._multiDrawCount=f,this._visibilityChanged=!1}onBeforeShadow(e,n,r,i,s,a){this.onBeforeRender(e,null,i,s,a)}}class Pa extends Ta{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Qt(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 e$=new Ie,t$=new Ie,n$=new Wn,hP=new Dx,Hk=new Xa;class Ff extends Xr{constructor(e=new or,n=new Pa){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,s=n.count;i<s;i++)e$.fromBufferAttribute(n,i-1),t$.fromBufferAttribute(n,i),r[i]=r[i-1],r[i]+=e$.distanceTo(t$);e.setAttribute("lineDistance",new _n(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Hk.copy(r.boundingSphere),Hk.applyMatrix4(i),Hk.radius+=s,e.ray.intersectsSphere(Hk)===!1)return;n$.copy(i).invert(),hP.copy(e.ray).applyMatrix4(n$);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,u=new Ie,d=new Ie,h=new Ie,p=new Ie,f=this.isLineSegments?2:1,m=r.index,v=r.attributes.position;if(m!==null){const g=Math.max(0,a.start),b=Math.min(m.count,a.start+a.count);for(let y=g,S=b-1;y<S;y+=f){const A=m.getX(y),k=m.getX(y+1);if(u.fromBufferAttribute(v,A),d.fromBufferAttribute(v,k),hP.distanceSqToSegment(u,d,p,h)>l)continue;p.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(p);T<e.near||T>e.far||n.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,a.start),b=Math.min(v.count,a.start+a.count);for(let y=g,S=b-1;y<S;y+=f){if(u.fromBufferAttribute(v,y),d.fromBufferAttribute(v,y+1),hP.distanceSqToSegment(u,d,p,h)>l)continue;p.applyMatrix4(this.matrixWorld);const k=e.ray.origin.distanceTo(p);k<e.near||k>e.far||n.push({distance:k,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[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}}}}}const r$=new Ie,i$=new Ie;class Ql extends Ff{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,s=n.count;i<s;i+=2)r$.fromBufferAttribute(n,i),i$.fromBufferAttribute(n,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+r$.distanceTo(i$);e.setAttribute("lineDistance",new _n(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Jz extends Ff{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class DM extends Ta{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Qt(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 s$=new Wn,BD=new Dx,Gk=new Xa,Vk=new Ie;class Zz extends Xr{constructor(e=new or,n=new DM){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),Gk.copy(r.boundingSphere),Gk.applyMatrix4(i),Gk.radius+=s,e.ray.intersectsSphere(Gk)===!1)return;s$.copy(i).invert(),BD.copy(e.ray).applyMatrix4(s$);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 p=Math.max(0,a.start),f=Math.min(u.count,a.start+a.count);for(let m=p,x=f;m<x;m++){const v=u.getX(m);Vk.fromBufferAttribute(h,v),a$(Vk,v,l,i,e,n,this)}}else{const p=Math.max(0,a.start),f=Math.min(h.count,a.start+a.count);for(let m=p,x=f;m<x;m++)Vk.fromBufferAttribute(h,m),a$(Vk,m,l,i,e,n,this)}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[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 a$(t,e,n,r,i,s,a){const o=BD.distanceSqToPoint(t);if(o<n){const l=new Ie;BD.closestPointToPoint(t,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,object:a})}}class c8e extends ui{constructor(e,n,r,i,s,a,o,l,u){super(e,n,r,i,s,a,o,l,u),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:zr,this.magFilter=s!==void 0?s:zr,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class u8e extends ui{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=Bs,this.minFilter=Bs,this.generateMipmaps=!1,this.needsUpdate=!0}}class BM extends ui{constructor(e,n,r,i,s,a,o,l,u,d,h,p){super(null,a,o,l,u,d,i,s,h,p),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class d8e extends BM{constructor(e,n,r,i,s,a){super(e,n,r,s,a),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ji}}class h8e extends BM{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Th),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class f8e extends ui{constructor(e,n,r,i,s,a,o,l,u){super(e,n,r,i,s,a,o,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Md{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}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 n=[];let r,i=this.getPoint(0),s=0;n.push(0);for(let a=1;a<=e;a++)r=this.getPoint(a/e),s+=r.distanceTo(i),n.push(s),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const s=r.length;let a;n?a=n: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],p=r[i+1]-d,f=(a-d)/p;return(i+f)/(s-1)}getTangent(e,n){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=n||(a.isVector2?new Rt:new Ie);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new Ie,i=[],s=[],a=[],o=new Ie,l=new Wn;for(let f=0;f<=e;f++){const m=f/e;i[f]=this.getTangentAt(m,new Ie)}s[0]=new Ie,a[0]=new Ie;let u=Number.MAX_VALUE;const d=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=u&&(u=d,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),p<=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 f=1;f<=e;f++){if(s[f]=s[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(Fs(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],s[f])}if(n===!0){let f=Math.acos(Fs(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(f=-f);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],s[m])}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.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class FM extends Md{constructor(e=0,n=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=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,n){const r=n||new Rt,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;s<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),p=l-this.aX,f=u-this.aY;l=p*d-f*h+this.aX,u=p*h+f*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 Boe extends FM{constructor(e,n,r,i,s,a){super(e,n,r,r,i,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Qz(){let t=0,e=0,n=0,r=0;function i(s,a,o,l){t=s,e=o,n=-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 p=(a-s)/u-(o-s)/(u+d)+(o-a)/d,f=(o-a)/d-(l-a)/(d+h)+(l-o)/h;p*=d,f*=d,i(a,o,p,f)},calc:function(s){const a=s*s,o=a*s;return t+e*s+n*a+r*o}}}const Wk=new Ie,fP=new Qz,pP=new Qz,mP=new Qz;class Foe extends Md{constructor(e=[],n=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=n,this.curveType=r,this.tension=i}getPoint(e,n=new Ie){const r=n,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]:(Wk.subVectors(i[0],i[1]).add(i[0]),u=Wk);const h=i[o%s],p=i[(o+1)%s];if(this.closed||o+2<s?d=i[(o+2)%s]:(Wk.subVectors(i[s-1],i[s-2]).add(i[s-1]),d=Wk),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(u.distanceToSquared(h),f),x=Math.pow(h.distanceToSquared(p),f),v=Math.pow(p.distanceToSquared(d),f);x<1e-4&&(x=1),m<1e-4&&(m=x),v<1e-4&&(v=x),fP.initNonuniformCatmullRom(u.x,h.x,p.x,d.x,m,x,v),pP.initNonuniformCatmullRom(u.y,h.y,p.y,d.y,m,x,v),mP.initNonuniformCatmullRom(u.z,h.z,p.z,d.z,m,x,v)}else this.curveType==="catmullrom"&&(fP.initCatmullRom(u.x,h.x,p.x,d.x,this.tension),pP.initCatmullRom(u.y,h.y,p.y,d.y,this.tension),mP.initCatmullRom(u.z,h.z,p.z,d.z,this.tension));return r.set(fP.calc(l),pP.calc(l),mP.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];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 n=0,r=this.points.length;n<r;n++){const i=this.points[n];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 n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(new Ie().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function o$(t,e,n,r,i){const s=(r-e)*.5,a=(i-n)*.5,o=t*t,l=t*o;return(2*n-2*r+s+a)*l+(-3*n+3*r-2*s-a)*o+s*t+n}function p8e(t,e){const n=1-t;return n*n*e}function m8e(t,e){return 2*(1-t)*t*e}function g8e(t,e){return t*t*e}function h2(t,e,n,r){return p8e(t,e)+m8e(t,n)+g8e(t,r)}function x8e(t,e){const n=1-t;return n*n*n*e}function v8e(t,e){const n=1-t;return 3*n*n*t*e}function y8e(t,e){return 3*(1-t)*t*t*e}function b8e(t,e){return t*t*t*e}function f2(t,e,n,r,i){return x8e(t,e)+v8e(t,n)+y8e(t,r)+b8e(t,i)}class e6 extends Md{constructor(e=new Rt,n=new Rt,r=new Rt,i=new Rt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=n,this.v2=r,this.v3=i}getPoint(e,n=new Rt){const r=n,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return r.set(f2(e,i.x,s.x,a.x,o.x),f2(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 Ooe extends Md{constructor(e=new Ie,n=new Ie,r=new Ie,i=new Ie){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=n,this.v2=r,this.v3=i}getPoint(e,n=new Ie){const r=n,i=this.v0,s=this.v1,a=this.v2,o=this.v3;return r.set(f2(e,i.x,s.x,a.x,o.x),f2(e,i.y,s.y,a.y,o.y),f2(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 t6 extends Md{constructor(e=new Rt,n=new Rt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=n}getPoint(e,n=new Rt){const r=n;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new Rt){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}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 zoe extends Md{constructor(e=new Ie,n=new Ie){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=n}getPoint(e,n=new Ie){const r=n;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new Ie){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}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 n6 extends Md{constructor(e=new Rt,n=new Rt,r=new Rt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=n,this.v2=r}getPoint(e,n=new Rt){const r=n,i=this.v0,s=this.v1,a=this.v2;return r.set(h2(e,i.x,s.x,a.x),h2(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 r6 extends Md{constructor(e=new Ie,n=new Ie,r=new Ie){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=n,this.v2=r}getPoint(e,n=new Ie){const r=n,i=this.v0,s=this.v1,a=this.v2;return r.set(h2(e,i.x,s.x,a.x),h2(e,i.y,s.y,a.y),h2(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 i6 extends Md{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,n=new Rt){const r=n,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(o$(o,l.x,u.x,d.x,h.x),o$(o,l.y,u.y,d.y,h.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,r=this.points.length;n<r;n++){const i=this.points[n];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,r=e.points.length;n<r;n++){const i=e.points[n];this.points.push(new Rt().fromArray(i))}return this}}var qT=Object.freeze({__proto__:null,ArcCurve:Boe,CatmullRomCurve3:Foe,CubicBezierCurve:e6,CubicBezierCurve3:Ooe,EllipseCurve:FM,LineCurve:t6,LineCurve3:zoe,QuadraticBezierCurve:n6,QuadraticBezierCurve3:r6,SplineCurve:i6});class Uoe extends Md{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(n)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new qT[r](n,e))}return this}getPoint(e,n){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,n)}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 n=0;for(let r=0,i=this.curves.length;r<i;r++)n+=this.curves[r].getLength(),e.push(n);return this.cacheLengths=e,e}getSpacedPoints(e=40){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return this.autoClose&&n.push(n[0]),n}getPoints(e=12){const n=[];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)||(n.push(d),r=d)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n<r;n++){const i=e.curves[n];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let n=0,r=this.curves.length;n<r;n++){const i=this.curves[n];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let n=0,r=e.curves.length;n<r;n++){const i=e.curves[n];this.curves.push(new qT[i.type]().fromJSON(i))}return this}}class ES extends Uoe{constructor(e){super(),this.type="Path",this.currentPoint=new Rt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let n=1,r=e.length;n<r;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){return this.currentPoint.set(e,n),this}lineTo(e,n){const r=new t6(this.currentPoint.clone(),new Rt(e,n));return this.curves.push(r),this.currentPoint.set(e,n),this}quadraticCurveTo(e,n,r,i){const s=new n6(this.currentPoint.clone(),new Rt(e,n),new Rt(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(e,n,r,i,s,a){const o=new e6(this.currentPoint.clone(),new Rt(e,n),new Rt(r,i),new Rt(s,a));return this.curves.push(o),this.currentPoint.set(s,a),this}splineThru(e){const n=[this.currentPoint.clone()].concat(e),r=new i6(n);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,n,r,i,s,a){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,n+l,r,i,s,a),this}absarc(e,n,r,i,s,a){return this.absellipse(e,n,r,r,i,s,a),this}ellipse(e,n,r,i,s,a,o,l){const u=this.currentPoint.x,d=this.currentPoint.y;return this.absellipse(e+u,n+d,r,i,s,a,o,l),this}absellipse(e,n,r,i,s,a,o,l){const u=new FM(e,n,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 OA extends or{constructor(e=[new Rt(0,-.5),new Rt(.5,0),new Rt(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=Fs(i,0,Math.PI*2);const s=[],a=[],o=[],l=[],u=[],d=1/n,h=new Ie,p=new Rt,f=new Ie,m=new Ie,x=new Ie;let v=0,g=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:v=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,f.x=g*1,f.y=-v,f.z=g*0,x.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:v=e[b+1].x-e[b].x,g=e[b+1].y-e[b].y,f.x=g*1,f.y=-v,f.z=g*0,m.copy(f),f.x+=x.x,f.y+=x.y,f.z+=x.z,f.normalize(),l.push(f.x,f.y,f.z),x.copy(m)}for(let b=0;b<=n;b++){const y=r+b*d*i,S=Math.sin(y),A=Math.cos(y);for(let k=0;k<=e.length-1;k++){h.x=e[k].x*S,h.y=e[k].y,h.z=e[k].x*A,a.push(h.x,h.y,h.z),p.x=b/n,p.y=k/(e.length-1),o.push(p.x,p.y);const M=l[3*k+0]*S,T=l[3*k+1],C=l[3*k+0]*A;u.push(M,T,C)}}for(let b=0;b<n;b++)for(let y=0;y<e.length-1;y++){const S=y+b*e.length,A=S,k=S+e.length,M=S+e.length+1,T=S+1;s.push(A,k,T),s.push(M,T,k)}this.setIndex(s),this.setAttribute("position",new _n(a,3)),this.setAttribute("uv",new _n(o,2)),this.setAttribute("normal",new _n(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new OA(e.points,e.segments,e.phiStart,e.phiLength)}}class OM extends OA{constructor(e=1,n=1,r=4,i=8){const s=new ES;s.absarc(0,-n/2,e,Math.PI*1.5,0),s.absarc(0,n/2,e,0,Math.PI*.5),super(s.getPoints(r),i),this.type="CapsuleGeometry",this.parameters={radius:e,length:n,capSegments:r,radialSegments:i}}static fromJSON(e){return new OM(e.radius,e.length,e.capSegments,e.radialSegments)}}class zM extends or{constructor(e=1,n=32,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:n,thetaStart:r,thetaLength:i},n=Math.max(3,n);const s=[],a=[],o=[],l=[],u=new Ie,d=new Rt;a.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let h=0,p=3;h<=n;h++,p+=3){const f=r+h/n*i;u.x=e*Math.cos(f),u.y=e*Math.sin(f),a.push(u.x,u.y,u.z),o.push(0,0,1),d.x=(a[p]/e+1)/2,d.y=(a[p+1]/e+1)/2,l.push(d.x,d.y)}for(let h=1;h<=n;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new _n(a,3)),this.setAttribute("normal",new _n(o,3)),this.setAttribute("uv",new _n(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zM(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class iw extends or{constructor(e=1,n=1,r=1,i=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,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=[],p=[],f=[];let m=0;const x=[],v=r/2;let g=0;b(),a===!1&&(e>0&&y(!0),n>0&&y(!1)),this.setIndex(d),this.setAttribute("position",new _n(h,3)),this.setAttribute("normal",new _n(p,3)),this.setAttribute("uv",new _n(f,2));function b(){const S=new Ie,A=new Ie;let k=0;const M=(n-e)/r;for(let T=0;T<=s;T++){const C=[],R=T/s,P=R*(n-e)+e;for(let j=0;j<=i;j++){const G=j/i,B=G*l+o,$=Math.sin(B),U=Math.cos(B);A.x=P*$,A.y=-R*r+v,A.z=P*U,h.push(A.x,A.y,A.z),S.set($,M,U).normalize(),p.push(S.x,S.y,S.z),f.push(G,1-R),C.push(m++)}x.push(C)}for(let T=0;T<i;T++)for(let C=0;C<s;C++){const R=x[C][T],P=x[C+1][T],j=x[C+1][T+1],G=x[C][T+1];d.push(R,P,G),d.push(P,j,G),k+=6}u.addGroup(g,k,0),g+=k}function y(S){const A=m,k=new Rt,M=new Ie;let T=0;const C=S===!0?e:n,R=S===!0?1:-1;for(let j=1;j<=i;j++)h.push(0,v*R,0),p.push(0,R,0),f.push(.5,.5),m++;const P=m;for(let j=0;j<=i;j++){const B=j/i*l+o,$=Math.cos(B),U=Math.sin(B);M.x=C*U,M.y=v*R,M.z=C*$,h.push(M.x,M.y,M.z),p.push(0,R,0),k.x=$*.5+.5,k.y=U*.5*R+.5,f.push(k.x,k.y),m++}for(let j=0;j<i;j++){const G=A+j,B=P+j;S===!0?d.push(B,B+1,G):d.push(B+1,B,G),T+=3}u.addGroup(g,T,S===!0?1:2),g+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new iw(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class UM extends iw{constructor(e=1,n=1,r=32,i=1,s=!1,a=0,o=Math.PI*2){super(0,e,n,r,i,s,a,o),this.type="C
4496oneGeometry",this.parameters={radius:e,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o}}static fromJSON(e){return new UM(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class hg extends or{constructor(e=[],n=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:n,radius:r,detail:i};const s=[],a=[];o(i),u(r),d(),this.setAttribute("position",new _n(s,3)),this.setAttribute("normal",new _n(s.slice(),3)),this.setAttribute("uv",new _n(a,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function o(b){const y=new Ie,S=new Ie,A=new Ie;for(let k=0;k<n.length;k+=3)f(n[k+0],y),f(n[k+1],S),f(n[k+2],A),l(y,S,A,b)}function l(b,y,S,A){const k=A+1,M=[];for(let T=0;T<=k;T++){M[T]=[];const C=b.clone().lerp(S,T/k),R=y.clone().lerp(S,T/k),P=k-T;for(let j=0;j<=P;j++)j===0&&T===k?M[T][j]=C:M[T][j]=C.clone().lerp(R,j/P)}for(let T=0;T<k;T++)for(let C=0;C<2*(k-T)-1;C++){const R=Math.floor(C/2);C%2===0?(p(M[T][R+1]),p(M[T+1][R]),p(M[T][R])):(p(M[T][R+1]),p(M[T+1][R+1]),p(M[T+1][R]))}}function u(b){const y=new Ie;for(let S=0;S<s.length;S+=3)y.x=s[S+0],y.y=s[S+1],y.z=s[S+2],y.normalize().multiplyScalar(b),s[S+0]=y.x,s[S+1]=y.y,s[S+2]=y.z}function d(){const b=new Ie;for(let y=0;y<s.length;y+=3){b.x=s[y+0],b.y=s[y+1],b.z=s[y+2];const S=v(b)/2/Math.PI+.5,A=g(b)/Math.PI+.5;a.push(S,1-A)}m(),h()}function h(){for(let b=0;b<a.length;b+=6){const y=a[b+0],S=a[b+2],A=a[b+4],k=Math.max(y,S,A),M=Math.min(y,S,A);k>.9&&M<.1&&(y<.2&&(a[b+0]+=1),S<.2&&(a[b+2]+=1),A<.2&&(a[b+4]+=1))}}function p(b){s.push(b.x,b.y,b.z)}function f(b,y){const S=b*3;y.x=e[S+0],y.y=e[S+1],y.z=e[S+2]}function m(){const b=new Ie,y=new Ie,S=new Ie,A=new Ie,k=new Rt,M=new Rt,T=new Rt;for(let C=0,R=0;C<s.length;C+=9,R+=6){b.set(s[C+0],s[C+1],s[C+2]),y.set(s[C+3],s[C+4],s[C+5]),S.set(s[C+6],s[C+7],s[C+8]),k.set(a[R+0],a[R+1]),M.set(a[R+2],a[R+3]),T.set(a[R+4],a[R+5]),A.copy(b).add(y).add(S).divideScalar(3);const P=v(A);x(k,R+0,b,P),x(M,R+2,y,P),x(T,R+4,S,P)}}function x(b,y,S,A){A<0&&b.x===1&&(a[y]=b.x-1),S.x===0&&S.z===0&&(a[y]=A/2/Math.PI+.5)}function v(b){return Math.atan2(b.z,-b.x)}function g(b){return Math.atan2(-b.y,Math.sqrt(b.x*b.x+b.z*b.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hg(e.vertices,e.indices,e.radius,e.details)}}class HM extends hg{constructor(e=1,n=0){const r=(1+Math.sqrt(5))/2,i=1/r,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 34,386 bytes, line 4496
449619,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,a,e,n),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new HM(e.radius,e.detail)}}const $k=new Ie,Kk=new Ie,gP=new Ie,qk=new Hl;class Hoe extends or{constructor(e=null,n=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:n},e!==null){const i=Math.pow(10,4),s=Math.cos($0*n),a=e.getIndex(),o=e.getAttribute("position"),l=a?a.count:o.count,u=[0,0,0],d=["a","b","c"],h=new Array(3),p={},f=[];for(let m=0;m<l;m+=3){a?(u[0]=a.getX(m),u[1]=a.getX(m+1),u[2]=a.getX(m+2)):(u[0]=m,u[1]=m+1,u[2]=m+2);const{a:x,b:v,c:g}=qk;if(x.fromBufferAttribute(o,u[0]),v.fromBufferAttribute(o,u[1]),g.fromBufferAttribute(o,u[2]),qk.getNormal(gP),h[0]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,h[1]=`${Math.round(v.x*i)},${Math.round(v.y*i)},${Math.round(v.z*i)}`,h[2]=`${Math.round(g.x*i)},${Math.round(g.y*i)},${Math.round(g.z*i)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let b=0;b<3;b++){const y=(b+1)%3,S=h[b],A=h[y],k=qk[d[b]],M=qk[d[y]],T=`${S}_${A}`,C=`${A}_${S}`;C in p&&p[C]?(gP.dot(p[C].normal)<=s&&(f.push(k.x,k.y,k.z),f.push(M.x,M.y,M.z)),p[C]=null):T in p||(p[T]={index0:u[b],index1:u[y],normal:gP.clone()})}}for(const m in p)if(p[m]){const{index0:x,index1:v}=p[m];$k.fromBufferAttribute(o,x),Kk.fromBufferAttribute(o,v),f.push($k.x,$k.y,$k.z),f.push(Kk.x,Kk.y,Kk.z)}this.setAttribute("position",new _n(f,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class q0 extends ES{constructor(e){super(e),this.uuid=Mc(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let r=0,i=this.holes.length;r<i;r++)n[r]=this.holes[r].getPoints(e);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let n=0,r=e.holes.length;n<r;n++){const i=e.holes[n];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let n=0,r=this.holes.length;n<r;n++){const i=this.holes[n];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let n=0,r=e.holes.length;n<r;n++){const i=e.holes[n];this.holes.push(new ES().fromJSON(i))}return this}}const w8e={triangulate:function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let s=Goe(t,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u,d,h,p,f;if(r&&(s=k8e(t,e,s,n)),t.length>80*n){o=u=t[0],l=d=t[1];for(let m=n;m<i;m+=n)h=t[m],p=t[m+1],h<o&&(o=h),p<l&&(l=p),h>u&&(u=h),p>d&&(d=p);f=Math.max(u-o,d-l),f=f!==0?32767/f:0}return kS(s,a,n,o,l,f,0),a}};function Goe(t,e,n,r,i){let s,a;if(i===B8e(t,e,n,r)>0)for(s=e;s<n;s+=r)a=l$(s,t[s],t[s+1],a);else for(s=n-r;s>=e;s-=r)a=l$(s,t[s],t[s+1],a);return a&&GM(a,a.next)&&(NS(a),a=a.next),a}function wx(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(GM(n,n.next)||Ss(n.prev,n,n.next)===0)){if(NS(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function kS(t,e,n,r,i,s,a){if(!t)return;!a&&s&&R8e(t,r,i,s);let o=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,s?S8e(t,r,i,s):_8e(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),NS(t),t=u.next,o=u.next;continue}if(t=u,t===o){a?a===1?(t=A8e(wx(t),e,n),kS(t,e,n,r,i,s,2)):a===2&&E8e(t,e,n,r,i,s):kS(wx(t),e,n,r,i,s,1);break}}}function _8e(t){const e=t.prev,n=t,r=t.next;if(Ss(e,n,r)>=0)return!1;const i=e.x,s=n.x,a=r.x,o=e.y,l=n.y,u=r.y,d=i<s?i<a?i:a:s<a?s:a,h=o<l?o<u?o:u:l<u?l:u,p=i>s?i>a?i:a:s>a?s:a,f=o>l?o>u?o:u:l>u?l:u;let m=r.next;for(;m!==e;){if(m.x>=d&&m.x<=p&&m.y>=h&&m.y<=f&&Wy(i,o,s,l,a,u,m.x,m.y)&&Ss(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function S8e(t,e,n,r){const i=t.prev,s=t,a=t.next;if(Ss(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,d=i.y,h=s.y,p=a.y,f=o<l?o<u?o:u:l<u?l:u,m=d<h?d<p?d:p:h<p?h:p,x=o>l?o>u?o:u:l>u?l:u,v=d>h?d>p?d:p:h>p?h:p,g=FD(f,m,e,n,r),b=FD(x,v,e,n,r);let y=t.prevZ,S=t.nextZ;for(;y&&y.z>=g&&S&&S.z<=b;){if(y.x>=f&&y.x<=x&&y.y>=m&&y.y<=v&&y!==i&&y!==a&&Wy(o,d,l,h,u,p,y.x,y.y)&&Ss(y.prev,y,y.next)>=0||(y=y.prevZ,S.x>=f&&S.x<=x&&S.y>=m&&S.y<=v&&S!==i&&S!==a&&Wy(o,d,l,h,u,p,S.x,S.y)&&Ss(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;y&&y.z>=g;){if(y.x>=f&&y.x<=x&&y.y>=m&&y.y<=v&&y!==i&&y!==a&&Wy(o,d,l,h,u,p,y.x,y.y)&&Ss(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;S&&S.z<=b;){if(S.x>=f&&S.x<=x&&S.y>=m&&S.y<=v&&S!==i&&S!==a&&Wy(o,d,l,h,u,p,S.x,S.y)&&Ss(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function A8e(t,e,n){let r=t;do{const i=r.prev,s=r.next.next;!GM(i,s)&&Voe(i,r,r.next,s)&&CS(i,s)&&CS(s,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(s.i/n|0),NS(r),NS(r.next),r=t=s),r=r.next}while(r!==t);return wx(r)}function E8e(t,e,n,r,i,s){let a=t;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&L8e(a,o)){let l=Woe(a,o);a=wx(a,a.next),l=wx(l,l.next),kS(a,e,n,r,i,s,0),kS(l,e,n,r,i,s,0);return}o=o.next}a=a.next}while(a!==t)}function k8e(t,e,n,r){const i=[];let s,a,o,l,u;for(s=0,a=e.length;s<a;s++)o=e[s]*r,l=s<a-1?e[s+1]*r:t.length,u=Goe(t,o,l,r,!1),u===u.next&&(u.steiner=!0),i.push(P8e(u));for(i.sort(C8e),s=0;s<i.length;s++)n=N8e(i[s],n);return n}function C8e(t,e){return t.x-e.x}function N8e(t,e){const n=T8e(t,e);if(!n)return e;const r=Woe(n,t);return wx(r,r.next),wx(n,n.next)}function T8e(t,e){let n=e,r=-1/0,i;const s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const p=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(p<=s&&p>r&&(r=p,i=n.x<n.next.x?n:n.next,p===s))return i}n=n.next}while(n!==e);if(!i)return null;const o=i,l=i.x,u=i.y;let d=1/0,h;n=i;do s>=n.x&&n.x>=l&&s!==n.x&&Wy(a<u?s:r,a,l,u,a<u?r:s,a,n.x,n.y)&&(h=Math.abs(a-n.y)/(s-n.x),CS(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&M8e(i,n)))&&(i=n,d=h)),n=n.next;while(n!==o);return i}function M8e(t,e){return Ss(t.prev,t,e.prev)<0&&Ss(e.next,t,t.next)<0}function R8e(t,e,n,r){let i=t;do i.z===0&&(i.z=FD(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,j8e(i)}function j8e(t){let e,n,r,i,s,a,o,l,u=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,r=n,o=0,e=0;e<u&&(o++,r=r.nextZ,!!r);e++);for(l=u;o>0||l>0&&r;)o!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,o--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;n=r}s.nextZ=null,u*=2}while(a>1);return t}function FD(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function P8e(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function Wy(t,e,n,r,i,s,a,o){return(i-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(r-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function L8e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!I8e(t,e)&&(CS(t,e)&&CS(e,t)&&D8e(t,e)&&(Ss(t.prev,t,e.prev)||Ss(t,e.prev,e))||GM(t,e)&&Ss(t.prev,t,t.next)>0&&Ss(e.prev,e,e.next)>0)}function Ss(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function GM(t,e){return t.x===e.x&&t.y===e.y}function Voe(t,e,n,r){const i=Yk(Ss(t,e,n)),s=Yk(Ss(t,e,r)),a=Yk(Ss(n,r,t)),o=Yk(Ss(n,r,e));return!!(i!==s&&a!==o||i===0&&Xk(t,n,e)||s===0&&Xk(t,r,e)||a===0&&Xk(n,t,r)||o===0&&Xk(n,e,r))}function Xk(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Yk(t){return t>0?1:t<0?-1:0}function I8e(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Voe(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function CS(t,e){return Ss(t.prev,t,t.next)<0?Ss(t,e,t.next)>=0&&Ss(t,t.prev,e)>=0:Ss(t,e,t.prev)<0||Ss(t,t.next,e)<0}function D8e(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function Woe(t,e){const n=new OD(t.i,t.x,t.y),r=new OD(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function l$(t,e,n,r){const i=new OD(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function NS(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function OD(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B8e(t,e,n,r){let i=0;for(let s=e,a=n-r;s<n;s+=r)i+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return i}class Sh{static area(e){const n=e.length;let r=0;for(let i=n-1,s=0;s<n;i=s++)r+=e[i].x*e[s].y-e[s].x*e[i].y;return r*.5}static isClockWise(e){return Sh.area(e)<0}static triangulateShape(e,n){const r=[],i=[],s=[];c$(e),u$(r,e);let a=e.length;n.forEach(c$);for(let l=0;l<n.length;l++)i.push(a),a+=n[l].length,u$(r,n[l]);const o=w8e.triangulate(r,i);for(let l=0;l<o.length;l+=3)s.push(o.slice(l,l+3));return s}}function c$(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function u$(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class VM extends or{constructor(e=new q0([new Rt(.5,.5),new Rt(-.5,.5),new Rt(-.5,-.5),new Rt(.5,-.5)]),n={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:n},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 _n(i,3)),this.setAttribute("uv",new _n(s,2)),this.computeVertexNormals();function a(o){const l=[],u=n.curveSegments!==void 0?n.curveSegments:12,d=n.steps!==void 0?n.steps:1,h=n.depth!==void 0?n.depth:1;let p=n.bevelEnabled!==void 0?n.bevelEnabled:!0,f=n.bevelThickness!==void 0?n.bevelThickness:.2,m=n.bevelSize!==void 0?n.bevelSize:f-.1,x=n.bevelOffset!==void 0?n.bevelOffset:0,v=n.bevelSegments!==void 0?n.bevelSegments:3;const g=n.extrudePath,b=n.UVGenerator!==void 0?n.UVGenerator:F8e;let y,S=!1,A,k,M,T;g&&(y=g.getSpacedPoints(d),S=!0,p=!1,A=g.computeFrenetFrames(d,!1),k=new Ie,M=new Ie,T=new Ie),p||(v=0,f=0,m=0,x=0);const C=o.extractPoints(u);let R=C.shape;const P=C.holes;if(!Sh.isClockWise(R)){R=R.reverse();for(let Q=0,we=P.length;Q<we;Q++){const Ae=P[Q];Sh.isClockWise(Ae)&&(P[Q]=Ae.reverse())}}const G=Sh.triangulateShape(R,P),B=R;for(let Q=0,we=P.length;Q<we;Q++){const Ae=P[Q];R=R.concat(Ae)}function $(Q,we,Ae){return we||console.error("THREE.ExtrudeGeometry: vec does not exist"),Q.clone().addScaledVector(we,Ae)}const U=R.length,Z=G.length;function V(Q,we,Ae){let K,pe,ye;const Se=Q.x-we.x,ee=Q.y-we.y,re=Ae.x-Q.x,me=Ae.y-Q.y,Ge=Se*Se+ee*ee,He=Se*me-ee*re;if(Math.abs(He)>Number.EPSILON){const _e=Math.sqrt(Ge),Ne=Math.sqrt(re*re+me*me),ue=we.x-ee/_e,Ce=we.y+Se/_e,Ke=Ae.x-me/Ne,Qe=Ae.y+re/Ne,je=((Ke-ue)*me-(Qe-Ce)*re)/(Se*me-ee*re);K=ue+Se*je-Q.x,pe=Ce+ee*je-Q.y;const We=K*K+pe*pe;if(We<=2)return new Rt(K,pe);ye=Math.sqrt(We/2)}else{let _e=!1;Se>Number.EPSILON?re>Number.EPSILON&&(_e=!0):Se<-Number.EPSILON?re<-Number.EPSILON&&(_e=!0):Math.sign(ee)===Math.sign(me)&&(_e=!0),_e?(K=-ee,pe=Se,ye=Math.sqrt(Ge)):(K=Se,pe=ee,ye=Math.sqrt(Ge/2))}return new Rt(K/ye,pe/ye)}const W=[];for(let Q=0,we=B.length,Ae=we-1,K=Q+1;Q<we;Q++,Ae++,K++)Ae===we&&(Ae=0),K===we&&(K=0),W[Q]=V(B[Q],B[Ae],B[K]);const O=[];let Y,z=W.concat();for(let Q=0,we=P.length;Q<we;Q++){const Ae=P[Q];Y=[];for(let K=0,pe=Ae.length,ye=pe-1,Se=K+1;K<pe;K++,ye++,Se++)ye===pe&&(ye=0),Se===pe&&(Se=0),Y[K]=V(Ae[K],Ae[ye],Ae[Se]);O.push(Y),z=z.concat(Y)}for(let Q=0;Q<v;Q++){const we=Q/v,Ae=f*Math.cos(we*Math.PI/2),K=m*Math.sin(we*Math.PI/2)+x;for(let pe=0,ye=B.length;pe<ye;pe++){const Se=$(B[pe],W[pe],K);ie(Se.x,Se.y,-Ae)}for(let pe=0,ye=P.length;pe<ye;pe++){const Se=P[pe];Y=O[pe];for(let ee=0,re=Se.length;ee<re;ee++){const me=$(Se[ee],Y[ee],K);ie(me.x,me.y,-Ae)}}}const I=m+x;for(let Q=0;Q<U;Q++){const we=p?$(R[Q],z[Q],I):R[Q];S?(M.copy(A.normals[0]).multiplyScalar(we.x),k.copy(A.binormals[0]).multiplyScalar(we.y),T.copy(y[0]).add(M).add(k),ie(T.x,T.y,T.z)):ie(we.x,we.y,0)}for(let Q=1;Q<=d;Q++)for(let we=0;we<U;we++){const Ae=p?$(R[we],z[we],I):R[we];S?(M.copy(A.normals[Q]).multiplyScalar(Ae.x),k.copy(A.binormals[Q]).multiplyScalar(Ae.y),T.copy(y[Q]).add(M).add(k),ie(T.x,T.y,T.z)):ie(Ae.x,Ae.y,h/d*Q)}for(let Q=v-1;Q>=0;Q--){const we=Q/v,Ae=f*Math.cos(we*Math.PI/2),K=m*Math.sin(we*Math.PI/2)+x;for(let pe=0,ye=B.length;pe<ye;pe++){const Se=$(B[pe],W[pe],K);ie(Se.x,Se.y,h+Ae)}for(let pe=0,ye=P.length;pe<ye;pe++){const Se=P[pe];Y=O[pe];for(let ee=0,re=Se.length;ee<re;ee++){const me=$(Se[ee],Y[ee],K);S?ie(me.x,me.y+y[d-1].y,y[d-1].x+Ae):ie(me.x,me.y,h+Ae)}}}q(),te();function q(){const Q=i.length/3;if(p){let we=0,Ae=U*we;for(let K=0;K<Z;K++){const pe=G[K];le(pe[2]+Ae,pe[1]+Ae,pe[0]+Ae)}we=d+v*2,Ae=U*we;for(let K=0;K<Z;K++){const pe=G[K];le(pe[0]+Ae,pe[1]+Ae,pe[2]+Ae)}}else{for(let we=0;we<Z;we++){const Ae=G[we];le(Ae[2],Ae[1],Ae[0])}for(let we=0;we<Z;we++){const Ae=G[we];le(Ae[0]+U*d,Ae[1]+U*d,Ae[2]+U*d)}}r.addGroup(Q,i.length/3-Q,0)}function te(){const Q=i.length/3;let we=0;se(B,we),we+=B.length;for(let Ae=0,K=P.length;Ae<K;Ae++){const pe=P[Ae];se(pe,we),we+=pe.length}r.addGroup(Q,i.length/3-Q,1)}function se(Q,we){let Ae=Q.length;for(;--Ae>=0;){const K=Ae;let pe=Ae-1;pe<0&&(pe=Q.length-1);for(let ye=0,Se=d+v*2;ye<Se;ye++){const ee=U*ye,re=U*(ye+1),me=we+K+ee,Ge=we+pe+ee,He=we+pe+re,_e=we+K+re;xe(me,Ge,He,_e)}}}function ie(Q,we,Ae){l.push(Q),l.push(we),l.push(Ae)}function le(Q,we,Ae){Ee(Q),Ee(we),Ee(Ae);const K=i.length/3,pe=b.generateTopUV(r,i,K-3,K-2,K-1);ae(pe[0]),ae(pe[1]),ae(pe[2])}function xe(Q,we,Ae,K){Ee(Q),Ee(we),Ee(K),Ee(we),Ee(Ae),Ee(K);const pe=i.length/3,ye=b.generateSideWallUV(r,i,pe-6,pe-3,pe-2,pe-1);ae(ye[0]),ae(ye[1]),ae(ye[3]),ae(ye[1]),ae(ye[2]),ae(ye[3])}function Ee(Q){i.push(l[Q*3+0]),i.push(l[Q*3+1]),i.push(l[Q*3+2])}function ae(Q){s.push(Q.x),s.push(Q.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes,r=this.parameters.options;return O8e(n,r,e)}static fromJSON(e,n){const r=[];for(let s=0,a=e.shapes.length;s<a;s++){const o=n[e.shapes[s]];r.push(o)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new qT[i.type]().fromJSON(i)),new VM(r,e.options)}}const F8e={generateTopUV:function(t,e,n,r,i){const s=e[n*3],a=e[n*3+1],o=e[r*3],l=e[r*3+1],u=e[i*3],d=e[i*3+1];return[new Rt(s,a),new Rt(o,l),new Rt(u,d)]},generateSideWallUV:function(t,e,n,r,i,s){const a=e[n*3],o=e[n*3+1],l=e[n*3+2],u=e[r*3],d=e[r*3+1],h=e[r*3+2],p=e[i*3],f=e[i*3+1],m=e[i*3+2],x=e[s*3],v=e[s*3+1],g=e[s*3+2];return Math.abs(o-d)<Math.abs(a-u)?[new Rt(a,1-l),new Rt(u,1-h),new Rt(p,1-m),new Rt(x,1-g)]:[new Rt(o,1-l),new Rt(d,1-h),new Rt(f,1-m),new Rt(v,1-g)]}};function O8e(t,e,n){if(n.shapes=[],Array.isArray(t))for(let r=0,i=t.length;r<i;r++){const s=t[r];n.shapes.push(s.uuid)}else n.shapes.push(t.uuid);return n.options=Object.assign({},e),e.extrudePath!==void 0&&(n.options.extrudePath=e.extrudePath.toJSON()),n}class zA extends hg{constructor(e=1,n=0){const r=(1+Math.sqrt(5))/2,i=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,s,e,n),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new zA(e.radius,e.detail)}}class UA extends hg{constructor(e=1,n=0){const r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(r,i,e,n),this.type="OctahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new UA(e.radius,e.detail)}}class WM extends or{constructor(e=.5,n=1,r=32,i=1,s=0,a=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:r,phiSegments:i,thetaStart:s,thetaLength:a},r=Math.max(3,r),i=Math.max(1,i);const o=[],l=[],u=[],d=[];let h=e;const p=(n-e)/i,f=new Ie,m=new Rt;for(let x=0;x<=i;x++){for(let v=0;v<=r;v++){const g=s+v/r*a;f.x=h*Math.cos(g),f.y=h*Math.sin(g),l.push(f.x,f.y,f.z),u.push(0,0,1),m.x=(f.x/n+1)/2,m.y=(f.y/n+1)/2,d.push(m.x,m.y)}h+=p}for(let x=0;x<i;x++){const v=x*(r+1);for(let g=0;g<r;g++){const b=g+v,y=b,S=b+r+1,A=b+r+2,k=b+1;o.push(y,S,k),o.push(S,A,k)}}this.setIndex(o),this.setAttribute("position",new _n(l,3)),this.setAttribute("normal",new _n(u,3)),this.setAttribute("uv",new _n(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new WM(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class $M extends or{constructor(e=new q0([new Rt(0,.5),new Rt(-.5,-.5),new Rt(.5,-.5)]),n=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:n};const r=[],i=[],s=[],a=[];let o=0,l=0;if(Array.isArray(e)===!1)u(e);else for(let d=0;d<e.length;d++)u(e[d]),this.addGroup(o,l,d),o+=l,l=0;this.setIndex(r),this.setAttribute("position",new _n(i,3)),this.setAttribute("normal",new _n(s,3)),this.setAttribute("uv",new _n(a,2));function u(d){const h=i.length/3,p=d.extractPoints(n);let f=p.shape;const m=p.holes;Sh.isClockWise(f)===!1&&(f=f.reverse());for(let v=0,g=m.length;v<g;v++){const b=m[v];Sh.isClockWise(b)===!0&&(m[v]=b.reverse())}const x=Sh.triangulateShape(f,m);for(let v=0,g=m.length;v<g;v++){const b=m[v];f=f.concat(b)}for(let v=0,g=f.length;v<g;v++){const b=f[v];i.push(b.x,b.y,0),s.push(0,0,1),a.push(b.x,b.y)}for(let v=0,g=x.length;v<g;v++){const b=x[v],y=b[0]+h,S=b[1]+h,A=b[2]+h;r.push(y,S,A),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes;return z8e(n,e)}static fromJSON(e,n){const r=[];for(let i=0,s=e.shapes.length;i<s;i++){const a=n[e.shapes[i]];r.push(a)}return new $M(r,e.curveSegments)}}function z8e(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,r=t.length;n<r;n++){const i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}class HA extends or{constructor(e=1,n=32,r=16,i=0,s=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:n,heightSegments:r,phiStart:i,phiLength:s,thetaStart:a,thetaLength:o},n=Math.max(3,Math.floor(n)),r=Math.max(2,Math.floor(r));const l=Math.min(a+o,Math.PI);let u=0;const d=[],h=new Ie,p=new Ie,f=[],m=[],x=[],v=[];for(let g=0;g<=r;g++){const b=[],y=g/r;let S=0;g===0&&a===0?S=.5/n:g===r&&l===Math.PI&&(S=-.5/n);for(let A=0;A<=n;A++){const k=A/n;h.x=-e*Math.cos(i+k*s)*Math.sin(a+y*o),h.y=e*Math.cos(a+y*o),h.z=e*Math.sin(i+k*s)*Math.sin(a+y*o),m.push(h.x,h.y,h.z),p.copy(h).normalize(),x.push(p.x,p.y,p.z),v.push(k+S,1-y),b.push(u++)}d.push(b)}for(let g=0;g<r;g++)for(let b=0;b<n;b++){const y=d[g][b+1],S=d[g][b],A=d[g+1][b],k=d[g+1][b+1];(g!==0||a>0)&&f.push(y,S,k),(g!==r-1||l<Math.PI)&&f.push(S,A,k)}this.setIndex(f),this.setAttribute("position",new _n(m,3)),this.setAttribute("normal",new _n(x,3)),this.setAttribute("uv",new _n(v,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new HA(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class KM extends hg{constructor(e=1,n=0){const r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(r,i,e,n),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new KM(e.radius,e.detail)}}class qM extends or{constructor(e=1,n=.4,r=12,i=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:n,radialSegments:r,tubularSegments:i,arc:s},r=Math.floor(r),i=Math.floor(i);const a=[],o=[],l=[],u=[],d=new Ie,h=new Ie,p=new Ie;for(let f=0;f<=r;f++)for(let m=0;m<=i;m++){const x=m/i*s,v=f/r*Math.PI*2;h.x=(e+n*Math.cos(v))*Math.cos(x),h.y=(e+n*Math.cos(v))*Math.sin(x),h.z=n*Math.sin(v),o.push(h.x,h.y,h.z),d.x=e*Math.cos(x),d.y=e*Math.sin(x),p.subVectors(h,d).normalize(),l.push(p.x,p.y,p.z),u.push(m/i),u.push(f/r)}for(let f=1;f<=r;f++)for(let m=1;m<=i;m++){const x=(i+1)*f+m-1,v=(i+1)*(f-1)+m-1,g=(i+1)*(f-1)+m,b=(i+1)*f+m;a.push(x,v,b),a.push(v,g,b)}this.setIndex(a),this.setAttribute("position",new _n(o,3)),this.setAttribute("normal",new _n(l,3)),this.setAttribute("uv",new _n(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qM(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class XM extends or{constructor(e=1,n=.4,r=64,i=8,s=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:n,tubularSegments:r,radialSegments:i,p:s,q:a},r=Math.floor(r),i=Math.floor(i);const o=[],l=[],u=[],d=[],h=new Ie,p=new Ie,f=new Ie,m=new Ie,x=new Ie,v=new Ie,g=new Ie;for(let y=0;y<=r;++y){const S=y/r*s*Math.PI*2;b(S,s,a,e,f),b(S+.01,s,a,e,m),v.subVectors(m,f),g.addVectors(m,f),x.crossVectors(v,g),g.crossVectors(x,v),x.normalize(),g.normalize();for(let A=0;A<=i;++A){const k=A/i*Math.PI*2,M=-n*Math.cos(k),T=n*Math.sin(k);h.x=f.x+(M*g.x+T*x.x),h.y=f.y+(M*g.y+T*x.y),h.z=f.z+(M*g.z+T*x.z),l.push(h.x,h.y,h.z),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),d.push(y/r),d.push(A/i)}}for(let y=1;y<=r;y++)for(let S=1;S<=i;S++){const A=(i+1)*(y-1)+(S-1),k=(i+1)*y+(S-1),M=(i+1)*y+S,T=(i+1)*(y-1)+S;o.push(A,k,T),o.push(k,M,T)}this.setIndex(o),this.setAttribute("position",new _n(l,3)),this.setAttribute("normal",new _n(u,3)),this.setAttribute("uv",new _n(d,2));function b(y,S,A,k,M){const T=Math.cos(y),C=Math.sin(y),R=A/S*y,P=Math.cos(R);M.x=k*(2+P)*.5*T,M.y=k*(2+P)*C*.5,M.z=k*Math.sin(R)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new XM(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class YM extends or{constructor(e=new r6(new Ie(-1,-1,0),new Ie(-1,1,0),new Ie(1,1,0)),n=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:n,radius:r,radialSegments:i,closed:s};const a=e.computeFrenetFrames(n,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new Ie,l=new Ie,u=new Rt;let d=new Ie;const h=[],p=[],f=[],m=[];x(),this.setIndex(m),this.setAttribute("position",new _n(h,3)),this.setAttribute("normal",new _n(p,3)),this.setAttribute("uv",new _n(f,2));function x(){for(let y=0;y<n;y++)v(y);v(s===!1?n:0),b(),g()}function v(y){d=e.getPointAt(y/n,d);const S=a.normals[y],A=a.binormals[y];for(let k=0;k<=i;k++){const M=k/i*Math.PI*2,T=Math.sin(M),C=-Math.cos(M);l.x=C*S.x+T*A.x,l.y=C*S.y+T*A.y,l.z=C*S.z+T*A.z,l.normalize(),p.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 g(){for(let y=1;y<=n;y++)for(let S=1;S<=i;S++){const A=(i+1)*(y-1)+(S-1),k=(i+1)*y+(S-1),M=(i+1)*y+S,T=(i+1)*(y-1)+S;m.push(A,k,T),m.push(k,M,T)}}function b(){for(let y=0;y<=n;y++)for(let S=0;S<=i;S++)u.x=y/n,u.y=S/i,f.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 YM(new qT[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class $oe extends or{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const n=[],r=new Set,i=new Ie,s=new Ie;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],p=h.start,f=h.count;for(let m=p,x=p+f;m<x;m+=3)for(let v=0;v<3;v++){const g=o.getX(m+v),b=o.getX(m+(v+1)%3);i.fromBufferAttribute(a,g),s.fromBufferAttribute(a,b),d$(i,s,r)===!0&&(n.push(i.x,i.y,i.z),n.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),d$(i,s,r)===!0&&(n.push(i.x,i.y,i.z),n.push(s.x,s.y,s.z))}}this.setAttribute("position",new _n(n,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function d$(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}var h$=Object.freeze({__proto__:null,BoxGeometry:Nd,CapsuleGeometry:OM,CircleGeometry:zM,ConeGeometry:UM,CylinderGeometry:iw,DodecahedronGeometry:HM,EdgesGeometry:Hoe,ExtrudeGeometry:VM,IcosahedronGeometry:zA,LatheGeometry:OA,OctahedronGeometry:UA,PlaneGeometry:Td,PolyhedronGeometry:hg,RingGeometry:WM,ShapeGeometry:$M,SphereGeometry:HA,TetrahedronGeometry:KM,TorusGeometry:qM,TorusKnotGeometry:XM,TubeGeometry:YM,WireframeGeometry:$oe});class Koe extends Ta{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Qt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class qoe extends bl{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Lc extends Ta{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Qt(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 Qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,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.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 Tu extends Lc{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 Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Fs(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Qt(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 Qt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Qt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=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 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.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 Xoe extends Ta{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Qt(16777215),this.specular=new Qt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Yoe extends Ta{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Qt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(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 Joe extends Ta{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(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 Zoe extends Ta{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="ro
4496und",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.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Qoe extends Ta{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Qt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=dg,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ele extends Pa{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function k0(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function tle(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function nle(t){function e(i,s){return t[i]-t[s]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function zD(t,e,n){const r=t.length,i=new t.constructor(r);for(let s=0,a=0;a!==r;++s){const o=n[s]*e;for(let l=0;l!==e;++l)i[a++]=t[o+l]}return i}function s6(t,e,n,r){let i=1,s=t[0];for(;s!==void 0&&s[r]===void 0;)s=t[i++];if(s===void 0)return;let a=s[r];if(a!==void 0)if(Array.isArray(a))do a=s[r],a!==void 0&&(e.push(s.time),n.push.apply(n,a)),s=t[i++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[r],a!==void 0&&(e.push(s.time),a.toArray(n,n.length)),s=t[i++];while(s!==void 0);else do a=s[r],a!==void 0&&(e.push(s.time),n.push(a)),s=t[i++];while(s!==void 0)}function U8e(t,e,n,r,i=30){const s=t.clone();s.name=e;const a=[];for(let l=0;l<s.tracks.length;++l){const u=s.tracks[l],d=u.getValueSize(),h=[],p=[];for(let f=0;f<u.times.length;++f){const m=u.times[f]*i;if(!(m<n||m>=r)){h.push(u.times[f]);for(let x=0;x<d;++x)p.push(u.values[f*d+x])}}h.length!==0&&(u.times=k0(h,u.times.constructor),u.values=k0(p,u.values.constructor),a.push(u))}s.tracks=a;let o=1/0;for(let l=0;l<s.tracks.length;++l)o>s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*o);return s.resetDuration(),s}function H8e(t,e=0,n=t,r=30){r<=0&&(r=30);const i=n.tracks.length,s=e/r;for(let a=0;a<i;++a){const o=n.tracks[a],l=o.ValueTypeName;if(l==="bool"||l==="string")continue;const u=t.tracks.find(function(g){return g.name===o.name&&g.ValueTypeName===l});if(u===void 0)continue;let d=0;const h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=h/3);let p=0;const f=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=f/3);const m=o.times.length-1;let x;if(s<=o.times[0]){const g=d,b=h-d;x=o.values.slice(g,b)}else if(s>=o.times[m]){const g=m*h+d,b=g+h-d;x=o.values.slice(g,b)}else{const g=o.createInterpolant(),b=d,y=h-d;g.evaluate(s),x=g.resultBuffer.slice(b,y)}l==="quaternion"&&new qa().fromArray(x).normalize().conjugate().toArray(x);const v=u.times.length;for(let g=0;g<v;++g){const b=g*f+p;if(l==="quaternion")qa.multiplyQuaternionsFlat(u.values,b,x,0,u.values,b);else{const y=f-p*2;for(let S=0;S<y;++S)u.values[b+S]-=x[S]}}}return t.blendMode=Iz,t}const G8e={convertArray:k0,isTypedArray:tle,getKeyframeOrder:nle,sortedArray:zD,flattenJSON:s6,subclip:U8e,makeClipAdditive:H8e};class sw{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],s=n[r-1];e:{t:{let a;n:{i:if(!(e<i)){for(let o=r+2;;){if(i===void 0){if(e<s)break i;return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===o)break;if(s=i,i=n[++r],e<i)break t}a=n.length;break n}if(!(e>=s)){const o=n[1];e<o&&(r=2,s=o);for(let l=r-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===l)break;if(i=s,s=n[--r-1],e>=s)break t}a=r,r=0;break n}break e}for(;r<a;){const o=r+a>>>1;e<n[o]?a=o:r=o+1}if(i=n[r],s=n[r-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=n.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i;for(let a=0;a!==i;++a)n[a]=r[s+a];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class rle extends sw{constructor(e,n,r,i){super(e,n,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:_0,endingEnd:_0}}intervalChanged_(e,n,r){const i=this.parameterPositions;let s=e-2,a=e+1,o=i[s],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case S0:s=e,o=2*n-r;break;case yS:s=i.length-2,o=n+i[s]-i[s+1];break;default:s=e,o=r}if(l===void 0)switch(this.getSettings_().endingEnd){case S0:a=e,l=2*r-n;break;case yS:a=1,l=r+i[1]-i[0];break;default:a=e-1,l=n}const u=(r-n)*.5,d=this.valueSize;this._weightPrev=u/(n-o),this._weightNext=u/(l-r),this._offsetPrev=s*d,this._offsetNext=a*d}interpolate_(e,n,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,u=l-o,d=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,f=this._weightNext,m=(r-n)/(i-n),x=m*m,v=x*m,g=-p*v+2*p*x-p*m,b=(1+p)*v+(-1.5-2*p)*x+(-.5+p)*m+1,y=(-1-f)*v+(1.5+f)*x+.5*m,S=f*v-f*x;for(let A=0;A!==o;++A)s[A]=g*a[d+A]+b*a[u+A]+y*a[l+A]+S*a[h+A];return s}}class a6 extends sw{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,u=l-o,d=(r-n)/(i-n),h=1-d;for(let p=0;p!==o;
vendor: 85,352 bytes, line 4496
4496++p)s[p]=a[u+p]*h+a[l+p]*d;return s}}class ile extends sw{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Rd{constructor(e,n,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=k0(n,this.TimeBufferType),this.values=k0(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const n=e.constructor;let r;if(n.toJSON!==this.toJSON)r=n.toJSON(e);else{r={name:e.name,times:k0(e.times,Array),values:k0(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new ile(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new a6(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new rle(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case i1:n=this.InterpolantFactoryMethodDiscrete;break;case bx:n=this.InterpolantFactoryMethodLinear;break;case hN:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){const r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return i1;case this.InterpolantFactoryMethodLinear:return bx;case this.InterpolantFactoryMethodSmooth:return hN}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]+=e}return this}scale(e){if(e!==1){const n=this.times;for(let r=0,i=n.length;r!==i;++r)n[r]*=e}return this}trim(e,n){const r=this.times,i=r.length;let s=0,a=i-1;for(;s!==i&&r[s]<e;)++s;for(;a!==-1&&r[a]>n;)--a;if(++a,s!==0||a!==i){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=r.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;o++){const l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&tle(i))for(let o=0,l=i.length;o!==l;++o){const u=i[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===hN,s=e.length-1;let a=1;for(let o=1;o<s;++o){let l=!1;const u=e[o],d=e[o+1];if(u!==d&&(o!==1||u!==e[0]))if(i)l=!0;else{const h=o*r,p=h-r,f=h+r;for(let m=0;m!==r;++m){const x=n[h+m];if(x!==n[p+m]||x!==n[f+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const h=o*r,p=a*r;for(let f=0;f!==r;++f)n[p+f]=n[h+f]}++a}}if(s>0){e[a]=e[s];for(let o=s*r,l=a*r,u=0;u!==r;++u)n[l+u]=n[o+u];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Rd.prototype.TimeBufferType=Float32Array;Rd.prototype.ValueBufferType=Float32Array;Rd.prototype.DefaultInterpolation=bx;class Bx extends Rd{}Bx.prototype.ValueTypeName="bool";Bx.prototype.ValueBufferType=Array;Bx.prototype.DefaultInterpolation=i1;Bx.prototype.InterpolantFactoryMethodLinear=void 0;Bx.prototype.InterpolantFactoryMethodSmooth=void 0;class o6 extends Rd{}o6.prototype.ValueTypeName="color";class _x extends Rd{}_x.prototype.ValueTypeName="number";class sle extends sw{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(r-n)/(i-n);let u=e*o;for(let d=u+o;u!==d;u+=4)qa.slerpFlat(s,0,a,u-o,a,u,l);return s}}class eg extends Rd{InterpolantFactoryMethodLinear(e){return new sle(this.times,this.values,this.getValueSize(),e)}}eg.prototype.ValueTypeName="quaternion";eg.prototype.DefaultInterpolation=bx;eg.prototype.InterpolantFactoryMethodSmooth=void 0;class Fx extends Rd{}Fx.prototype.ValueTypeName="string";Fx.prototype.ValueBufferType=Array;Fx.prototype.DefaultInterpolation=i1;Fx.prototype.InterpolantFactoryMethodLinear=void 0;Fx.prototype.InterpolantFactoryMethodSmooth=void 0;class Sx extends Rd{}Sx.prototype.ValueTypeName="vector";class l1{constructor(e,n=-1,r,i=kM){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Mc(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,o=r.length;a!==o;++a)n.push(W8e(r[a]).scale(i));const s=new this(e.name,e.duration,n,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,a=r.length;s!==a;++s)n.push(Rd.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const s=n.length,a=[];for(let o=0;o<s;o++){let l=[],u=[];l.push((o+s-1)%s,o,(o+1)%s),u.push(0,1,0);const d=nle(l);l=zD(l,1,d),u=zD(u,1,d),!i&&l[0]===0&&(l.push(s),u.push(u[0])),a.push(new _x(".morphTargetInfluences["+n[o].name+"]",l,u).scale(1/r))}return new this(e,-1,a)}static findByName(e,n){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===n)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,n,r){const i={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const u=e[o],d=u.name.match(s);if(d&&d.length>1){const h=d[1];let p=i[h];p||(i[h]=p=[]),p.push(u)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],n,r));return a}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(h,p,f,m,x){if(f.length!==0){const v=[],g=[];s6(f,v,g,m),v.length!==0&&x.push(new h(p,v,g))}},i=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h<u.length;h++){const p=u[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const f={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let x=0;x<p[m].morphTargets.length;x++)f[p[m].morphTargets[x]]=-1;for(const x in f){const v=[],g=[];for(let b=0;b!==p[m].morphTargets.length;++b){const y=p[m];v.push(y.time),g.push(y.morphTarget===x?1:0)}i.push(new _x(".morphTargetInfluence["+x+"]",v,g))}l=f.length*a}else{const f=".bones["+n[h].name+"]";r(Sx,f+".position",p,"pos",i),r(eg,f+".quaternion",p,"rot",i),r(Sx,f+".scale",p,"scl",i)}}return i.length===0?null:new this(s,l,i,o)}resetDuration(){const e=this.tracks;let n=0;for(let r=0,i=e.length;r!==i;++r){const s=this.tracks[r];n=Math.max(n,s.times[s.times.length-1])}return this.duration=n,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let n=0;n<this.tracks.length;n++)e=e&&this.tracks[n].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function V8e(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return _x;case"vector":case"vector2":case"vector3":case"vector4":return Sx;case"color":return o6;case"quaternion":return eg;case"bool":case"boolean":return Bx;case"string":return Fx}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function W8e(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=V8e(t.type);if(t.times===void 0){const n=[],r=[];s6(t.keys,n,r,"value"),t.times=n,t.values=r}return e.parse!==void 0?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const _f={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class JM{constructor(e,n,r){const i=this;let s=!1,a=0,o=0,l;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=r,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 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,p=u.length;h<p;h+=2){const f=u[h],m=u[h+1];if(f.global&&(f.lastIndex=0),f.test(d))return m}return null}}}const ale=new JM;class wo{constructor(e){this.manager=e!==void 0?e:ale,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const r=this;return new Promise(function(i,s){r.load(e,i,n,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}}wo.DEFAULT_MATERIAL_NAME="__DEFAULT";const sf={};class $8e extends Error{constructor(e,n){super(e),this.response=n}}class xo extends wo{constructor(e){super(e)}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=_f.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(s),this.manager.itemEnd(e)},0),s;if(sf[e]!==void 0){sf[e].push({onLoad:n,onProgress:r,onError:i});return}sf[e]=[],sf[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=sf[e],h=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),f=p?parseInt(p):0,m=f!==0;let x=0;const v=new ReadableStream({start(g){b();function b(){h.read().then(({done:y,value:S})=>{if(y)g.close();else{x+=S.byteLength;const A=new ProgressEvent("progress",{lengthComputable:m,loaded:x,total:f});for(let k=0,M=d.length;k<M;k++){const T=d[k];T.onProgress&&T.onProgress(A)}g.enqueue(S),b()}})}}});return new Response(v)}else throw new $8e(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,o));case"json":return u.json();default:if(o===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(o),p=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(p);return u.arrayBuffer().then(m=>f.decode(m))}}}).then(u=>{_f.add(e,u);const d=sf[e];delete sf[e];for(let h=0,p=d.length;h<p;h++){const f=d[h];f.onLoad&&f.onLoad(u)}}).catch(u=>{const d=sf[e];if(d===void 0)throw this.manager.itemError(e),u;delete sf[e];for(let h=0,p=d.length;h<p;h++){const f=d[h];f.onError&&f.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class K8e extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=new xo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r<e.length;r++){const i=l1.parse(e[r]);n.push(i)}return n}}class q8e extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=[],o=new BM,l=new xo(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let u=0;function d(h){l.load(e[h],function(p){const f=s.parse(p,!0);a[h]={width:f.width,height:f.height,format:f.format,mipmaps:f.mipmaps},u+=1,u===6&&(f.mipmapCount===1&&(o.minFilter=zr),o.image=a,o.format=f.format,o.needsUpdate=!0,n&&n(o))},r,i)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)d(h);else l.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const f=p.mipmaps.length/p.mipmapCount;for(let m=0;m<f;m++){a[m]={mipmaps:[]};for(let x=0;x<p.mipmapCount;x++)a[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+x]),a[m].format=p.format,a[m].width=p.width,a[m].height=p.height}o.image=a}else o.image.width=p.width,o.image.height=p.height,o.mipmaps=p.mipmaps;p.mipmapCount===1&&(o.minFilter=zr),o.format=p.format,o.needsUpdate=!0,n&&n(o)},r,i);return o}}class TS extends wo{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=_f.get(e);if(a!==void 0)return s.manager.itemStart(e),setTimeout(function(){n&&n(a),s.manager.itemEnd(e)},0),a;const o=AS("img");function l(){d(),_f.add(e,this),n&&n(this),s.manager.itemEnd(e)}function u(h){d(),i&&i(h),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),s.manager.itemStart(e),o.src=e,o}}class ole extends wo{constructor(e){super(e)}load(e,n,r,i){const s=new PA;s.colorSpace=os;const a=new TS(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function l(u){a.load(e[u],function(d){s.images[u]=d,o++,o===6&&(s.needsUpdate=!0,n&&n(s))},void 0,i)}for(let u=0;u<e.length;++u)l(u);return s}}class l6 extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=new Tm,o=new xo(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let u;try{u=s.parse(l)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?a.image=u.image:u.data!==void 0&&(a.image.width=u.width,a.image.height=u.height,a.image.data=u.data),a.wrapS=u.wrapS!==void 0?u.wrapS:Ji,a.wrapT=u.wrapT!==void 0?u.wrapT:Ji,a.magFilter=u.magFilter!==void 0?u.magFilter:zr,a.minFilter=u.minFilter!==void 0?u.minFilter:zr,a.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0?a.colorSpace=u.colorSpace:u.encoding!==void 0&&(a.encoding=u.encoding),u.flipY!==void 0&&(a.flipY=u.flipY),u.format!==void 0&&(a.format=u.format),u.type!==void 0&&(a.type=u.type),u.mipmaps!==void 0&&(a.mipmaps=u.mipmaps,a.minFilter=Mh),u.mipmapCount===1&&(a.minFilter=zr),u.generateMipmaps!==void 0&&(a.generateMipmaps=u.generateMipmaps),a.needsUpdate=!0,n&&n(a,u)},r,i),a}}class GA extends wo{constructor(e){super(e)}load(e,n,r,i){const s=new ui,a=new TS(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,n!==void 0&&n(s)},r,i),s}}class fg extends Xr{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new Qt(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),n}}class lle extends fg{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Xr.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Qt(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const xP=new Wn,f$=new Ie,p$=new Ie;class c6{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new Wn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new LA,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new gi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;f$.setFromMatrixPosition(e.matrixWorld),n.position.copy(f$),p$.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(p$),n.updateMatrixWorld(),xP.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(xP),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(xP)}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.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class X8e extends c6{constructor(){super(new Os(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const n=this.camera,r=a1*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||n.far;(r!==n.fov||i!==n.aspect||s!==n.far)&&(n.fov=r,n.aspect=i,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class u6 extends fg{constructor(e,n,r=0,i=Math.PI/3,s=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Xr.DEFAULT_UP),this.updateMatrix(),this.target=new Xr,this.distance=r,this.angle=i,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new X8e}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const m$=new Wn,c_=new Ie,vP=new Ie;class Y8e extends c6{constructor(){super(new Os(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new gi(2,1,1,1),new gi(0,1,1,1),new gi(3,1,1,1),new gi(1,1,1,1),new gi(3,0,1,1),new gi(1,0,1,1)],this._cubeDirections=[new Ie(1,0,0),new Ie(-1,0,0),new Ie(0,0,1),new Ie(0,0,-1),new Ie(0,1,0),new Ie(0,-1,0)],this._cubeUps=[new Ie(0,1,0),new Ie(0,1,0),new Ie(0,1,0),new Ie(0,1,0),new Ie(0,0,1),new Ie(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),c_.setFromMatrixPosition(e.matrixWorld),r.position.copy(c_),vP.copy(r.position),vP.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(vP),r.updateMatrixWorld(),i.makeTranslation(-c_.x,-c_.y,-c_.z),m$.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(m$)}}class d6 extends fg{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Y8e}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class J8e extends c6{constructor(){super(new _h(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class h6 extends fg{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Xr.DEFAULT_UP),this.updateMatrix(),this.target=new Xr,this.shadow=new J8e}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class cle extends fg{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class ule extends fg{constructor(e,n,r=10,i=10){super(e,n),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 n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class dle{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Ie)}set(e){for(let n=0;n<9;n++)this.coefficients[n].copy(e[n]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,n){const r=e.x,i=e.y,s=e.z,a=this.coefficients;return n.copy(a[0]).multiplyScalar(.282095),n.addScaledVector(a[1],.488603*i),n.addScaledVector(a[2],.488603*s),n.addScaledVector(a[3],.488603*r),n.addScaledVector(a[4],1.092548*(r*i)),n.addScaledVector(a[5],1.092548*(i*s)),n.addScaledVector(a[6],.315392*(3*s*s-1)),n.addScaledVector(a[7],1.092548*(r*s)),n.addScaledVector(a[8],.546274*(r*r-i*i)),n}getIrradianceAt(e,n){const r=e.x,i=e.y,s=e.z,a=this.coefficients;return n.copy(a[0]).multiplyScalar(.886227),n.addScaledVector(a[1],2*.511664*i),n.addScaledVector(a[2],2*.511664*s),n.addScaledVector(a[3],2*.511664*r),n.addScaledVector(a[4],2*.429043*r*i),n.addScaledVector(a[5],2*.429043*i*s),n.addScaledVector(a[6],.743125*s*s-.247708),n.addScaledVector(a[7],2*.429043*r*s),n.addScaledVector(a[8],.429043*(r*r-i*i)),n}add(e){for(let n=0;n<9;n++)this.coefficients[n].add(e.coefficients[n]);return this}addScaledSH(e,n){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],n);return this}scale(e){for(let n=0;n<9;n++)this.coefficients[n].multiplyScalar(e);return this}lerp(e,n){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],n);return this}equals(e){for(let n=0;n<9;n++)if(!this.coefficients[n].equals(e.coefficients[n]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,n=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,n+i*3);return this}toArray(e=[],n=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,n+i*3);return e}static getBasisAt(e,n){const r=e.x,i=e.y,s=e.z;n[0]=.282095,n[1]=.488603*i,n[2]=.488603*s,n[3]=.488603*r,n[4]=1.092548*r*i,n[5]=1.092548*i*s,n[6]=.315392*(3*s*s-1),n[7]=1.092548*r*s,n[8]=.546274*(r*r-i*i)}}class hle extends fg{constructor(e=new dle,n=1){super(void 0,n),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const n=super.toJSON(e);return n.object.sh=this.sh.toArray(),n}}class ZM extends wo{constructor(e){super(e),this.textures={}}load(e,n,r,i){const s=this,a=new xo(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const n=this.textures;function r(s){return n[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),n[s]}const i=ZM.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new Qt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const a=e.uniforms[s];switch(i.uniforms[s]={},a.type){case"t":i.uniforms[s].value=r(a.value);break;case"c":i.uniforms[s].value=new Qt().setHex(a.value);break;case"v2":i.uniforms[s].value=new Rt().fromArray(a.value);break;case"v3":i.uniforms[s].value=new Ie().fromArray(a.value);break;case"v4":i.uniforms[s].value=new gi().fromArray(a.value);break;case"m3":i.uniforms[s].value=new Nr().fromArray(a.value);break;case"m4":i.uniforms[s].value=new Wn().fromArray(a.value);break;default:i.uniforms[s].value=a.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new Rt().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Rt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const n={ShadowMaterial:Koe,SpriteMaterial:qz,RawShaderMaterial:qoe,ShaderMaterial:bl,PointsMaterial:DM,MeshPhysicalMaterial:Tu,MeshStandardMaterial:Lc,MeshPhongMaterial:Xoe,MeshToonMaterial:Yoe,MeshNormalMaterial:Joe,MeshLambertMaterial:Zoe,MeshDepthMaterial:IA,MeshDistanceMaterial:RM,MeshBasicMaterial:ml,MeshMatcapMaterial:Qoe,LineDashedMaterial:ele,LineBasicMaterial:Pa,Material:Ta};return new n[e]}}class Mm{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r<i;r++)n+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(n))}catch{return n}}static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}class f6 extends or{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class fle extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=new xo(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const n={},r={};function i(f,m){if(n[m]!==void 0)return n[m];const v=f.interleavedBuffers[m],g=s(f,v.buffer),b=Hy(v.type,g),y=new BA(b,v.stride);return y.uuid=v.uuid,n[m]=y,y}function s(f,m){if(r[m]!==void 0)return r[m];const v=f.arrayBuffers[m],g=new Uint32Array(v).buffer;return r[m]=g,g}const a=e.isInstancedBufferGeometry?new f6:new or,o=e.data.index;if(o!==void 0){const f=Hy(o.type,o.array);a.setIndex(new Yr(f,1))}const l=e.data.attributes;for(const f in l){const m=l[f];let x;if(m.isInterleavedBufferAttribute){const v=i(e.data,m.data);x=new Zm(v,m.itemSize,m.offset,m.normalized)}else{const v=Hy(m.type,m.array),g=m.isInstancedBufferAttribute?Qm:Yr;x=new g(v,m.itemSize,m.normalized)}m.name!==void 0&&(x.name=m.name),m.usage!==void 0&&x.setUsage(m.usage),a.setAttribute(f,x)}const u=e.data.morphAttributes;if(u)for(const f in u){const m=u[f],x=[];for(let v=0,g=m.length;v<g;v++){const b=m[v];let y;if(b.isInterleavedBufferAttribute){const S=i(e.data,b.data);y=new Zm(S,b.itemSize,b.offset,b.normalized)}else{const S=Hy(b.type,b.array);y=new Yr(S,b.itemSize,b.normalized)}b.name!==void 0&&(y.name=b.name),x.push(y)}a.morphAttributes[f]=x}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let f=0,m=h.length;f!==m;++f){const x=h[f];a.addGroup(x.start,x.count,x.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const f=new Ie;p.center!==void 0&&f.fromArray(p.center),a.boundingSphere=new Xa(f,p.radius)}return e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}}class Z8e extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=this.path===""?Mm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const o=new xo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){let u=null;try{u=JSON.parse(l)}catch(h){i!==void 0&&i(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const d=u.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(u,n)},r,i)}async loadAsync(e,n){const r=this,i=this.path===""?Mm.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new xo(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const a=await s.loadAsync(e,n),o=JSON.parse(a),l=o.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await r.parseAsync(o)}parse(e,n){const r=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),a=this.parseImages(e.images,function(){n!==void 0&&n(u)}),o=this.parseTextures(e.textures,a),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,s,l,o,r),d=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,d),n!==void 0){let h=!1;for(const p in a)if(a[p].data instanceof HTMLImageElement){h=!0;break}h===!1&&n(u)}return u}async parseAsync(e){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,i,o,a,n),u=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,u),l}parseShapes(e){const n={};if(e!==void 0)for(let r=0,i=e.length;r<i;r++){const s=new q0().fromJSON(e[r]);n[s.uuid]=s}return n}parseSkeletons(e,n){const r={},i={};if(n.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,a=e.length;s<a;s++){const o=new FA().fromJSON(e[s],i);r[o.uuid]=o}return r}parseGeometries(e,n){const r={};if(e!==void 0){const i=new fle;for(let s=0,a=e.length;s<a;s++){let o;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(l);break;default:l.type in h$?o=h$[l.type].fromJSON(l,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}o.uuid=l.uuid,l.name!==void 0&&(o.name=l.name),l.userData!==void 0&&(o.userData=l.userData),r[l.uuid]=o}}return r}parseMaterials(e,n){const r={},i={};if(e!==void 0){const s=new ZM;s.setTextures(n);for(let a=0,o=e.length;a<o;a++){const l=e[a];r[l.uuid]===void 0&&(r[l.uuid]=s.parse(l)),i[l.uuid]=r[l.uuid]}}return i}parseAnimations(e){const n={};if(e!==void 0)for(let r=0;r<e.length;r++){const i=e[r],s=l1.parse(i);n[s.uuid]=s}return n}parseImages(e,n){const r=this,i={};let s;function a(l){return r.manager.itemStart(l),s.load(l,function(){r.manager.itemEnd(l)},void 0,function(){r.manager.itemError(l),r.manager.itemEnd(l)})}function o(l){if(typeof l=="string"){const u=l,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:r.resourcePath+u;return a(d)}else return l.data?{data:Hy(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new JM(n);s=new TS(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,d=e.length;u<d;u++){const h=e[u],p=h.url;if(Array.isArray(p)){const f=[];for(let m=0,x=p.length;m<x;m++){const v=p[m],g=o(v);g!==null&&(g instanceof HTMLImageElement?f.push(g):f.push(new Tm(g.data,g.width,g.height)))}i[h.uuid]=new A0(f)}else{const f=o(h.url);i[h.uuid]=new A0(f)}}}return i}async parseImagesAsync(e){const n=this,r={};let i;async function s(a){if(typeof a=="string"){const o=a,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:n.resourcePath+o;return await i.loadAsync(l)}else return a.data?{data:Hy(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){i=new TS(this.manager),i.setCrossOrigin(this.crossOrigin);for(let a=0,o=e.length;a<o;a++){const l=e[a],u=l.url;if(Array.isArray(u)){const d=[];for(let h=0,p=u.length;h<p;h++){const f=u[h],m=await s(f);m!==null&&(m instanceof HTMLImageElement?d.push(m):d.push(new Tm(m.data,m.width,m.height)))}r[l.uuid]=new A0(d)}else{const d=await s(l.url);r[l.uuid]=new A0(d)}}}return r}parseTextures(e,n){function r(s,a){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),a[s])}const i={};if(e!==void 0)for(let s=0,a=e.length;s<a;s++){const o=e[s];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),n[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const l=n[o.image],u=l.data;let d;Array.isArray(u)?(d=new PA,u.length===6&&(d.needsUpdate=!0)):(u&&u.data?d=new Tm:d=new ui,u&&(d.needsUpdate=!0)),d.source=l,d.uuid=o.uuid,o.name!==void 0&&(d.name=o.name),o.mapping!==void 0&&(d.mapping=r(o.mapping,Q8e)),o.channel!==void 0&&(d.channel=o.channel),o.offset!==void 0&&d.offset.fromArray(o.offset),o.repeat!==void 0&&d.repeat.fromArray(o.repeat),o.center!==void 0&&d.center.fromArray(o.center),o.rotation!==void 0&&(d.rotation=o.rotation),o.wrap!==void 0&&(d.wrapS=r(o.wrap[0],g$),d.wrapT=r(o.wrap[1],g$)),o.format!==void 0&&(d.format=o.format),o.internalFormat!==void 0&&(d.internalFormat=o.internalFormat),o.type!==void 0&&(d.type=o.type),o.colorSpace!==void 0&&(d.colorSpace=o.colorSpace),o.encoding!==void 0&&(d.encoding=o.encoding),o.minFilter!==void 0&&(d.minFilter=r(o.minFilter,x$)),o.magFilter!==void 0&&(d.magFilter=r(o.magFilter,x$)),o.anisotropy!==void 0&&(d.anisotropy=o.anisotropy),o.flipY!==void 0&&(d.flipY=o.flipY),o.generateMipmaps!==void 0&&(d.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(d.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(d.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(d.compareFunction=o.compareFunction),o.userData!==void 0&&(d.userData=o.userData),i[o.uuid]=d}return i}parseObject(e,n,r,i,s){let a;function o(p){return n[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),n[p]}function l(p){if(p!==void 0){if(Array.isArray(p)){const f=[];for(let m=0,x=p.length;m<x;m++){const v=p[m];r[v]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",v),f.push(r[v])}return f}return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),r[p]}}function u(p){return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),i[p]}let d,h;switch(e.type){case"Scene":a=new DA,e.background!==void 0&&(Number.isInteger(e.background)?a.background=new Qt(e.background):a.background=u(e.background)),e.environment!==void 0&&(a.environment=u(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?a.fog=new LM(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(a.fog=new PM(e.fog.color,e.fog.density)),e.fog.name!==""&&(a.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(a.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(a.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":a=new Os(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(a.focus=e.focus),e.zoom!==void 0&&(a.zoom=e.zoom),e.filmGauge!==void 0&&(a.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(a.filmOffset=e.filmOffset),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new _h(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(a.zoom=e.zoom),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new cle(e.color,e.intensity);break;case"DirectionalLight":a=new h6(e.color,e.intensity);break;case"PointLight":a=new d6(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new ule(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new u6(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new lle(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=new hle().fromJSON(e);break;case"SkinnedMesh":d=o(e.geometry),h=l(e.material),a=new Xz(d,h),e.bindMode!==void 0&&(a.bindMode=e.bindMode),e.bindMatrix!==void 0&&a.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(a.skeleton=e.skeleton);break;case"Mesh":d=o(e.geometry),h=l(e.material),a=new Li(d,h);break;case"InstancedMesh":d=o(e.geometry),h=l(e.material);const p=e.count,f=e.instanceMatrix,m=e.instanceColor;a=new Yz(d,h,p),a.instanceMatrix=new Qm(new Float32Array(f.array),16),m!==void 0&&(a.instanceColor=new Qm(new Float32Array(m.array),m.itemSize));break;case"BatchedMesh":d=o(e.geometry),h=l(e.material),a=new Doe(e.maxGeometryCount,e.maxVertexCount,e.maxIndexCount,h),a.geometry=d,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._visibility=e.visibility,a._active=e.active,a._bounds=e.bounds.map(x=>{const v=new ma;v.min.fromArray(x.boxMin),v.max.fromArray(x.boxMax);const g=new Xa;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:v,sphereInitialized:x.sphereInitialized,sphere:g}}),a._maxGeometryCount=e.maxGeometryCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._geometryCount=e.geometryCount,a._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":a=new Ioe;break;case"Line":a=new Ff(o(e.geometry),l(e.material));break;case"LineLoop":a=new Jz(o(e.geometry),l(e.material));break;case"LineSegments":a=new Ql(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":a=new Zz(o(e.geometry),l(e.material));break;case"Sprite":a=new Loe(l(e.material));break;case"Group":a=new wf;break;case"Bone":a=new IM;break;default:a=new Xr}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix!==void 0?(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let f=0;f<p.length;f++)a.add(this.parseObject(p[f],n,r,i,s))}if(e.animations!==void 0){const p=e.animations;for(let f=0;f<p.length;f++){const m=p[f];a.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(a.autoUpdate=e.autoUpdate);const p=e.levels;for(let f=0;f<p.length;f++){const m=p[f],x=a.getObjectByProperty("uuid",m.object);x!==void 0&&a.addLevel(x,m.distance,m.hysteresis)}}return a}bindSkeletons(e,n){Object.keys(n).length!==0&&e.traverse(function(r){if(r.isSkinnedMesh===!0&&r.skeleton!==void 0){const i=n[r.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",r.skeleton):r.bind(i,r.bindMatrix)}})}}const Q8e={UVMapping:Xm,CubeReflectionMapping:Th,CubeRefractionMapping:Ym,EquirectangularReflectionMapping:n1,EquirectangularRefractionMapping:xS,CubeUVReflectionMapping:nw},g$={RepeatWrapping:Jm,ClampToEdgeWrapping:Ji,MirroredRepeatWrapping:r1},x$={NearestFilter:Bs,NearestMipmapNearestFilter:vS,NearestMipmapLinearFilter:gb,LinearFilter:zr,LinearMipmapNearestFilter:SM,LinearMipmapLinearFilter:Mh};class ple extends wo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=_f.get(e);if(a!==void 0){if(s.manager.itemStart(e),a.then){a.then(u=>{n&&n(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){n&&n(a),s.manager.itemEnd(e)},0),a}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader;const l=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return _f.add(e,u),n&&n(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),_f.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});_f.add(e,l),s.manager.itemStart(e)}}let Jk;class p6{static getContext(){return Jk===void 0&&(Jk=new(window.AudioContext||window.webkitAudioContext)),Jk}static setContext(e){Jk=e}}class e9e extends wo{constructor(e){super(e)}load(e,n,r,i){const s=this,a=new xo(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{const u=l.slice(0);p6.getContext().decodeAudioData(u,function(h){n(h)}).catch(o)}catch(u){o(u)}},r,i);function o(l){i?i(l):console.error(l),s.manager.itemError(e)}}}const v$=new Wn,y$=new Wn,Hg=new Wn;class t9e{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Os,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Os,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,Hg.copy(e.projectionMatrix);const i=n.eyeSep/2,s=i*n.near/n.focus,a=n.near*Math.tan($0*n.fov*.5)/n.zoom;let o,l;y$.elements[12]=-i,v$.elements[12]=i,o=-a*n.aspect+s,l=a*n.aspect+s,Hg.elements[0]=2*n.near/(l-o),Hg.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Hg),o=-a*n.aspect-s,l=a*n.aspect-s,Hg.elements[0]=2*n.near/(l-o),Hg.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Hg)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(y$),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(v$)}}class m6{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=b$(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=b$();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function b$(){return(typeof performance>"u"?Date:performance).now()}const Gg=new Ie,w$=new qa,n9e=new Ie,Vg=new Ie;class r9e extends Xr{constructor(){super(),this.type="AudioListener",this.context=p6.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new m6}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Gg,w$,n9e),Vg.set(0,0,-1).applyQuaternion(w$),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(Gg.x,i),n.positionY.linearRampToValueAtTime(Gg.y,i),n.positionZ.linearRampToValueAtTime(Gg.z,i),n.forwardX.linearRampToValueAtTime(Vg.x,i),n.forwardY.linearRampToValueAtTime(Vg.y,i),n.forwardZ.linearRampToValueAtTime(Vg.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(Gg.x,Gg.y,Gg.z),n.setOrientation(Vg.x,Vg.y,Vg.z,r.x,r.y,r.z)}}class mle extends Xr{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Wg=new Ie,_$=new qa,i9e=new Ie,$g=new Ie;class s9e extends mle{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,n,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=n,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Wg,_$,i9e),$g.set(0,0,1).applyQuaternion(_$);const n=this.panner;if(n.positionX){const r=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Wg.x,r),n.positionY.linearRampToValueAtTime(Wg.y,r),n.positionZ.linearRampToValueAtTime(Wg.z,r),n.orientationX.linearRampToValueAtTime($g.x,r),n.orientationY.linearRampToValueAtTime($g.y,r),n.orientationZ.linearRampToValueAtTime($g.z,r)}else n.setPosition(Wg.x,Wg.y,Wg.z),n.setOrientation($g.x,$g.y,$g.z)}}class a9e{constructor(e,n=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const n=this.getFrequencyData();for(let r=0;r<n.length;r++)e+=n[r];return e/n.length}}class gle{constructor(e,n,r){this.binding=e,this.valueSize=r;let i,s,a;switch(n){case"quaternion":i=this._slerp,s=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:i=this._lerp,s=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,n){const r=this.buffer,i=this.valueSize,s=e*i+i;let a=this.cumulativeWeight;if(a===0){for(let o=0;o!==i;++o)r[s+o]=r[o];a=n}else{a+=n;const o=n/a;this._mixBufferRegion(r,s,0,o,i)}this.cumulativeWeight=a}accumulateAdditive(e){const n=this.buffer,r=this.valueSize,i=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(n,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const n=this.valueSize,r=this.buffer,i=e*n+n,s=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=n*this._origIndex;this._mixBufferRegion(r,i,l,1-s,n)}a>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){o.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let s=r,a=i;s!==a;++s)n[s]=n[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let r=e;r<n;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,n=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[n+r]=this.buffer[e+r]}_select(e,n,r,i,s){if(i>=.5)for(let a=0;a!==s;++a)e[n+a]=e[r+a]}_slerp(e,n,r,i){qa.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,s){const a=this._workIndex*s;qa.multiplyQuaternionsFlat(e,a,e,n,e,r),qa.slerpFlat(e,n,e,n,e,a,i)}_lerp(e,n,r,i,s){const a=1-i;for(let o=0;o!==s;++o){const l=n+o;e[l]=e[l]*a+e[r+o]*i}}_lerpAdditive(e,n,r,i,s){for(let a=0;a!==s;++a){const o=n+a;e[o]=e[o]+e[r+a]*i}}}const g6="\\[\\]\\.:\\/",o9e=new RegExp("["+g6+"]","g"),x6="[^"+g6+"]",l9e="[^"+g6.replace("\\.","")+"]",c9e=/((?:WC+[\/:])*)/.source.replace("WC",x6),u9e=/(WCOD+)?/.source.replace("WCOD",l9e),d9e=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",x6),h9e=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",x6),f9e=new RegExp("^"+c9e+u9e+d9e+h9e+"$"),p9e=["material","materials","bones","map"];class m9e{constructor(e,n,r){const i=r||qr.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class qr{constructor(e,n,r){this.path=n,this.parsedPath=r||qr.parseTrackName(n),this.node=qr.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new qr.Composite(e,n,r):new qr(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(o9e,"")}static parseTrackName(e){const n=f9e.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);p9e.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(s){for(let a=0;a<s.length;a++){const o=s[a];if(o.name===n||o.uuid===n)return o;const l=r(o.children);if(l)return l}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)e[n++]=r[i]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[n++]}_setValue_array_setNeedsUpdate(e,n){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node;const n=this.parsedPath,r=n.objectName,i=n.propertyName;let s=n.propertyIndex;if(e||(e=qr.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let u=n.objectIndex;switch(r){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const a=e[i];if(a===void 0){const u=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(l=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}qr.Composite=m9e;qr.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};qr.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};qr.prototype.GetterByBindingType=[qr.prototype._getValue_direct,qr.prototype._getValue_array,qr.prototype._getValue_arrayElement,qr.prototype._getValue_toArray];qr.prototype.SetterByBindingTypeAndVersioning=[[qr.prototype._setValue_direct,qr.prototype._setValue_direct_setNeedsUpdate,qr.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[qr.prototype._setValue_array,qr.prototype._setValue_array_setNeedsUpdate,qr.prototype._setValue_array_setMatrixWorldNeedsUpdate],[qr.prototype._setValue_arrayElement,qr.prototype._setValue_arrayElement_setNeedsUpdate,qr.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[qr.prototype._setValue_fromArray,qr.prototype._setValue_fromArray_setNeedsUpdate,qr.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class g9e{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Mc(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}add(){const e=this._objects,n=this._indicesByUUID,r=this._paths,i=this._parsedPaths,s=this._bindings,a=s.length;let o,l=e.length,u=this.nCachedObjects_;for(let d=0,h=arguments.length;d!==h;++d){const p=arguments[d],f=p.uuid;let m=n[f];if(m===void 0){m=l++,n[f]=m,e.push(p);for(let x=0,v=a;x!==v;++x)s[x].push(new qr(p,r[x],i[x]))}else if(m<u){o=e[m];const x=--u,v=e[x];n[v.uuid]=m,e[m]=v,n[f]=x,e[x]=p;for(let g=0,b=a;g!==b;++g){const y=s[g],S=y[x];let A=y[m];y[m]=S,A===void 0&&(A=new qr(p,r[g],i[g])),y[x]=A}}else e[m]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){const l=arguments[a],u=l.uuid,d=n[u];if(d!==void 0&&d>=s){const h=s++,p=e[h];n[p.uuid]=d,e[d]=p,n[u]=h,e[h]=l;for(let f=0,m=i;f!==m;++f){const x=r[f],v=x[h],g=x[d];x[d]=v,x[h]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,a=e.length;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],d=u.uuid,h=n[d];if(h!==void 0)if(delete n[d],h<s){const p=--s,f=e[p],m=--a,x=e[m];n[f.uuid]=h,e[h]=f,n[x.uuid]=p,e[p]=x,e.pop();for(let v=0,g=i;v!==g;++v){const b=r[v],y=b[p],S=b[m];b[h]=y,b[p]=S,b.pop()}}else{const p=--a,f=e[p];p>0&&(n[f.uuid]=h),e[h]=f,e.pop();for(let m=0,x=i;m!==x;++m){const v=r[m];v[h]=v[p],v.pop()}}}this.nCachedObjects_=s}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const a=this._paths,o=this._parsedPaths,l=this._objects,u=l.length,d=this.nCachedObjects_,h=new Array(u);i=s.length,r[e]=i,a.push(e),o.push(n),s.push(h);for(let p=d,f=l.length;p!==f;++p){const m=l[p];h[p]=new qr(m,e,n)}return h}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],u=e[o];n[u]=r,a[r]=l,a.pop(),s[r]=s[o],s.pop(),i[r]=i[o],i.pop()}}}class xle{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const s=n.tracks,a=s.length,o=new Array(a),l={endingStart:_0,endingEnd:_0};for(let u=0;u!==a;++u){const d=s[u].createInterpolant(null);o[u]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=aoe,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,n){return this.loop=e,this.repetitions=n,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,s=e._clip.duration,a=s/i,o=i/s;e.warp(1,a,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,r){const i=this._mixer,s=i.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,l[1]=s+r,u[0]=e/a,u[1]=n/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,n,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const a=this._updateTime(n),o=this._updateWeight(e);if(o>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case Iz:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(a),u[d].accumulateAdditive(o);break;case kM:default:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(a),u[d].accumulate(i,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const a=r===ooe;if(e===0)return s===-1?i:a&&(s&1)===1?n-i:i;if(r===soe){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),i>=n||i<0){const o=Math.floor(i/n);i-=n*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(a&&(s&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=S0,i.endingEnd=S0):(e?i.endingStart=this.zeroSlopeAtStart?S0:_0:i.endingStart=yS,n?i.endingEnd=this.zeroSlopeAtEnd?S0:_0:i.endingEnd=yS)}_scheduleFading(e,n,r){const i=this._mixer,s=i.time;let a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=n,o[1]=s+e,l[1]=r,this}}const x9e=new Float32Array(1);class v9e extends Zf{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,a=e._propertyBindings,o=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let d=u[l];d===void 0&&(d={},u[l]=d);for(let h=0;h!==s;++h){const p=i[h],f=p.name;let m=d[f];if(m!==void 0)++m.referenceCount,a[h]=m;else{if(m=a[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,l,f));continue}const x=n&&n._propertyBindings[h].binding.parsedPath;m=new gle(qr.create(r,f,x),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,f),a[h]=m}o[h].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const s=n[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const s=n[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n<this._nActiveActions}_addInactiveAction(e,n,r){const i=this._actions,s=this._actionsByClip;let a=s[n];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[n]=a;else{const o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[r]=e}_removeInactiveAction(e){const n=this._actions,r=n[n.length-1],i=e._cacheIndex;r._cacheIndex=i,n[i]=r,n.pop(),e._cacheIndex=null;const s=e._clip.uuid,a=this._actionsByClip,o=a[s],l=o.knownActions,u=l[l.length-1],d=e._byClipCacheIndex;u._byClipCacheIndex=d,l[d]=u,l.pop(),e._byClipCacheIndex=null;const h=o.actionByRoot,p=(e._localRoot||this._root).uuid;delete h[p],l.length===0&&delete a[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const s=n[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const n=this._actions,r=e._cacheIndex,i=this._nActiveActions++,s=n[i];e._cacheIndex=i,n[i]=e,s._cacheIndex=r,n[r]=s}_takeBackAction(e){const n=this._actions,r=e._cacheIndex,i=--this._nActiveActions,s=n[i];e._cacheIndex=i,n[i]=e,s._cacheIndex=r,n[r]=s}_addInactiveBinding(e,n,r){const i=this._bindingsByRootAndName,s=this._bindings;let a=i[n];a===void 0&&(a={},i[n]=a),a[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const n=this._bindings,r=e.binding,i=r.rootNode.uuid,s=r.path,a=this._bindingsByRootAndName,o=a[i],l=n[n.length-1],u=e._cacheIndex;l._cacheIndex=u,n[u]=l,n.pop(),delete o[s],Object.keys(o).length===0&&delete a[i]}_lendBinding(e){const n=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,s=n[i];e._cacheIndex=i,n[i]=e,s._cacheIndex=r,n[r]=s}_takeBackBinding(e){const n=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,s=n[i];e._cacheIndex=i,n[i]=e,s._cacheIndex=r,n[r]=s}_lendControlInterpolant(){const e=this._controlInterpolants,n=this._nActiveControlInterpolants++;let r=e[n];return r===void 0&&(r=new a6(new Float32Array(2),new Float32Array(2),1,x9e),r.__cacheIndex=n,e[n]=r),r}_takeBackControlInterpolant(e){const n=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=n[i];e.__cacheIndex=i,n[i]=e,s.__cacheIndex=r,n[r]=s}clipAction(e,n,r){const i=n||this._root,s=i.uuid;let a=typeof e=="string"?l1.findByName(i,e):e;const o=a!==null?a.uuid:e,l=this._actionsByClip[o];let u=null;if(r===void 0&&(a!==null?r=a.blendMode:r=kM),l!==void 0){const h=l.actionByRoot[s];if(h!==void 0&&h.blendMode===r)return h;u=l.knownActions[0],a===null&&(a=u._clip)}if(a===null)return null;const d=new xle(this,a,n,r);return this._bindAction(d,u),this._addInactiveAction(d,o,s),d}existingAction(e,n){const r=n||this._root,i=r.uuid,s=typeof e=="string"?l1.findByName(r,e):e,a=s?s.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[i]||null}stopAllAction(){const e=this._actions,n=this._nActiveActions;for(let r=n-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),a=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,s,a);const o=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)o[u].apply(a);return this}setTime(e){this.time=0;for(let n=0;n<this._actions.length;n++)this._actions[n].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const n=this._actions,r=e.uuid,i=this._actionsByClip,s=i[r];if(s!==void 0){const a=s.knownActions;for(let o=0,l=a.length;o!==l;++o){const u=a[o];this._deactivateAction(u);const d=u._cacheIndex,h=n[n.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,h._cacheIndex=d,n[d]=h,n.pop(),this._removeInactiveBindingsForAction(u)}delete i[r]}}uncacheRoot(e){const n=e.uuid,r=this._actionsByClip;for(const a in r){const o=r[a].actionByRoot,l=o[n];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const i=this._bindingsByRootAndName,s=i[n];if(s!==void 0)for(const a in s){const o=s[a];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,n){const r=this.existingAction(e,n);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class v6{constructor(e){this.value=e}clone(){return new v6(this.value.clone===void 0?this.value:this.value.clone())}}let y9e=0;class b9e extends Zf{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:y9e++}),this.name="",this.usage=SS,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const n=this.uniforms.indexOf(e);return n!==-1&&this.uniforms.splice(n,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const n=e.uniforms;this.uniforms.length=0;for(let r=0,i=n.length;r<i;r++){const s=Array.isArray(n[r])?n[r]:[n[r]];for(let a=0;a<s.length;a++)this.uniforms.push(s[a].clone())}return this}clone(){return new this.constructor().copy(this)}}class w9e extends BA{constructor(e,n,r=1){super(e,n),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const n=super.clone(e);return n.meshPerAttribute=this.meshPerAttribute,n}toJSON(e){const n=super.toJSON(e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}class _9e{constructor(e,n,r,i,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=n,this.itemSize=r,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,n){return this.type=e,this.elementSize=n,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class y6{constructor(e,n,r=0,i=1/0){this.ray=new Dx(e,n),this.near=r,this.far=i,this.camera=null,this.layers=new K0,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster:
4496Unsupported camera type: "+n.type)}intersectObject(e,n=!0,r=[]){return UD(e,this,r,n),r.sort(S$),r}intersectObjects(e,n=!0,r=[]){for(let i=0,s=e.length;i<s;i++)UD(e[i],this,r,n);return r.sort(S$),r}}function S$(t,e){return t.distance-e.distance}function UD(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),r===!0){const i=t.children;for(let s=0,a=i.length;s<a;s++)UD(i[s],e,n,!0)}}class HD{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Fs(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class S9e{constructor(e=1,n=0,r=0){return this.radius=e,this.theta=n,this.y=r,this}set(e,n,r){return this.radius=e,this.theta=n,this.y=r,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=n,this}clone(){return new this.constructor().copy(this)}}const A$=new Rt;class A9e{constructor(e=new Rt(1/0,1/0),n=new Rt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=A$.copy(n).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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}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,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,A$).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 E$=new Ie,Zk=new Ie;class E9e{constructor(e=new Ie,n=new Ie){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),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,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){E$.subVectors(e,this.start),Zk.subVectors(this.end,this.start);const r=Zk.dot(Zk);let s=Zk.dot(E$)/r;return n&&(s=Fs(s,0,1)),s}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}
vendor: 59,992 bytes, lines 4496-4524
4496applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const k$=new Ie;class k9e extends Xr{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new or,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a<l;a++,o++){const u=a/l*Math.PI*2,d=o/l*Math.PI*2;i.push(Math.cos(u),Math.sin(u),1,Math.cos(d),Math.sin(d),1)}r.setAttribute("position",new _n(i,3));const s=new Pa({fog:!1,toneMapped:!1});this.cone=new Ql(r,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);const e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),k$.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(k$),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ap=new Ie,Qk=new Wn,yP=new Wn;class C9e extends Ql{constructor(e){const n=vle(e),r=new or,i=[],s=[],a=new Qt(0,0,1),o=new Qt(0,1,0);for(let u=0;u<n.length;u++){const d=n[u];d.parent&&d.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(a.r,a.g,a.b),s.push(o.r,o.g,o.b))}r.setAttribute("position",new _n(i,3)),r.setAttribute("color",new _n(s,3));const l=new Pa({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=n,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const n=this.bones,r=this.geometry,i=r.getAttribute("position");yP.copy(this.root.matrixWorld).invert();for(let s=0,a=0;s<n.length;s++){const o=n[s];o.parent&&o.parent.isBone&&(Qk.multiplyMatrices(yP,o.matrixWorld),Ap.setFromMatrixPosition(Qk),i.setXYZ(a,Ap.x,Ap.y,Ap.z),Qk.multiplyMatrices(yP,o.parent.matrixWorld),Ap.setFromMatrixPosition(Qk),i.setXYZ(a+1,Ap.x,Ap.y,Ap.z),a+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function vle(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push.apply(e,vle(t.children[n]));return e}class N9e extends Li{constructor(e,n,r){const i=new HA(n,4,2),s=new ml({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const T9e=new Ie,C$=new Qt,N$=new Qt;class M9e extends Xr{constructor(e,n,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new UA(n);i.rotateY(Math.PI*.5),this.material=new ml({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),a=new Float32Array(s.count*3);i.setAttribute("color",new Yr(a,3)),this.add(new Li(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const n=e.geometry.getAttribute("color");C$.copy(this.light.color),N$.copy(this.light.groundColor);for(let r=0,i=n.count;r<i;r++){const s=r<i/2?C$:N$;n.setXYZ(r,s.r,s.g,s.b)}n.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(T9e.setFromMatrixPosition(this.light.matrixWorld).negate())}}class R9e extends Ql{constructor(e=10,n=10,r=4473924,i=8947848){r=new Qt(r),i=new Qt(i);const s=n/2,a=e/n,o=e/2,l=[],u=[];for(let p=0,f=0,m=-o;p<=n;p++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const x=p===s?r:i;x.toArray(u,f),f+=3,x.toArray(u,f),f+=3,x.toArray(u,f),f+=3,x.toArray(u,f),f+=3}const d=new or;d.setAttribute("position",new _n(l,3)),d.setAttribute("color",new _n(u,3));const h=new Pa({vertexColors:!0,toneMapped:!1});super(d,h),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class j9e extends Ql{constructor(e=10,n=16,r=8,i=64,s=4473924,a=8947848){s=new Qt(s),a=new Qt(a);const o=[],l=[];if(n>1)for(let h=0;h<n;h++){const p=h/n*(Math.PI*2),f=Math.sin(p)*e,m=Math.cos(p)*e;o.push(0,0,0),o.push(f,0,m);const x=h&1?s:a;l.push(x.r,x.g,x.b),l.push(x.r,x.g,x.b)}for(let h=0;h<r;h++){const p=h&1?s:a,f=e-e/r*h;for(let m=0;m<i;m++){let x=m/i*(Math.PI*2),v=Math.sin(x)*f,g=Math.cos(x)*f;o.push(v,0,g),l.push(p.r,p.g,p.b),x=(m+1)/i*(Math.PI*2),v=Math.sin(x)*f,g=Math.cos(x)*f,o.push(v,0,g),l.push(p.r,p.g,p.b)}}const u=new or;u.setAttribute("position",new _n(o,3)),u.setAttribute("color",new _n(l,3));const d=new Pa({vertexColors:!0,toneMapped:!1});super(u,d),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const T$=new Ie,eC=new Ie,M$=new Ie;class P9e extends Xr{constructor(e,n,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",n===void 0&&(n=1);let i=new or;i.setAttribute("position",new _n([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));const s=new Pa({fog:!1,toneMapped:!1});this.lightPlane=new Ff(i,s),this.add(this.lightPlane),i=new or,i.setAttribute("position",new _n([0,0,0,0,0,1],3)),this.targetLine=new Ff(i,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),T$.setFromMatrixPosition(this.light.matrixWorld),eC.setFromMatrixPosition(this.light.target.matrixWorld),M$.subVectors(eC,T$),this.lightPlane.lookAt(eC),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(eC),this.targetLine.scale.z=M$.length()}}const tC=new Ie,Ms=new jA;class L9e extends Ql{constructor(e){const n=new or,r=new Pa({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],a={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(m,x){l(m),l(x)}function l(m){i.push(0,0,0),s.push(0,0,0),a[m]===void 0&&(a[m]=[]),a[m].push(i.length/3-1)}n.setAttribute("position",new _n(i,3)),n.setAttribute("color",new _n(s,3)),super(n,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const u=new Qt(16755200),d=new Qt(16711680),h=new Qt(43775),p=new Qt(16777215),f=new Qt(3355443);this.setColors(u,d,h,p,f)}setColors(e,n,r,i,s){const o=this.geometry.getAttribute("color");o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,n.r,n.g,n.b),o.setXYZ(25,n.r,n.g,n.b),o.setXYZ(26,n.r,n.g,n.b),o.setXYZ(27,n.r,n.g,n.b),o.setXYZ(28,n.r,n.g,n.b),o.setXYZ(29,n.r,n.g,n.b),o.setXYZ(30,n.r,n.g,n.b),o.setXYZ(31,n.r,n.g,n.b),o.setXYZ(32,r.r,r.g,r.b),o.setXYZ(33,r.r,r.g,r.b),o.setXYZ(34,r.r,r.g,r.b),o.setXYZ(35,r.r,r.g,r.b),o.setXYZ(36,r.r,r.g,r.b),o.setXYZ(37,r.r,r.g,r.b),o.setXYZ(38,i.r,i.g,i.b),o.setXYZ(39,i.r,i.g,i.b),o.setXYZ(40,s.r,s.g,s.b),o.setXYZ(41,s.r,s.g,s.b),o.setXYZ(42,s.r,s.g,s.b),o.setXYZ(43,s.r,s.g,s.b),o.setXYZ(44,s.r,s.g,s.b),o.setXYZ(45,s.r,s.g,s.b),o.setXYZ(46,s.r,s.g,s.b),o.setXYZ(47,s.r,s.g,s.b),o.setXYZ(48,s.r,s.g,s.b),o.setXYZ(49,s.r,s.g,s.b),o.needsUpdate=!0}update(){const e=this.geometry,n=this.pointMap,r=1,i=1;Ms.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Ks("c",n,e,Ms,0,0,-1),Ks("t",n,e,Ms,0,0,1),Ks("n1",n,e,Ms,-r,-i,-1),Ks("n2",n,e,Ms,r,-i,-1),Ks("n3",n,e,Ms,-r,i,-1),Ks("n4",n,e,Ms,r,i,-1),Ks("f1",n,e,Ms,-r,-i,1),Ks("f2",n,e,Ms,r,-i,1),Ks("f3",n,e,Ms,-r,i,1),Ks("f4",n,e,Ms,r,i,1),Ks("u1",n,e,Ms,r*.7,i*1.1,-1),Ks("u2",n,e,Ms,-r*.7,i*1.1,-1),Ks("u3",n,e,Ms,0,i*2,-1),Ks("cf1",n,e,Ms,-r,0,1),Ks("cf2",n,e,Ms,r,0,1),Ks("cf3",n,e,Ms,0,-i,1),Ks("cf4",n,e,Ms,0,i,1),Ks("cn1",n,e,Ms,-r,0,-1),Ks("cn2",n,e,Ms,r,0,-1),Ks("cn3",n,e,Ms,0,-i,-1),Ks("cn4",n,e,Ms,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Ks(t,e,n,r,i,s,a){tC.set(i,s,a).unproject(r);const o=e[t];if(o!==void 0){const l=n.getAttribute("position");for(let u=0,d=o.length;u<d;u++)l.setXYZ(o[u],tC.x,tC.y,tC.z)}}const nC=new ma;class I9e extends Ql{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),s=new or;s.setIndex(new Yr(r,1)),s.setAttribute("position",new Yr(i,3)),super(s,new Pa({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&nC.setFromObject(this.object),nC.isEmpty())return;const n=nC.min,r=nC.max,i=this.geometry.attributes.position,s=i.array;s[0]=r.x,s[1]=r.y,s[2]=r.z,s[3]=n.x,s[4]=r.y,s[5]=r.z,s[6]=n.x,s[7]=n.y,s[8]=r.z,s[9]=r.x,s[10]=n.y,s[11]=r.z,s[12]=r.x,s[13]=r.y,s[14]=n.z,s[15]=n.x,s[16]=r.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=r.x,s[22]=n.y,s[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class D9e extends Ql{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new or;s.setIndex(new Yr(r,1)),s.setAttribute("position",new _n(i,3)),super(s,new Pa({color:n,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class B9e extends Ff{constructor(e,n=1,r=16776960){const i=r,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],a=new or;a.setAttribute("position",new _n(s,3)),a.computeBoundingSphere(),super(a,new Pa({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=n;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new or;l.setAttribute("position",new _n(o,3)),l.computeBoundingSphere(),this.add(new Li(l,new ml({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const R$=new Ie;let rC,bP;class F9e extends Xr{constructor(e=new Ie(0,0,1),n=new Ie(0,0,0),r=1,i=16776960,s=r*.2,a=s*.2){super(),this.type="ArrowHelper",rC===void 0&&(rC=new or,rC.setAttribute("position",new _n([0,0,0,0,1,0],3)),bP=new iw(0,.5,1,5,1),bP.translate(0,-.5,0)),this.position.copy(n),this.line=new Ff(rC,new Pa({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Li(bP,new ml({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,s,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{R$.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(R$,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class O9e extends Ql{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new or;i.setAttribute("position",new _n(n,3)),i.setAttribute("color",new _n(r,3));const s=new Pa({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,n,r){const i=new Qt,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(n),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class z9e{constructor(){this.type="ShapePath",this.color=new Qt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new ES,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,s,a){return this.currentPath.bezierCurveTo(e,n,r,i,s,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(g){const b=[];for(let y=0,S=g.length;y<S;y++){const A=g[y],k=new q0;k.curves=A.curves,b.push(k)}return b}function r(g,b){const y=b.length;let S=!1;for(let A=y-1,k=0;k<y;A=k++){let M=b[A],T=b[k],C=T.x-M.x,R=T.y-M.y;if(Math.abs(R)>Number.EPSILON){if(R<0&&(M=b[k],C=-C,T=b[A],R=-R),g.y<M.y||g.y>T.y)continue;if(g.y===M.y){if(g.x===M.x)return!0}else{const P=R*(g.x-M.x)-C*(g.y-M.y);if(P===0)return!0;if(P<0)continue;S=!S}}else{if(g.y!==M.y)continue;if(T.x<=g.x&&g.x<=M.x||M.x<=g.x&&g.x<=T.x)return!0}}return S}const i=Sh.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const u=[];if(s.length===1)return o=s[0],l=new q0,l.curves=o.curves,u.push(l),u;let d=!i(s[0].getPoints());d=e?!d:d;const h=[],p=[];let f=[],m=0,x;p[m]=void 0,f[m]=[];for(let g=0,b=s.length;g<b;g++)o=s[g],x=o.getPoints(),a=i(x),a=e?!a:a,a?(!d&&p[m]&&m++,p[m]={s:new q0,p:x},p[m].s.curves=o.curves,d&&m++,f[m]=[]):f[m].push({h:o,p:x[0]});if(!p[0])return n(s);if(p.length>1){let g=!1,b=0;for(let y=0,S=p.length;y<S;y++)h[y]=[];for(let y=0,S=p.length;y<S;y++){const A=f[y];for(let k=0;k<A.length;k++){const M=A[k];let T=!0;for(let C=0;C<p.length;C++)r(M.p,p[C].p)&&(y!==C&&b++,T?(T=!1,h[C].push(M)):g=!0);T&&h[y].push(M)}}b>0&&g===!1&&(f=h)}let v;for(let g=0,b=p.length;g<b;g++){l=p[g].s,u.push(l),v=f[g];for(let y=0,S=v.length;y<S;y++)l.holes.push(v[y].h)}return u}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:NA}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=NA);const U9e=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Ez,AddEquation:Kp,AddOperation:Kae,AdditiveAnimationBlendMode:Iz,AdditiveBlending:eD,AgXToneMapping:Zae,AlphaFormat:eoe,AlwaysCompare:xoe,AlwaysDepth:zae,AlwaysStencilFunc:jD,AmbientLight:cle,AnimationAction:xle,AnimationClip:l1,AnimationLoader:K8e,AnimationMixer:v9e,AnimationObjectGroup:g9e,AnimationUtils:G8e,ArcCurve:Boe,ArrayCamera:Roe,ArrowHelper:F9e,AttachedBindMode:sD,Audio:mle,AudioAnalyser:a9e,AudioContext:p6,AudioListener:r9e,AudioLoader:e9e,AxesHelper:O9e,BackSide:xl,BasicDepthPacking:coe,BasicShadowMap:_ae,BatchedMesh:Doe,Bone:IM,BooleanKeyframeTrack:Bx,Box2:A9e,Box3:ma,Box3Helper:D9e,BoxGeometry:Nd,BoxHelper:I9e,BufferAttribute:Yr,BufferGeometry:or,BufferGeometryLoader:fle,ByteType:kz,Cache:_f,Camera:jA,CameraHelper:L9e,CanvasTexture:f8e,CapsuleGeometry:OM,CatmullRomCurve3:Foe,CineonToneMapping:Yae,CircleGeometry:zM,ClampToEdgeWrapping:Ji,Clock:m6,Color:Qt,ColorKeyframeTrack:o6,ColorManagement:_i,CompressedArrayTexture:d8e,CompressedCubeTexture:h8e,CompressedTexture:BM,CompressedTextureLoader:q8e,ConeGeometry:UM,ConstantAlphaFactor:Bae,ConstantColorFactor:Iae,CubeCamera:Soe,CubeReflectionMapping:Th,CubeRefractionMapping:Ym,CubeTexture:PA,CubeTextureLoader:ole,CubeUVReflectionMapping:nw,CubicBezierCurve:e6,CubicBezierCurve3:Ooe,CubicInterpolant:rle,CullFaceBack:Q4,CullFaceFront:wae,CullFaceFrontBack:aBe,CullFaceNone:bae,Curve:Md,CurvePath:Uoe,CustomBlending:Sae,CustomToneMapping:Jae,CylinderGeometry:iw,Cylindrical:S9e,Data3DTexture:Hz,DataArrayTexture:NM,DataTexture:Tm,DataTextureLoader:l6,DataUtils:E0,DecrementStencilOp:pBe,DecrementWrapStencilOp:gBe,DefaultLoadingManager:ale,DepthFormat:Cm,DepthStencilFormat:yx,DepthTexture:TM,DetachedBindMode:Qae,DirectionalLight:h6,DirectionalLightHelper:P9e,DiscreteInterpolant:ile,DisplayP3ColorSpace:CM,DodecahedronGeometry:HM,DoubleSide:bc,DstAlphaFactor:Mae,DstColorFactor:jae,DynamicCopyUsage:RBe,DynamicDrawUsage:EBe,DynamicReadUsage:NBe,EdgesGeometry:Hoe,EllipseCurve:FM,EqualCompare:foe,EqualDepth:Hae,EqualStencilFunc:bBe,EquirectangularReflectionMapping:n1,EquirectangularRefractionMapping:xS,Euler:RA,EventDispatcher:Zf,ExtrudeGeometry:VM,FileLoader:xo,Float16BufferAttribute:gFe,Float32BufferAttribute:_n,Float64BufferAttribute:xFe,FloatType:Zs,Fog:LM,FogExp2:PM,FramebufferTexture:u8e,FrontSide:Nh,Frustum:LA,GLBufferAttribute:_9e,GLSL1:PBe,GLSL3:PD,GreaterCompare:poe,GreaterDepth:Vae,GreaterEqualCompare:goe,GreaterEqualDepth:Gae,GreaterEqualStencilFunc:ABe,GreaterStencilFunc:_Be,GridHelper:R9e,Group:wf,HalfFloatType:Na,HemisphereLight:lle,HemisphereLightHelper:M9e,IcosahedronGeometry:zA,ImageBitmapLoader:ple,ImageLoader:TS,ImageUtils:Uz,IncrementStencilOp:fBe,IncrementWrapStencilOp:mBe,InstancedBufferAttribute:Qm,InstancedBufferGeometry:f6,InstancedInterleavedBuffer:w9e,InstancedMesh:Yz,Int16BufferAttribute:pFe,Int32BufferAttribute:mFe,Int8BufferAttribute:dFe,IntType:EM,InterleavedBuffer:BA,InterleavedBufferAttribute:Zm,Interpolant:sw,InterpolateDiscrete:i1,InterpolateLinear:bx,InterpolateSmooth:hN,InvertStencilOp:xBe,KeepStencilOp:r0,KeyframeTrack:Rd,LOD:Ioe,LatheGeometry:OA,Layers:K0,LessCompare:hoe,LessDepth:Uae,LessEqualCompare:Oz,LessEqualDepth:gS,LessEqualStencilFunc:wBe,LessStencilFunc:yBe,Light:fg,LightProbe:hle,Line:Ff,Line3:E9e,LineBasicMaterial:Pa,LineCurve:t6,LineCurve3:zoe,LineDashedMaterial:ele,LineLoop:Jz,LineSegments:Ql,LinearDisplayP3ColorSpace:MA,LinearEncoding:Bz,LinearFilter:zr,LinearInterpolant:a6,LinearMipMapLinearFilter:aD,LinearMipMapNearestFilter:uBe,LinearMipmapLinearFilter:Mh,LinearMipmapNearestFilter:SM,LinearSRGBColorSpace:Pc,LinearToneMapping:qae,LinearTransfer:bS,Loader:wo,LoaderUtils:Mm,LoadingManager:JM,LoopOnce:soe,LoopPingPong:ooe,LoopRepeat:aoe,LuminanceAlphaFormat:noe,LuminanceFormat:toe,MOUSE:n0,Material:Ta,MaterialLoader:ZM,MathUtils:KT,Matrix3:Nr,Matrix4:Wn,MaxEquation:iD,Mesh:Li,MeshBasicMaterial:ml,MeshDepthMaterial:IA,MeshDistanceMaterial:RM,MeshLambertMaterial:Zoe,MeshMatcapMaterial:Qoe,MeshNormalMaterial:Joe,MeshPhongMaterial:Xoe,MeshPhysicalMaterial:Tu,MeshStandardMaterial:Lc,MeshToonMaterial:Yoe,MinEquation:rD,MirroredRepeatWrapping:r1,MixOperation:$ae,MultiplyBlending:nD,MultiplyOperation:TA,NearestFilter:Bs,NearestMipMapLinearFilter:cBe,NearestMipMapNearestFilter:lBe,NearestMipmapLinearFilter:gb,NearestMipmapNearestFilter:vS,NeverCompare:doe,NeverDepth:Oae,NeverStencilFunc:vBe,NoBlending:bh,NoColorSpace:wc,NoToneMapping:wh,NormalAnimationBlendMode:kM,NormalBlending:W0,NotEqualCompare:moe,NotEqualDepth:Wae,NotEqualStencilFunc:SBe,NumberKeyframeTrack:_x,Object3D:Xr,ObjectLoader:Z8e,ObjectSpaceNormalMap:uoe,OctahedronGeometry:UA,OneFactor:Cae,OneMinusConstantAlphaFactor:Fae,OneMinusConstantColorFactor:Dae,OneMinusDstAlphaFactor:Rae,OneMinusDstColorFactor:Pae,OneMinusSrcAlphaFactor:GT,OneMinusSrcColorFactor:Tae,OrthographicCamera:_h,P3Primaries:_S,PCFShadowMap:_M,PCFSoftShadowMap:c2,PMREMGenerator:ID,Path:ES,PerspectiveCamera:Os,Plane:ff,PlaneGeometry:Td,PlaneHelper:B9e,PointLight:d6,PointLightHelper:N9e,Points:Zz,PointsMaterial:DM,PolarGridHelper:j9e,PolyhedronGeometry:hg,PositionalAudio:s9e,PropertyBinding:qr,PropertyMixer:gle,QuadraticBezierCurve:n6,QuadraticBezierCurve3:r6,Quaternion:qa,QuaternionKeyframeTrack:eg,QuaternionLinearInterpolant:sle,RED_GREEN_RGTC2_Format:MD,RED_RGTC1_Format:ioe,REVISION:NA,RGBADepthPacking:Fz,RGBAFormat:fa,RGBAIntegerFormat:Pz,RGBA_ASTC_10x10_Format:AD,RGBA_ASTC_10x5_Format:wD,RGBA_ASTC_10x6_Format:_D,RGBA_ASTC_10x8_Format:SD,RGBA_ASTC_12x10_Format:ED,RGBA_ASTC_12x12_Format:kD,RGBA_ASTC_4x4_Format:fD,RGBA_ASTC_5x4_Format:pD,RGBA_ASTC_5x5_Format:mD,RGBA_ASTC_6x5_Format:gD,RGBA_ASTC_6x6_Format:xD,RGBA_ASTC_8x5_Format:vD,RGBA_ASTC_8x6_Format:yD,RGBA_ASTC_8x8_Format:bD,RGBA_BPTC_Format:dN,RGBA_ETC2_EAC_Format:hD,RGBA_PVRTC_2BPPV1_Format:uD,RGBA_PVRTC_4BPPV1_Format:cD,RGBA_S3TC_DXT1_Format:lN,RGBA_S3TC_DXT3_Format:cN,RGBA_S3TC_DXT5_Format:uN,RGB_BPTC_SIGNED_Format:CD,RGB_BPTC_UNSIGNED_Format:ND,RGB_ETC1_Format:Lz,RGB_ETC2_Format:dD,RGB_PVRTC_2BPPV1_Format:lD,RGB_PVRTC_4BPPV1_Format:oD,RGB_S3TC_DXT1_Format:oN,RGFormat:roe,RGIntegerFormat:jz,RawShaderMaterial:qoe,Ray:Dx,Raycaster:y6,Rec709Primaries:wS,RectAreaLight:ule,RedFormat:Mz,RedIntegerFormat:Rz,ReinhardToneMapping:Xae,RenderTarget:boe,RepeatWrapping:Jm,ReplaceStencilOp:hBe,ReverseSubtractEquation:Eae,RingGeometry:WM,SIGNED_RED_GREEN_RGTC2_Format:RD,SIGNED_RED_RGTC1_Format:TD,SRGBColorSpace:os,SRGBTransfer:Oi,Scene:DA,ShaderChunk:_r,ShaderLib:dd,ShaderMaterial:bl,ShadowMaterial:Koe,Shape:q0,ShapeGeometry:$M,ShapePath:z9e,ShapeUtils:Sh,ShortType:Cz,Skeleton:FA,SkeletonHelper:C9e,SkinnedMesh:Xz,Source:A0,Sphere:Xa,SphereGeometry:HA,Spherical:HD,SphericalHarmonics3:dle,SplineCurve:i6,SpotLight:u6,SpotLightHelper:k9e,Sprite:Loe,SpriteMaterial:qz,SrcAlphaFactor:HT,SrcAlphaSaturateFactor:Lae,SrcColorFactor:Nae,StaticCopyUsage:MBe,StaticDrawUsage:SS,StaticReadUsage:CBe,StereoCamera:t9e,StreamCopyUsage:jBe,StreamDrawUsage:kBe,StreamReadUsage:TBe,StringKeyframeTrack:Fx,SubtractEquation:Aae,SubtractiveBlending:tD,TOUCH:ud,TangentSpaceNormalMap:dg,TetrahedronGeometry:KM,Texture:ui,TextureLoader:GA,TorusGeometry:qM,TorusKnotGeometry:XM,Triangle:Hl,TriangleFanDrawMode:VT,TriangleStripDrawMode:Dz,TrianglesDrawMode:loe,TubeGeometry:YM,TwoPassDoubleSide:oBe,UVMapping:Xm,Uint16BufferAttribute:Gz,Uint32BufferAttribute:Vz,Uint8BufferAttribute:hFe,Uint8ClampedBufferAttribute:fFe,Uniform:v6,UniformsGroup:b9e,UniformsLib:Zt,UniformsUtils:Wz,UnsignedByteType:Tc,UnsignedInt248Type:km,UnsignedIntType:dh,UnsignedShort4444Type:Nz,UnsignedShort5551Type:Tz,UnsignedShortType:AM,VSMShadowMap:id,Vector2:Rt,Vector3:Ie,Vector4:gi,VectorKeyframeTrack:Sx,VideoTexture:c8e,WebGL1Renderer:joe,WebGL3DRenderTarget:QBe,WebGLArrayRenderTarget:ZBe,WebGLCoordinateSystem:hd,WebGLCubeRenderTarget:$z,WebGLMultipleRenderTargets:eFe,WebGLRenderTarget:Yo,WebGLRenderer:jM,WebGLUtils:Moe,WebGPUCoordinateSystem:s1,WireframeGeometry:$oe,WrapAroundEnding:yS,ZeroCurvatureEnding:_0,ZeroFactor:kae,ZeroSlopeEnding:S0,ZeroStencilOp:dBe,_SRGBAFormat:WT,createCanvasElement:yoe,sRGBEncoding:Nm},Symbol.toStringTag,{value:"Module"}));var yle={exports:{}},Ox={};/** 4497 * @license React 4498 * react-reconciler-constants.production.min.js 4499 * 4500 * Copyright (c) Facebook, Inc. and its affiliates. 4501 * 4502 * This source code is licensed under the MIT license found in the 4503 * LICENSE file in the root directory of this source tree. 4504 */Ox.ConcurrentRoot=1;Ox.ContinuousEventPriority=4;Ox.DefaultEventPriority=16;Ox.DiscreteEventPriority=1;Ox.IdleEventPriority=536870912;Ox.LegacyRoot=0;yle.exports=Ox;var $y=yle.exports;function H9e(t){let e;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(e):u;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),n.forEach(f=>f(e,p))}},i=()=>e,s=(u,d=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function f(){const m=d(e);if(!h(p,m)){const x=p;u(p=m,x)}}return n.add(f),()=>n.delete(f)},l={setState:r,getState:i,subscribe:(u,d,h)=>d||h?s(u,d,h):(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return e=t(r,i,l),l}const G9e=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),j$=G9e?E.useEffect:E.useLayoutEffect;function ble(t){const e=typeof t=="function"?H9e(t):t,n=(r=e.getState,i=Object.is)=>{const[,s]=E.useReducer(v=>v+1,0),a=e.getState(),o=E.useRef(a),l=E.useRef(r),u=E.useRef(i),d=E.useRef(!1),h=E.useRef();h.current===void 0&&(h.current=r(a));let p,f=!1;(o.current!==a||l.current!==r||u.current!==i||d.current)&&(p=r(a),f=!i(h.current,p)),j$(()=>{f&&(h.current=p),o.current=a,l.current=r,u.current=i,d.current=!1});const m=E.useRef(a);j$(()=>{const v=()=>{try{const b=e.getState(),y=l.current(b);u.current(h.current,y)||(o.current=b,h.current=y,s())}catch{d.current=!0,s()}},g=e.subscribe(v);return e.getState()!==m.current&&v(),g},[]);const x=f?p:h.current;return E.useDebugValue(x),x};return Object.assign(n,e),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},n}const V9e=t=>typeof t=="object"&&typeof t.then=="function",C0=[];function wle(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e)return!1;const r=t.length;if(e.length!==r)return!1;for(let i=0;i<r;i++)if(!n(t[i],e[i]))return!1;return!0}function _le(t,e=null,n=!1,r={}){e===null&&(e=[t]);for(const s of C0)if(wle(e,s.keys,s.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(s,"error"))throw s.error;if(Object.prototype.hasOwnProperty.call(s,"response"))return r.lifespan&&r.lifespan>0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,r.lifespan)),s.response;if(!n)throw s.promise}const i={keys:e,equal:r.equal,remove:()=>{const s=C0.indexOf(i);s!==-1&&C0.splice(s,1)},promise:(V9e(t)?t:t(...e)).then(s=>{i.response=s,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(s=>i.error=s)};if(C0.push(i),!n)throw i.promise}const Sle=(t,e,n)=>_le(t,e,!1,n),W9e=(t,e,n)=>void _le(t,e,!0,n),$9e=t=>{if(t===void 0||t.length===0)C0.splice(0,C0.length);else{const e=C0.find(n=>wle(t,n.keys,n.equal));e&&e.remove()}};var Ale={exports:{}},Ele={exports:{}},kle={};/** 4505 * @license React 4506 * scheduler.production.min.js 4507 * 4508 * Copyright (c) Facebook, Inc. and its affiliates. 4509 * 4510 * This source code is licensed under the MIT license found in the 4511 * LICENSE file in the root directory of this source tree. 4512 */(function(t){function e(V,W){var O=V.length;V.push(W);e:for(;0<O;){var Y=O-1>>>1,z=V[Y];if(0<i(z,W))V[Y]=W,V[O]=z,O=Y;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var W=V[0],O=V.pop();if(O!==W){V[0]=O;e:for(var Y=0,z=V.length,I=z>>>1;Y<I;){var q=2*(Y+1)-1,te=V[q],se=q+1,ie=V[se];if(0>i(te,O))se<z&&0>i(ie,te)?(V[Y]=ie,V[se]=O,Y=se):(V[Y]=te,V[q]=O,Y=q);else if(se<z&&0>i(ie,O))V[Y]=ie,V[se]=O,Y=se;else break e}}return W}function i(V,W){var O=V.sortIndex-W.sortIndex;return O!==0?O:V.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,h=null,p=3,f=!1,m=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(V){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=V)r(u),W.sortIndex=W.expirationTime,e(l,W);else break;W=n(u)}}function S(V){if(x=!1,y(V),!m)if(n(l)!==null)m=!0,U(A);else{var W=n(u);W!==null&&Z(S,W.startTime-V)}}function A(V,W){m=!1,x&&(x=!1,g(T),T=-1),f=!0;var O=p;try{for(y(W),h=n(l);h!==null&&(!(h.expirationTime>W)||V&&!P());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,p=h.priorityLevel;var z=Y(h.expirationTime<=W);W=t.unstable_now(),typeof z=="function"?h.callback=z:h===n(l)&&r(l),y(W)}else r(l);h=n(l)}if(h!==null)var I=!0;else{var q=n(u);q!==null&&Z(S,q.startTime-W),I=!1}return I}finally{h=null,p=O,f=!1}}var k=!1,M=null,T=-1,C=5,R=-1;function P(){return!(t.unstable_now()-R<C)}function j(){if(M!==null){var V=t.unstable_now();R=V;var W=!0;try{W=M(!0,V)}finally{W?G():(k=!1,M=null)}}else k=!1}var G;if(typeof b=="function")G=function(){b(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,$=B.port2;B.port1.onmessage=j,G=function(){$.postMessage(null)}}else G=function(){v(j,0)};function U(V){M=V,k||(k=!0,G())}function Z(V,W){T=v(function(){V(t.unstable_now())},W)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,U(A))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var O=p;p=W;try{return V()}finally{p=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,W){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var O=p;p=V;try{return W()}finally{p=O}},t.unstable_scheduleCallback=function(V,W,O){var Y=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?Y+O:Y):O=Y,V){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=O+z,V={id:d++,callback:W,priorityLevel:V,startTime:O,expirationTime:z,sortIndex:-1},O>Y?(V.sortIndex=O,e(u,V),n(l)===null&&V===n(u)&&(x?(g(T),T=-1):x=!0,Z(S,O-Y))):(V.sortIndex=z,e(l,V),m||f||(m=!0,U(A))),V},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(V){var W=p;return function(){var O=p;p=W;try{return V.apply(this,arguments)}finally{p=O}}}})(kle);Ele.exports=kle;var GD=Ele.exports;/** 4513 * @license React 4514 * react-reconciler.production.min.js 4515 * 4516 * Copyright (c) Facebook, Inc. and its affiliates. 4517 * 4518 * This source code is licensed under the MIT license found in the 4519 * LICENSE file in the root directory of this source tree. 4520 */var K9e=function(e){var n={},r=E,i=GD,s=Object.assign;function a(w){for(var _="https://reactjs.org/docs/error-decoder.html?invariant="+w,L=1;L<arguments.length;L++)_+="&args[]="+encodeURIComponent(arguments[L]);return"Minified React error #"+w+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),A=Symbol.iterator;function k(w){return w===null||typeof w!="object"?null:(w=A&&w[A]||w["@@iterator"],typeof w=="function"?w:null)}function M(w){if(w==null)return null;if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case d:return"Fragment";case u:return"Portal";case p:return"Profiler";case h:return"StrictMode";case v:return"Suspense";case g:return"SuspenseList"}if(typeof w=="object")switch(w.$$typeof){case m:return(w.displayName||"Context")+".Consumer";case f:return(w._context.displayName||"Context")+".Provider";case x:var _=w.render;return w=w.displayName,w||(w=_.displayName||_.name||"",w=w!==""?"ForwardRef("+w+")":"ForwardRef"),w;case b:return _=w.displayName||null,_!==null?_:M(w.type)||"Memo";case y:_=w._payload,w=w._init;try{return M(w(_))}catch{}}return null}function T(w){var _=w.type;switch(w.tag){case 24:return"Cache";case 9:return(_.displayName||"Context")+".Consumer";case 10:return(_._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return w=_.render,w=w.displayName||w.name||"",_.displayName||(w!==""?"ForwardRef("+w+")":"ForwardRef");case 7:return"Fragment";case 5:return _;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(_);case 8:return _===h?"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 _=="function")return _.displayName||_.name||null;if(typeof _=="string")return _}return null}function C(w){var _=w,L=w;if(w.alternate)for(;_.return;)_=_.return;else{w=_;do _=w,_.flags&4098&&(L=_.return),w=_.return;while(w)}return _.tag===3?L:null}function R(w){if(C(w)!==w)throw Error(a(188))}function P(w){var _=w.alternate;if(!_){if(_=C(w),_===null)throw Error(a(188));return _!==w?null:w}for(var L=w,F=_;;){var J=L.return;if(J===null)break;var oe=J.alternate;if(oe===null){if(F=J.return,F!==null){L=F;continue}break}if(J.child===oe.child){for(oe=J.child;oe;){if(oe===L)return R(J),w;if(oe===F)return R(J),_;oe=oe.sibling}throw Error(a(188))}if(L.return!==F.return)L=J,F=oe;else{for(var Ve=!1,at=J.child;at;){if(at===L){Ve=!0,L=J,F=oe;break}if(at===F){Ve=!0,F=J,L=oe;break}at=at.sibling}if(!Ve){for(at=oe.child;at;){if(at===L){Ve=!0,L=oe,F=J;break}if(at===F){Ve=!0,F=oe,L=J;break}at=at.sibling}if(!Ve)throw Error(a(189))}}if(L.alternate!==F)throw Error(a(190))}if(L.tag!==3)throw Error(a(188));return L.stateNode.current===L?w:_}function j(w){return w=P(w),w!==null?G(w):null}function G(w){if(w.tag===5||w.tag===6)return w;for(w=w.child;w!==null;){var _=G(w);if(_!==null)return _;w=w.sibling}return null}function B(w){if(w.tag===5||w.tag===6)return w;for(w=w.child;w!==null;){if(w.tag!==4){var _=B(w);if(_!==null)return _}w=w.sibling}return null}var $=Array.isArray,U=e.getPublicInstance,Z=e.getRootHostContext,V=e.getChildHostContext,W=e.prepareForCommit,O=e.resetAfterCommit,Y=e.createInstance,z=e.appendInitialChild,I=e.finalizeInitialChildren,q=e.prepareUpdate,te=e.shouldSetTextContent,se=e.createTextInstance,ie=e.scheduleTimeout,le=e.cancelTimeout,xe=e.noTimeout,Ee=e.isPrimaryRenderer,ae=e.supportsMutation,Q=e.supportsPersistence,we=e.supportsHydration,Ae=e.getInstanceFromNode,K=e.preparePortalMount,pe=e.getCurrentEventPriority,ye=e.detachDeletedInstance,Se=e.supportsMicrotasks,ee=e.scheduleMicrotask,re=e.supportsTestSelectors,me=e.findFiberRoot,Ge=e.getBoundingRect,He=e.getTextContent,_e=e.isHiddenSubtree,Ne=e.matchAccessibilityRole,ue=e.setFocusIfFocusable,Ce=e.setupIntersectionObserver,Ke=e.appendChild,Qe=e.appendChildToContainer,je=e.commitTextUpdate,We=e.commitMount,xt=e.commitUpdate,et=e.insertBefore,Je=e.insertInContainerBefore,Ze=e.removeChild,Me=e.removeChildFromContainer,Xe=e.resetTextContent,ut=e.hideInstance,lt=e.hideTextInstance,Fe=e.unhideInstance,Le=e.unhideTextInstance,bt=e.clearContainer,dt=e.cloneInstance,Nt=e.createContainerChildSet,_t=e.appendChildToContainerChildSet,Lt=e.finalizeContainerChildren,Dt=e.replaceContainerChildren,en=e.cloneHiddenInstance,Mt=e.cloneHiddenTextInstance,nn=e.canHydrateInstance,Tn=e.canHydrateTextInstance,Fn=e.canHydrateSuspenseInstance,lr=e.isSuspenseInstancePending,mr=e.isSuspenseInstanceFallback,gr=e.registerSuspenseInstanceRetry,br=e.getNextHydratableSibling,sn=e.getFirstHydratableChild,Mr=e.getFirstHydratableChildWithinContainer,yi=e.getFirstHydratableChildWithinSuspenseInstance,de=e.hydrateInstance,ke=e.hydrateTextInstance,Ye=e.hydrateSuspenseInstance,ce=e.getNextHydratableInstanceAfterSuspenseInstance,Pe=e.commitHydratedContainer,De=e.commitHydratedSuspenseInstance,qe=e.clearSuspenseBoundary,$e=e.clearSuspenseBoundaryFromContainer,mt=e.shouldDeleteUnhydratedTailInstances,vt=e.didNotMatchHydratedContainerTextInstance,wt=e.didNotMatchHydratedTextInstance,nt;function Xt(w){if(nt===void 0)try{throw Error()}catch(L){var _=L.stack.trim().match(/\n( *(at )?)/);nt=_&&_[1]||""}return` 4521`+nt+w}var ft=!1;function ve(w,_){if(!w||ft)return"";ft=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(_)if(_=function(){throw Error()},Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(Kt){var F=Kt}Reflect.construct(w,[],_)}else{try{_.call()}catch(Kt){F=Kt}w.call(_.prototype)}else{try{throw Error()}catch(Kt){F=Kt}w()}}catch(Kt){if(Kt&&F&&typeof Kt.stack=="string"){for(var J=Kt.stack.split(` 4522`),oe=F.stack.split(` 4523`),Ve=J.length-1,at=oe.length-1;1<=Ve&&0<=at&&J[Ve]!==oe[at];)at--;for(;1<=Ve&&0<=at;Ve--,at--)if(J[Ve]!==oe[at]){if(Ve!==1||at!==1)do if(Ve--,at--,0>at||J[Ve]!==oe[at]){var Ct=` 4524`+J[Ve].replace(" at new "," at ");return w.displayName&&Ct.includes("<anonymous>")&&(Ct=Ct.replace("<anonymous>",w.displayName)),Ct}while(1<=Ve&&0<=at);break}}}finally{ft=!1,Error.prepareStackTrace=L}return(w=w?w.displayName||w.name:"")?Xt(w):""}var rt=Object.prototype.hasOwnProperty,At=[],Gt=-1;function Wt(w){return{current:w}}function zt(w){0>Gt||(w.current=At[Gt],At[Gt]=null,Gt--)}function Ut(w,_){Gt++,At[Gt]=w.current,w.current=_}var pn={},an=Wt(pn),Cn=Wt(!1),on=pn;function Hr(w,_){var L=w.type.contextTypes;if(!L)return pn;var F=w.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===_)return F.__reactInternalMemoizedMaskedChildContext;var J={},oe;for(oe in L)J[oe]=_[oe];return F&&(w=w.stateNode,w.__reactInternalMemoizedUnmaskedChildContext=_,w.__reactInternalMemoizedMaskedChildContext=J),J}function wr(w){return w=w.childContextTypes,w!=null}function Jn(){zt(Cn),zt(an)}function Zn(w,_,L){if(an.current!==pn)throw Error(a(168));Ut(an,_),Ut(Cn,L)}function Sr(w,_,L){var F=w.stateNode;if(_=_.childContextTypes,typeof F.getChildContext!="function")return L;F=F.getChildContext();for(var J in F)if(!(J in _))throw Error(a(108,T(w)||"Unknown",J));return s({},L,F)}function zn(w){return w=(w=w.stateNode)&&w.__reactInternalMemoizedMergedChildContext||pn,on=an.current,Ut(an,w),Ut(Cn,Cn.current),!0}function Ln(w,_,L){var F=w.stateNode;if(!F)throw Error(a(169));L?(w=Sr(w,_,on),F.__reactInternalMemoizedMergedChildContext=w,zt(Cn),zt(an),Ut(an,w)):zt(Cn),Ut(Cn,L)}var rr=Math.clz32?Math.clz32:Za,Cs=Math.log,Wi=Math.LN2;function Za(w){return w>>>=0,w===0?32:31-(Cs(w)/Wi|0)|0}var ec=64,Qs=4194304;function El(w){switch(w&-w){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 w&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return w&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return w}}function kl(w,_){var L=w.pendingLanes;if(L===0)return 0;var F=0,J=w.suspendedLanes,oe=w.pingedLanes,Ve=L&268435455;if(Ve!==0){var at=Ve&~J;at!==0?F=El(at):(oe&=Ve,oe!==0&&(F=El(oe)))}else Ve=L&~J,Ve!==0?F=El(Ve):oe!==0&&(F=El(oe));if(F===0)return 0;if(_!==0&&_!==F&&!(_&J)&&(J=F&-F,oe=_&-_,J>=oe||J===16&&(oe&4194240)!==0))return _;if(F&4&&(F|=L&16),_=w.entangledLanes,_!==0)for(w=w.entanglements,_&=F;0<_;)L=31-rr(_),J=1<<L,F|=w[L],_&=~J;return F}function Mu(w,_){switch(w){case 1:case 2:case 4:return _+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 _+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 Ru(w,_){for(var L=w.suspendedLanes,F=w.pingedLanes,J=w.expirationTimes,oe=w.pendingLanes;0<oe;){var Ve=31-rr(oe),at=1<<Ve,Ct=J[Ve];Ct===-1?(!(at&L)||at&F)&&(J[Ve]=Mu(at,_)):Ct<=_&&(w.expiredLanes|=at),oe&=~at}}function tc(w){return w=w.pendingLanes&-1073741825,w!==0?w:w&1073741824?1073741824:0}function jd(w){for(var _=[],L=0;31>L;L++)_.push(w);return _}function Cl(w,_,L){w.pendingLanes|=_,_!==536870912&&(w.suspendedLanes=0,w.pingedLanes=0),w=w.eventTimes,_=31-rr(_),w[_]=L}function Qa(w,_){var L=w.pendingLanes&~_;w.pendingLanes=_,w.suspendedLanes=0,w.pingedLanes=0,w.expiredLanes&=_,w.mutableReadLanes&=_,w.entangledLanes&=_,_=w.entanglements;var F=w.eventTimes;for(w=w.expirationTimes;0<L;){var J=31-rr(L),oe=1<<J;_[J]=0,F[J]=-1,w[J]=-1,L&=~oe}}function Zo(w,_){var L=w.entangledLanes|=_;for(w=w.entanglements;L;){var F=31-rr(L),J=1<<F;J&_|w[F]&_&&(w[F]|=_),L&=~J}}var er=0;function Dh(w){return w&=-w,1<w?4<w?w&268435455?16:536870912:4:1}var eo=i.unstable_scheduleCallback,On=i.unstable_cancelCallback,Bh=i.unstable_shouldYield,Qf=i.unstable_requestPaint,Ni=i.unstable_now,ju=i.unstable_ImmediatePriority,ep=i.unstable_UserBlockingPriority,$i=i.unstable_NormalPriority,Qo=i.unstable_IdlePriority,Pu=null,to=null;function Oc(w){if(to&&typeof to.onCommitFiberRoot=="function")try{to.onCommitFiberRoot(Pu,w,void 0,(w.current.flags&128)===128)}catch{}}function Pd(w,_){return w===_&&(w!==0||1/w===1/_)||w!==w&&_!==_}var ts=typeof Object.is=="function"?Object.is:Pd,xa=null,no=!1,_o=!1;function Lu(w){xa===null?xa=[w]:xa.push(w)}function Nl(w){no=!0,Lu(w)}function ea(){if(!_o&&xa!==null){_o=!0;var w=0,_=er;try{var L=xa;for(er=1;w<L.length;w++){var F=L[w];do F=F(!0);while(F!==null)}xa=null,no=!1}catch(J){throw xa!==null&&(xa=xa.slice(w+1)),eo(ju,ea),J}finally{er=_,_o=!1}}return null}var el=o.ReactCurrentBatchConfig;function nc(w,_){if(ts(w,_))return!0;if(typeof w!="object"||w===null||typeof _!="object"||_===null)return!1;var L=Object.keys(w),F=Object.keys(_);if(L.length!==F.length)return!1;for(F=0;F<L.length;F++){var J=L[F];if(!rt.call(_,J)||!ts(w[J],_[J]))return!1}return!0}function Tl(w){switch(w.tag){case 5:return Xt(w.type);case 16:return Xt("Lazy");case 13:return Xt("Suspense");case 19:return Xt("SuspenseList");case 0:case 2:case 15:return w=ve(w.type,!1),w;case 11:return w=ve(w.type.render,!1),w;case 1:return w=ve(w.type,!0),w;default:return""}}function Hs(w,_){if(w&&w.defaultProps){_=s({},_),w=w.defaultProps;for(var L in w)_[L]===void 0&&(_[L]=w[L]);return _}return _}var Ki=Wt(null),Iu=null,Gs=null,La=null;function Du(){La=Gs=Iu=null}function Fh(w,_,L){Ee?(Ut(Ki,_._currentValue),_._currentValue=L):(Ut(Ki,_._currentValue2),_._currentValue2=L)}function cs(w){var _=Ki.current;zt(Ki),Ee?w._currentValue=_:w._currentValue2=_}function us(w,_,L){for(;w!==null;){var F=w.alternate;if((w.childLanes&_)!==_?(w.childLanes|=_,F!==null&&(F.childLanes|=_)):F!==null&&(F.childLanes&_)!==_&&(F.childLanes|=_),w===L)break;w=w.return}}function Ii(w,_){Iu=w,La=Gs=null,w=w.dependencies,w!==null&&w.firstContext!==null&&(w.lanes&_&&(Fa=!0),w.firstContext=null)}function H(w){var _=Ee?w._currentValue:w._currentValue2;if(La!==w)if(w={context:w,memoizedValue:_,next:null},Gs===null){if(Iu===null)throw Error(a(308));Gs=w,Iu.dependencies={lanes:0,firstContext:w}}else Gs=Gs.next=w;return _}var he=null,Be=!1;function tt(w){w.updateQueue={baseState:w.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ot(w,_){w=w.updateQueue,_.updateQueue===w&&(_.updateQueue={baseState:w.baseState,firstBaseUpdate:w.firstBaseUpdate,lastBaseUpdate:w.lastBaseUpdate,shared:w.shared,effects:w.effects})}function St(w,_){return{eventTime:w,lane:_,tag:0,payload:null,callback:null,next:null}}function It(w,_){var L=w.updateQueue;L!==null&&(L=L.shared,Gr!==null&&w.mode&1&&!(Un&2)?(w=L.interleaved,w===null?(_.next=_,he===null?he=[L]:he.push(L)):(_.next=w.next,w.next=_),L.interleaved=_):(w=L.pending,w===null?_.next=_:(_.next=w.next,w.next=_),L.pending=_))}function fn(w,_,L){if(_=_.updateQueue,_!==null&&(_=_.shared,(L&4194240)!==0)){var F=_.lanes;F&=w.pendingLanes,L|=F,_.lanes=L,Zo(w,L)}}function mn(w,_){var L=w.updateQueue,F=w.alternate;if(F!==null&&(F=F.updateQueue,L===F)){var J=null,oe=null;if(L=L.firstBaseUpdate,L!==null){do{var Ve={eventTime:L.eventTime,lane:L.lane,tag:L.tag,payload:L.payload,callback:L.callback,next:null};oe===null?J=oe=Ve:oe=oe.next=Ve,L=L.next}while(L!==null);oe===null?J=oe=_:oe=oe.next=_}else J=oe=_;L={baseState:F.baseState,firstBaseUpdate:J,lastBaseUpdate:oe,shared:F.shared,effects:F.effects},w.updateQueue=L;return}w=L.lastBaseUpdate,w===null?L.firstBaseUpdate=_:w.next=_,L.lastBaseUpdate=_}function qn(w,_,L,F){var J=w.updateQueue;Be=!1;var oe=J.firstBaseUpdate,Ve=J.lastBaseUpdate,at=J.shared.pending;if(at!==null){J.shared.pending=null;var Ct=at,Kt=Ct.next;Ct.next=null,Ve===null?oe=Kt:Ve.next=Kt,Ve=Ct;var bn=w.alternate;bn!==null&&(bn=bn.updateQueue,at=bn.lastBaseUpdate,at!==Ve&&(at===null?bn.firstBaseUpdate=Kt:at.next=Kt,bn.lastBaseUpdate=Ct))}if(oe!==null){var xr=J.baseState;Ve=0,bn=Kt=Ct=null,at=oe;do{var Hn=at.lane,Ri=at.eventTime;if((F&Hn)===Hn){bn!==null&&(bn=bn.next={eventTime:Ri,lane:0,tag:at.tag,payload:at.payload,callback:at.callback,next:null});e:{var In=w,Mo=at;switch(Hn=_,Ri=L,Mo.tag){case 1:if(In=Mo.payload,typeof In=="function"){xr=In.call(Ri,xr,Hn);break e}xr=In;break e;case 3:In.flags=In.flags&-65537|128;case 0:if(In=Mo.payload,Hn=typeof In=="function"?In.call(Ri,xr,Hn):In,Hn==null)break e;xr=s({},xr,Hn);break e;case 2:Be=!0}}at.callback!==null&&at.lane!==0&&(w.flags|=64,Hn=J.effects,Hn===null?J.effects=[at]:Hn.push(at))}else Ri={eventTime:Ri,lane:Hn,tag:at.tag,payload:at.payload,callback:at.callback,next:null},bn===null?(Kt=bn=Ri,Ct=xr):bn=bn.next=Ri,Ve|=Hn;if(at=at.next,at===null){if(at=J.shared.pending,at===null)break;Hn=at,at=Hn.next,Hn.next=null,J.lastBaseUpdate=Hn,J.shared.pending=null}}while(!0);if(bn===null&&(Ct=xr),J.baseState=Ct,J.firstBaseUpdate=Kt,J.lastBaseUpdate=bn,_=J.shared.interleaved,_!==null){J=_;do Ve|=J.lane,J=J.next;while(J!==_)}else oe===null&&(J.shared.lanes=0);Oa|=Ve,w.lanes=Ve,w.memoizedState=xr}}function ir(w,_,L){if(w=_.effects,_.effects=null,w!==null)for(_=0;_<w.length;_++){var F=w[_],J=F.callback;if(J!==null){if(F.callback=null,F=L,typeof J!="function")throw Error(a(191,J));J.call(F)}}}var Br=new r.Component().refs;function ns(w,_,L,F){_=w.memoizedState,L=L(F,_),L=L==null?_:s({},_,L),w.memoizedState=L,w.lanes===0&&(w.updateQueue.baseState=L)}var ri={isMounted:function(w){return(w=w._reactInternals)?C(w)===w:!1},enqueueSetState:function(w,_,L){w=w._reactInternals;var F=za(),J=lc(w),oe=St(F,J);oe.payload=_,L!=null&&(oe.callback=L),It(w,oe),_=No(w,J,F),_!==null&&fn(_,w,J)},enqueueReplaceState:function(w,_,L){w=w._reactInternals;var F=za(),J=lc(w),oe=St(F,J);oe.tag=1,oe.payload=_,L!=null&&(oe.callback=L),It(w,oe),_=No(w,J,F),_!==null&&fn(_,w,J)},enqueueForceUpdate:function(w,_){w=w._reactInternals;var L=za(),F=lc(w),J=St(L,F);J.tag=2,_!=null&&(J.callback=_),It(w,J),_=No(w,F,L),_!==null&&fn(_,w,F)}};function di(w,_,L,F,J,oe,Ve){return w=w.stateNode,typeof w.shouldComponentUpdate=="function"?w.shouldComponentUpdate(F,oe,Ve):_.prototype&&_.prototype.isPureReactComponent?!nc(L,F)||!nc(J,oe):!0}function Ei(w,_,L){var F=!1,J=pn,oe=_.contextType;return typeof oe=="object"&&oe!==null?oe=H(oe):(J=wr(_)?on:an.current,F=_.contextTypes,oe=(F=F!=null)?Hr(w,J):pn),_=new _(L,oe),w.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=ri,w.stateNode=_,_._reactInternals=w,F&&(w=w.stateNode,w.__reactInternalMemoizedUnmaskedChildContext=J,w.__reactInternalMemoizedMaskedChildContext=oe),_}function Di(w,_,L,F){w=_.state,typeof _.componentWillReceiveProps=="function"&&_.componentWillReceiveProps(L,F),typeof _.UNSAFE_componentWillReceiveProps=="function"&&_.UNSAFE_componentWillReceiveProps(L,F),_.state!==w&&ri.enqueueReplaceState(_,_.state,null)}function Ti(w,_,L,F){var J=w.stateNode;J.props=L,J.state=w.memoizedState,J.refs=Br,tt(w);var oe=_.contextType;typeof oe=="object"&&oe!==null?J.context=H(oe):(oe=wr(_)?on:an.current,J.context=Hr(w,oe)),J.state=w.memoizedState,oe=_.getDerivedStateFromProps,typeof oe=="function"&&(ns(w,_,oe,L),J.state=w.memoizedState),typeof _.getDerivedStateFromProps=="function"||typeof J.getSnapshotBeforeUpdate=="function"||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(_=J.state,typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount(),_!==J.state&&ri.enqueueReplaceState(J,J.state,null),qn(w,L,J,F),J.state=w.memoizedState),typeof J.componentDidMount=="function"&&(w.flags|=4194308)}var ds=[],So=0,Ld=null,zc=0,ta=[],Vs=0,tl=null,Ao=1,Eo="";function rs(w,_){ds[So++]=zc,ds[So++]=Ld,Ld=w,zc=_}function Id(w,_,L){ta[Vs++]=Ao,ta[Vs++]=Eo,ta[Vs++]=tl,tl=w;var F=Ao;w=Eo;var J=32-rr(F)-1;F&=~(1<<J),L+=1;var oe=32-rr(_)+J;if(30<oe){var Ve=J-J%5;oe=(F&(1<<Ve)-1).toString(32),F>>=Ve,J-=Ve,Ao=1<<32-rr(_)+J|L<<J|F,Eo=oe+w}else Ao=1<<oe|L<<J|F,Eo=w}function Bu(w){w.return!==null&&(rs(w,1),Id(w,1,0))}function Oh(w){for(;w===Ld;)Ld=ds[--So],ds[So]=null,zc=ds[--So],ds[So]=null;for(;w===tl;)tl=ta[--Vs],ta[Vs]=null,Eo=ta[--Vs],ta[Vs]=null,Ao=ta[--Vs],ta[Vs]=null}var is=null,bi=null,wi=!1,Uc=!1,ko=null;function nl(w,_){var L=Jc(5,null,null,0);L.elementType="DELETED",L.stateNode=_,L.return=w,_=w.deletions,_===null?(w.deletions=[L],w.flags|=16):_.push(L)}function Dd(w,_){switch(w.tag){case 5:return _=nn(_,w.type,w.pendingProps),_!==null?(w.stateNode=_,is=w,bi=sn(_),!0):!1;case 6:return _=Tn(_,w.pendingProps),_!==null?(w.stateNode=_,is=w,bi=null,!0):!1;case 13:if(_=Fn(_),_!==null){var L=tl!==null?{id:Ao,overflow:Eo}:null;return w.memoizedState={dehydrated:_,treeContext:L,retryLane:1073741824},L=Jc(18,null,null,0),L.stateNode=_,L.return=w,w.child=L,is=w,bi=null,!0}return!1;default:return!1}}function zh(w){return(w.mode&1)!==0&&(w.flags&128)===0}function Bd(w){if(wi){var _=bi;if(_){var L=_;if(!Dd(w,_)){if(zh(w))throw Error(a(418));_=br(L);var F=is;_&&Dd(w,_)?nl(F,L):(w.flags=w.flags&-4097|2,wi=!1,is=w)}}else{if(zh(w))throw Error(a(418));w.flags=w.flags&-4097|2,wi=!1,is=w}}}function Fd(w){for(w=w.return;w!==null&&w.tag!==5&&w.tag!==3&&w.tag!==13;)w=w.return;is=w}function Fu(w){if(!we||w!==is)return!1;if(!wi)return Fd(w),wi=!0,!1;if(w.tag!==3&&(w.tag!==5||mt(w.type)&&!te(w.type,w.memoizedProps))){var _=bi;if(_){if(zh(w)){for(w=bi;w;)w=br(w);throw Error(a(418))}for(;_;)nl(w,_),_=br(_)}}if(Fd(w),w.tag===13){if(!we)throw Error(a(316));if(w=w.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(a(317));bi=ce(w)}else bi=is?br(w.stateNode):null;return!0}function Ns(){we&&(bi=is=null,Uc=wi=!1)}function Ia(w){ko===null?ko=[w]:ko.push(w)}function Hc(w,_,L){if(w=L.ref,w!==null&&typeof w!="function"&&typeof w!="object"){if(L._owner){if(L=L._owner,L){if(L.tag!==1)throw Error(a(309));var F=L.stateNode}if(!F)throw Error(a(147,w));var J=F,oe=""+w;return _!==null&&_.ref!==null&&typeof _.ref=="function"&&_.ref._stringRef===oe?_.ref:(_=function(Ve){var at=J.refs;at===Br&&(at=J.refs={}),Ve===null?delete at[oe]:at[oe]=Ve},_._stringRef=oe,_)}if(typeof w!="string")throw Error(a(284));if(!L._owner)throw Error(a(290,w))}return w}function rc(w,_){throw w=Object.prototype.toString.call(_),Error(a(31,w==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":w))}function Ou(w){var _=w._init;return _(w._payload)}function Uh(w){function _(yt,ct){if(w){var Et=yt.deletions;Et===null?(yt.deletions=[ct],yt.flags|=16):Et.push(ct)}}function L(yt,ct){if(!w)return null;for(;ct!==null;)_(yt,ct),ct=ct.sibling;return null}function F(yt,ct){for(yt=new Map;ct!==null;)ct.key!==null?yt.set(ct.key,ct):yt.set(ct.index,ct),ct=ct.sibling;return yt}function J(yt,ct){return yt=cp(yt,ct),yt.index=0,yt.sibling=null,yt}function oe(yt,ct,Et){return yt.index=Et,w?(Et=yt.alternate,Et!==null?(Et=Et.index,Et<ct?(yt.flags|=2,ct):Et):(yt.flags|=2,ct)):(yt.flags|=1048576,ct)}function Ve(yt){return w&&yt.alternate===null&&(yt.flags|=2),yt}function at(yt,ct,Et,ln){return ct===null||ct.tag!==6?(ct=g3(Et,yt.mode,ln),ct.return=yt,ct):(ct=J(ct,Et),ct.return=yt,ct)}function Ct(yt,ct,Et,ln){var Rn=Et.type;return Rn===d?bn(yt,ct,Et.props.children,ln,Et.key):ct!==null&&(ct.elementType===Rn||typeof Rn=="object"&&Rn!==null&&Rn.$$typeof===y&&Ou(Rn)===ct.type)?(ln=J(ct,Et.props),ln.ref=Hc(yt,ct,Et),ln.return=yt,ln):(ln=lE(Et.type,Et.key,Et.props,null,yt.mode,ln),ln.ref=Hc(yt,ct,Et),ln.return=yt,ln)}function Kt(yt,ct,Et,ln){return ct===null||ct.tag!==4||ct.stateNode.containerInfo!==Et.containerInfo||ct.stateNode.implementation!==Et.implementation?(ct=x3(Et,yt.mode,ln),ct.return=yt,ct):(ct=J(ct,Et.children||[]),ct.return=yt,ct)}function bn(yt,ct,Et,ln,Rn){return ct===null||ct.tag!==7?(ct=kg(Et,yt.mode,ln,Rn),ct.return=yt,ct):(ct=J(ct,Et),ct.return=yt,ct)}function xr(yt,ct,Et){if(typeof ct=="string"&&ct!==""||typeof ct=="number")return ct=g3(""+ct,yt.mode,Et),ct.return=yt,ct;if(typeof ct=="object"&&ct!==null){switch(ct.$$typeof){case l:return Et=lE(ct.type,ct.key,ct.props,null,yt.mode,Et),Et.ref=Hc(yt,null,ct),Et.return=yt,Et;case u:return ct=x3(ct,yt.mode,Et),ct.return=yt,ct;case y:var ln=ct._init;return xr(yt,ln(ct._payload),Et)}if($(ct)||k(ct))return ct=kg(ct,yt.mode,Et,null),ct.return=yt,ct;rc(yt,ct)}return null}function Hn(yt,ct,Et,ln){var Rn=ct!==null?ct.key:null;if(typeof Et=="string"&&Et!==""||typeof Et=="number")return Rn!==null?null:at(yt,ct,""+Et,ln);if(typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case l:return Et.key===Rn?Ct(yt,ct,Et,ln):null;case u:return Et.key===Rn?Kt(yt,ct,Et,ln):null;case y:return Rn=Et._init,Hn(yt,ct,Rn(Et._payload),ln)}if($(Et)||k(Et))return Rn!==null?null:bn(yt,ct,Et,ln,null);rc(yt,Et)}return null}function Ri(yt,ct,Et,ln,Rn){if(typeof ln=="string"&&ln!==""||typeof ln=="number")return yt=yt.get(Et)||null,at(ct,yt,""+ln,Rn);if(typeof ln=="object"&&ln!==null){switch(ln.$$typeof){case l:return yt=yt.get(ln.key===null?Et:ln.key)||null,Ct(ct,yt,ln,Rn);case u:return yt=yt.get(ln.key===null?Et:ln.key)||null,Kt(ct,yt,ln,Rn);case y:var Rr=ln._init;return Ri(yt,ct,Et,Rr(ln._payload),Rn)}if($(ln)||k(ln))return yt=yt.get(Et)||null,bn(ct,yt,ln,Rn,null);rc(ct,ln)}return null}function In(yt,ct,Et,ln){for(var Rn=null,Rr=null,vr=ct,si=ct=0,Ua=null;vr!==null&&si<Et.length;si++){vr.index>si?(Ua=vr,vr=null):Ua=vr.sibling;var ai=Hn(yt,vr,Et[si],ln);if(ai===null){vr===null&&(vr=Ua);break}w&&vr&&ai.alternate===null&&_(yt,vr),ct=oe(ai,ct,si),Rr===null?Rn=ai:Rr.sibling=ai,Rr=ai,vr=Ua}if(si===Et.length)return L(yt,vr),wi&&rs(yt,si),Rn;if(vr===null){for(;si<Et.length;si++)vr=xr(yt,Et[si],ln),vr!==null&&(ct=oe(vr,ct,si),Rr===null?Rn=vr:Rr.sibling=vr,Rr=vr);return wi&&rs(yt,si),Rn}for(vr=F(yt,vr);si<Et.length;si++)Ua=Ri(vr,yt,si,Et[si],ln),Ua!==null&&(w&&Ua.alternate!==null&&vr.delete(Ua.key===null?si:Ua.key),ct=oe(Ua,ct,si),Rr===null?Rn=Ua:Rr.sibling=Ua,Rr=Ua);return w&&vr.forEach(function(up){return _(yt,up)}),wi&&rs(yt,si),Rn}function Mo(yt,ct,Et,ln){var Rn=k(Et);if(typeof Rn!="function")throw Error(a(150));if(Et=Rn.call(Et),Et==null)throw Error(a(151));for(var Rr=Rn=null,vr=ct,si=ct=0,Ua=null,ai=Et.next();vr!==null&&!ai.done;si++,ai=Et.next()){vr.index>si?(Ua=vr,vr=null):Ua=vr.sibling;var up=Hn(yt,vr,ai.value,ln);if(up===null){vr===null&&(vr=Ua);break}w&&vr&&up.alternate===null&&_(yt,vr),ct=oe(up,ct,si),Rr===null?Rn=up:Rr.sibling=up,Rr=up,vr=Ua}if(ai.done)return L(yt,vr),wi&&rs(yt,si),Rn;if(vr===null){for(;!ai.done;si++,ai=Et.next())ai=xr(yt,ai.value,ln),ai!==null&&(ct=oe(ai,ct,si),Rr===null?Rn=ai:Rr.sibling=ai,Rr=ai);return wi&&rs(yt,si),Rn}for(vr=F(yt,vr);!ai.done;si++,ai=Et.next())ai=Ri(vr,yt,si,ai.value,ln),ai!==null&&(w&&ai.alternate!==null&&vr.delete(ai.key===null?si:ai.key),ct=oe(ai,ct,si),Rr===null?Rn=ai:Rr.sibling=ai,Rr=ai);return w&&vr.forEach(function(mue){return _(yt,mue)}),wi&&rs(yt,si),Rn}function Zc(yt,ct,Et,ln){if(typeof Et=="object"&&Et!==null&&Et.type===d&&Et.key===null&&(Et=Et.props.children),typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case l:e:{for(var Rn=Et.key,Rr=ct;Rr!==null;){if(Rr.key===Rn){if(Rn=Et.type,Rn===d){if(Rr.tag===7){L(yt,Rr.sibling),ct=J(Rr,Et.props.children),ct.return=yt,yt=ct;break e}}else if(Rr.elementType===Rn||typeof Rn=="object"&&Rn!==null&&Rn.$$typeof===y&&Ou(Rn)===Rr.type){L(yt,Rr.sibling),ct=J(Rr,Et.props),ct.ref=Hc(yt,Rr,Et),ct.return=yt,yt=ct;break e}L(yt,Rr);break}else _(yt,Rr);Rr=Rr.sibling}Et.type===d?(ct=kg(Et.props.children,yt.mode,ln,Et.key),ct.return=yt,yt=ct):(ln=lE(Et.type,Et.key,Et.props,null,yt.mode,ln),ln.ref=Hc(yt,ct,Et),ln.return=yt,yt=ln)}return Ve(yt);case u:e:{for(Rr=Et.key;ct!==null;){if(ct.key===Rr)if(ct.tag===4&&ct.stateNode.containerInfo===Et.containerInfo&&ct.stateNode.implementation===Et.implementation){L(yt,ct.sibling),ct=J(ct,Et.children||[]),ct.return=yt,yt=ct;break e}else{L(yt,ct);break}else _(yt,ct);ct=ct.sibling}ct=x3(Et,yt.mode,ln),ct.return=yt,yt=ct}return Ve(yt);case y:return Rr=Et._init,Zc(yt,ct,Rr(Et._payload),ln)}if($(Et))return In(yt,ct,Et,ln);if(k(Et))return Mo(yt,ct,Et,ln);rc(yt,Et)}return typeof Et=="string"&&Et!==""||typeof Et=="number"?(Et=""+Et,ct!==null&&ct.tag===6?(L(yt,ct.sibling),ct=J(ct,Et),ct.return=yt,yt=ct):(L(yt,ct),ct=g3(Et,yt.mode,ln),ct.return=yt,yt=ct),Ve(yt)):L(yt,ct)}return Zc}var Ml=Uh(!0),hs=Uh(!1),Hh={},fs=Wt(Hh),ro=Wt(Hh),Rl=Wt(Hh);function Co(w){if(w===Hh)throw Error(a(174));return w}function Gh(w,_){Ut(Rl,_),Ut(ro,w),Ut(fs,Hh),w=Z(_),zt(fs),Ut(fs,w)}function ic(){zt(fs),zt(ro),zt(Rl)}function Od(w){var _=Co(Rl.current),L=Co(fs.current);_=V(L,w.type,_),L!==_&&(Ut(ro,w),Ut(fs,_))}function zu(w){ro.current===w&&(zt(fs),zt(ro))}var ii=Wt(0);function jl(w){for(var _=w;_!==null;){if(_.tag===13){var L=_.memoizedState;if(L!==null&&(L=L.dehydrated,L===null||lr(L)||mr(L)))return _}else if(_.tag===19&&_.memoizedProps.revealOrder!==void 0){if(_.flags&128)return _}else if(_.child!==null){_.child.return=_,_=_.child;continue}if(_===w)break;for(;_.sibling===null;){if(_.return===null||_.return===w)return null;_=_.return}_.sibling.return=_.return,_=_.sibling}return null}var Gc=[];function zd(){for(var w=0;w<Gc.length;w++){var _=Gc[w];Ee?_._workInProgressVersionPrimary=null:_._workInProgressVersionSecondary=null}Gc.length=0}var Ws=o.ReactCurrentDispatcher,ps=o.ReactCurrentBatchConfig,Jr=0,Yn=null,Lr=null,Ir=null,Pl=!1,Uu=!1,Vc=0,Ux=0;function va(){throw Error(a(321))}function Hx(w,_){if(_===null)return!1;for(var L=0;L<_.length&&L<w.length;L++)if(!ts(w[L],_[L]))return!1;return!0}function Gx(w,_,L,F,J,oe){if(Jr=oe,Yn=_,_.memoizedState=null,_.updateQueue=null,_.lanes=0,Ws.current=w===null||w.memoizedState===null?bg:c3,w=L(F,J),Uu){oe=0;do{if(Uu=!1,Vc=0,25<=oe)throw Error(a(301));oe+=1,Ir=Lr=null,_.updateQueue=null,Ws.current=u3,w=L(F,J)}while(Uu)}
vendor: 2,106 bytes, line 4524
4524if(Ws.current=rp,_=Lr!==null&&Lr.next!==null,Jr=0,Ir=Lr=Yn=null,Pl=!1,_)throw Error(a(300));return w}function Vx(){var w=Vc!==0;return Vc=0,w}function rl(){var w={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ir===null?Yn.memoizedState=Ir=w:Ir=Ir.next=w,Ir}function sc(){if(Lr===null){var w=Yn.alternate;w=w!==null?w.memoizedState:null}else w=Lr.next;var _=Ir===null?Yn.memoizedState:Ir.next;if(_!==null)Ir=_,Lr=w;else{if(w===null)throw Error(a(310));Lr=w,w={memoizedState:Lr.memoizedState,baseState:Lr.baseState,baseQueue:Lr.baseQueue,queue:Lr.queue,next:null},Ir===null?Yn.memoizedState=Ir=w:Ir=Ir.next=w}return Ir}function Ud(w,_){return typeof _=="function"?_(w):_}function mg(w){var _=sc(),L=_.queue;if(L===null)throw Error(a(311));L.lastRenderedReducer=w;var F=Lr,J=F.baseQueue,oe=L.pending;if(oe!==null){if(J!==null){var Ve=J.next;J.next=oe.next,oe.next=Ve}F.baseQueue=J=oe,L.pending=null}if(J!==null){oe=J.next,F=F.baseState;var at=Ve=null,Ct=null,Kt=oe;do{var bn=Kt.lane;if((Jr&bn)===bn)Ct!==null&&(Ct=Ct.next={lane:0,action:Kt.action,hasEagerState:Kt.hasEagerState,eagerState:Kt.eagerState,next:null}),F=Kt.hasEagerState?Kt.eagerState:w(F,Kt.action);else{var xr={lane:bn,action:Kt.action,hasEagerState:Kt.hasEagerState,eagerState:Kt.eagerState,next:null};Ct===null?(at=Ct=xr,Ve=F):Ct=Ct.next=xr,Yn.lanes|=bn,Oa|=bn}Kt=Kt.next}while(Kt!==null&&Kt!==oe);Ct===null?Ve=F:Ct.next=at,ts(F,_.memoizedState)||(Fa=!0),_.memoizedState=F,_.baseState=Ve,_.baseQueue=Ct,L.lastRenderedState=F}if(w=L.interleaved,w!==null){J=w;do oe=J.lane,Yn.lanes|=oe,Oa|=oe,J=J.next;while(J!==w)}else J===null&&(L.lanes=0);return[_.memoizedState,L.dispatch]}function gg(w){var _=sc(),L=_.queue;if(L===null)throw Error(a(311));L.lastRenderedReducer=w;var F=L.dispatch,J=L.pending,oe=_.memoizedState;if(J!==null){L.pending=null;var Ve=J=J.next;do oe=w(oe,Ve.action),Ve=Ve.next;while(Ve!==J);ts(oe,_.memoizedState)||(Fa=!0),_.memoizedState=oe,_.baseQueue===null&&(_.baseState=oe),L.lastRenderedState=oe}return[oe,F]}function lw(){}function cw(w,_){var L=Yn,F=sc(),J=_(),oe=!ts(F.memoizedState,J);
vendor: 77,996 bytes, lines 4524-4530
4524if(oe&&(F.memoizedState=J,Fa=!0),F=F.queue,Hd(Wx.bind(null,L,F,w),[w]),F.getSnapshot!==_||oe||Ir!==null&&Ir.memoizedState.tag&1){if(L.flags|=2048,Da(9,dw.bind(null,L,F,J,_),void 0,null),Gr===null)throw Error(a(349));Jr&30||uw(L,_,J)}return J}function uw(w,_,L){w.flags|=16384,w={getSnapshot:_,value:L},_=Yn.updateQueue,_===null?(_={lastEffect:null,stores:null},Yn.updateQueue=_,_.stores=[w]):(L=_.stores,L===null?_.stores=[w]:L.push(w))}function dw(w,_,L,F){_.value=L,_.getSnapshot=F,xg(_)&&No(w,1,-1)}function Wx(w,_,L){return L(function(){xg(_)&&No(w,1,-1)})}function xg(w){var _=w.getSnapshot;w=w.value;try{var L=_();return!ts(w,L)}catch{return!0}}function io(w){var _=rl();return typeof w=="function"&&(w=w()),_.memoizedState=_.baseState=w,w={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ud,lastRenderedState:w},_.queue=w,w=w.dispatch=l3.bind(null,Yn,w),[_.memoizedState,w]}function Da(w,_,L,F){return w={tag:w,create:_,destroy:L,deps:F,next:null},_=Yn.updateQueue,_===null?(_={lastEffect:null,stores:null},Yn.updateQueue=_,_.lastEffect=w.next=w):(L=_.lastEffect,L===null?_.lastEffect=w.next=w:(F=L.next,L.next=w,w.next=F,_.lastEffect=w)),w}function vg(){return sc().memoizedState}function Vh(w,_,L,F){var J=rl();Yn.flags|=w,J.memoizedState=Da(1|_,L,void 0,F===void 0?null:F)}function yg(w,_,L,F){var J=sc();F=F===void 0?null:F;var oe=void 0;if(Lr!==null){var Ve=Lr.memoizedState;if(oe=Ve.destroy,F!==null&&Hx(F,Ve.deps)){J.memoizedState=Da(_,L,oe,F);return}}Yn.flags|=w,J.memoizedState=Da(1|_,L,oe,F)}function tp(w,_){return Vh(8390656,8,w,_)}function Hd(w,_){return yg(2048,8,w,_)}function $x(w,_){return yg(4,2,w,_)}function hw(w,_){return yg(4,4,w,_)}function Kx(w,_){if(typeof _=="function")return w=w(),_(w),function(){_(null)};if(_!=null)return w=w(),_.current=w,function(){_.current=null}}function qx(w,_,L){return L=L!=null?L.concat([w]):null,yg(4,4,Kx.bind(null,_,w),L)}function np(){}function Xx(w,_){var L=sc();_=_===void 0?null:_;var F=L.memoizedState;return F!==null&&_!==null&&Hx(_,F[1])?F[0]:(L.memoizedState=[w,_],w)}function KA(w,_){var L=sc();_=_===void 0?null:_;var F=L.memoizedState;return F!==null&&_!==null&&Hx(_,F[1])?F[0]:(w=w(),L.memoizedState=[w,_],w)}function a3(w,_){var L=er;er=L!==0&&4>L?L:4,w(!0);var F=ps.transition;ps.transition={};try{w(!1),_()}finally{er=L,ps.transition=F}}function fw(){return sc().memoizedState}function o3(w,_,L){var F=lc(w);L={lane:F,action:L,hasEagerState:!1,eagerState:null,next:null},qA(w)?XA(_,L):(YA(w,_,L),L=za(),w=No(w,F,L),w!==null&&Yx(w,_,F))}function l3(w,_,L){var F=lc(w),J={lane:F,action:L,hasEagerState:!1,eagerState:null,next:null};if(qA(w))XA(_,J);else{YA(w,_,J);var oe=w.alternate;if(w.lanes===0&&(oe===null||oe.lanes===0)&&(oe=_.lastRenderedReducer,oe!==null))try{var Ve=_.lastRenderedState,at=oe(Ve,L);if(J.hasEagerState=!0,J.eagerState=at,ts(at,Ve))return}catch{}finally{}L=za(),w=No(w,F,L),w!==null&&Yx(w,_,F)}}function qA(w){var _=w.alternate;return w===Yn||_!==null&&_===Yn}function XA(w,_){Uu=Pl=!0;var L=w.pending;L===null?_.next=_:(_.next=L.next,L.next=_),w.pending=_}function YA(w,_,L){Gr!==null&&w.mode&1&&!(Un&2)?(w=_.interleaved,w===null?(L.next=L,he===null?he=[_]:he.push(_)):(L.next=w.next,w.next=L),_.interleaved=L):(w=_.pending,w===null?L.next=L:(L.next=w.next,w.next=L),_.pending=L)}function Yx(w,_,L){if(L&4194240){var F=_.lanes;F&=w.pendingLanes,L|=F,_.lanes=L,Zo(w,L)}}var rp={readContext:H,useCallback:va,useContext:va,useEffect:va,useImperativeHandle:va,useInsertionEffect:va,useLayoutEffect:va,useMemo:va,useReducer:va,useRef:va,useState:va,useDebugValue:va,useDeferredValue:va,useTransition:va,useMutableSource:va,useSyncExternalStore:va,useId:va,unstable_isNewReconciler:!1},bg={readContext:H,useCallback:function(w,_){return rl().memoizedState=[w,_===void 0?null:_],w},useContext:H,useEffect:tp,useImperativeHandle:function(w,_,L){return L=L!=null?L.concat([w]):null,Vh(4194308,4,Kx.bind(null,_,w),L)},useLayoutEffect:function(w,_){return Vh(4194308,4,w,_)},useInsertionEffect:function(w,_){return Vh(4,2,w,_)},useMemo:function(w,_){var L=rl();return _=_===void 0?null:_,w=w(),L.memoizedState=[w,_],w},useReducer:function(w,_,L){var F=rl();return _=L!==void 0?L(_):_,F.memoizedState=F.baseState=_,w={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:w,lastRenderedState:_},F.queue=w,w=w.dispatch=o3.bind(null,Yn,w),[F.memoizedState,w]},useRef:function(w){var _=rl();return w={current:w},_.memoizedState=w},useState:io,useDebugValue:np,useDeferredValue:function(w){var _=io(w),L=_[0],F=_[1];return tp(function(){var J=ps.transition;ps.transition={};try{F(w)}finally{ps.transition=J}},[w]),L},useTransition:function(){var w=io(!1),_=w[0];return w=a3.bind(null,w[1]),rl().memoizedState=w,[_,w]},useMutableSource:function(){},useSyncExternalStore:function(w,_,L){var F=Yn,J=rl();if(wi){if(L===void 0)throw Error(a(407));L=L()}else{if(L=_(),Gr===null)throw Error(a(349));Jr&30||uw(F,_,L)}J.memoizedState=L;var oe={value:L,getSnapshot:_};return J.queue=oe,tp(Wx.bind(null,F,oe,w),[w]),F.flags|=2048,Da(9,dw.bind(null,F,oe,L,_),void 0,null),L},useId:function(){var w=rl(),_=Gr.identifierPrefix;if(wi){var L=Eo,F=Ao;L=(F&~(1<<32-rr(F)-1)).toString(32)+L,_=":"+_+"R"+L,L=Vc++,0<L&&(_+="H"+L.toString(32)),_+=":"}else L=Ux++,_=":"+_+"r"+L.toString(32)+":";return w.memoizedState=_},unstable_isNewReconciler:!1},c3={readContext:H,useCallback:Xx,useContext:H,useEffect:Hd,useImperativeHandle:qx,useInsertionEffect:$x,useLayoutEffect:hw,useMemo:KA,useReducer:mg,useRef:vg,useState:function(){return mg(Ud)},useDebugValue:np,useDeferredValue:function(w){var _=mg(Ud),L=_[0],F=_[1];return Hd(function(){var J=ps.transition;ps.transition={};try{F(w)}finally{ps.transition=J}},[w]),L},useTransition:function(){var w=mg(Ud)[0],_=sc().memoizedState;return[w,_]},useMutableSource:lw,useSyncExternalStore:cw,useId:fw,unstable_isNewReconciler:!1},u3={readContext:H,useCallback:Xx,useContext:H,useEffect:Hd,useImperativeHandle:qx,useInsertionEffect:$x,useLayoutEffect:hw,useMemo:KA,useReducer:gg,useRef:vg,useState:function(){return gg(Ud)},useDebugValue:np,useDeferredValue:function(w){var _=gg(Ud),L=_[0],F=_[1];return Hd(function(){var J=ps.transition;ps.transition={};try{F(w)}finally{ps.transition=J}},[w]),L},useTransition:function(){var w=gg(Ud)[0],_=sc().memoizedState;return[w,_]},useMutableSource:lw,useSyncExternalStore:cw,useId:fw,unstable_isNewReconciler:!1};function Jx(w,_){try{var L="",F=_;do L+=Tl(F),F=F.return;while(F);var J=L}catch(oe){J=` 4525Error generating stack: `+oe.message+` 4526`+oe.stack}return{value:w,source:_,stack:J}}function pw(w,_){try{console.error(_.value)}catch(L){setTimeout(function(){throw L})}}var d3=typeof WeakMap=="function"?WeakMap:Map;function JA(w,_,L){L=St(-1,L),L.tag=3,L.payload={element:null};var F=_.value;return L.callback=function(){nv||(nv=!0,Sw=F),pw(w,_)},L}function ZA(w,_,L){L=St(-1,L),L.tag=3;var F=w.type.getDerivedStateFromError;if(typeof F=="function"){var J=_.value;L.payload=function(){return F(J)},L.callback=function(){pw(w,_)}}var oe=w.stateNode;return oe!==null&&typeof oe.componentDidCatch=="function"&&(L.callback=function(){pw(w,_),typeof F!="function"&&(Xc===null?Xc=new Set([this]):Xc.add(this));var Ve=_.stack;this.componentDidCatch(_.value,{componentStack:Ve!==null?Ve:""})}),L}function Hu(w,_,L){var F=w.pingCache;if(F===null){F=w.pingCache=new d3;var J=new Set;F.set(_,J)}else J=F.get(_),J===void 0&&(J=new Set,F.set(_,J));J.has(L)||(J.add(L),w=Nw.bind(null,w,_,L),_.then(w,w))}function Ll(w){do{var _;if((_=w.tag===13)&&(_=w.memoizedState,_=_!==null?_.dehydrated!==null:!0),_)return w;w=w.return}while(w!==null);return null}function Wc(w,_,L,F,J){return w.mode&1?(w.flags|=65536,w.lanes=J,w):(w===_?w.flags|=65536:(w.flags|=128,L.flags|=131072,L.flags&=-52805,L.tag===1&&(L.alternate===null?L.tag=17:(_=St(-1,1),_.tag=2,It(L,_))),L.lanes|=1),w)}function $c(w){w.flags|=4}function mw(w,_){if(w!==null&&w.child===_.child)return!0;if(_.flags&16)return!1;for(w=_.child;w!==null;){if(w.flags&12854||w.subtreeFlags&12854)return!1;w=w.sibling}return!0}var Il,Ba,Zx,Qx;if(ae)Il=function(w,_){for(var L=_.child;L!==null;){if(L.tag===5||L.tag===6)z(w,L.stateNode);else if(L.tag!==4&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===_)break;for(;L.sibling===null;){if(L.return===null||L.return===_)return;L=L.return}L.sibling.return=L.return,L=L.sibling}},Ba=function(){},Zx=function(w,_,L,F,J){if(w=w.memoizedProps,w!==F){var oe=_.stateNode,Ve=Co(fs.current);L=q(oe,L,w,F,J,Ve),(_.updateQueue=L)&&$c(_)}},Qx=function(w,_,L,F){L!==F&&$c(_)};else if(Q){Il=function(w,_,L,F){for(var J=_.child;J!==null;){if(J.tag===5){var oe=J.stateNode;L&&F&&(oe=en(oe,J.type,J.memoizedProps,J)),z(w,oe)}else if(J.tag===6)oe=J.stateNode,L&&F&&(oe=Mt(oe,J.memoizedProps,J)),z(w,oe);else if(J.tag!==4){if(J.tag===22&&J.memoizedState!==null)oe=J.child,oe!==null&&(oe.return=J),Il(w,J,!0,!0);else if(J.child!==null){J.child.return=J,J=J.child;continue}}if(J===_)break;for(;J.sibling===null;){if(J.return===null||J.return===_)return;J=J.return}J.sibling.return=J.return,J=J.sibling}};var gw=function(w,_,L,F){for(var J=_.child;J!==null;){if(J.tag===5){var oe=J.stateNode;L&&F&&(oe=en(oe,J.type,J.memoizedProps,J)),_t(w,oe)}else if(J.tag===6)oe=J.stateNode,L&&F&&(oe=Mt(oe,J.memoizedProps,J)),_t(w,oe);else if(J.tag!==4){if(J.tag===22&&J.memoizedState!==null)oe=J.child,oe!==null&&(oe.return=J),gw(w,J,!0,!0);else if(J.child!==null){J.child.return=J,J=J.child;continue}}if(J===_)break;for(;J.sibling===null;){if(J.return===null||J.return===_)return;J=J.return}J.sibling.return=J.return,J=J.sibling}};Ba=function(w,_){var L=_.stateNode;if(!mw(w,_)){w=L.containerInfo;var F=Nt(w);gw(F,_,!1,!1),L.pendingChildren=F,$c(_),Lt(w,F)}},Zx=function(w,_,L,F,J){var oe=w.stateNode,Ve=w.memoizedProps;if((w=mw(w,_))&&Ve===F)_.stateNode=oe;else{var at=_.stateNode,Ct=Co(fs.current),Kt=null;Ve!==F&&(Kt=q(at,L,Ve,F,J,Ct)),w&&Kt===null?_.stateNode=oe:(oe=dt(oe,Kt,L,Ve,F,_,w,at),I(oe,L,F,J,Ct)&&$c(_),_.stateNode=oe,w?$c(_):Il(oe,_,!1,!1))}},Qx=function(w,_,L,F){L!==F?(w=Co(Rl.current),L=Co(fs.current),_.stateNode=se(F,w,L,_),$c(_)):_.stateNode=w.stateNode}}else Ba=function(){},Zx=function(){},Qx=function(){};function ip(w,_){if(!wi)switch(w.tailMode){case"hidden":_=w.tail;for(var L=null;_!==null;)_.alternate!==null&&(L=_),_=_.sibling;L===null?w.tail=null:L.sibling=null;break;case"collapsed":L=w.tail;for(var F=null;L!==null;)L.alternate!==null&&(F=L),L=L.sibling;F===null?_||w.tail===null?w.tail=null:w.tail.sibling=null:F.sibling=null}}function ya(w){var _=w.alternate!==null&&w.alternate.child===w.child,L=0,F=0;if(_)for(var J=w.child;J!==null;)L|=J.lanes|J.childLanes,F|=J.subtreeFlags&14680064,F|=J.flags&14680064,J.return=w,J=J.sibling;else for(J=w.child;J!==null;)L|=J.lanes|J.childLanes,F|=J.subtreeFlags,F|=J.flags,J.return=w,J=J.sibling;return w.subtreeFlags|=F,w.childLanes=L,_}function QA(w,_,L){var F=_.pendingProps;switch(Oh(_),_.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ya(_),null;case 1:return wr(_.type)&&Jn(),ya(_),null;case 3:return F=_.stateNode,ic(),zt(Cn),zt(an),zd(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(w===null||w.child===null)&&(Fu(_)?$c(_):w===null||w.memoizedState.isDehydrated&&!(_.flags&256)||(_.flags|=1024,ko!==null&&(sv(ko),ko=null))),Ba(w,_),ya(_),null;case 5:zu(_),L=Co(Rl.current);var J=_.type;if(w!==null&&_.stateNode!=null)Zx(w,_,J,F,L),w.ref!==_.ref&&(_.flags|=512,_.flags|=2097152);else{if(!F){if(_.stateNode===null)throw Error(a(166));return ya(_),null}if(w=Co(fs.current),Fu(_)){if(!we)throw Error(a(175));w=de(_.stateNode,_.type,_.memoizedProps,L,w,_,!Uc),_.updateQueue=w,w!==null&&$c(_)}else{var oe=Y(J,F,L,w,_);Il(oe,_,!1,!1),_.stateNode=oe,I(oe,J,F,L,w)&&$c(_)}_.ref!==null&&(_.flags|=512,_.flags|=2097152)}return ya(_),null;case 6:if(w&&_.stateNode!=null)Qx(w,_,w.memoizedProps,F);else{if(typeof F!="string"&&_.stateNode===null)throw Error(a(166));if(w=Co(Rl.current),L=Co(fs.current),Fu(_)){if(!we)throw Error(a(176));if(w=_.stateNode,F=_.memoizedProps,(L=ke(w,F,_,!Uc))&&(J=is,J!==null))switch(oe=(J.mode&1)!==0,J.tag){case 3:vt(J.stateNode.containerInfo,w,F,oe);break;case 5:wt(J.type,J.memoizedProps,J.stateNode,w,F,oe)}L&&$c(_)}else _.stateNode=se(F,w,L,_)}return ya(_),null;case 13:if(zt(ii),F=_.memoizedState,wi&&bi!==null&&_.mode&1&&!(_.flags&128)){for(w=bi;w;)w=br(w);return Ns(),_.flags|=98560,_}if(F!==null&&F.dehydrated!==null){if(F=Fu(_),w===null){if(!F)throw Error(a(318));if(!we)throw Error(a(344));if(w=_.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(a(317));Ye(w,_)}else Ns(),!(_.flags&128)&&(_.memoizedState=null),_.flags|=4;return ya(_),null}return ko!==null&&(sv(ko),ko=null),_.flags&128?(_.lanes=L,_):(F=F!==null,L=!1,w===null?Fu(_):L=w.memoizedState!==null,F&&!L&&(_.child.flags|=8192,_.mode&1&&(w===null||ii.current&1?ar===0&&(ar=3):av())),_.updateQueue!==null&&(_.flags|=4),ya(_),null);case 4:return ic(),Ba(w,_),w===null&&K(_.stateNode.containerInfo),ya(_),null;case 10:return cs(_.type._context),ya(_),null;case 17:return wr(_.type)&&Jn(),ya(_),null;case 19:if(zt(ii),J=_.memoizedState,J===null)return ya(_),null;if(F=(_.flags&128)!==0,oe=J.rendering,oe===null)if(F)ip(J,!1);else{if(ar!==0||w!==null&&w.flags&128)for(w=_.child;w!==null;){if(oe=jl(w),oe!==null){for(_.flags|=128,ip(J,!1),w=oe.updateQueue,w!==null&&(_.updateQueue=w,_.flags|=4),_.subtreeFlags=0,w=L,F=_.child;F!==null;)L=F,J=w,L.flags&=14680066,oe=L.alternate,oe===null?(L.childLanes=0,L.lanes=J,L.child=null,L.subtreeFlags=0,L.memoizedProps=null,L.memoizedState=null,L.updateQueue=null,L.dependencies=null,L.stateNode=null):(L.childLanes=oe.childLanes,L.lanes=oe.lanes,L.child=oe.child,L.subtreeFlags=0,L.deletions=null,L.memoizedProps=oe.memoizedProps,L.memoizedState=oe.memoizedState,L.updateQueue=oe.updateQueue,L.type=oe.type,J=oe.dependencies,L.dependencies=J===null?null:{lanes:J.lanes,firstContext:J.firstContext}),F=F.sibling;return Ut(ii,ii.current&1|2),_.child}w=w.sibling}J.tail!==null&&Ni()>ap&&(_.flags|=128,F=!0,ip(J,!1),_.lanes=4194304)}else{if(!F)if(w=jl(oe),w!==null){if(_.flags|=128,F=!0,w=w.updateQueue,w!==null&&(_.updateQueue=w,_.flags|=4),ip(J,!0),J.tail===null&&J.tailMode==="hidden"&&!oe.alternate&&!wi)return ya(_),null}else 2*Ni()-J.renderingStartTime>ap&&L!==1073741824&&(_.flags|=128,F=!0,ip(J,!1),_.lanes=4194304);J.isBackwards?(oe.sibling=_.child,_.child=oe):(w=J.last,w!==null?w.sibling=oe:_.child=oe,J.last=oe)}return J.tail!==null?(_=J.tail,J.rendering=_,J.tail=_.sibling,J.renderingStartTime=Ni(),_.sibling=null,w=ii.current,Ut(ii,F?w&1|2:w&1),_):(ya(_),null);case 22:case 23:return Cw(),F=_.memoizedState!==null,w!==null&&w.memoizedState!==null!==F&&(_.flags|=8192),F&&_.mode&1?Ci&1073741824&&(ya(_),ae&&_.subtreeFlags&6&&(_.flags|=8192)):ya(_),null;case 24:return null;case 25:return null}throw Error(a(156,_.tag))}var h3=o.ReactCurrentOwner,Fa=!1;function na(w,_,L,F){_.child=w===null?hs(_,null,L,F):Ml(_,w.child,L,F)}function sp(w,_,L,F,J){L=L.render;var oe=_.ref;return Ii(_,J),F=Gx(w,_,L,F,oe,J),L=Vx(),w!==null&&!Fa?(_.updateQueue=w.updateQueue,_.flags&=-2053,w.lanes&=~J,fe(w,_,J)):(wi&&L&&Bu(_),_.flags|=1,na(w,_,F,J),_.child)}function ev(w,_,L,F,J){if(w===null){var oe=L.type;return typeof oe=="function"&&!m3(oe)&&oe.defaultProps===void 0&&L.compare===null&&L.defaultProps===void 0?(_.tag=15,_.type=oe,xw(w,_,oe,F,J)):(w=lE(L.type,null,F,_,_.mode,J),w.ref=_.ref,w.return=_,_.child=w)}if(oe=w.child,!(w.lanes&J)){var Ve=oe.memoizedProps;if(L=L.compare,L=L!==null?L:nc,L(Ve,F)&&w.ref===_.ref)return fe(w,_,J)}return _.flags|=1,w=cp(oe,F),w.ref=_.ref,w.return=_,_.child=w}function xw(w,_,L,F,J){if(w!==null&&nc(w.memoizedProps,F)&&w.ref===_.ref)if(Fa=!1,(w.lanes&J)!==0)w.flags&131072&&(Fa=!0);else return _.lanes=w.lanes,fe(w,_,J);return yw(w,_,L,F,J)}function eE(w,_,L){var F=_.pendingProps,J=F.children,oe=w!==null?w.memoizedState:null;if(F.mode==="hidden")if(!(_.mode&1))_.memoizedState={baseLanes:0,cachePool:null},Ut(oa,Ci),Ci|=L;else if(L&1073741824)_.memoizedState={baseLanes:0,cachePool:null},F=oe!==null?oe.baseLanes:L,Ut(oa,Ci),Ci|=F;else return w=oe!==null?oe.baseLanes|L:L,_.lanes=_.childLanes=1073741824,_.memoizedState={baseLanes:w,cachePool:null},_.updateQueue=null,Ut(oa,Ci),Ci|=w,null;else oe!==null?(F=oe.baseLanes|L,_.memoizedState=null):F=L,Ut(oa,Ci),Ci|=F;return na(w,_,J,L),_.child}function vw(w,_){var L=_.ref;(w===null&&L!==null||w!==null&&w.ref!==L)&&(_.flags|=512,_.flags|=2097152)}function yw(w,_,L,F,J){var oe=wr(L)?on:an.current;return oe=Hr(_,oe),Ii(_,J),L=Gx(w,_,L,F,oe,J),F=Vx(),w!==null&&!Fa?(_.updateQueue=w.updateQueue,_.flags&=-2053,w.lanes&=~J,fe(w,_,J)):(wi&&F&&Bu(_),_.flags|=1,na(w,_,L,J),_.child)}function tE(w,_,L,F,J){if(wr(L)){var oe=!0;zn(_)}else oe=!1;if(Ii(_,J),_.stateNode===null)w!==null&&(w.alternate=null,_.alternate=null,_.flags|=2),Ei(_,L,F),Ti(_,L,F,J),F=!0;else if(w===null){var Ve=_.stateNode,at=_.memoizedProps;Ve.props=at;var Ct=Ve.context,Kt=L.contextType;typeof Kt=="object"&&Kt!==null?Kt=H(Kt):(Kt=wr(L)?on:an.current,Kt=Hr(_,Kt));var bn=L.getDerivedStateFromProps,xr=typeof bn=="function"||typeof Ve.getSnapshotBeforeUpdate=="function";xr||typeof Ve.UNSAFE_componentWillReceiveProps!="function"&&typeof Ve.componentWillReceiveProps!="function"||(at!==F||Ct!==Kt)&&Di(_,Ve,F,Kt),Be=!1;var Hn=_.memoizedState;Ve.state=Hn,qn(_,F,Ve,J),Ct=_.memoizedState,at!==F||Hn!==Ct||Cn.current||Be?(typeof bn=="function"&&(ns(_,L,bn,F),Ct=_.memoizedState),(at=Be||di(_,L,at,F,Hn,Ct,Kt))?(xr||typeof Ve.UNSAFE_componentWillMount!="function"&&typeof Ve.componentWillMount!="function"||(typeof Ve.componentWillMount=="function"&&Ve.componentWillMount(),typeof Ve.UNSAFE_componentWillMount=="function"&&Ve.UNSAFE_componentWillMount()),typeof Ve.componentDidMount=="function"&&(_.flags|=4194308)):(typeof Ve.componentDidMount=="function"&&(_.flags|=4194308),_.memoizedProps=F,_.memoizedState=Ct),Ve.props=F,Ve.state=Ct,Ve.context=Kt,F=at):(typeof Ve.componentDidMount=="function"&&(_.flags|=4194308),F=!1)}else{Ve=_.stateNode,ot(w,_),at=_.memoizedProps,Kt=_.type===_.elementType?at:Hs(_.type,at),Ve.props=Kt,xr=_.pendingProps,Hn=Ve.context,Ct=L.contextType,typeof Ct=="object"&&Ct!==null?Ct=H(Ct):(Ct=wr(L)?on:an.current,Ct=Hr(_,Ct));var Ri=L.getDerivedStateFromProps;(bn=typeof Ri=="function"||typeof Ve.getSnapshotBeforeUpdate=="function")||typeof Ve.UNSAFE_componentWillReceiveProps!="function"&&typeof Ve.componentWillReceiveProps!="function"||(at!==xr||Hn!==Ct)&&Di(_,Ve,F,Ct),Be=!1,Hn=_.memoizedState,Ve.state=Hn,qn(_,F,Ve,J);var In=_.memoizedState;at!==xr||Hn!==In||Cn.current||Be?(typeof Ri=="function"&&(ns(_,L,Ri,F),In=_.memoizedState),(Kt=Be||di(_,L,Kt,F,Hn,In,Ct)||!1)?(bn||typeof Ve.UNSAFE_componentWillUpdate!="function"&&typeof Ve.componentWillUpdate!="function"||(typeof Ve.componentWillUpdate=="function"&&Ve.componentWillUpdate(F,In,Ct),typeof Ve.UNSAFE_componentWillUpdate=="function"&&Ve.UNSAFE_componentWillUpdate(F,In,Ct)),typeof Ve.componentDidUpdate=="function"&&(_.flags|=4),typeof Ve.getSnapshotBeforeUpdate=="function"&&(_.flags|=1024)):(typeof Ve.componentDidUpdate!="function"||at===w.memoizedProps&&Hn===w.memoizedState||(_.flags|=4),typeof Ve.getSnapshotBeforeUpdate!="function"||at===w.memoizedProps&&Hn===w.memoizedState||(_.flags|=1024),_.memoizedProps=F,_.memoizedState=In),Ve.props=F,Ve.state=In,Ve.context=Ct,F=Kt):(typeof Ve.componentDidUpdate!="function"||at===w.memoizedProps&&Hn===w.memoizedState||(_.flags|=4),typeof Ve.getSnapshotBeforeUpdate!="function"||at===w.memoizedProps&&Hn===w.memoizedState||(_.flags|=1024),F=!1)}return bw(w,_,L,F,oe,J)}function bw(w,_,L,F,J,oe){vw(w,_);var Ve=(_.flags&128)!==0;if(!F&&!Ve)return J&&Ln(_,L,!1),fe(w,_,oe);F=_.stateNode,h3.current=_;var at=Ve&&typeof L.getDerivedStateFromError!="function"?null:F.render();return _.flags|=1,w!==null&&Ve?(_.child=Ml(_,w.child,null,oe),_.child=Ml(_,null,at,oe)):na(w,_,at,oe),_.memoizedState=F.state,J&&Ln(_,L,!0),_.child}function nE(w){var _=w.stateNode;_.pendingContext?Zn(w,_.pendingContext,_.pendingContext!==_.context):_.context&&Zn(w,_.context,!1),Gh(w,_.containerInfo)}function rE(w,_,L,F,J){return Ns(),Ia(J),_.flags|=256,na(w,_,L,F),_.child}var tv={dehydrated:null,treeContext:null,retryLane:0};function wg(w){return{baseLanes:w,cachePool:null}}function _g(w,_,L){var F=_.pendingProps,J=ii.current,oe=!1,Ve=(_.flags&128)!==0,at;if((at=Ve)||(at=w!==null&&w.memoizedState===null?!1:(J&2)!==0),at?(oe=!0,_.flags&=-129):(w===null||w.memoizedState!==null)&&(J|=1),Ut(ii,J&1),w===null)return Bd(_),w=_.memoizedState,w!==null&&(w=w.dehydrated,w!==null)?(_.mode&1?mr(w)?_.lanes=8:_.lanes=1073741824:_.lanes=1,null):(J=F.children,w=F.fallback,oe?(F=_.mode,oe=_.child,J={mode:"hidden",children:J},!(F&1)&&oe!==null?(oe.childLanes=0,oe.pendingProps=J):oe=cE(J,F,0,null),w=kg(w,F,L,null),oe.return=_,w.return=_,oe.sibling=w,_.child=oe,_.child.memoizedState=wg(L),_.memoizedState=tv,w):ww(_,J));if(J=w.memoizedState,J!==null){if(at=J.dehydrated,at!==null){if(Ve)return _.flags&256?(_.flags&=-257,N(w,_,L,Error(a(422)))):_.memoizedState!==null?(_.child=w.child,_.flags|=128,null):(oe=F.fallback,J=_.mode,F=cE({mode:"visible",children:F.children},J,0,null),oe=kg(oe,J,L,null),oe.flags|=2,F.return=_,oe.return=_,F.sibling=oe,_.child=F,_.mode&1&&Ml(_,w.child,null,L),_.child.memoizedState=wg(L),_.memoizedState=tv,oe);if(!(_.mode&1))_=N(w,_,L,null);else if(mr(at))_=N(w,_,L,Error(a(419)));else if(F=(L&w.childLanes)!==0,Fa||F){if(F=Gr,F!==null){switch(L&-L){case 4:oe=2;break;case 16:oe=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:oe=32;break;case 536870912:oe=268435456;break;default:oe=0}F=oe&(F.suspendedLanes|L)?0:oe,F!==0&&F!==J.retryLane&&(J.retryLane=F,No(w,F,-1))}av(),_=N(w,_,L,Error(a(421)))}else lr(at)?(_.flags|=128,_.child=w.child,_=p3.bind(null,w),gr(at,_),_=null):(L=J.treeContext,we&&(bi=yi(at),is=_,wi=!0,ko=null,Uc=!1,L!==null&&(ta[Vs++]=Ao,ta[Vs++]=Eo,ta[Vs++]=tl,Ao=L.id,Eo=L.overflow,tl=_)),_=ww(_,_.pendingProps.children),_.flags|=4096);return _}return oe?(F=_w(w,_,F.children,F.fallback,L),oe=_.child,J=w.child.memoizedState,oe.memoizedState=J===null?wg(L):{baseLanes:J.baseLanes|L,cachePool:null},oe.childLanes=w.childLanes&~L,_.memoizedState=tv,F):(L=iE(w,_,F.children,L),_.memoizedState=null,L)}return oe?(F=_w(w,_,F.children,F.fallback,L),oe=_.child,J=w.child.memoizedState,oe.memoizedState=J===null?wg(L):{baseLanes:J.baseLanes|L,cachePool:null},oe.childLanes=w.childLanes&~L,_.memoizedState=tv,F):(L=iE(w,_,F.children,L),_.memoizedState=null,L)}function ww(w,_){return _=cE({mode:"visible",children:_},w.mode,0,null),_.return=w,w.child=_}function iE(w,_,L,F){var J=w.child;return w=J.sibling,L=cp(J,{mode:"visible",children:L}),!(_.mode&1)&&(L.lanes=F),L.return=_,L.sibling=null,w!==null&&(F=_.deletions,F===null?(_.deletions=[w],_.flags|=16):F.push(w)),_.child=L}function _w(w,_,L,F,J){var oe=_.mode;w=w.child;var Ve=w.sibling,at={mode:"hidden",children:L};return!(oe&1)&&_.child!==w?(L=_.child,L.childLanes=0,L.pendingProps=at,_.deletions=null):(L=cp(w,at),L.subtreeFlags=w.subtreeFlags&14680064),Ve!==null?F=cp(Ve,F):(F=kg(F,oe,J,null),F.flags|=2),F.return=_,L.return=_,L.sibling=F,_.child=L,F}function N(w,_,L,F){return F!==null&&Ia(F),Ml(_,w.child,null,L),w=ww(_,_.pendingProps.children),w.flags|=2,_.memoizedState=null,w}function D(w,_,L){w.lanes|=_;var F=w.alternate;F!==null&&(F.lanes|=_),us(w.return,_,L)}function X(w,_,L,F,J){var oe=w.memoizedState;oe===null?w.memoizedState={isBackwards:_,rendering:null,renderingStartTime:0,last:F,tail:L,tailMode:J}:(oe.isBackwards=_,oe.rendering=null,oe.renderingStartTime=0,oe.last=F,oe.tail=L,oe.tailMode=J)}function ne(w,_,L){var F=_.pendingProps,J=F.revealOrder,oe=F.tail;if(na(w,_,F.children,L),F=ii.current,F&2)F=F&1|2,_.flags|=128;else{if(w!==null&&w.flags&128)e:for(w=_.child;w!==null;){if(w.tag===13)w.memoizedState!==null&&D(w,L,_);else if(w.tag===19)D(w,L,_);else if(w.child!==null){w.child.return=w,w=w.child;continue}if(w===_)break e;for(;w.sibling===null;){if(w.return===null||w.return===_)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}F&=1}if(Ut(ii,F),!(_.mode&1))_.memoizedState=null;else switch(J){case"forwards":for(L=_.child,J=null;L!==null;)w=L.alternate,w!==null&&jl(w)===null&&(J=L),L=L.sibling;L=J,L===null?(J=_.child,_.child=null):(J=L.sibling,L.sibling=null),X(_,!1,J,L,oe);break;case"backwards":for(L=null,J=_.child,_.child=null;J!==null;){if(w=J.alternate,w!==null&&jl(w)===null){_.child=J;break}w=J.sibling,J.sibling=L,L=J,J=w}X(_,!0,L,null,oe);break;case"together":X(_,!1,null,null,void 0);break;default:_.memoizedState=null}return _.child}function fe(w,_,L){if(w!==null&&(_.dependencies=w.dependencies),Oa|=_.lanes,!(L&_.childLanes))return null;if(w!==null&&_.child!==w.child)throw Error(a(153));if(_.child!==null){for(w=_.child,L=cp(w,w.pendingProps),_.child=L,L.return=_;w.sibling!==null;)w=w.sibling,L=L.sibling=cp(w,w.pendingProps),L.return=_;L.sibling=null}return _.child}function ge(w,_,L){switch(_.tag){case 3:nE(_),Ns();break;case 5:Od(_);break;case 1:wr(_.type)&&zn(_);break;case 4:Gh(_,_.stateNode.containerInfo);break;case 10:Fh(_,_.type._context,_.memoizedProps.value);break;case 13:var F=_.memoizedState;if(F!==null)return F.dehydrated!==null?(Ut(ii,ii.current&1),_.flags|=128,null):L&_.child.childLanes?_g(w,_,L):(Ut(ii,ii.current&1),w=fe(w,_,L),w!==null?w.sibling:null);Ut(ii,ii.current&1);break;case 19:if(F=(L&_.childLanes)!==0,w.flags&128){if(F)return ne(w,_,L);_.flags|=128}var J=_.memoizedState;if(J!==null&&(J.rendering=null,J.tail=null,J.lastEffect=null),Ut(ii,ii.current),F)break;return null;case 22:case 23:return _.lanes=0,eE(w,_,L)}return fe(w,_,L)}function be(w,_){switch(Oh(_),_.tag){case 1:return wr(_.type)&&Jn(),w=_.flags,w&65536?(_.flags=w&-65537|128,_):null;case 3:return ic(),zt(Cn),zt(an),zd(),w=_.flags,w&65536&&!(w&128)?(_.flags=w&-65537|128,_):null;case 5:return zu(_),null;case 13:if(zt(ii),w=_.memoizedState,w!==null&&w.dehydrated!==null){if(_.alternate===null)throw Error(a(340));Ns()}return w=_.flags,w&65536?(_.flags=w&-65537|128,_):null;case 19:return zt(ii),null;case 4:return ic(),null;case 10:return cs(_.type._context),null;case 22:case 23:return Cw(),null;case 24:return null;default:return null}}var Te=!1,Re=!1,ze=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function gt(w,_){var L=w.ref;if(L!==null)if(typeof L=="function")try{L(null)}catch(F){Sa(w,_,F)}else L.current=null}function Oe(w,_,L){try{L()}catch(F){Sa(w,_,F)}}var it=!1;function ht(w,_){for(W(w.containerInfo),Ue=_;Ue!==null;)if(w=Ue,_=w.child,(w.subtreeFlags&1028)!==0&&_!==null)_.return=w,Ue=_;else for(;Ue!==null;){w=Ue;try{var L=w.alternate;if(w.flags&1024)switch(w.tag){case 0:case 11:case 15:break;case 1:if(L!==null){var F=L.memoizedProps,J=L.memoizedState,oe=w.stateNode,Ve=oe.getSnapshotBeforeUpdate(w.elementType===w.type?F:Hs(w.type,F),J);oe.__reactInternalSnapshotBeforeUpdate=Ve}break;case 3:ae&&bt(w.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(at){Sa(w,w.return,at)}if(_=w.sibling,_!==null){_.return=w.return,Ue=_;break}Ue=w.return}return L=it,it=!1,L}function kt(w,_,L){var F=_.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var J=F=F.next;do{if((J.tag&w)===w){var oe=J.destroy;J.destroy=void 0,oe!==void 0&&Oe(_,L,oe)}J=J.next}while(J!==F)}}function pt(w,_){if(_=_.updateQueue,_=_!==null?_.lastEffect:null,_!==null){var L=_=_.next;do{if((L.tag&w)===w){var F=L.create;L.destroy=F()}L=L.next}while(L!==_)}}function Tt(w){var _=w.ref;if(_!==null){var L=w.stateNode;switch(w.tag){case 5:w=U(L);break;default:w=L}typeof _=="function"?_(w):_.current=w}}function jt(w,_,L){if(to&&typeof to.onCommitFiberUnmount=="function")try{to.onCommitFiberUnmount(Pu,_)}catch{}switch(_.tag){case 0:case 11:case 14:case 15:if(w=_.updateQueue,w!==null&&(w=w.lastEffect,w!==null)){var F=w=w.next;do{var J=F,oe=J.destroy;J=J.tag,oe!==void 0&&(J&2||J&4)&&Oe(_,L,oe),F=F.next}while(F!==w)}break;case 1:if(gt(_,L),w=_.stateNode,typeof w.componentWillUnmount=="function")try{w.props=_.memoizedProps,w.state=_.memoizedState,w.componentWillUnmount()}catch(Ve){Sa(_,L,Ve)}break;case 5:gt(_,L);break;case 4:ae?Ts(w,_,L):Q&&Q&&(_=_.stateNode.containerInfo,L=Nt(_),Dt(_,L))}}function Ht(w,_,L){for(var F=_;;)if(jt(w,F,L),F.child===null||ae&&F.tag===4){if(F===_)break;for(;F.sibling===null;){if(F.return===null||F.return===_)return;F=F.return}F.sibling.return=F.return,F=F.sibling}else F.child.return=F,F=F.child}function Ft(w){var _=w.alternate;_!==null&&(w.alternate=null,Ft(_)),w.child=null,w.deletions=null,w.sibling=null,w.tag===5&&(_=w.stateNode,_!==null&&ye(_)),w.stateNode=null,w.return=null,w.dependencies=null,w.memoizedProps=null,w.memoizedState=null,w.pendingProps=null,w.stateNode=null,w.updateQueue=null}function kn(w){return w.tag===5||w.tag===3||w.tag===4}function hn(w){e:for(;;){for(;w.sibling===null;){if(w.return===null||kn(w.return))return null;w=w.return}for(w.sibling.return=w.return,w=w.sibling;w.tag!==5&&w.tag!==6&&w.tag!==18;){if(w.flags&2||w.child===null||w.tag===4)continue e;w.child.return=w,w=w.child}if(!(w.flags&2))return w.stateNode}}function dr(w){if(ae){e:{for(var _=w.return;_!==null;){if(kn(_))break e;_=_.return}throw Error(a(160))}var L=_;switch(L.tag){case 5:_=L.stateNode,L.flags&32&&(Xe(_),L.flags&=-33),L=hn(w),jr(w,L,_);break;case 3:case 4:_=L.stateNode.containerInfo,L=hn(w),yn(w,L,_);break;default:throw Error(a(161))}}}function yn(w,_,L){var F=w.tag;if(F===5||F===6)w=w.stateNode,_?Je(L,w,_):Qe(L,w);else if(F!==4&&(w=w.child,w!==null))for(yn(w,_,L),w=w.sibling;w!==null;)yn(w,_,L),w=w.sibling}function jr(w,_,L){var F=w.tag;if(F===5||F===6)w=w.stateNode,_?et(L,w,_):Ke(L,w);else if(F!==4&&(w=w.child,w!==null))for(jr(w,_,L),w=w.sibling;w!==null;)jr(w,_,L),w=w.sibling}function Ts(w,_,L){for(var F=_,J=!1,oe,Ve;;){if(!J){J=F.return;e:for(;;){if(J===null)throw Error(a(160));switch(oe=J.stateNode,J.tag){case 5:Ve=!1;break e;case 3:oe=oe.containerInfo,Ve=!0;break e;case 4:oe=oe.containerInfo,Ve=!0;break e}J=J.return}J=!0}if(F.tag===5||F.tag===6)Ht(w,F,L),Ve?Me(oe,F.stateNode):Ze(oe,F.stateNode);else if(F.tag===18)Ve?$e(oe,F.stateNode):qe(oe,F.stateNode);else if(F.tag===4){if(F.child!==null){oe=F.stateNode.containerInfo,Ve=!0,F.child.return=F,F=F.child;continue}}else if(jt(w,F,L),F.child!==null){F.child.return=F,F=F.child;continue}if(F===_)break;for(;F.sibling===null;){if(F.return===null||F.return===_)return;F=F.return,F.tag===4&&(J=!1)}F.sibling.return=F.return,F=F.sibling}}function cr(w,_){if(ae){switch(_.tag){case 0:case 11:case 14:case 15:kt(3,_,_.return),pt(3,_),kt(5,_,_.return);return;case 1:return;case 5:var L=_.stateNode;if(L!=null){var F=_.memoizedProps;w=w!==null?w.memoizedProps:F;var J=_.type,oe=_.updateQueue;_.updateQueue=null,oe!==null&&xt(L,oe,J,w,F,_)}return;case 6:if(_.stateNode===null)throw Error(a(162));L=_.memoizedProps,je(_.stateNode,w!==null?w.memoizedProps:L,L);return;case 3:we&&w!==null&&w.memoizedState.isDehydrated&&Pe(_.stateNode.containerInfo);return;case 12:return;case 13:gn(_);return;case 19:gn(_);return;case 17:return}throw Error(a(163))}switch(_.tag){case 0:case 11:case 14:case 15:kt(3,_,_.return),pt(3,_),kt(5,_,_.return);return;case 12:return;case 13:gn(_);return;case 19:gn(_);return;case 3:we&&w!==null&&w.memoizedState.isDehydrated&&Pe(_.stateNode.containerInfo);break;case 22:case 23:return}e:if(Q){switch(_.tag){case 1:case 5:case 6:break e;case 3:case 4:_=_.stateNode,Dt(_.containerInfo,_.pendingChildren);break e}throw Error(a(163))}}function gn(w){var _=w.updateQueue;if(_!==null){w.updateQueue=null;var L=w.stateNode;L===null&&(L=w.stateNode=new ze),_.forEach(function(F){var J=Mw.bind(null,w,F);L.has(F)||(L.add(F),F.then(J,J))})}}function Jt(w,_){for(Ue=_;Ue!==null;){_=Ue;var L=_.deletions;if(L!==null)for(var F=0;F<L.length;F++){var J=L[F];try{var oe=w;ae?Ts(oe,J,_):Ht(oe,J,_);var Ve=J.alternate;Ve!==null&&(Ve.return=null),J.return=null}catch(Rn){Sa(J,_,Rn)}}if(L=_.child,_.subtreeFlags&12854&&L!==null)L.return=_,Ue=L;else for(;Ue!==null;){_=Ue;try{var at=_.flags;if(at&32&&ae&&Xe(_.stateNode),at&512){var Ct=_.alternate;if(Ct!==null){var Kt=Ct.ref;Kt!==null&&(typeof Kt=="function"?Kt(null):Kt.current=null)}}if(at&8192)switch(_.tag){case 13:if(_.memoizedState!==null){var bn=_.alternate;(bn===null||bn.memoizedState===null)&&(Sg=Ni())}break;case 22:var xr=_.memoizedState!==null,Hn=_.alternate,Ri=Hn!==null&&Hn.memoizedState!==null;if(L=_,ae){e:if(F=L,J=xr,oe=null,ae)for(var In=F;;){if(In.tag===5){if(oe===null){oe=In;var Mo=In.stateNode;J?ut(Mo):Fe(In.stateNode,In.memoizedProps)}}else if(In.tag===6){if(oe===null){var Zc=In.stateNode;J?lt(Zc):Le(Zc,In.memoizedProps)}}else if((In.tag!==22&&In.tag!==23||In.memoizedState===null||In===F)&&In.child!==null){In.child.return=In,In=In.child;continue}if(In===F)break;for(;In.sibling===null;){if(In.return===null||In.return===F)break e;oe===In&&(oe=null),In=In.return}oe===In&&(oe=null),In.sibling.return=In.return,In=In.sibling}}if(xr&&!Ri&&L.mode&1){Ue=L;for(var yt=L.child;yt!==null;){for(L=Ue=yt;Ue!==null;){F=Ue;var ct=F.child;switch(F.tag){case 0:case 11:case 14:case 15:kt(4,F,F.return);break;case 1:gt(F,F.return);var Et=F.stateNode;if(typeof Et.componentWillUnmount=="function"){var ln=F.return;try{Et.props=F.memoizedProps,Et.state=F.memoizedState,Et.componentWillUnmount()}catch(Rn){Sa(F,ln,Rn)}}break;case 5:gt(F,F.return);break;case 22:if(F.memoizedState!==null){ki(L);continue}}ct!==null?(ct.return=F,Ue=ct):ki(L)}yt=yt.sibling}}}switch(at&4102){case 2:dr(_),_.flags&=-3;break;case 6:dr(_),_.flags&=-3,cr(_.alternate,_);break;case 4096:_.flags&=-4097;break;case 4100:_.flags&=-4097,cr(_.alternate,_);break;case 4:cr(_.alternate,_)}}catch(Rn){Sa(_,_.return,Rn)}if(L=_.sibling,L!==null){L.return=_.return,Ue=L;break}Ue=_.return}}}function ms(w,_,L){Ue=w,sr(w)}function sr(w,_,L){for(var F=(w.mode&1)!==0;Ue!==null;){var J=Ue,oe=J.child;if(J.tag===22&&F){var Ve=J.memoizedState!==null||Te;if(!Ve){var at=J.alternate,Ct=at!==null&&at.memoizedState!==null||Re;at=Te;var Kt=Re;if(Te=Ve,(Re=Ct)&&!Kt)for(Ue=J;Ue!==null;)Ve=Ue,Ct=Ve.child,Ve.tag===22&&Ve.memoizedState!==null?ra(J):Ct!==null?(Ct.return=Ve,Ue=Ct):ra(J);for(;oe!==null;)Ue=oe,sr(oe),oe=oe.sibling;Ue=J,Te=at,Re=Kt}Fr(w)}else J.subtreeFlags&8772&&oe!==null?(oe.return=J,Ue=oe):Fr(w)}}function Fr(w){for(;Ue!==null;){var _=Ue;if(_.flags&8772){var L=_.alternate;try{if(_.flags&8772)switch(_.tag){case 0:case 11:case 15:Re||pt(5,_);break;case 1:var F=_.stateNode;if(_.flags&4&&!Re)if(L===null)F.componentDidMount();else{var J=_.elementType===_.type?L.memoizedProps:Hs(_.type,L.memoizedProps);F.componentDidUpdate(J,L.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var oe=_.updateQueue;oe!==null&&ir(_,oe,F);break;case 3:var Ve=_.updateQueue;if(Ve!==null){if(L=null,_.child!==null)switch(_.child.tag){case 5:L=U(_.child.stateNode);break;case 1:L=_.child.stateNode}ir(_,Ve,L)}break;case 5:var at=_.stateNode;L===null&&_.flags&4&&We(at,_.type,_.memoizedProps,_);break;case 6:break;case 4:break;case 12:break;case 13:if(we&&_.memoizedState===null){var Ct=_.alternate;if(Ct!==null){var Kt=Ct.memoizedState;if(Kt!==null){var bn=Kt.dehydrated;bn!==null&&De(bn)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(a(163))}Re||_.flags&512&&Tt(_)}catch(xr){Sa(_,_.return,xr)}}if(_===w){Ue=null;break}if(L=_.sibling,L!==null){L.return=_.return,Ue=L;break}Ue=_.return}}function ki(w){for(;Ue!==null;){var _=Ue;if(_===w){Ue=null;break}var L=_.sibling;if(L!==null){L.return=_.return,Ue=L;break}Ue=_.return}}function ra(w){for(;Ue!==null;){var _=Ue;try{switch(_.tag){case 0:case 11:case 15:var L=_.return;try{pt(4,_)}catch(Ct){Sa(_,L,Ct)}break;case 1:var F=_.stateNode;if(typeof F.componentDidMount=="function"){var J=_.return;try{F.componentDidMount()}catch(Ct){Sa(_,J,Ct)}}var oe=_.return;try{Tt(_)}catch(Ct){Sa(_,oe,Ct)}break;case 5:var Ve=_.return;try{Tt(_)}catch(Ct){Sa(_,Ve,Ct)}}}catch(Ct){Sa(_,_.return,Ct)}if(_===w){Ue=null;break}var at=_.sibling;if(at!==null){at.return=_.return,Ue=at;break}Ue=_.return}}var ia=0,Mi=1,$s=2,sa=3,ss=4;if(typeof Symbol=="function"&&Symbol.for){var Pr=Symbol.for;ia=Pr("selector.component"),Mi=Pr("selector.has_pseudo_class"),$s=Pr("selector.role"),sa=Pr("selector.test_id"),ss=Pr("selector.text")}function Zr(w){var _=Ae(w);if(_!=null){if(typeof _.memoizedProps["data-testname"]!="string")throw Error(a(364));return _}if(w=me(w),w===null)throw Error(a(362));return w.stateNode.current}function Bi(w,_){switch(_.$$typeof){case ia:if(w.type===_.value)return!0;break;case Mi:e:{_=_.value,w=[w,0];for(var L=0;L<w.length;){var F=w[L++],J=w[L++],oe=_[J];if(F.tag!==5||!_e(F)){for(;oe!=null&&Bi(F,oe);)J++,oe=_[J];if(J===_.length){_=!0;break e}else for(F=F.child;F!==null;)w.push(F,J),F=F.sibling}}_=!1}return _;case $s:if(w.tag===5&&Ne(w.stateNode,_.value))return!0;break;case ss:if((w.tag===5||w.tag===6)&&(w=He(w),w!==null&&0<=w.indexOf(_.value)))return!0;break;case sa:if(w.tag===5&&(w=w.memoizedProps["data-testname"],typeof w=="string"&&w.toLowerCase()===_.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function Qr(w){switch(w.$$typeof){case ia:return"<"+(M(w.value)||"Unknown")+">";case Mi:return":has("+(Qr(w)||"")+")";case $s:return'[role="'+w.value+'"]';case ss:return'"'+w.value+'"';case sa:return'[data-testname="'+w.value+'"]';default:throw Error(a(365))}}function aa(w,_){var L=[];w=[w,0];for(var F=0;F<w.length;){var J=w[F++],oe=w[F++],Ve=_[oe];if(J.tag!==5||!_e(J)){for(;Ve!=null&&Bi(J,Ve);)oe++,Ve=_[oe];if(oe===_.length)L.push(J);else for(J=J.child;J!==null;)w.push(J,oe),J=J.sibling}}return L}function il(w,_){if(!re)throw Error(a(363));w=Zr(w),w=aa(w,_),_=[],w=Array.from(w);for(var L=0;L<w.length;){var F=w[L++];if(F.tag===5)_e(F)||_.push(F.stateNode);else for(F=F.child;F!==null;)w.push(F),F=F.sibling}return _}var gs=Math.ceil,ba=o.ReactCurrentDispatcher,hi=o.ReactCurrentOwner,Ar=o.ReactCurrentBatchConfig,Un=0,Gr=null,Kr=null,fi=0,Ci=0,oa=Wt(0),ar=0,wa=null,Oa=0,Kc=0,ac=0,xs=null,_a=null,Sg=0,ap=1/0;function qc(){ap=Ni()+500}var nv=!1,Sw=null,Xc=null,oc=!1,Gd=null,rv=0,Ag=0,iv=null,Wh=-1,Eg=0;function za(){return Un&6?Ni():Wh!==-1?Wh:Wh=Ni()}function lc(w){return w.mode&1?Un&2&&fi!==0?fi&-fi:el.transition!==null?(Eg===0&&(w=ec,ec<<=1,!(ec&4194240)&&(ec=64),Eg=w),Eg):(w=er,w!==0?w:pe()):1}function No(w,_,L){if(50<Ag)throw Ag=0,iv=null,Error(a(185));var F=Vd(w,_);return F===null?null:(Cl(F,_,L),(!(Un&2)||F!==Gr)&&(F===Gr&&(!(Un&2)&&(Kc|=_),ar===4&&ao(F,fi)),so(F,L),_===1&&Un===0&&!(w.mode&1)&&(qc(),no&&ea())),F)}function Vd(w,_){w.lanes|=_;var L=w.alternate;for(L!==null&&(L.lanes|=_),L=w,w=w.return;w!==null;)w.childLanes|=_,L=w.alternate,L!==null&&(L.childLanes|=_),L=w,w=w.return;return L.tag===3?L.stateNode:null}function so(w,_){var L=w.callbackNode;Ru(w,_);var F=kl(w,w===Gr?fi:0);if(F===0)L!==null&&On(L),w.callbackNode=null,w.callbackPriority=0;else if(_=F&-F,w.callbackPriority!==_){if(L!=null&&On(L),_===1)w.tag===0?Nl(Ew.bind(null,w)):Lu(Ew.bind(null,w)),Se?ee(function(){Un===0&&ea()}):eo(ju,ea),L=null;else{switch(Dh(F)){case 1:L=ju;break;case 4:L=ep;break;case 16:L=$i;break;case 536870912:L=Qo;break;default:L=$i}L=G6(L,sE.bind(null,w))}w.callbackPriority=_,w.callbackNode=L}}function sE(w,_){if(Wh=-1,Eg=0,Un&6)throw Error(a(327));var L=w.callbackNode;if(To()&&w.callbackNode!==L)return null;var F=kl(w,w===Gr?fi:0);if(F===0)return null;if(F&30||F&w.expiredLanes||_)_=ov(w,F);else{_=F;var J=Un;Un|=2;var oe=aE();(Gr!==w||fi!==_)&&(qc(),Wd(w,_));do try{f3();break}catch(at){$h(w,at)}while(!0);Du(),ba.current=oe,Un=J,Kr!==null?_=0:(Gr=null,fi=0,_=ar)}if(_!==0){if(_===2&&(J=tc(w),J!==0&&(F=J,_=op(w,J))),_===1)throw L=wa,Wd(w,0),ao(w,F),so(w,Ni()),L;if(_===6)ao(w,F);else{if(J=w.current.alternate,!(F&30)&&!Aw(J)&&(_=ov(w,F),_===2&&(oe=tc(w),oe!==0&&(F=oe,_=op(w,oe))),_===1))throw L=wa,Wd(w,0),ao(w,F),so(w,Ni()),L;switch(w.finishedWork=J,w.finishedLanes=F,_){case 0:case 1:throw Error(a(345));case 2:Yc(w,_a);break;case 3:if(ao(w,F),(F&130023424)===F&&(_=Sg+500-Ni(),10<_)){if(kl(w,0)!==0)break;if(J=w.suspendedLanes,(J&F)!==F){za(),w.pingedLanes|=w.suspendedLanes&J;break}w.timeoutHandle=ie(Yc.bind(null,w,_a),_);break}Yc(w,_a);break;case 4:if(ao(w,F),(F&4194240)===F)break;for(_=w.eventTimes,J=-1;0<F;){var Ve=31-rr(F);oe=1<<Ve,Ve=_[Ve],Ve>J&&(J=Ve),F&=~oe}if(F=J,F=Ni()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*gs(F/1960))-F,10<F){w.timeoutHandle=ie(Yc.bind(null,w,_a),F);break}Yc(w,_a);break;case 5:Yc(w,_a);break;default:throw Error(a(329))}}}return so(w,Ni()),w.callbackNode===L?sE.bind(null,w):null}function op(w,_){var L=xs;return w.current.memoizedState.isDehydrated&&(Wd(w,_).flags|=256),w=ov(w,_),w!==2&&(_=_a,_a=L,_!==null&&sv(_)),w}function sv(w){_a===null?_a=w:_a.push.apply(_a,w)}function Aw(w){for(var _=w;;){if(_.flags&16384){var L=_.updateQueue;if(L!==null&&(L=L.stores,L!==null))for(var F=0;F<L.length;F++){var J=L[F],oe=J.getSnapshot;J=J.value;try{if(!ts(oe(),J))return!1}catch{return!1}}}if(L=_.child,_.subtreeFlags&16384&&L!==null)L.return=_,_=L;else{if(_===w)break;for(;_.sibling===null;){if(_.return===null||_.return===w)return!0;_=_.return}_.sibling.return=_.return,_=_.sibling}}return!0}function ao(w,_){for(_&=~ac,_&=~Kc,w.suspendedLanes|=_,w.pingedLanes&=~_,w=w.expirationTimes;0<_;){var L=31-rr(_),F=1<<L;w[L]=-1,_&=~F}}function Ew(w){if(Un&6)throw Error(a(327));To();var _=kl(w,0);if(!(_&1))return so(w,Ni()),null;var L=ov(w,_);if(w.tag!==0&&L===2){var F=tc(w);F!==0&&(_=F,L=op(w,F))}if(L===1)throw L=wa,Wd(w,0),ao(w,_),so(w,Ni()),L;if(L===6)throw Error(a(345));return w.finishedWork=w.current.alternate,w.finishedLanes=_,Yc(w,_a),so(w,Ni()),null}function kw(w){Gd!==null&&Gd.tag===0&&!(Un&6)&&To();var _=Un;Un|=1;var L=Ar.transition,F=er;try{if(Ar.transition=null,er=1,w)return w()}finally{er=F,Ar.transition=L,Un=_,!(Un&6)&&ea()}}function Cw(){Ci=oa.current,zt(oa)}function Wd(w,_){w.finishedWork=null,w.finishedLanes=0;var L=w.timeoutHandle;if(L!==xe&&(w.timeoutHandle=xe,le(L)),Kr!==null)for(L=Kr.return;L!==null;){var F=L;switch(Oh(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&Jn();break;case 3:ic(),zt(Cn),zt(an),zd();break;case 5:zu(F);break;case 4:ic();break;case 13:zt(ii);break;case 19:zt(ii);break;case 10:cs(F.type._context);break;case 22:case 23:Cw()}L=L.return}if(Gr=w,Kr=w=cp(w.current,null),fi=Ci=_,ar=0,wa=null,ac=Kc=Oa=0,_a=xs=null,he!==null){for(_=0;_<he.length;_++)if(L=he[_],F=L.interleaved,F!==null){L.interleaved=null;var J=F.next,oe=L.pending;if(oe!==null){var Ve=oe.next;oe.next=J,F.next=Ve}L.pending=F}he=null}return w}function $h(w,_){do{var L=Kr;try{if(Du(),Ws.current=rp,Pl){for(var F=Yn.memoizedState;F!==null;){var J=F.queue;J!==null&&(J.pending=null),F=F.next}Pl=!1}if(Jr=0,Ir=Lr=Yn=null,Uu=!1,Vc=0,hi.current=null,L===null||L.return===null){ar=1,wa=_,Kr=null;break}e:{var oe=w,Ve=L.return,at=L,Ct=_;if(_=fi,at.flags|=32768,Ct!==null&&typeof Ct=="object"&&typeof Ct.then=="function"){var Kt=Ct,bn=at,xr=bn.tag;if(!(bn.mode&1)&&(xr===0||xr===11||xr===15)){var Hn=bn.alternate;Hn?(bn.updateQueue=Hn.updateQueue,bn.memoizedState=Hn.memoizedState,bn.lanes=Hn.lanes):(bn.updateQueue=null,bn.memoizedState=null)}var Ri=Ll(Ve);if(Ri!==null){Ri.flags&=-257,Wc(Ri,Ve,at,oe,_),Ri.mode&1&&Hu(oe,Kt,_),_=Ri,Ct=Kt;var In=_.updateQueue;if(In===null){var Mo=new Set;Mo.add(Ct),_.updateQueue=Mo}else In.add(Ct);break e}else{if(!(_&1)){Hu(oe,Kt,_),av();break e}Ct=Error(a(426))}}else if(wi&&at.mode&1){var Zc=Ll(Ve);if(Zc!==null){!(Zc.flags&65536)&&(Zc.flags|=256),Wc(Zc,Ve,at,oe,_),Ia(Ct);break e}}oe=Ct,ar!==4&&(ar=2),xs===null?xs=[oe]:xs.push(oe),Ct=Jx(Ct,at),at=Ve;do{switch(at.tag){case 3:at.flags|=65536,_&=-_,at.lanes|=_;var yt=JA(at,Ct,_);mn(at,yt);break e;case 1:oe=Ct;var ct=at.type,Et=at.stateNode;if(!(at.flags&128)&&(typeof ct.getDerivedStateFromError=="function"||Et!==null&&typeof Et.componentDidCatch=="function"&&(Xc===null||!Xc.has(Et)))){at.flags|=65536,_&=-_,at.lanes|=_;var ln=ZA(at,oe,_);mn(at,ln);break e}}at=at.return}while(at!==null)}lv(L)}catch(Rn){_=Rn,Kr===L&&L!==null&&(Kr=L=L.return);continue}break}while(!0)}function aE(){var w=ba.current;return ba.current=rp,w===null?rp:w}function av(){(ar===0||ar===3||ar===2)&&(ar=4),Gr===null||!(Oa&268435455)&&!(Kc&268435455)||ao(Gr,fi)}function ov(w,_){var L=Un;Un|=2;var F=aE();Gr===w&&fi===_||Wd(w,_);do try{oE();break}catch(J){$h(w,J)}while(!0);if(Du(),Un=L,ba.current=F,Kr!==null)throw Error(a(261));return Gr=null,fi=0,ar}function oE(){for(;Kr!==null;)lp(Kr)}function f3(){for(;Kr!==null&&!Bh();)lp(Kr)}function lp(w){var _=cv(w.alternate,w,Ci);w.memoizedProps=w.pendingProps,_===null?lv(w):Kr=_,hi.current=null}function lv(w){var _=w;do{var L=_.alternate;if(w=_.return,_.flags&32768){if(L=be(L,_),L!==null){L.flags&=32767,Kr=L;return}if(w!==null)w.flags|=32768,w.subtreeFlags=0,w.deletions=null;else{ar=6,Kr=null;return}}else if(L=QA(L,_,Ci),L!==null){Kr=L;return}if(_=_.sibling,_!==null){Kr=_;return}Kr=_=w}while(_!==null);ar===0&&(ar=5)}function Yc(w,_){var L=er,F=Ar.transition;try{Ar.transition=null,er=1,Gu(w,_,L)}finally{Ar.transition=F,er=L}return null}function Gu(w,_,L){do To();while(Gd!==null);if(Un&6)throw Error(a(327));var F=w.finishedWork,J=w.finishedLanes;if(F===null)return null;if(w.finishedWork=null,w.finishedLanes=0,F===w.current)throw Error(a(177));w.callbackNode=null,w.callbackPriority=0;var oe=F.lanes|F.childLanes;if(Qa(w,oe),w===Gr&&(Kr=Gr=null,fi=0),!(F.subtreeFlags&2064)&&!(F.flags&2064)||oc||(oc=!0,G6($i,function(){return To(),null})),oe=(F.flags&15990)!==0,F.subtreeFlags&15990||oe){oe=Ar.transition,Ar.transition=null;var Ve=er;er=1;var at=Un;Un|=4,hi.current=null,ht(w,F),Jt(w,F),O(w.containerInfo),w.current=F,ms(F),Qf(),Un=at,er=Ve,Ar.transition=oe}else w.current=F;if(oc&&(oc=!1,Gd=w,rv=J),oe=w.pendingLanes,oe===0&&(Xc=null),Oc(F.stateNode),so(w,Ni()),_!==null)for(L=w.onRecoverableError,F=0;F<_.length;F++)L(_[F]);if(nv)throw nv=!1,w=Sw,Sw=null,w;return rv&1&&w.tag!==0&&To(),oe=w.pendingLanes,oe&1?w===iv?Ag++:(Ag=0,iv=w):Ag=0,ea(),null}function To(){if(Gd!==null){var w=Dh(rv),_=Ar.transition,L=er;try{if(Ar.transition=null,er=16>w?16:w,Gd===null)var F=!1;else{if(w=Gd,Gd=null,rv=0,Un&6)throw Error(a(331));var J=Un;for(Un|=4,Ue=w.current;Ue!==null;){var oe=Ue,Ve=oe.child;if(Ue.flags&16){var at=oe.deletions;if(at!==null){for(var Ct=0;Ct<at.length;Ct++){var Kt=at[Ct];for(Ue=Kt;Ue!==null;){var bn=Ue;switch(bn.tag){case 0:case 11:case 15:kt(8,bn,oe)}var xr=bn.child;if(xr!==null)xr.return=bn,Ue=xr;else for(;Ue!==null;){bn=Ue;var Hn=bn.sibling,Ri=bn.return;if(Ft(bn),bn===Kt){Ue=null;break}if(Hn!==null){Hn.return=Ri,Ue=Hn;break}Ue=Ri}}}var In=oe.alternate;if(In!==null){var Mo=In.child;if(Mo!==null){In.child=null;do{var Zc=Mo.sibling;Mo.sibling=null,Mo=Zc}while(Mo!==null)}}Ue=oe}}if(oe.subtreeFlags&2064&&Ve!==null)Ve.return=oe,Ue=Ve;else e:for(;Ue!==null;){if(oe=Ue,oe.flags&2048)switch(oe.tag){case 0:case 11:case 15:kt(9,oe,oe.return)}var yt=oe.sibling;if(yt!==null){yt.return=oe.return,Ue=yt;break e}Ue=oe.return}}var ct=w.current;for(Ue=ct;Ue!==null;){Ve=Ue;var Et=Ve.child;if(Ve.subtreeFlags&2064&&Et!==null)Et.return=Ve,Ue=Et;else e:for(Ve=ct;Ue!==null;){if(at=Ue,at.flags&2048)try{switch(at.tag){case 0:case 11:case 15:pt(9,at)}}catch(Rn){Sa(at,at.return,Rn)}if(at===Ve){Ue=null;break e}var ln=at.sibling;if(ln!==null){ln.return=at.return,Ue=ln;break e}Ue=at.return}}if(Un=J,ea(),to&&typeof to.onPostCommitFiberRoot=="function")try{to.onPostCommitFiberRoot(Pu,w)}catch{}F=!0}return F}finally{er=L,Ar.transition=_}}return!1}function Vu(w,_,L){_=Jx(L,_),_=JA(w,_,1),It(w,_),_=za(),w=Vd(w,1),w!==null&&(Cl(w,1,_),so(w,_))}function Sa(w,_,L){if(w.tag===3)Vu(w,w,L);else for(;_!==null;){if(_.tag===3){Vu(_,w,L);break}else if(_.tag===1){var F=_.stateNode;if(typeof _.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Xc===null||!Xc.has(F))){w=Jx(L,w),w=ZA(_,w,1),It(_,w),w=za(),_=Vd(_,1),_!==null&&(Cl(_,1,w),so(_,w));break}}_=_.return}}function Nw(w,_,L){var F=w.pingCache;F!==null&&F.delete(_),_=za(),w.pingedLanes|=w.suspendedLanes&L,Gr===w&&(fi&L)===L&&(ar===4||ar===3&&(fi&130023424)===fi&&500>Ni()-Sg?Wd(w,0):ac|=L),so(w,_)}function Tw(w,_){_===0&&(w.mode&1?(_=Qs,Qs<<=1,!(Qs&130023424)&&(Qs=4194304)):_=1);var L=za();w=Vd(w,_),w!==null&&(Cl(w,_,L),so(w,L))}function p3(w){var _=w.memoizedState,L=0;_!==null&&(L=_.retryLane),Tw(w,L)}function Mw(w,_){var L=0;switch(w.tag){case 13:var F=w.stateNode,J=w.memoizedState;J!==null&&(L=J.retryLane);break;case 19:F=w.stateNode;break;default:throw Error(a(314))}F!==null&&F.delete(_),Tw(w,L)}var cv;cv=function(w,_,L){if(w!==null)if(w.memoizedProps!==_.pendingProps||Cn.current)Fa=!0;else{if(!(w.lanes&L)&&!(_.flags&128))return Fa=!1,ge(w,_,L);Fa=!!(w.flags&131072)}else Fa=!1,wi&&_.flags&1048576&&Id(_,zc,_.index);switch(_.lanes=0,_.tag){case 2:var F=_.type;w!==null&&(w.alternate=null,_.alternate=null,_.flags|=2),w=_.pendingProps;var J=Hr(_,an.current);Ii(_,L),J=Gx(null,_,F,w,J,L);var oe=Vx();return _.flags|=1,typeof J=="object"&&J!==null&&typeof J.render=="function"&&J.$$typeof===void 0?(_.tag=1,_.memoizedState=null,_.updateQueue=null,wr(F)?(oe=!0,zn(_)):oe=!1,_.memoizedState=J.state!==null&&J.state!==void 0?J.state:null,tt(_),J.updater=ri,_.stateNode=J,J._reactInternals=_,Ti(_,F,w,L),_=bw(null,_,F,!0,oe,L)):(_.tag=0,wi&&oe&&Bu(_),na(null,_,J,L),_=_.child),_;case 16:F=_.elementType;e:{switch(w!==null&&(w.alternate=null,_.alternate=null,_.flags|=2),w=_.pendingProps,J=F._init,F=J(F._payload),_.type=F,J=_.tag=due(F),w=Hs(F,w),J){case 0:_=yw(null,_,F,w,L);break e;case 1:_=tE(null,_,F,w,L);break e;case 11:_=sp(null,_,F,w,L);break e;case 14:_=ev(null,_,F,Hs(F.type,w),L);break e}throw Error(a(306,F,""))}return _;case 0:return F=_.type,J=_.pendingProps,J=_.elementType===F?J:Hs(F,J),yw(w,_,F,J,L);case 1:return F=_.type,J=_.pendingProps,J=_.elementType===F?J:Hs(F,J),tE(w,_,F,J,L);case 3:e:{if(nE(_),w===null)throw Error(a(387));F=_.pendingProps,oe=_.memoizedState,J=oe.element,ot(w,_),qn(_,F,null,L);var Ve=_.memoizedState;if(F=Ve.element,we&&oe.isDehydrated)if(oe={element:F,isDehydrated:!1,cache:Ve.cache,transitions:Ve.transitions},_.updateQueue.baseState=oe,_.memoizedState=oe,_.flags&256){J=Error(a(423)),_=rE(w,_,F,L,J);break e}else if(F!==J){J=Error(a(424)),_=rE(w,_,F,L,J);break e}else for(we&&(bi=Mr(_.stateNode.containerInfo),is=_,wi=!0,ko=null,Uc=!1),L=hs(_,null,F,L),_.child=L;L;)L.flags=L.flags&-3|4096,L=L.sibling;else{if(Ns(),F===J){_=fe(w,_,L);break e}na(w,_,F,L)}_=_.child}return _;case 5:return Od(_),w===null&&Bd(_),F=_.type,J=_.pendingProps,oe=w!==null?w.memoizedProps:null,Ve=J.children,te(F,J)?Ve=null:oe!==null&&te(F,oe)&&(_.flags|=32),vw(w,_),na(w,_,Ve,L),_.child;case 6:return w===null&&Bd(_),null;case 13:return _g(w,_,L);case 4:return Gh(_,_.stateNode.containerInfo),F=_.pendingProps,w===null?_.child=Ml(_,null,F,L):na(w,_,F,L),_.child;case 11:return F=_.type,J=_.pendingProps,J=_.elementType===F?J:Hs(F,J),sp(w,_,F,J,L);case 7:return na(w,_,_.pendingProps,L),_.child;case 8:return na(w,_,_.pendingProps.children,L),_.child;case 12:return na(w,_,_.pendingProps.children,L),_.child;case 10:e:{if(F=_.type._context,J=_.pendingProps,oe=_.memoizedProps,Ve=J.value,Fh(_,F,Ve),oe!==null)if(ts(oe.value,Ve)){if(oe.children===J.children&&!Cn.current){_=fe(w,_,L);break e}}else for(oe=_.child,oe!==null&&(oe.return=_);oe!==null;){var at=oe.dependencies;if(at!==null){Ve=oe.child;for(var Ct=at.firstContext;Ct!==null;){if(Ct.context===F){if(oe.tag===1){Ct=St(-1,L&-L),Ct.tag=2;var Kt=oe.updateQueue;if(Kt!==null){Kt=Kt.shared;var bn=Kt.pending;bn===null?Ct.next=Ct:(Ct.next=bn.next,bn.next=Ct),Kt.pending=Ct}}oe.lanes|=L,Ct=oe.alternate,Ct!==null&&(Ct.lanes|=L),us(oe.return,L,_),at.lanes|=L;break}Ct=Ct.next}}else if(oe.tag===10)Ve=oe.type===_.type?null:oe.child;else if(oe.tag===18){if(Ve=oe.return,Ve===null)throw Error(a(341));Ve.lanes|=L,at=Ve.alternate,at!==null&&(at.lanes|=L),us(Ve,L,_),Ve=oe.sibling}else Ve=oe.child;if(Ve!==null)Ve.return=oe;else for(Ve=oe;Ve!==null;){if(Ve===_){Ve=null;break}if(oe=Ve.sibling,oe!==null){oe.return=Ve.return,Ve=oe;break}Ve=Ve.return}oe=Ve}na(w,_,J.children,L),_=_.child}return _;case 9:return J=_.type,F=_.pendingProps.children,Ii(_,L),J=H(J),F=F(J),_.flags|=1,na(w,_,F,L),_.child;case 14:return F=_.type,J=Hs(F,_.pendingProps),J=Hs(F.type,J),ev(w,_,F,J,L);case 15:return xw(w,_,_.type,_.pendingProps,L);case 17:return F=_.type,J=_.pendingProps,J=_.elementType===F?J:Hs(F,J),w!==null&&(w.alternate=null,_.alternate=null,_.flags|=2),_.tag=1,wr(F)?(w=!0,zn(_)):w=!1,Ii(_,L),Ei(_,F,J),Ti(_,F,J,L),bw(null,_,F,!0,w,L);case 19:return ne(w,_,L);case 22:return eE(w,_,L)}throw Error(a(156,_.tag))};function G6(w,_){return eo(w,_)}function uue(w,_,L,F){this.tag=w,this.key=L,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=_,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jc(w,_,L,F){return new uue(w,_,L,F)}function m3(w){return w=w.prototype,!(!w||!w.isReactComponent)}function due(w){if(typeof w=="function")return m3(w)?1:0;if(w!=null){if(w=w.$$typeof,w===x)return 11;if(w===b)return 14}return 2}function cp(w,_){var L=w.alternate;return L===null?(L=Jc(w.tag,_,w.key,w.mode),L.elementType=w.elementType,L.type=w.type,L.stateNode=w.stateNode,L.alternate=w,w.alternate=L):(L.pendingProps=_,L.type=w.type,L.flags=0,L.subtreeFlags=0,L.deletions=null),L.flags=w.flags&14680064,L.childLanes=w.childLanes,L.lanes=w.lanes,L.child=w.child,L.memoizedProps=w.memoizedProps,L.memoizedState=w.memoizedState,L.updateQueue=w.updateQueue,_=w.dependencies,L.dependencies=_===null?null:{lanes:_.lanes,firstContext:_.firstContext},L.sibling=w.sibling,L.index=w.index,L.ref=w.ref,L}function lE(w,_,L,F,J,oe){var Ve=2;if(F=w,typeof w=="function")m3(w)&&(Ve=1);else if(typeof w=="string")Ve=5;else e:switch(w){case d:return kg(L.children,J,oe,_);case h:Ve=8,J|=8;break;case p:return w=Jc(12,L,_,J|2),w.elementType=p,w.lanes=oe,w;case v:return w=Jc(13,L,_,J),w.elementType=v,w.lanes=oe,w;case g:return w=Jc(19,L,_,J),w.elementType=g,w.lanes=oe,w;case S:return cE(L,J,oe,_);default:if(typeof w=="object"&&w!==null)switch(w.$$typeof){case f:Ve=10;break e;case m:Ve=9;break e;case x:Ve=11;break e;case b:Ve=14;break e;case y:Ve=16,F=null;break e}throw Error(a(130,w==null?w:typeof w,""))}return _=Jc(Ve,L,_,J),_.elementType=w,_.type=F,_.lanes=oe,_}function kg(w,_,L,F){return w=Jc(7,w,F,_),w.lanes=L,w}function cE(w,_,L,F){return w=Jc(22,w,F,_),w.elementType=S,w.lanes=L,w.stateNode={},w}function g3(w,_,L){return w=Jc(6,w,null,_),w.lanes=L,w}function x3(w,_,L){return _=Jc(4,w.children!==null?w.children:[],w.key,_),_.lanes=L,_.stateNode={containerInfo:w.containerInfo,pendingChildren:null,implementation:w.implementation},_}function hue(w,_,L,F,J){this.tag=_,this.containerInfo=w,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=xe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jd(0),this.expirationTimes=jd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jd(0),this.identifierPrefix=F,this.onRecoverableError=J,we&&(this.mutableSourceEagerHydrationData=null)}function V6(w,_,L,F,J,oe,Ve,at,Ct){return w=new hue(w,_,L,at,Ct),_===1?(_=1,oe===!0&&(_|=8)):_=0,oe=Jc(3,null,null,_),w.current=oe,oe.stateNode=w,oe.memoizedState={element:F,isDehydrated:L,cache:null,transitions:null},tt(oe),w}function W6(w){if(!w)return pn;w=w._reactInternals;e:{if(C(w)!==w||w.tag!==1)throw Error(a(170));var _=w;do{switch(_.tag){case 3:_=_.stateNode.context;break e;case 1:if(wr(_.type)){_=_.stateNode.__reactInternalMemoizedMergedChildContext;break e}}_=_.return}while(_!==null);throw Error(a(171))}if(w.tag===1){var L=w.type;if(wr(L))return Sr(w,L,_)}return _}function $6(w){var _=w._reactInternals;if(_===void 0)throw typeof w.render=="function"?Error(a(188)):(w=Object.keys(w).join(","),Error(a(268,w)));return w=j(_),w===null?null:w.stateNode}function K6(w,_){if(w=w.memoizedState,w!==null&&w.dehydrated!==null){var L=w.retryLane;w.retryLane=L!==0&&L<_?L:_}}function v3(w,_){K6(w,_),(w=w.alternate)&&K6(w,_)}function fue(w){return w=j(w),w===null?null:w.stateNode}function pue(){return null}return n.attemptContinuousHydration=function(w){if(w.tag===13){var _=za();No(w,134217728,_),v3(w,134217728)}},n.attemptHydrationAtCurrentPriority=function(w){if(w.tag===13){var _=za(),L=lc(w);No(w,L,_),v3(w,L)}},n.attemptSynchronousHydration=function(w){switch(w.tag){case 3:var _=w.stateNode;if(_.current.memoizedState.isDehydrated){var L=El(_.pendingLanes);L!==0&&(Zo(_,L|1),so(_,Ni()),!(Un&6)&&(qc(),ea()))}break;case 13:var F=za();kw(function(){return No(w,1,F)}),v3(w,1)}},n.batchedUpdates=function(w,_){var L=Un;Un|=1;try{return w(_)}finally{Un=L,Un===0&&(qc(),no&&ea())}},n.createComponentSelector=function(w){return{$$typeof:ia,value:w}},n.createContainer=function(w,_,L,F,J,oe,Ve){return V6(w,_,!1,null,L,F,J,oe,Ve)},n.createHasPseudoClassSelector=function(w){return{$$typeof:Mi,value:w}},n.createHydrationContainer=function(w,_,L,F,J,oe,Ve,at,Ct){return w=V6(L,F,!0,w,J,oe,Ve,at,Ct),w.context=W6(null),L=w.current,F=za(),J=lc(L),oe=St(F,J),oe.callback=_??null,It(L,oe),w.current.lanes=J,Cl(w,J,F),so(w,F),w},n.createPortal=function(w,_,L){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:F==null?null:""+F,children:w,containerInfo:_,implementation:L}},n.createRoleSelector=function(w){return{$$typeof:$s,value:w}},n.createTestNameSelector=function(w){return{$$typeof:sa,value:w}},n.createTextSelector=function(w){return{$$typeof:ss,value:w}},n.deferredUpdates=function(w){var _=er,L=Ar.transition;try{return Ar.transition=null,er=16,w()}finally{er=_,Ar.transition=L}},n.discreteUpdates=function(w,_,L,F,J){var oe=er,Ve=Ar.transition;try{return Ar.transition=null,er=1,w(_,L,F,J)}finally{er=oe,Ar.transition=Ve,Un===0&&qc()}},n.findAllNodes=il,n.findBoundingRects=function(w,_){if(!re)throw Error(a(363));_=il(w,_),w=[];for(var L=0;L<_.length;L++)w.push(Ge(_[L]));for(_=w.length-1;0<_;_--){L=w[_];for(var F=L.x,J=F+L.width,oe=L.y,Ve=oe+L.height,at=_-1;0<=at;at--)if(_!==at){var Ct=w[at],Kt=Ct.x,bn=Kt+Ct.width,xr=Ct.y,Hn=xr+Ct.height;if(F>=Kt&&oe>=xr&&J<=bn&&Ve<=Hn){w.splice(_,1);break}else if(F!==Kt||L.width!==Ct.width||Hn<oe||xr>Ve){if(!(oe!==xr||L.height!==Ct.height||bn<F||Kt>J)){Kt>F&&(Ct.width+=Kt-F,Ct.x=F),bn<J&&(Ct.width=J-Kt),w.splice(_,1);break}}else{xr>oe&&(Ct.height+=xr-oe,Ct.y=oe),Hn<Ve&&(Ct.height=Ve-xr),w.splice(_,1);break}}}return w},n.findHostInstance=$6,n.findHostInstanceWithNoPortals=function(w){return w=P(w),w=w!==null?B(w):null,w===null?null:w.stateNode},n.findHostInstanceWithWarning=function(w){return $6(w)},n.flushControlled=function(w){var _=Un;Un|=1;var L=Ar.transition,F=er;try{Ar.transition=null,er=1,w()}finally{er=F,Ar.transition=L,Un=_,Un===0&&(qc(),ea())}},n.flushPassiveEffects=To,n.flushSync=kw,n.focusWithin=function(w,_){if(!re)throw Error(a(363));for(w=Zr(w),_=aa(w,_),_=Array.from(_),w=0;w<_.length;){var L=_[w++];if(!_e(L)){if(L.tag===5&&ue(L.stateNode))return!0;for(L=L.child;L!==null;)_.push(L),L=L.sibling}}return!1},n.getCurrentUpdatePriority=function(){return er},n.getFindAllNodesFailureDescription=function(w,_){if(!re)throw Error(a(363));var L=0,F=[];w=[Zr(w),0];for(var J=0;J<w.length;){var oe=w[J++],Ve=w[J++],at=_[Ve];if((oe.tag!==5||!_e(oe))&&(Bi(oe,at)&&(F.push(Qr(at)),Ve++,Ve>L&&(L=Ve)),Ve<_.length))for(oe=oe.child;oe!==null;)w.push(oe,Ve),oe=oe.sibling}if(L<_.length){for(w=[];L<_.length;L++)w.push(Qr(_[L]));return`findAllNodes was able to match part of the selector: 4527 `+(F.join(" > ")+` 4528 4529No matching component was found for: 4530 `)+w.join(" > ")}return null},n.getPublicRootInstance=function(w){if(w=w.current,!w.child)return null;switch(w.child.tag){case 5:return U(w.child.stateNode);default:return w.child.stateNode}},n.injectIntoDevTools=function(w){if(w={bundleType:w.bundleType,version:w.version,rendererPackageName:w.rendererPackageName,rendererConfig:w.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:fue,findFiberByHostInstance:w.findFiberByHostInstance||pue,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")w=!1;else{var _=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(_.isDisabled||!_.supportsFiber)w=!0;else{try{Pu=_.inject(w),to=_}catch{}w=!!_.checkDCE}}return w},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(w,_,L,F){if(!re)throw Error(a(363));w=il(w,_);var J=Ce(w,L,F).disconnect;return{disconnect:function(){J()}}},n.registerMutableSourceForHydration=function(w,_){var L=_._getVersion;L=L(_._source),w.mutableSourceEagerHydrationData==null?w.mutableSourceEagerHydrationData=[_,L]:w.mutableSourceEagerHydrationData.push(_,L)},n.runWithPriority=function(w,_){var L=er;try{return er=w,_()}finally{er=L}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(w,_,L,F){var J=_.current,oe=za(),Ve=lc(J);return L=W6(L),_.context===null?_.context=L:_.pendingContext=L,_=St(oe,Ve),_.payload={element:w},F=F===void 0?null:F,F!==null&&(_.callback=F),It(J,_),w=No(J,Ve,oe),w!==null&&fn(w,J,Ve),Ve},n};Ale.exports=K9e;var q9e=Ale.exports;const X9e=DS(q9e),b6={},Cle=t=>void Object.assign(b6,t);function Y9e(t,e){function n(d,{args:h=[],attach:p,...f},m){let x=`${d[0].toUpperCase()}${d.slice(1)}`,v;if(d==="primitive"){if(f.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=f.object;v=my(g,{type:d,root:m,attach:p,primitive:!0})}else{const g=b6[x];if(!g)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");v=my(new g(...h),{type:d,root:m,attach:p,memoizedProps:{args:h}})}return v.__r3f.attach===void 0&&(v.isBufferGeometry?v.__r3f.attach="geometry":v.isMaterial&&(v.__r3f.attach="material")),x!=="inject"&&SP(v,f),v}function r(d,h){let p=!1;if(h){var f,m;(f=h.__r3f)!=null&&f.attach?_P(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(m=d.__r3f)==null||m.objects.push(h),h.__r3f||my(h,{}),h.__r3f.parent=d,WD(h),gy(h)}}function i(d,h,p){let f=!1;if(h){var m,x;if((m=h.__r3f)!=null&&m.attach)_P(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:h});const v=d.children.filter(b=>b!==h),g=v.indexOf(p);d.children=[...v.slice(0,g),h,...v.slice(g)],f=!0}f||(x=d.__r3f)==null||x.objects.push(h),h.__r3f||my(h,{}),h.__r3f.parent=d,WD(h),gy(h)}}function s(d,h,p=!1){d&&[...d].forEach(f=>a(h,f,p))}function a(d,h,p){if(h){var f,m,x;if(h.__r3f&&(h.__r3f.parent=null),(f=d.__r3f)!=null&&f.objects&&(d.__r3f.objects=d.__r3f.objects.filter(S=>S!==h)),(m=h.__r3f)!=null&&m.attach)B$(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var v;d.remove(h),(v=h.__r3f)!=null&&v.root&&i7e(pN(h),h)}const b=(x=h.__r3f)==null?void 0:x.primitive,y=!b&&(p===void 0?h.dispose!==null:p);if(!b){var g;s((g=h.__r3f)==null?void 0:g.objects,h,y),s(h.children,h,y)}if(delete h.__r3f,y&&h.dispose&&h.type!=="Scene"){const S=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?GD.unstable_scheduleCallback(GD.unstable_IdlePriority,S):S()}gy(d)}}function o(d,h,p,f){var m;const x=(m=d.__r3f)==null?void 0:m.parent;if(!x)return;const v=n(h,p,d.__r3f.root);if(d.children){for(const g of d.children)g.__r3f&&r(v,g);d.children=d.children.filter(g=>!g.__r3f)}d.__r3f.objects.forEach(g=>r(v,g)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||a(x,d),v.parent&&(v.__r3f.autoRemovedBeforeAppend=!0),r(x,v),v.raycast&&v.__r3f.eventCount&&pN(v).getState().internal.interaction.push(v),[f,f.alternate].forEach(g=>{g!==null&&(g.stateNode=v,g.ref&&(typeof g.ref=="function"?g.ref(v):g.ref.current=v))})}const l=()=>{};return{reconciler:X9e({createInstance:n,removeChild:a,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,r(p,h))},removeChildFromContainer:(d,h)=>{h&&a(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const f=d.getState().scene;f.__r3f&&i(f,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;return!!((h=d==null?void 0:d.__r3f)!=null?h:{}).handlers},prepareUpdate(d,h,p,f){var m;if(((m=d==null?void 0:d.__r3f)!=null?m:{}).primitive&&f.object&&f.object!==d)return[!0];{const{args:v=[],children:g,...b}=f,{args:y=[],children:S,...A}=p;if(!Array.isArray(v))throw new Error("R3F: the args prop must be an array!");if(v.some((M,T)=>M!==y[T]))return[!0];const k=Lle(d,b,A,!0);return k.changes.length?[!1,k]:null}},commitUpdate(d,[h,p],f,m,x,v){h?o(d,f,x,v):SP(d,p)},commitMount(d,h,p,f){var m;const x=(m=d.__r3f)!=null?m:{};d.raycast&&x.handlers&&x.eventCount&&pN(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>my(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:f}=(h=d.__r3f)!=null?h:{};p&&f&&B$(f,d,p),d.isObject3D&&(d.visible=!1),gy(d)},unhideInstance(d,h){var p;const{attach:f,parent:m}=(p=d.__r3f)!=null?p:{};f&&m&&_P(m,d,f),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),gy(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():$y.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Ui.fun(performance.now)?performance.now:Ui.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Ui.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Ui.fun(clearTimeout)?clearTimeout:void 0}),applyProps:SP}}var P$,L$;const wP=t=>"colorSpace"in t||"outputColorSpace"in t,Nle=()=>{var t;return(t=b6.ColorManagement)!=null?t:null},Tle=t=>t&&t.isOrthographicCamera,J9e=t=>t&&t.hasOwnProperty("current"),VA=typeof window<"u"&&((P$=window.document)!=null&&P$.createElement||((L$=window.navigator)==null?void 0:L$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function Mle(t){const e=E.useRef(t);return VA(()=>void(e.current=t),[t]),e}function Z9e({set:t}){return VA(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class Rle extends E.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Rle.getDerivedStateFromError=()=>({error:!0});const jle="__default",I$=new Map,Q9e=t=>t&&!!t.memoized&&!!t.changes;function Ple(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const u_=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function pN(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Ui={obj:t=>t===Object(t)&&!Ui.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Ui.str(t)||Ui.num(t)||Ui.boo(t))return t===e;const s=Ui.obj(t);if(s&&r==="reference")return t===e;const a=Ui.arr(t);if(a&&n==="reference")return t===e;if((a||s)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(s&&n==="shallow"&&r==="shallow"){for(o in i?e:t)if(!Ui.equ(t[o],e[o],{strict:i,objects:"reference"}))return!1}else for(o in i?e:t)if(t[o]!==e[o])return!1;if(Ui.und(o)){if(a&&t.length===0&&e.length===0||s&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function e7e(t){const e={nodes:{},materials:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material)}),e}function t7e(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function my(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function VD(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((s,a)=>s[a],t),{target:n,key:i}}else return{target:n,key:e}}const D$=/-\d+$/;function _P(t,e,n){if(Ui.str(n)){if(D$.test(n)){const s=n.replace(D$,""),{target:a,key:o}=VD(t,s);Array.isArray(a[o])||(a[o]=[])}const{target:r,key:i}=VD(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function B$(t,e,n){var r,i;if(Ui.str(n)){const{target:s,key:a}=VD(t,n),o=e.__r3f.previousAttach;o===void 0?delete s[a]:s[a]=o}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function Lle(t,{children:e,key:n,ref:r,...i},{children:s,key:a,ref:o,...l}={},u=!1){const d=t.__r3f,h=Object.entries(i),p=[];if(u){const m=Object.keys(l);for(let x=0;x<m.length;x++)i.hasOwnProperty(m[x])||h.unshift([m[x],jle+"remove"])}h.forEach(([m,x])=>{var v;if((v=t.__r3f)!=null&&v.primitive&&m==="object"||Ui.equ(x,l[m]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(m))return p.push([m,x,!0,[]]);let g=[];m.includes("-")&&(g=m.split("-")),p.push([m,x,!1,g]);for(const b in i){const y=i[b];b.startsWith(`${m}-`)&&p.push([b,y,!1,b.split("-")])}});const f={...i};return d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.args&&(f.args=d.memoizedProps.args),d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.attach&&(f.attach=d.memoizedProps.attach),{memoized:f,changes:p}}const n7e=typeof process<"u"&&!1;function SP(t,e){var n;const r=t.__r3f,i=r==null?void 0:r.root,s=i==null||i.getState==null?void 0:i.getState(),{memoized:a,changes:o}=Q9e(e)?e:Lle(t,e),l=r==null?void 0:r.eventCount;t.__r3f&&(t.__r3f.memoizedProps=a);for(let p=0;p<o.length;p++){let[f,m,x,v]=o[p];if(wP(t)){const S="srgb",A="srgb-linear";f==="encoding"?(f="colorSpace",m=m===3001?S:A):f==="outputEncoding"&&(f="outputColorSpace",m=m===3001?S:A)}let g=t,b=g[f];if(v.length&&(b=v.reduce((y,S)=>y[S],t),!(b&&b.set))){const[y,...S]=v.reverse();g=S.reverse().reduce((A,k)=>A[k],t),f=y}if(m===jle+"remove")if(g.constructor){let y=I$.get(g.constructor);y||(y=new g.constructor,I$.set(g.constructor,y)),m=y[f]}else m=0;if(x&&r)m?r.handlers[f]=m:delete r.handlers[f],r.eventCount=Object.keys(r.handlers).length;else if(b&&b.set&&(b.copy||b instanceof K0)){if(Array.isArray(m))b.fromArray?b.fromArray(m):b.set(...m);else if(b.copy&&m&&m.constructor&&(n7e?b.constructor.name===m.constructor.name:b.constructor===m.constructor))b.copy(m);else if(m!==void 0){var u;const y=(u=b)==null?void 0:u.isColor;!y&&b.setScalar?b.setScalar(m):b instanceof K0&&m instanceof K0?b.mask=m.mask:b.set(m),!Nle()&&s&&!s.linear&&y&&b.convertSRGBToLinear()}}else{var d;if(g[f]=m,(d=g[f])!=null&&d.isTexture&&g[f].format===fa&&g[f].type===Tc&&s){const y=g[f];wP(y)&&wP(s.gl)?y.colorSpace=s.gl.outputColorSpace:y.encoding=s.gl.outputEncoding}}gy(t)}if(r&&r.parent&&t.raycast&&l!==r.eventCount){const p=pN(t).getState().internal,f=p.interaction.indexOf(t);f>-1&&p.interaction.splice(f,1),r.eventCount&&p.interaction.push(t)}return!(o.length===1&&o[0][0]==="onUpdate")&&o.length&&(n=t.__r3f)!=null&&n.parent&&WD(t),t}function gy(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function WD(t){t.onUpdate==null||t.onUpdate(t)}function Ile(t,e){t.manual||(Tle(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function iC(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function r7e(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return $y.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return $y.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return $y.ContinuousEventPriority;default:return $y.DefaultEventPriority}}function Dle(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function i7e(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{Dle(n.capturedMap,e,r,i)})}function s7e(t){function e(l){const{internal:u}=t.getState(),d=l.offsetX-u.initialClick[0],h=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=u.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function r(l,u){const d=t.getState(),h=new Set,p=[],f=u?u(d.internal.interaction):d.internal.interaction;for(let g=0;g<f.length;g++){const b=u_(f[g]);b&&(b.raycaster.camera=void 0)}d.previousRoot||d.events.compute==null||d.events.compute(l,d);function m(g){const b=u_(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var y;b.events.compute==null||b.events.compute(l,b,(y=b.previousRoot)==null?void 0:y.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let x=f.flatMap(m).sort((g,b)=>{const y=u_(g.object),S=u_(b.object);return!y||!S?g.distance-b.distance:S.events.priority-y.events.priority||g.distance-b.distance}).filter(g=>{const b=iC(g);return h.has(b)?!1:(h.add(b),!0)});d.events.filter&&(x=d.events.filter(x,d));for(const g of x){let b=g.object;for(;b;){var v;(v=b.__r3f)!=null&&v.eventCount&&p.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let g of d.internal.capturedMap.get(l.pointerId).values())h.has(iC(g.intersection))||p.push(g.intersection);return p}function i(l,u,d,h){const p=t.getState();if(l.length){const f={stopped:!1};for(const m of l){const x=u_(m.object)||p,{raycaster:v,pointer:g,camera:b,internal:y}=x,S=new Ie(g.x,g.y,0).unproject(b),A=R=>{var P,j;return(P=(j=y.capturedMap.get(R))==null?void 0:j.has(m.eventObject))!=null?P:!1},k=R=>{const P={intersection:m,target:u.target};y.capturedMap.has(R)?y.capturedMap.get(R).set(m.eventObject,P):y.capturedMap.set(R,new Map([[m.eventObject,P]])),u.target.setPointerCapture(R)},M=R=>{const P=y.capturedMap.get(R);P&&Dle(y.capturedMap,m.eventObject,P,R)};let T={};for(let R in u){let P=u[R];typeof P!="function"&&(T[R]=P)}let C={...m,...T,pointer:g,intersections:l,stopped:f.stopped,delta:d,unprojectedPoint:S,ray:v.ray,camera:b,stopPropagation(){const R="pointerId"in u&&y.capturedMap.get(u.pointerId);if((!R||R.has(m.eventObject))&&(C.stopped=f.stopped=!0,y.hovered.size&&Array.from(y.hovered.values()).find(P=>P.eventObject===m.eventObject))){const P=l.slice(0,l.indexOf(m));s([...P,m])}},target:{hasPointerCapture:A,setPointerCapture:k,releasePointerCapture:M},currentTarget:{hasPointerCapture:A,setPointerCapture:k,releasePointerCapture:M},nativeEvent:u};if(h(C),f.stopped===!0)break}}return l}function s(l){const{internal:u}=t.getState();for(const d of u.hovered.values())if(!l.length||!l.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,f=p==null?void 0:p.handlers;if(u.hovered.delete(iC(d)),p!=null&&p.eventCount){const m={...d,intersections:l};f.onPointerOut==null||f.onPointerOut(m),f.onPointerLeave==null||f.onPointerLeave(m)}}}function a(l,u){for(let d=0;d<u.length;d++){const h=u[d].__r3f;h==null||h.handlers.onPointerMissed==null||h.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return u=>{const{internal:d}=t.getState();"pointerId"in u&&d.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(u.pointerId)&&(d.capturedMap.delete(u.pointerId),s([]))})}}return function(d){const{onPointerMissed:h,internal:p}=t.getState();p.lastEvent.current=d;const f=l==="onPointerMove",m=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",v=r(d,f?n:void 0),g=m?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=v.map(y=>y.eventObject)),m&&!v.length&&g<=2&&(a(d,p.interaction),h&&h(d)),f&&s(v);function b(y){const S=y.eventObject,A=S.__r3f,k=A==null?void 0:A.handlers;if(A!=null&&A.eventCount)if(f){if(k.onPointerOver||k.onPointerEnter||k.onPointerOut||k.onPointerLeave){const M=iC(y),T=p.hovered.get(M);T?T.stopped&&y.stopPropagation():(p.hovered.set(M,y),k.onPointerOver==null||k.onPointerOver(y),k.onPointerEnter==null||k.onPointerEnter(y))}k.onPointerMove==null||k.onPointerMove(y)}else{const M=k[l];M?(!m||p.initialHits.includes(S))&&(a(d,p.interaction.filter(T=>!p.initialHits.includes(T))),M(y)):m&&p.initialHits.includes(S)&&a(d,p.interaction.filter(T=>!p.initialHits.includes(T)))}}i(v,d,g,b)}}return{handlePointer:o}}const a7e=["set","get","setSize","setFrameloop","setDpr","events","invali
4530date","advance","size","viewport"],Ble=t=>!!(t!=null&&t.render),w6=E.createContext(null),o7e=(t,e)=>{const n=ble((o,l)=>{const u=new Ie,d=new Ie,h=new Ie;function p(g=l().camera,b=d,y=l().size){const{width:S,height:A,top:k,left:M}=y,T=S/A;b.isVector3?h.copy(b):h.set(...b);const C=g.getWorldPosition(u).distanceTo(h);if(Tle(g))return{width:S/g.zoom,height:A/g.zoom,top:k,left:M,factor:1,distance:C,aspect:T};{const R=g.fov*Math.PI/180,P=2*Math.tan(R/2)*C,j=P*(S/A);return{width:j,height:P,top:k,left:M,factor:S/j,distance:C,aspect:T}}}let f;const m=g=>o(b=>({performance:{...b.performance,current:g}})),x=new Rt;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>t(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new m6,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();f&&clearTimeout(f),g.performance.current!==g.performance.min&&m(g.performance.min),f=setTimeout(()=>m(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>o(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,y,S,A)=>{const k=l().camera,M={width:g,height:b,top:S||0,left:A||0,updateStyle:y};o(T=>({size:M,viewport:{...T.viewport,...p(k,d,M)}}))},setDpr:g=>o(b=>{const y=Ple(g);return{viewport:{...b.viewport,dpr:y,initialDpr:b.viewport.initialDpr||y}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:E.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,b,y)=>{const S=l().internal;return S.priority=S.priority+(b>0?1:0),S.subscribers.push({ref:g,priority:b,store:y}),S.subscribers=S.subscribers.sort((A,k)=>A.priority-k.priority),()=>{const A=l().internal;A!=null&&A.subscribers&&(A.priority=A.priority-(b>0?1:0),A.subscribers=A.subscribers.filter(k=>k.ref!==g))}}}}}),r=n.getState();let i=r.size,s=r.viewport.dpr,a=r.camera;return n.subscribe(()=>{const{camera:o,size:l,viewport:u,gl:d,set:h}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==s){var p;i=l,s=u.dpr,Ile(o,l),d.setPixelRatio(u.dpr);const f=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,f)}o!==a&&(a=o,h(f=>({viewport:{...f.viewport,...f.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};let sC,l7e=new Set,c7e=new Set,u7e=new Set;function AP(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function d_(t,e){switch(t){case"before":return AP(l7e,e);case"after":return AP(c7e,e);case"tail":return AP(u7e,e)}}let EP,kP;function CP(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),EP=e.internal.subscribers,sC=0;sC<EP.length;sC++)kP=EP[sC],kP.ref.current(kP.store.getState(),r,n);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}function d7e(t){let e=!1,n=!1,r,i,s;function a(u){i=requestAnimationFrame(a),e=!0,r=0,d_("before",u),n=!0;for(const h of t.values()){var d;s=h.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(r+=CP(u,s))}if(n=!1,d_("after",u),r===0)return d_("tail",u),e=!1,cancelAnimationFrame(i)}function o(u,d=1){var h;if(!u)return t.forEach(p=>o(p.store.getState(),d));(h=u.gl.xr)!=null&&h.isPresenting||!u.internal.active||u.frameloop==="never"||(d>1?u.internal.frames=Math.min(60,u.internal.frames+d):n?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(a)))}function l(u,d=!0,h,p){if(d&&d_("before",u),h)CP(u,h,p);else for(const f of t.values())CP(u,f.store.getState());d&&d_("after",u)}return{loop:a,invalidate:o,advance:l}}function _6(){const t=E.useContext(w6);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function bs(t=n=>n,e){return _6()(t,e)}function QM(t,e=0){const n=_6(),r=n.getState().internal.subscribe,i=Mle(t);return VA(()=>r(i,e,n),[e,r,n]),null}const F$=new WeakMap;function Fle(t,e){return function(n,...r){let i=F$.get(n);
vendor: 23,295 bytes, lines 4530-4611
4530return i||(i=new n,F$.set(n,i)),t&&t(i),Promise.all(r.map(s=>new Promise((a,o)=>i.load(s,l=>{l.scene&&Object.assign(l,e7e(l.scene)),a(l)},e,l=>o(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function Eu(t,e,n,r){const i=Array.isArray(e)?e:[e],s=Sle(Fle(n,r),[t,...i],{equal:Ui.equ});return Array.isArray(e)?s:s[0]}Eu.preload=function(t,e,n){const r=Array.isArray(e)?e:[e];return W9e(Fle(n),[t,...r])};Eu.clear=function(t,e){const n=Array.isArray(e)?e:[e];return $9e([t,...n])};const c1=new Map,{invalidate:O$,advance:z$}=d7e(c1),{reconciler:MS,applyProps:Bp}=Y9e(c1,r7e),Yv={objects:"shallow",strict:!1},h7e=(t,e)=>{const n=typeof t=="function"?t(e):t;return Ble(n)?n:new jM({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function f7e(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:s,left:a,updateStyle:o=n}=e;return{width:r,height:i,top:s,left:a,updateStyle:o}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:s,left:a}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:s,left:a,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function p7e(t){const e=c1.get(t),n=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||o7e(O$,z$),a=n||MS.createContainer(s,$y.ConcurrentRoot,null,!1,null,"",i,null);e||c1.set(t,{fiber:a,store:s});let o,l=!1,u;return{configure(d={}){let{gl:h,size:p,scene:f,events:m,onCreated:x,shadows:v=!1,linear:g=!1,flat:b=!1,legacy:y=!1,orthographic:S=!1,frameloop:A="always",dpr:k=[1,2],performance:M,raycaster:T,camera:C,onPointerMissed:R}=d,P=s.getState(),j=P.gl;P.gl||P.set({gl:j=h7e(h,t)});let G=P.raycaster;G||P.set({raycaster:G=new y6});const{params:B,...$}=T||{};if(Ui.equ($,G,Yv)||Bp(G,{...$}),Ui.equ(B,G.params,Yv)||Bp(G,{params:{...G.params,...B}}),!P.camera||P.camera===u&&!Ui.equ(u,C,Yv)){u=C;const O=C instanceof jA,Y=O?C:S?new _h(0,0,0,0,.1,1e3):new Os(75,0,.1,1e3);O||(Y.position.z=5,C&&(Bp(Y,C),("aspect"in C||"left"in C||"right"in C||"bottom"in C||"top"in C)&&(Y.manual=!0,Y.updateProjectionMatrix())),!P.camera&&!(C!=null&&C.rotation)&&Y.lookAt(0,0,0)),P.set({camera:Y}),G.camera=Y}if(!P.scene){let O;f!=null&&f.isScene?O=f:(O=new DA,f&&Bp(O,f)),P.set({scene:my(O)})}if(!P.xr){var U;const O=(I,q)=>{const te=s.getState();te.frameloop!=="never"&&z$(I,!0,te,q)},Y=()=>{const I=s.getState();I.gl.xr.enabled=I.gl.xr.isPresenting,I.gl.xr.setAnimationLoop(I.gl.xr.isPresenting?O:null),I.gl.xr.isPresenting||O$(I)},z={connect(){const I=s.getState().gl;I.xr.addEventListener("sessionstart",Y),I.xr.addEventListener("sessionend",Y)},disconnect(){const I=s.getState().gl;I.xr.removeEventListener("sessionstart",Y),I.xr.removeEventListener("sessionend",Y)}};typeof((U=j.xr)==null?void 0:U.addEventListener)=="function"&&z.connect(),P.set({xr:z})}if(j.shadowMap){const O=j.shadowMap.enabled,Y=j.shadowMap.type;if(j.shadowMap.enabled=!!v,Ui.boo(v))j.shadowMap.type=c2;else if(Ui.str(v)){var Z;const z={basic:_ae,percentage:_M,soft:c2,variance:id};j.shadowMap.type=(Z=z[v])!=null?Z:c2}else Ui.obj(v)&&Object.assign(j.shadowMap,v);(O!==j.shadowMap.enabled||Y!==j.shadowMap.type)&&(j.shadowMap.needsUpdate=!0)}const V=Nle();V&&("enabled"in V?V.enabled=!y:"legacyMode"in V&&(V.legacyMode=y)),l||Bp(j,{outputEncoding:g?3e3:3001,toneMapping:b?wh:Ez}),P.legacy!==y&&P.set(()=>({legacy:y})),P.linear!==g&&P.set(()=>({linear:g})),P.flat!==b&&P.set(()=>({flat:b})),h&&!Ui.fun(h)&&!Ble(h)&&!Ui.equ(h,j,Yv)&&Bp(j,h),m&&!P.events.handlers&&P.set({events:m(s)});const W=f7e(t,p);return Ui.equ(W,P.size,Yv)||P.setSize(W.width,W.height,W.updateStyle,W.top,W.left),k&&P.viewport.dpr!==Ple(k)&&P.setDpr(k),P.frameloop!==A&&P.setFrameloop(A),P.onPointerMissed||P.set({onPointerMissed:R}),M&&!Ui.equ(M,P.performance,Yv)&&P.set(O=>({performance:{...O.performance,...M}})),o=x,l=!0,this},render(d){return l||this.configure(),MS.updateContainer(c.jsx(m7e,{store:s,children:d,onCreated:o,rootElement:t}),a,null,()=>{}),s},unmount(){Ole(t)}}}function m7e({store:t,children:e,onCreated:n,rootElement:r}){return VA(()=>{const i=t.getState();i.set(s=>({internal:{...s.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),c.jsx(w6.Provider,{value:t,children:e})}function Ole(t,e){const n=c1.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),MS.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,a,o,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=i.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),t7e(i),c1.delete(t)}catch{}},500)})}}function g7e(t,e,n){return c.jsx(x7e,{children:t,container:e,state:n},e.uuid)}function x7e({state:t={},children:e,container:n}){const{events:r,size:i,...s}=t,a=_6(),[o]=E.useState(()=>new y6),[l]=E.useState(()=>new Rt),u=E.useCallback((h,p)=>{const f={...h};Object.keys(h).forEach(x=>{(a7e.includes(x)||h[x]!==p[x]&&p[x])&&delete f[x]});let m;if(p&&i){const x=p.camera;m=h.viewport.getCurrentViewport(x,new Ie,i),x!==h.camera&&Ile(x,i)}return{...f,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:a,events:{...h.events,...p==null?void 0:p.events,...r},size:{...h.size,...i},viewport:{...h.viewport,...m},...s}},[t]),[d]=E.useState(()=>{const h=a.getState();return ble((f,m)=>({...h,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:a,events:{...h.events,...r},size:{...h.size,...i},...s,set:f,get:m,setEvents:x=>f(v=>({...v,events:{...v.events,...x}}))}))});return E.useEffect(()=>{const h=a.subscribe(p=>d.setState(f=>u(p,f)));return()=>{h()}},[u]),E.useEffect(()=>{d.setState(h=>u(a.getState(),h))},[u]),E.useEffect(()=>()=>{d.destroy()},[]),c.jsx(c.Fragment,{children:MS.createPortal(c.jsx(w6.Provider,{value:d,children:e}),d,null)})}MS.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:E.version});const NP={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function v7e(t){const{handlePointer:e}=s7e(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(NP).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:s}=t.getState();s.disconnect==null||s.disconnect(),i(a=>({events:{...a.events,connected:n}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([a,o])=>{const[l,u]=NP[a];n.addEventListener(l,o,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,a])=>{if(r&&r.connected instanceof HTMLElement){const[o]=NP[s];r.connected.removeEventListener(o,a)}}),n(s=>({events:{...s.events,connected:void 0}}))}}}}function U$(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function y7e({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=E.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=E.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,d=E.useRef(!1);E.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[h,p,f]=E.useMemo(()=>{const g=()=>{if(!o.current.element)return;const{left:b,top:y,width:S,height:A,bottom:k,right:M,x:T,y:C}=o.current.element.getBoundingClientRect(),R={left:b,top:y,width:S,height:A,bottom:k,right:M,x:T,y:C};o.current.element instanceof HTMLElement&&r&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),d.current&&!S7e(o.current.lastBounds,R)&&a(o.current.lastBounds=R)};return[g,u?U$(g,u):g,l?U$(g,l):g]},[a,r,l,u]);function m(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",f,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function x(){o.current.element&&(o.current.resizeObserver=new i(f),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(g=>g.addEventListener("scroll",f,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{f()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const v=g=>{!g||g===o.current.element||(m(),o.current.element=g,o.current.scrollContainers=zle(g),x())};return w7e(f,!!e),b7e(p),E.useEffect(()=>{m(),x()},[e,f,p]),E.useEffect(()=>m,[]),[v,s,h]}function b7e(t){E.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function w7e(t,e){E.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function zle(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...zle(t.parentElement)]}const _7e=["x","y","top","bottom","left","right","width","height"],S7e=(t,e)=>_7e.every(n=>t[n]===e[n]);var A7e=Object.defineProperty,E7e=Object.defineProperties,k7e=Object.getOwnPropertyDescriptors,H$=Object.getOwnPropertySymbols,C7e=Object.prototype.hasOwnProperty,N7e=Object.prototype.propertyIsEnumerable,G$=(t,e,n)=>e in t?A7e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V$=(t,e)=>{for(var n in e||(e={}))C7e.call(e,n)&&G$(t,n,e[n]);if(H$)for(var n of H$(e))N7e.call(e,n)&&G$(t,n,e[n]);return t},T7e=(t,e)=>E7e(t,k7e(e)),W$,$$;typeof window<"u"&&((W$=window.document)!=null&&W$.createElement||(($$=window.navigator)==null?void 0:$$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function Ule(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=Ule(r,e,n);if(i)return i;r=r.sibling}}function Hle(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const K$=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=K$;return}return K$.apply(this,arguments)};const S6=Hle(E.createContext(null));class Gle extends E.Component{render(){return E.createElement(S6.Provider,{value:this._reactInternals},this.props.children)}}function M7e(){const t=E.useContext(S6);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=E.useId();return E.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=Ule(r,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}function R7e(){const t=M7e(),[e]=E.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==S6&&!e.has(i)&&e.set(i,E.useContext(Hle(i)))}n=n.return}return e}function j7e(){const t=R7e();return E.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>E.createElement(e,null,E.createElement(n.Provider,T7e(V$({},r),{value:t.get(n)}))),e=>E.createElement(Gle,V$({},e))),[t])}const P7e=E.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:s,events:a=v7e,eventSource:o,eventPrefix:l,shadows:u,linear:d,flat:h,legacy:p,orthographic:f,frameloop:m,dpr:x,performance:v,raycaster:g,camera:b,scene:y,onPointerMissed:S,onCreated:A,...k},M){E.useMemo(()=>Cle(U9e),[]);const T=j7e(),[C,R]=y7e({scroll:!0,debounce:{scroll:50,resize:0},...r}),P=E.useRef(null),j=E.useRef(null);E.useImperativeHandle(M,()=>P.current);const G=Mle(S),[B,$]=E.useState(!1),[U,Z]=E.useState(!1);if(B)throw B;if(U)throw U;const V=E.useRef(null);VA(()=>{const O=P.current;R.width>0&&R.height>0&&O&&(V.current||(V.current=p7e(O)),V.current.configure({gl:s,events:a,shadows:u,linear:d,flat:h,legacy:p,orthographic:f,frameloop:m,dpr:x,performance:v,raycaster:g,camera:b,scene:y,size:R,onPointerMissed:(...Y)=>G.current==null?void 0:G.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(o?J9e(o)?o.current:o:j.current),l&&Y.setEvents({compute:(z,I)=>{const q=z[l+"X"],te=z[l+"Y"];I.pointer.set(q/I.size.width*2-1,-(te/I.size.height)*2+1),I.raycaster.setFromCamera(I.pointer,I.camera)}}),A==null||A(Y)}}),V.current.render(c.jsx(T,{children:c.jsx(Rle,{set:Z,children:c.jsx(E.Suspense,{fallback:c.jsx(Z9e,{set:$}),children:e??null})})})))}),E.useEffect(()=>{const O=P.current;if(O)return()=>Ole(O)},[]);const W=o?"none":"auto";return c.jsx("div",{ref:j,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:W,...i},...k,children:c.jsx("div",{ref:C,style:{width:"100%",height:"100%"},children:c.jsx("canvas",{ref:P,style:{display:"block"},children:n})})})}),A6=E.forwardRef(function(e,n){return c.jsx(Gle,{children:c.jsx(P7e,{...e,ref:n})})});function Ax(){return Ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ax.apply(null,arguments)}const E6=parseInt(NA.replace(/\D+/g,""));function q$(t,e){if(e===loe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===VT||e===Dz){let n=t.getIndex();if(n===null){const a=[],o=t.getAttribute("position");if(o!==void 0){for(let l=0;l<o.count;l++)a.push(l);t.setIndex(a),n=t.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t}const r=n.count-2,i=[];if(n)if(e===VT)for(let a=1;a<=r;a++)i.push(n.getX(0)),i.push(n.getX(a)),i.push(n.getX(a+1));else for(let a=0;a<r;a++)a%2===0?(i.push(n.getX(a)),i.push(n.getX(a+1)),i.push(n.getX(a+2))):(i.push(n.getX(a+2)),i.push(n.getX(a+1)),i.push(n.getX(a)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}var uu=Uint8Array,cm=Uint16Array,$D=Uint32Array,Vle=new uu([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Wle=new uu([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),L7e=new uu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$le=function(t,e){for(var n=new cm(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new $D(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},Kle=$le(Vle,2),qle=Kle[0],I7e=Kle[1];qle[28]=258,I7e[258]=28;var D7e=$le(Wle,0),B7e=D7e[0],KD=new cm(32768);for(var Zi=0;Zi<32768;++Zi){var Ep=(Zi&43690)>>>1|(Zi&21845)<<1;Ep=(Ep&52428)>>>2|(Ep&13107)<<2,Ep=(Ep&61680)>>>4|(Ep&3855)<<4,KD[Zi]=((Ep&65280)>>>8|(Ep&255)<<8)>>>1}var p2=function(t,e,n){for(var r=t.length,i=0,s=new cm(e);i<r;++i)++s[t[i]-1];var a=new cm(e);for(i=0;i<e;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new cm(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],d=e-t[i],h=a[t[i]-1]++<<d,p=h|(1<<d)-1;h<=p;++h)o[KD[h]>>>l]=u}else for(o=new cm(r),i=0;i<r;++i)t[i]&&(o[i]=KD[a[t[i]-1]++]>>>15-t[i]);return o},WA=new uu(288);for(var Zi=0;Zi<144;++Zi)WA[Zi]=8;for(var Zi=144;Zi<256;++Zi)WA[Zi]=9;for(var Zi=256;Zi<280;++Zi)WA[Zi]=7;for(var Zi=280;Zi<288;++Zi)WA[Zi]=8;var Xle=new uu(32);for(var Zi=0;Zi<32;++Zi)Xle[Zi]=5;var F7e=p2(WA,9,1),O7e=p2(Xle,5,1),TP=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Zu=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},MP=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},z7e=function(t){return(t/8|0)+(t&7&&1)},U7e=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof cm?cm:t instanceof $D?$D:uu)(n-e);return r.set(t.subarray(e,n)),r},H7e=function(t,e,n){var r=t.length;if(!r||n&&!n.l&&r<5)return e||new uu(0);var i=!e||n,s=!n||n.i;n||(n={}),e||(e=new uu(r*3));var a=function(se){var ie=e.length;if(se>ie){var le=new uu(Math.max(ie*2,se));le.set(e),e=le}},o=n.f||0,l=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,f=n.n,m=r*8;do{if(!d){n.f=o=Zu(t,l,1);var x=Zu(t,l+1,3);if(l+=3,x)if(x==1)d=F7e,h=O7e,p=9,f=5;else if(x==2){var y=Zu(t,l,31)+257,S=Zu(t,l+10,15)+4,A=y+Zu(t,l+5,31)+1;l+=14;for(var k=new uu(A),M=new uu(19),T=0;T<S;++T)M[L7e[T]]=Zu(t,l+T*3,7);l+=S*3;for(var C=TP(M),R=(1<<C)-1,P=p2(M,C,1),T=0;T<A;){var j=P[Zu(t,l,R)];l+=j&15;var v=j>>>4;if(v<16)k[T++]=v;else{var G=0,B=0;for(v==16?(B=3+Zu(t,l,3),l+=2,G=k[T-1]):v==17?(B=3+Zu(t,l,7),l+=3):v==18&&(B=11+Zu(t,l,127),l+=7);B--;)k[T++]=G}}var $=k.subarray(0,y),U=k.subarray(y);p=TP($),f=TP(U),d=p2($,p,1),h=p2(U,f,1)}else throw"invalid block type";else{var v=z7e(l)+4,g=t[v-4]|t[v-3]<<8,b=v+g;if(b>r){if(s)throw"unexpected EOF";break}i&&a(u+g),e.set(t.subarray(v,b),u),n.b=u+=g,n.p=l=b*8;continue}if(l>m){if(s)throw"unexpected EOF";break}}i&&a(u+131072);for(var Z=(1<<p)-1,V=(1<<f)-1,W=l;;W=l){var G=d[MP(t,l)&Z],O=G>>>4;if(l+=G&15,l>m){if(s)throw"unexpected EOF";break}if(!G)throw"invalid length/literal";if(O<256)e[u++]=O;else if(O==256){W=l,d=null;break}else{var Y=O-254;if(O>264){var T=O-257,z=Vle[T];Y=Zu(t,l,(1<<z)-1)+qle[T],l+=z}var I=h[MP(t,l)&V],q=I>>>4;if(!I)throw"invalid distance";l+=I&15;var U=B7e[q];if(q>3){var z=Wle[q];U+=MP(t,l)&(1<<z)-1,l+=z}if(l>m){if(s)throw"unexpected EOF";break}i&&a(u+131072);for(var te=u+Y;u<te;u+=4)e[u]=e[u-U],e[u+1]=e[u+1-U],e[u+2]=e[u+2-U],e[u+3]=e[u+3-U];u=te}}n.l=d,n.p=W,n.b=u,d&&(o=1,n.m=p,n.d=h,n.n=f)}while(!o);return u==e.length?e:U7e(e,0,u)},G7e=new uu(0),V7e=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function aC(t,e){return H7e((V7e(t),t.subarray(2,-4)),e)}var W7e=typeof TextDecoder<"u"&&new TextDecoder,$7e=0;try{W7e.decode(G7e,{stream:!0}),$7e=1}catch{}const K7e=t=>t&&t.isCubeTexture;class q7e extends Li{constructor(e,n){var r,i;const s=K7e(e),o=((i=s?(r=e.image[0])==null?void 0:r.width:e.image.width)!=null?i:1024)/4,l=Math.floor(Math.log2(o)),u=Math.pow(2,l),d=3*Math.max(u,16*7),h=4*u,p=[s?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/d}`,`#define CUBEUV_TEXEL_HEIGHT ${1/h}`,`#define CUBEUV_MAX_MIP ${l}.0`],f=` 4531 varying vec3 vWorldPosition; 4532 void main() 4533 { 4534 vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); 4535 vWorldPosition = worldPosition.xyz; 4536 4537 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4538 } 4539 `,m=p.join(` 4540`)+` 4541 #define ENVMAP_TYPE_CUBE_UV 4542 varying vec3 vWorldPosition; 4543 uniform float radius; 4544 uniform float height; 4545 uniform float angle; 4546 #ifdef ENVMAP_TYPE_CUBE 4547 uniform samplerCube map; 4548 #else 4549 uniform sampler2D map; 4550 #endif 4551 // From: https://www.shadertoy.com/view/4tsBD7 4552 float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 4553 { 4554 float d = dot ( rd, n ); 4555 4556 if( d > 0.0 ) { return 1e6; } 4557 4558 vec3 o = ro - c; 4559 float t = - dot( n, o ) / d; 4560 vec3 q = o + rd * t; 4561 4562 return ( dot( q, q ) < r * r ) ? t : 1e6; 4563 } 4564 // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm 4565 float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 4566 { 4567 vec3 oc = ro - ce; 4568 float b = dot( oc, rd ); 4569 float c = dot( oc, oc ) - ra * ra; 4570 float h = b * b - c; 4571 4572 if( h < 0.0 ) { return -1.0; } 4573 4574 h = sqrt( h ); 4575 4576 return - b + h; 4577 } 4578 vec3 project() 4579 { 4580 vec3 p = normalize( vWorldPosition ); 4581 vec3 camPos = cameraPosition; 4582 camPos.y -= height; 4583 float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); 4584 if( intersection > 0.0 ) { 4585 4586 vec3 h = vec3( 0.0, - height, 0.0 ); 4587 float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); 4588 p = ( camPos + min( intersection, intersection2 ) * p ) / radius; 4589 } else { 4590 p = vec3( 0.0, 1.0, 0.0 ); 4591 } 4592 return p; 4593 } 4594 #include <common> 4595 #include <cube_uv_reflection_fragment> 4596 void main() 4597 { 4598 vec3 projectedWorldPosition = project(); 4599 4600 #ifdef ENVMAP_TYPE_CUBE 4601 vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; 4602 #else 4603 vec3 direction = normalize( projectedWorldPosition ); 4604 vec2 uv = equirectUv( direction ); 4605 vec3 outcolor = texture2D( map, uv ).rgb; 4606 #endif 4607 gl_FragColor = vec4( outcolor, 1.0 ); 4608 #include <tonemapping_fragment> 4609 #include <${E6>=154?"colorspace_fragment":"encodings_fragment"}> 4610 } 4611 `,x={map:{value:e},height:{value:(n==null?void 0:n.height)||15},radius:{value:(n==null?void 0:n.radius)||100}},v=new zA(1,16),g=new bl({uniforms:x,fragmentShader:m,vertexShader:f,side:bc});super(v,g)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}var X7e=Object.defineProperty,Y7e=(t,e,n)=>e in t?X7e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}
4611):t[e]=n,J7e=(t,e,n)=>(Y7e(t,e+"",n),n);class Z7e{constructor(){J7e(this,"_listeners")}addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}var Q7e=Object.defineProperty,eHe=(t,e,n)=>e in t?Q7e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gn=(t,e,n)=>(eHe(t,typeof e!="symbol"?e+"":e,n),n);const oC=new Dx,X$=new ff,tHe=Math.cos(70*(Math.PI/180)),Y$=(t,e)=>(t%e+e)%e;let nHe=class extends Z7e{constructor(e,n){super(),Gn(this,"object"),Gn(this,"domElement"),Gn(this,"enabled",!0),Gn(this,"target",new Ie),Gn(this,"minDistance",0),Gn(this,"maxDistance",1/0),Gn(this,"minZoom",0),Gn(this,"maxZoom",1/0),Gn(this,"minPolarAngle",0),Gn(this,"maxPolarAngle",Math.PI),Gn(this,"minAzimuthAngle",-1/0),Gn(this,"maxAzimuthAngle",1/0),Gn(this,"enableDamping",!1),Gn(this,"dampingFactor",.05),Gn(this,"enableZoom",!0),Gn(this,"zoomSpeed",1),Gn(this,"enableRotate",!0),Gn(this,"rotateSpeed",1),Gn(this,"enablePan",!0),Gn(this,"panSpeed",1),Gn(this,"screenSpacePanning",!0),Gn(this,"keyPanSpeed",7),Gn(this,"zoomToCursor",!1),Gn(this,"autoRotate",!1),Gn(this,"autoRotateSpeed",2),Gn(this,"reverseOrbit",!1),Gn(this,"reverseHorizontalOrbit",!1),Gn(this,"reverseVerticalOrbit",!1),Gn(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Gn(this,"mouseButtons",{LEFT:n0.ROTATE,MIDDLE:n0.DOLLY,RIGHT:n0.PAN}),Gn(this,"touches",{ONE:ud.ROTATE,TWO:ud.DOLLY_PAN}),Gn(this,"target0"),Gn(this,"position0"),Gn(this,"zoom0"),Gn(this,"_domElementKeyEvents",null),Gn(this,"getPolarAngle"),Gn(this,"getAzimuthalAngle"),Gn(this,"setPolarAngle"),Gn(this,"setAzimuthalAngle"),Gn(this,"getDistance"),Gn(this,"getZoomScale"),Gn(this,"listenToKeyEvents"),Gn(this,"stopListenToKeyEvents"),Gn(this,"saveState"),Gn(this,"reset"),Gn(this,"update"),Gn(this,"connect"),Gn(this,"dispose"),Gn(this,"dollyIn"),Gn(this,"dollyOut"),Gn(this,"getScale"),Gn(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=Me=>{let Xe=Y$(Me,2*Math.PI),ut=d.phi;ut<0&&(ut+=2*Math.PI),Xe<0&&(Xe+=2*Math.PI);let lt=Math.abs(Xe-ut);2*Math.PI-lt<lt&&(Xe<ut?Xe+=2*Math.PI:ut+=2*Math.PI),h.phi=Xe-ut,r.update()},this.setAzimuthalAngle=Me=>{let Xe=Y$(Me,2*Math.PI),ut=d.theta;ut<0&&(ut+=2*Math.PI),Xe<0&&(Xe+=2*Math.PI);let lt=Math.abs(Xe-ut);2*Math.PI-lt<lt&&(Xe<ut?Xe+=2*Math.PI:ut+=2*Math.PI),h.theta=Xe-ut,r.update()},this.getDistance=()=>r.object.position.distanceTo(r.target),this.listenToKeyEvents=Me=>{Me.addEventListener("keydown",Ke),this._domElementKeyEvents=Me},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ke),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=o.NONE},this.update=(()=>{const Me=new Ie,Xe=new Ie(0,1,0),ut=new qa().setFromUnitVectors(e.up,Xe),lt=ut.clone().invert(),Fe=new Ie,Le=new qa,bt=2*Math.PI;return function(){const Nt=r.object.position;ut.setFromUnitVectors(e.up,Xe),lt.copy(ut).invert(),Me.copy(Nt).sub(r.target),Me.applyQuaternion(ut),d.setFromVector3(Me),r.autoRotate&&l===o.NONE&&B(j()),r.enableDamping?(d.theta+=h.theta*r.dampingFactor,d.phi+=h.phi*r.dampingFactor):(d.theta+=h.theta,d.phi+=h.phi);let _t=r.minAzimuthAngle,Lt=r.maxAzimuthAngle;isFinite(_t)&&isFinite(Lt)&&(_t<-Math.PI?_t+=bt:_t>Math.PI&&(_t-=bt),Lt<-Math.PI?Lt+=bt:Lt>Math.PI&&(Lt-=bt),_t<=Lt?d.theta=Math.max(_t,Math.min(Lt,d.theta)):d.theta=d.theta>
4611(_t+Lt)/2?Math.max(_t,d.theta):Math.min(Lt,d.theta)),d.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,d.phi)),d.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(f,r.dampingFactor):r.target.add(f),r.zoomToCursor&&C||r.object.isOrthographicCamera?d.radius=I(d.radius):d.radius=I(d.radius*p),Me.setFromSpherical(d),Me.applyQuaternion(lt),Nt.copy(r.target).add(Me),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(h.theta*=1-r.dampingFactor,h.phi*=1-r.dampingFactor,f.multiplyScalar(1-r.dampingFactor)):(h.set(0,0,0),f.set(0,0,0));let Dt=!1;if(r.zoomToCursor&&C){let en=null;if(r.object instanceof Os&&r.object.isPerspectiveCamera){const Mt=Me.length();en=I(Mt*p);const nn=Mt-en;r.object.position.addScaledVector(M,nn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const Mt=new Ie(T.x,T.y,0);Mt.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),Dt=!0;const nn=new Ie(T.x,T.y,0);nn.unproject(r.object),r.object.position.sub(nn).add(Mt),r.object.updateMatrixWorld(),en=Me.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;en!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(en).add(r.object.position):(oC.origin.copy(r.object.position),oC.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(oC.direction))<tHe?e.lookAt(r.target):(X$.setFromNormalAndCoplanarPoint(r.object.up,r.target),oC.intersectPlane(X$,r.target))))}else r.object instanceof _h&&r.object.isOrthographicCamera&&(Dt=p!==1,Dt&&(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix()));return p=1,C=!1,Dt||Fe.distanceToSquared(r.object.position)>u||8*(1-Le.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Fe.copy(r.object.position),Le.copy(r.object.quaternion),Dt=!1,!0):!1}})(),this.connect=Me=>{r.domElement=Me,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",We),r.domElement.addEventListener("pointerdown",Ge),r.domElement.addEventListener("pointercancel",_e),r.domElement.addEventListener("wheel",Ce)},this.dispose=()=>{var Me,Xe,ut,lt,Fe,Le;r.domElement&&(r.domElement.style.touchAction="auto"),(Me=r.domElement)==null||Me.removeEventListener("contextmenu",We),(Xe=r.domElement)==null||Xe.removeEventListener("pointerdown",Ge),(ut=r.domElement)==null||ut.removeEventListener("pointercancel",_e),(lt=r.domElement)==null||lt.removeEventListener("wheel",Ce),(Fe=r.domElement)==null||Fe.ownerDocument.removeEventListener("pointermove",He),(Le=r.domElement)==null||Le.ownerDocument.removeEventListener("pointerup",_e),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",Ke)};const r=this,i={type:"change"},s={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=o.NONE;const u=1e-6,d=new HD,h=new HD;let p=1;const f=new Ie,m=new Rt,x=new Rt,v=new Rt,g=new Rt,b=new Rt,y=new Rt,S=new Rt,A=new Rt,k=new Rt,M=new Ie,T=new Rt;let C=!1;const R=[],P={};function j(){return 2*Math.PI/60/60*r.autoRotateSpeed}function G(){return Math.pow(.95,r.zoomSpeed)}function B(Me){r.reverseOrbit||r.reverseHorizontalOrbit?h.theta+=Me:h.theta-=Me}function $(Me){r.reverseOrbit||r.reverseVerticalOrbit?h.phi+=Me:h.phi-=Me}const U=(()=>{const Me=new Ie;return function(ut,lt){Me.setFromMatrixColumn(lt,0),Me.multiplyScalar(-ut),f.add(Me)}})(),Z=(()=>{const Me=new Ie;return function(ut,lt){r.screenSpacePanning===!0?Me.setFromMatrixColumn(lt,1):(Me.setFromMatrixColumn(lt,0),Me.crossVectors(r.object.up,Me)),Me.multiplyScalar(ut),f.add(Me)}})(),V=(()=>{const Me=new Ie;return function(ut,lt){const Fe=r.domElement;if(Fe&&r.object instanceof Os&&r.object.isPerspectiveCamera){const Le=r.object.position;Me.copy(Le).sub(r.target);let bt=Me.length();bt*=Math.tan(r.object.fov/2*Math.PI/180),U(2*ut*bt/Fe.clientHeight,r.object.matrix),Z(2*lt*bt/Fe.clientHeight,r.object.matrix)}else Fe&&r.object instanceof _h&&r.object.isOrthographicCamera?(U(ut*(r.object.right-r.object.left)/r.object.zoom/Fe.clientWidth,r.object.matrix),Z(lt*(r.object.top-r.object.bottom)/r.object.zoom/Fe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function W(Me){r.object instanceof Os&&r.object.isPerspectiveCamera||r.object instanceof _h&&r.object.isOrthographicCamera?p=Me:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function O(Me){W(p/Me)}function Y(Me){W(p*Me)}function z(Me){if(!r.zoomToCursor||!r.domElement)return;C=!0;const Xe=r.domElement.getBoundingClientRect(),ut=Me.clientX-Xe.left,lt=Me.clientY-Xe.top,Fe=Xe.width,Le=Xe.height;T.x=ut/Fe*2-1,T.y=-(lt/Le)*2+1,M.set(T.x,T.y,1).unproject(r.object).sub(r.object.position).normalize()}function I(Me){return Math.max(r.minDistance,Math.min(r.maxDistance,Me))}
4611function q(Me){m.set(Me.clientX,Me.clientY)}function te(Me){z(Me),S.set(Me.clientX,Me.clientY)}function se(Me){g.set(Me.clientX,Me.clientY)}function ie(Me){x.set(Me.clientX,Me.clientY),v.subVectors(x,m).multiplyScalar(r.rotateSpeed);const Xe=r.domElement;Xe&&(B(2*Math.PI*v.x/Xe.clientHeight),$(2*Math.PI*v.y/Xe.clientHeight)),m.copy(x),r.update()}function le(Me){A.set(Me.clientX,Me.clientY),k.subVectors(A,S),k.y>0?O(G()):k.y<0&&Y(G()),S.copy(A),r.update()}function xe(Me){b.set(Me.clientX,Me.clientY),y.subVectors(b,g).multiplyScalar(r.panSpeed),V(y.x,y.y),g.copy(b),r.update()}function Ee(Me){z(Me),Me.deltaY<0?Y(G()):Me.deltaY>0&&O(G()),r.update()}function ae(Me){let Xe=!1;switch(Me.code){case r.keys.UP:V(0,r.keyPanSpeed),Xe=!0;break;case r.keys.BOTTOM:V(0,-r.keyPanSpeed),Xe=!0;break;case r.keys.LEFT:V(r.keyPanSpeed,0),Xe=!0;break;case r.keys.RIGHT:V(-r.keyPanSpeed,0),Xe=!0;break}Xe&&(Me.preventDefault(),r.update())}function Q(){if(R.length==1)m.set(R[0].pageX,R[0].pageY);else{const Me=.5*(R[0].pageX+R[1].pageX),Xe=.5*(R[0].pageY+R[1].pageY);m.set(Me,Xe)}}function we(){if(R.length==1)g.set(R[0].pageX,R[0].pageY);else{const Me=.5*(R[0].pageX+R[1].pageX),Xe=.5*(R[0].pageY+R[1].pageY);g.set(Me,Xe)}}function Ae(){const Me=R[0].pageX-R[1].pageX,Xe=R[0].pageY-R[1].pageY,ut=Math.sqrt(Me*Me+Xe*Xe);S.set(0,ut)}function K(){r.enableZoom&&Ae(),r.enablePan&&we()}function pe(){r.enableZoom&&Ae(),r.enableRotate&&Q()}function ye(Me){if(R.length==1)x.set(Me.pageX,Me.pageY);else{const ut=Ze(Me),lt=.5*(Me.pageX+ut.x),Fe=.5*(Me.pageY+ut.y);x.set(lt,Fe)}v.subVectors(x,m).multiplyScalar(r.rotateSpeed);const Xe=r.domElement;Xe&&(B(2*Math.PI*v.x/Xe.clientHeight),$(2*Math.PI*v.y/Xe.clientHeight)),m.copy(x)}function Se(Me){if(R.length==1)b.set(Me.pageX,Me.pageY);else{const Xe=Ze(Me),ut=.5*(Me.pageX+Xe.x),lt=.5*(Me.pageY+Xe.y);b.set(ut,lt)}y.subVectors(b,g).multiplyScalar(r.panSpeed),V(y.x,y.y),g.copy(b)}function ee(Me){const Xe=Ze(Me),ut=Me.pageX-Xe.x,lt=Me.pageY-Xe.y,Fe=Math.sqrt(ut*ut+lt*lt);A.set(0,Fe),k.set(0,Math.pow(A.y/S.y,r.zoomSpeed)),O(k.y),S.copy(A)}function re(Me){r.enableZoom&&ee(Me),r.enablePan&&Se(Me)}function me(Me){r.enableZoom&&ee(Me),r.enableRotate&&ye(Me)}function Ge(Me){var Xe,ut;r.enabled!==!1&&(R.length===0&&((Xe=r.domElement)==null||Xe.ownerDocument.addEventListener("pointermove",He),(ut=r.domElement)==null||ut.ownerDocument.addEventListener("pointerup",_e)),xt(Me),Me.pointerType==="touch"?Qe(Me):Ne(Me))}function He(Me){r.enabled!==!1&&(Me.pointerType==="touch"?je(Me):ue(Me))}function _e(Me){var Xe,ut,lt;et(Me),R.length===0&&((Xe=r.domElement)==null||Xe.releasePointerCapture(Me.pointerId),(ut=r.domElement)==null||ut.ownerDocument.removeEventListener("pointermove",He),(lt=r.domElement)==null||lt.ownerDocument.removeEventListener("pointerup",_e)),r.dispatchEvent(a),l=o.NONE}function Ne(Me){let Xe;switch(Me.button){case 0:Xe=r.mouseButtons.LEFT;break;case 1:Xe=r.mouseButtons.MIDDLE;break;case 2:Xe=r.mouseButtons.RIGHT;break;default:Xe=-1}switch(Xe){case n0.DOLLY:if(r.enableZoom===!1)return;te(Me),l=o.DOLLY;break;case n0.ROTATE:if(Me.ctrlKey||Me.metaKey||Me.shiftKey){if(r.enablePan===!1)return;se(Me),l=o.PAN}else{if(r.enableRotate===!1)return;q(Me),l=o.ROTATE}break;case n0.PAN:if(Me.ctrlKey||Me.metaKey||Me.shiftKey){if(r.enableRotate===!1)return;q(Me),l=o.ROTATE}else{if(r.enablePan===!1)return;se(Me),l=o.PAN}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(s)}function ue(Me){if(r.enabled!==!1)switch(l){case o.ROTATE:if(r.enableRotate===!1)return;ie(Me);break;case o.DOLLY:if(r.enableZoom===!1)return;le(Me);break;case o.PAN:if(r.enablePan===!1)return;xe(Me);break}}function Ce(Me){r.enabled===!1||r.enableZoom===!1||l!==o.NONE&&l!==o.ROTATE||(Me.preventDefault(),r.dispatchEvent(s),Ee(Me),r.dispatchEvent(a))}function Ke(Me){r.enabled===!1||r.enablePan===!1||ae(Me)}function Qe(Me){switch(Je(Me),R.length){case 1:switch(r.touches.ONE){case ud.ROTATE:if(r.enableRotate===!1)return;Q(),l=o.TOUCH_ROTATE;break;case ud.PAN:if(r.enablePan===!1)return;we(),l=o.TOUCH_PAN;break;default:l=o.NONE}break;case 2:switch(r.touches.TWO){case ud.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;K(),l=o.TOUCH_DOLLY_PAN;break;case ud.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;pe(),l=o.TOUCH_DOLLY_ROTATE;break;default:l=o.NONE}break;default:l=o.NONE}l!==o.NONE&&r.dispatchEvent(s)}function je(Me){switch(Je(Me),l){case o.TOUCH_ROTATE:if(r.enableRotate===!1)return;
4611ye(Me),r.update();break;case o.TOUCH_PAN:if(r.enablePan===!1)return;Se(Me),r.update();break;case o.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;re(Me),r.update();break;case o.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;me(Me),r.update();break;default:l=o.NONE}}function We(Me){r.enabled!==!1&&Me.preventDefault()}function xt(Me){R.push(Me)}function et(Me){delete P[Me.pointerId];for(let Xe=0;Xe<R.length;Xe++)if(R[Xe].pointerId==Me.pointerId){R.splice(Xe,1);return}}function Je(Me){let Xe=P[Me.pointerId];Xe===void 0&&(Xe=new Rt,P[Me.pointerId]=Xe),Xe.set(Me.pageX,Me.pageY)}function Ze(Me){const Xe=Me.pointerId===R[0].pointerId?R[1]:R[0];return P[Xe.pointerId]}this.dollyIn=(Me=G())=>{Y(Me),r.update()},this.dollyOut=(Me=G())=>{O(Me),r.update()},this.getScale=()=>p,this.setScale=Me=>{W(Me),r.update()},this.getZoomScale=()=>G(),n!==void 0&&this.connect(n),this.update()}};function XT(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}const N0="srgb",Ef="srgb-linear",J$=3001,rHe=3e3;class k6 extends wo{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(n){return new lHe(n)}),this.register(function(n){return new cHe(n)}),this.register(function(n){return new vHe(n)}),this.register(function(n){return new yHe(n)}),this.register(function(n){return new bHe(n)}),this.register(function(n){return new dHe(n)}),this.register(function(n){return new hHe(n)}),this.register(function(n){return new fHe(n)}),this.register(function(n){return new pHe(n)}),this.register(function(n){return new oHe(n)}),this.register(function(n){return new mHe(n)}),this.register(function(n){return new uHe(n)}),this.register(function(n){return new xHe(n)}),this.register(function(n){return new gHe(n)}),this.register(function(n){return new sHe(n)}),this.register(function(n){return new wHe(n)}),this.register(function(n){return new _He(n)})}load(e,n,r,i){const s=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const u=Mm.extractUrlBase(e);a=Mm.resolveURL(u,this.path)}else a=Mm.extractUrlBase(e);this.manager.itemStart(e);const o=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},l=new xo(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{s.parse(u,a,function(d){n(d),s.manager.itemEnd(e)},o)}catch(d){o(d)}},r,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){let s;const a={},o={};if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(XT(new Uint8Array(e.slice(0,4)))===Yle){try{a[Or.KHR_BINARY_GLTF]=new SHe(e)}catch(d){i&&i(d);return}s=JSON.parse(a[Or.KHR_BINARY_GLTF].content)}else s=JSON.parse(XT(new Uint8Array(e)));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new DHe(s,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[d.name]=d,a[d.name]=!0}if(s.extensionsUsed)for(let u=0;u<s.extensionsUsed.length;++u){const d=s.extensionsUsed[u],h=s.extensionsRequired||[];
vendor: 13,094 bytes, line 4611
4611switch(d){case Or.KHR_MATERIALS_UNLIT:a[d]=new aHe;break;case Or.KHR_DRACO_MESH_COMPRESSION:a[d]=new AHe(s,this.dracoLoader);break;case Or.KHR_TEXTURE_TRANSFORM:a[d]=new EHe;break;case Or.KHR_MESH_QUANTIZATION:a[d]=new kHe;break;default:h.indexOf(d)>=0&&o[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,s){r.parse(e,n,i,s)})}}function iHe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Or={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class sHe{constructor(e){this.parser=e,this.name=Or.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r<i;r++){const s=n[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const n=this.parser,r="light:"+e;let i=n.cache.get(r);if(i)return i;const s=n.json,l=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let u;const d=new Qt(16777215);l.color!==void 0&&d.setRGB(l.color[0],l.color[1],l.color[2],Ef);const h=l.range!==void 0?l.range:0;switch(l.type){case"directional":u=new h6(d),u.target.position.set(0,0,-1),u.add(u.target);break;case"point":u=new d6(d),u.distance=h;break;case"spot":u=new u6(d),u.distance=h,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,u.angle=l.spot.outerConeAngle,u.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,u.target.position.set(0,0,-1),u.add(u.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return u.position.set(0,0,0),u.decay=2,cf(u,l),l.intensity!==void 0&&(u.intensity=l.intensity),u.name=n.createUniqueName(l.name||"light_"+e),i=Promise.resolve(u),n.cache.add(r,i),i}getDependency(e,n){if(e==="light")return this._loadLight(n)}createNodeAttachment(e){const n=this,r=this.parser,s=r.json.nodes[e],o=(s.extensions&&s.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(l){return r._getNodeRef(n.cache,o,l)})}}class aHe{constructor(){this.name=Or.KHR_MATERIALS_UNLIT}getMaterialType(){return ml}extendParams(e,n,r){const i=[];e.color=new Qt(1,1,1),e.opacity=1;const s=n.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const a=s.baseColorFactor;e.color.setRGB(a[0],a[1],a[2],Ef),e.opacity=a[3]}s.baseColorTexture!==void 0&&i.push(r.assignTexture(e,"map",s.baseColorTexture,N0))}return Promise.all(i)}}class oHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name].emissiveStrength;return s!==void 0&&(n.emissiveIntensity=s),Promise.resolve()}}class lHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];if(a.clearcoatFactor!==void 0&&(n.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&s.push(r.assignTexture(n,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(n.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(n,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(n,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const o=a.clearcoatNormalTexture.scale;n.clearcoatNormalScale=new Rt(o,o)}return Promise.all(s)}}class cHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_DISPERSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return n.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}}class uHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.iridescenceFactor!==void 0&&(n.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&s.push(r.assignTexture(n,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(n.iridescenceIOR=a.iridescenceIor),n.iridescenceThicknessRange===void 0&&(n.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(n.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(n.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(n,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(s)}}class dHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_SHEEN}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];n.sheenColor=new Qt(0,0,0),n.sheenRoughness=0,n.sheen=1;const a=i.extensions[this.name];if(a.sheenColorFactor!==void 0){const o=a.sheenColorFactor;n.sheenColor.setRGB(o[0],o[1],o[2],Ef)}return a.sheenRoughnessFactor!==void 0&&(n.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&s.push(r.assignTexture(n,"sheenColorMap",a.sheenColorTexture,N0)),a.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(n,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(s)}}class hHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.transmissionFactor!==void 0&&(n.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&s.push(r.assignTexture(n,"transmissionMap",a.transmissionTexture)),Promise.all(s)}}class fHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_VOLUME}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];n.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&s.push(r.assignTexture(n,"thicknessMap",a.thicknessTexture)),n.attenuationDistance=a.attenuationDistance||1/0;const o=a.attenuationColor||[1,1,1];return n.attenuationColor=new Qt().setRGB(o[0],o[1],o[2],Ef),Promise.all(s)}}class pHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_IOR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=i.extensions[this.name];return n.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}}class mHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_SPECULAR}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];n.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&s.push(r.assignTexture(n,"specularIntensityMap",a.specularTexture));const o=a.specularColorFactor||[1,1,1];return n.specularColor=new Qt().setRGB(o[0],o[1],o[2],Ef),a.specularColorTexture!==void 0&&s.push(r.assignTexture(n,"specularColorMap",a.specularColorTexture,N0)),Promise.all(s)}}class gHe{constructor(e){this.parser=e,this.name=Or.EXT_MATERIALS_BUMP}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return n.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&s.push(r.assignTexture(n,"bumpMap",a.bumpTexture)),Promise.all(s)}}class xHe{constructor(e){this.parser=e,this.name=Or.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const r=this.parser.json.materials[e];return!r.extensions||!r.extensions[this.name]?null:Tu}extendMaterialParams(e,n){const r=this.parser,i=r.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],a=i.extensions[this.name];return a.anisotropyStrength!==void 0&&(n.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(n.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&s.push(r.assignTexture(n,"anisotropyMap",a.anisotropyTexture)),Promise.all(s)}}class vHe{constructor(e){this.parser=e,this.name=Or.KHR_TEXTURE_BASISU}loadTexture(e){const n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],a=n.options.ktx2Loader;if(!a){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,s.source,a)}}class yHe{constructor(e){this.parser=e,this.name=Or.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[n])return null;const a=s.extensions[n],o=i.images[a.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,a.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class bHe{constructor(e){this.parser=e,this.name=Or.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,s=i.textures[e];if(!s.extensions||!s.extensions[n])return null;const a=s.extensions[n],o=i.images[a.source];let l=r.textureLoader;if(o.uri){const u=r.options.manager.getHandler(o.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,a.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
4611FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class wHe{constructor(e){this.name=Or.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(o){const l=i.byteOffset||0,u=i.byteLength||0,d=i.count,h=i.byteStride,p=new Uint8Array(o,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(d,h,p,i.mode,i.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(d*h);return a.decodeGltfBuffer(new Uint8Array(f),d,h,p,i.mode,i.filter),f})})}else return null}}class _He{constructor(e){this.name=Or.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==nu.TRIANGLES&&u.mode!==nu.TRIANGLE_STRIP&&u.mode!==nu.TRIANGLE_FAN&&u.mode!==void 0)return null;const a=r.extensions[this.name].attributes,o=[],l={};for(const u in a)o.push(this.parser.getDependency("accessor",a[u]).then(d=>(l[u]=d,l[u])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(u=>{const d=u.pop(),h=d.isGroup?d.children:[d],p=u[0].count,f=[];for(const m of h){const x=new Wn,v=new Ie,g=new qa,b=new Ie(1,1,1),y=new Yz(m.geometry,m.material,p);for(let S=0;S<p;S++)l.TRANSLATION&&v.fromBufferAttribute(l.TRANSLATION,S),l.ROTATION&&g.fromBufferAttribute(l.ROTATION,S),l.SCALE&&b.fromBufferAttribute(l.SCALE,S),y.setMatrixAt(S,x.compose(v,g,b));for(const S in l)if(S==="_COLOR_0"){const A=l[S];y.instanceColor=new Qm(A.array,A.itemSize,A.normalized)}else S!=="TRANSLATION"&&S!=="ROTATION"&&S!=="SCALE"&&m.geometry.setAttribute(S,l[S]);Xr.prototype.copy.call(y,m),this.parser.assignFinalMaterial(y),f.push(y)}return d.isGroup?(d.clear(),d.add(...f),d):f[0]}))}}const Yle="glTF",h_=12,Z$={JSON:1313821514,BIN:5130562};class SHe{constructor(e){this.name=Or.KHR_BINARY_GLTF,this.content=null,this.body=null;const n=new DataView(e,0,h_);if(this.header={magic:XT(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==Yle)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-h_,i=new DataView(e,h_);let s=0;for(;s<r;){const a=i.getUint32(s,!0);s+=4;const o=i.getUint32(s,!0);if(s+=4,o===Z$.JSON){const l=new Uint8Array(e,h_+s,a);this.content=XT(l)}else if(o===Z$.BIN){const l=h_+s;this.body=e.slice(l,l+a)}s+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class AHe{constructor(e,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Or.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=n,this.dracoLoader.preload()}decodePrimitive(e,n){const r=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},l={},u={};for(const d in a){const h=qD[d]||d.toLowerCase();o[h]=a[d]}for(const d in e.attributes){const h=qD[d]||d.toLowerCase();if(a[d]!==void 0){const p=r.accessors[e.attributes[d]],f=vb[p.componentType];u[h]=f.name,l[h]=p.normalized===!0}}return n.getDependency("bufferView",s).then(function(d){return new Promise(function(h,p){i.decodeDracoFile(d,function(f){for(const m in f.attributes){const x=f.attributes[m],v=l[m];v!==void 0&&(x.normalized=v)}h(f)},o,u,Ef,p)})})}}class EHe{constructor(){this.name=Or.KHR_TEXTURE_TRANSFORM}extendTexture(e,n){return(n.texCoord===void 0||n.texCoord===e.channel)&&n.offset===void 0&&n.rotation===void 0&&n.scale===void 0||(e=e.clone(),n.texCoord!==void 0&&(e.channel=n.texCoord),n.offset!==void 0&&e.offset.fromArray(n.offset),n.rotation!==void 0&&(e.rotation=n.rotation),n.scale!==void 0&&e.repeat.fromArray(n.scale),e.needsUpdate=!0),e}}class kHe{constructor(){this.name=Or.KHR_MESH_QUANTIZATION}}class Jle extends sw{constructor(e,n,r,i){super(e,n,r,i)}copySampleValue_(e){const n=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let a=0;a!==i;a++)n[a]=r[s+a];return n}interpolate_(e,n,r,i){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,d=i-n,h=(r-n)/d,p=h*h,f=p*h,m=e*u,x=m-u,v=-2*f+3*p,g=f-p,b=1-v,y=g-p+h;for(let S=0;S!==o;S++){const A=a[x+S+o],k=a[x+S+l]*d,M=a[m+S+o],T=a[m+S]*d;s[S]=b*A+y*k+v*M+g*T}return s}}const CHe=new qa;class NHe extends Jle{interpolate_(e,n,r,i){const s=super.interpolate_(e,n,r,i);return CHe.fromArray(s).normalize().toArray(s),s}}const nu={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},vb={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Q$={9728:Bs,9729:zr,9984:vS,9985:SM,9986:gb,9987:Mh},eK={33071:Ji,33648:r1,10497:Jm},RP={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qD={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...E6>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},kp={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},THe={CUBICSPLINE:void 0,LINEAR:bx,STEP:i1},jP={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function MHe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new Lc({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Nh})),t.DefaultMaterial}function Kg(t,e,n){for(const r in n.extensions)t[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=n.extensions[r])}function cf(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function RHe(t,e,n){let r=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const h=e[u];if(h.POSITION!==void 0&&(r=!0),h.NORMAL!==void 0&&(i=!0),h.COLOR_0!==void 0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(t);const a=[],o=[],l=[];for(let u=0,d=e.length;u<d;u++){const h=e[u];if(r){const p=h.POSITION!==void 0?n.getDependency("accessor",h.POSITION):t.attributes.position;a.push(p)}if(i){const p=h.NORMAL!==void 0?n.getDependency("accessor",h.NORMAL):t.attributes.normal;o.push(p)}if(s){const p=h.COLOR_0!==void 0?n.getDependency("accessor",h.COLOR_0):t.attributes.color;l.push(p)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then(function(u){const d=u[0],h=u[1],p=u[2];return r&&(t.morphAttributes.position=d),i&&(t.morphAttributes.normal=h),s&&(t.morphAttributes.color=p),t.morphTargetsRelative=!0,t})}function jHe(t,e){if(t.updateMorphTargets(),e.weights!==void 0)for(let n=0,r=e.weights.length;n<r;n++)t.morphTargetInfluences[n]=e.weights[n];if(e.extras&&Array.isArray(e.extras.targetNames)){const n=e.extras.targetNames;if(t.morphTargetInfluences.length===n.length){t.morphTargetDictionary={};for(let r=0,i=n.length;r<i;r++)t.morphTargetDictionary[n[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function PHe(t){let e;const n=t.extensions&&t.extensions[Or.KHR_DRACO_MESH_COMPRESSION];if(n?e="draco:"+n.bufferView+":"+n.indices+":"+PP(n.attributes):e=t.indices+":"+PP(t.attributes)+":"+t.mode,t.targets!==void 0)for(let r=0,i=t.targets.length;r<i;r++)e+=":"+PP(t.targets[r]);return e}function PP(t){let e="";const n=Object.keys(t).sort();for(let r=0,i=n.length;r<i;r++)e+=n[r]+":"+t[n[r]]+";";return e}function XD(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function LHe(t){return t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const IHe=new Wn;class DHe{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new iHe,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||i&&s<98?this.textureLoader=new GA(this.options.manager):this.textureLoader=new ple(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new xo(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()}
vendor: 51,344 bytes, lines 4611-4681
4611)).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const o={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Kg(s,o,i),cf(o,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,s=n.length;i<s;i++){const a=n[i].joints;for(let o=0,l=a.length;o<l;o++)e[a[o]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const a=e[i];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(r[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.camera)}}_addNodeRef(e,n){n!==void 0&&(e.refs[n]===void 0&&(e.refs[n]=e.uses[n]=0),e.refs[n]++)}_getNodeRef(e,n,r){if(e.refs[n]<=1)return r;const i=r.clone(),s=(a,o)=>{const l=this.associations.get(a);l!=null&&this.associations.set(o,l);for(const[u,d]of a.children.entries())s(d,o.children[u])};return s(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r<n.length;r++){const i=e(n[r]);if(i)return i}return null}_invokeAll(e){const n=Object.values(this.plugins);n.unshift(this);const r=[];for(let i=0;i<n.length;i++){const s=e(n[i]);s&&r.push(s)}return r}getDependency(e,n){const r=e+":"+n;let i=this.cache.get(r);if(!i){switch(e){case"scene":i=this.loadScene(n);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(n)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(n)});break;case"accessor":i=this.loadAccessor(n);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(n)});break;case"buffer":i=this.loadBuffer(n);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(n)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(n)});break;case"skin":i=this.loadSkin(n);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(n)});break;case"camera":i=this.loadCamera(n);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,n)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(r,i)}return i}getDependencies(e){let n=this.cache.get(e);if(!n){const r=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];n=Promise.all(i.map(function(s,a){return r.getDependency(e,a)})),this.cache.add(e,n)}return n}loadBuffer(e){const n=this.json.buffers[e],r=this.fileLoader;if(n.type&&n.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+n.type+" buffer type is not supported.");if(n.uri===void 0&&e===0)return Promise.resolve(this.extensions[Or.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,a){r.load(Mm.resolveURL(n.uri,i.path),s,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})}loadBufferView(e){const n=this.json.bufferViews[e];return this.getDependency("buffer",n.buffer).then(function(r){const i=n.byteLength||0,s=n.byteOffset||0;return r.slice(s,s+i)})}loadAccessor(e){const n=this,r=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const a=RP[i.type],o=vb[i.componentType],l=i.normalized===!0,u=new o(i.count*a);return Promise.resolve(new Yr(u,a,l))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(a){const o=a[0],l=RP[i.type],u=vb[i.componentType],d=u.BYTES_PER_ELEMENT,h=d*l,p=i.byteOffset||0,f=i.bufferView!==void 0?r.bufferViews[i.bufferView].byteStride:void 0,m=i.normalized===!0;let x,v;if(f&&f!==h){const g=Math.floor(p/f),b="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+g+":"+i.count;let y=n.cache.get(b);y||(x=new u(o,g*f,i.count*f/d),y=new BA(x,f/d),n.cache.add(b,y)),v=new Zm(y,l,p%f/d,m)}else o===null?x=new u(i.count*l):x=new u(o,p,i.count*l),v=new Yr(x,l,m);if(i.sparse!==void 0){const g=RP.SCALAR,b=vb[i.sparse.indices.componentType],y=i.sparse.indices.byteOffset||0,S=i.sparse.values.byteOffset||0,A=new b(a[1],y,i.sparse.count*g),k=new u(a[2],S,i.sparse.count*l);o!==null&&(v=new Yr(v.array.slice(),v.itemSize,v.normalized));for(let M=0,T=A.length;M<T;M++){const C=A[M];if(v.setX(C,k[M*l]),l>=2&&v.setY(C,k[M*l+1]),l>=3&&v.setZ(C,k[M*l+2]),l>=4&&v.setW(C,k[M*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return v})}loadTexture(e){const n=this.json,r=this.options,s=n.textures[e].source,a=n.images[s];let o=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,n,r){const i=this,s=this.json,a=s.textures[e],o=s.images[n],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(d){d.flipY=!1,d.name=a.name||o.name||"",d.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(d.name=o.uri);const p=(s.samplers||{})[a.sampler]||{};return d.magFilter=Q$[p.magFilter]||zr,d.minFilter=Q$[p.minFilter]||Mh,d.wrapS=eK[p.wrapS]||Jm,d.wrapT=eK[p.wrapT]||Jm,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const a=i.images[e],o=self.URL||self.webkitURL;let l=a.uri||"",u=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(h){u=!0;const p=new Blob([h],{type:a.mimeType});return l=o.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(h){return new Promise(function(p,f){let m=p;n.isImageBitmapLoader===!0&&(m=function(x){const v=new ui(x);v.needsUpdate=!0,p(v)}),n.load(Mm.resolveURL(h,s.path),m,void 0,f)})}).then(function(h){return u===!0&&o.revokeObjectURL(l),cf(h,a),h.userData.mimeType=a.mimeType||LHe(a.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,n,r,i){const s=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),s.extensions[Or.KHR_TEXTURE_TRANSFORM]){const o=r.extensions!==void 0?r.extensions[Or.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=s.associations.get(a);a=s.extensions[Or.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),s.associations.set(a,l)}}return i!==void 0&&(typeof i=="number"&&(i=i===J$?N0:Ef),"colorSpace"in a?a.colorSpace=i:a.encoding=i===N0?J$:rHe),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,s=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new DM,Ta.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(o,l)),r=l}else if(e.isLine){const o="LineBasicMaterial:"+r.uuid;let l=this.cache.get(o);l||(l=new Pa,Ta.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(o,l)),r=l}if(i||s||a){let o="ClonedMaterial:"+r.uuid+":";i&&(o+="derivative-tangents:"),s&&(o+="vertex-colors:"),a&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=r.clone(),s&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return Lc}loadMaterial(e){const n=this,r=this.json,i=this.extensions,s=r.materials[e];let a;const o={},l=s.extensions||{},u=[];if(l[Or.KHR_MATERIALS_UNLIT]){const h=i[Or.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),u.push(h.extendParams(o,s,n))}else{const h=s.pbrMetallicRoughness||{};if(o.color=new Qt(1,1,1),o.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;o.color.setRGB(p[0],p[1],p[2],Ef),o.opacity=p[3]}h.baseColorTexture!==void 0&&u.push(n.assignTexture(o,"map",h.baseColorTexture,N0)),o.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,o.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(o,"metalnessMap",h.metallicRoughnessTexture)),u.push(n.assignTexture(o,"roughnessMap",h.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,o)})))}s.doubleSided===!0&&(o.side=bc);const d=s.alphaMode||jP.OPAQUE;if(d===jP.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,d===jP.MASK&&(o.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&a!==ml&&(u.push(n.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new Rt(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;o.normalScale.set(h,h)}if(s.occlusionTexture!==void 0&&a!==ml&&(u.push(n.assignTexture(o,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&a!==ml){const h=s.emissiveFactor;o.emissive=new Qt().setRGB(h[0],h[1],h[2],Ef)}return s.emissiveTexture!==void 0&&a!==ml&&u.push(n.assignTexture(o,"emissiveMap",s.emissiveTexture,N0)),Promise.all(u).then(function(){const h=new a(o);return s.name&&(h.name=s.name),cf(h,s),n.associations.set(h,{materials:e}),s.extensions&&Kg(i,h,s),h})}createUniqueName(e){const n=qr.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function s(o){return r[Or.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(l){return tK(l,o,n)})}const a=[];for(let o=0,l=e.length;o<l;o++){const u=e[o],d=PHe(u),h=i[d];if(h)a.push(h.promise);else{let p;u.extensions&&u.extensions[Or.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=tK(new or,u,n),i[d]={primitive:u,promise:p},a.push(p)}}return Promise.all(a)}loadMesh(e){const n=this,r=this.json,i=this.extensions,s=r.meshes[e],a=s.primitives,o=[];for(let l=0,u=a.length;l<u;l++){const d=a[l].material===void 0?MHe(this.cache):this.getDependency("material",a[l].material);o.push(d)}return o.push(n.loadGeometries(a)),Promise.all(o).then(function(l){const u=l.slice(0,l.length-1),d=l[l.length-1],h=[];for(let f=0,m=d.length;f<m;f++){const x=d[f],v=a[f];let g;const b=u[f];if(v.mode===nu.TRIANGLES||v.mode===nu.TRIANGLE_STRIP||v.mode===nu.TRIANGLE_FAN||v.mode===void 0)g=s.isSkinnedMesh===!0?new Xz(x,b):new Li(x,b),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),v.mode===nu.TRIANGLE_STRIP?g.geometry=q$(g.geometry,Dz):v.mode===nu.TRIANGLE_FAN&&(g.geometry=q$(g.geometry,VT));else if(v.mode===nu.LINES)g=new Ql(x,b);else if(v.mode===nu.LINE_STRIP)g=new Ff(x,b);else if(v.mode===nu.LINE_LOOP)g=new Jz(x,b);else if(v.mode===nu.POINTS)g=new Zz(x,b);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+v.mode);Object.keys(g.geometry.morphAttributes).length>0&&jHe(g,s),g.name=n.createUniqueName(s.name||"mesh_"+e),cf(g,s),v.extensions&&Kg(i,g,v),n.assignFinalMaterial(g),h.push(g)}for(let f=0,m=h.length;f<m;f++)n.associations.set(h[f],{meshes:e,primitives:f});if(h.length===1)return s.extensions&&Kg(i,h[0],s),h[0];const p=new wf;s.extensions&&Kg(i,p,s),n.associations.set(p,{meshes:e});for(let f=0,m=h.length;f<m;f++)p.add(h[f]);return p})}loadCamera(e){let n;const r=this.json.cameras[e],i=r[r.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?n=new Os(KT.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):r.type==="orthographic"&&(n=new _h(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),r.name&&(n.name=this.createUniqueName(r.name)),cf(n,r),Promise.resolve(n)}loadSkin(e){const n=this.json.skins[e],r=[];for(let i=0,s=n.joints.length;i<s;i++)r.push(this._loadNodeShallow(n.joints[i]));return n.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",n.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(i){const s=i.pop(),a=i,o=[],l=[];for(let u=0,d=a.length;u<d;u++){const h=a[u];if(h){o.push(h);const p=new Wn;s!==null&&p.fromArray(s.array,u*16),l.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',n.joints[u])}return new FA(o,l)})}loadAnimation(e){const n=this.json,r=this,i=n.animations[e],s=i.name?i.name:"animation_"+e,a=[],o=[],l=[],u=[],d=[];for(let h=0,p=i.channels.length;h<p;h++){const f=i.channels[h],m=i.samplers[f.sampler],x=f.target,v=x.node,g=i.parameters!==void 0?i.parameters[m.input]:m.input,b=i.parameters!==void 0?i.parameters[m.output]:m.output;x.node!==void 0&&(a.push(this.getDependency("node",v)),o.push(this.getDependency("accessor",g)),l.push(this.getDependency("accessor",b)),u.push(m),d.push(x))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l),Promise.all(u),Promise.all(d)]).then(function(h){const p=h[0],f=h[1],m=h[2],x=h[3],v=h[4],g=[];for(let b=0,y=p.length;b<y;b++){const S=p[b],A=f[b],k=m[b],M=x[b],T=v[b];if(S===void 0)continue;S.updateMatrix&&S.updateMatrix();const C=r._createAnimationTracks(S,A,k,M,T);if(C)for(let R=0;R<C.length;R++)g.push(C[R])}return new l1(s,void 0,g)})}createNodeMesh(e){const n=this.json,r=this,i=n.nodes[e];return i.mesh===void 0?null:r.getDependency("mesh",i.mesh).then(function(s){const a=r._getNodeRef(r.meshCache,i.mesh,s);return i.weights!==void 0&&a.traverse(function(o){if(o.isMesh)for(let l=0,u=i.weights.length;l<u;l++)o.morphTargetInfluences[l]=i.weights[l]}),a})}loadNode(e){const n=this.json,r=this,i=n.nodes[e],s=r._loadNodeShallow(e),a=[],o=i.children||[];for(let u=0,d=o.length;u<d;u++)a.push(r.getDependency("node",o[u]));const l=i.skin===void 0?Promise.resolve(null):r.getDependency("skin",i.skin);return Promise.all([s,Promise.all(a),l]).then(function(u){const d=u[0],h=u[1],p=u[2];p!==null&&d.traverse(function(f){f.isSkinnedMesh&&f.bind(p,IHe)});for(let f=0,m=h.length;f<m;f++)d.add(h[f]);return d})}_loadNodeShallow(e){const n=this.json,r=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=n.nodes[e],a=s.name?i.createUniqueName(s.name):"",o=[],l=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return l&&o.push(l),s.camera!==void 0&&o.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){o.push(u)}),this.nodeCache[e]=Promise.all(o).then(function(u){let d;if(s.isBone===!0?d=new IM:u.length>1?d=new wf:u.length===1?d=u[0]:d=new Xr,d!==u[0])for(let h=0,p=u.length;h<p;h++)d.add(u[h]);if(s.name&&(d.userData.name=s.name,d.name=a),cf(d,s),s.extensions&&Kg(r,d,s),s.matrix!==void 0){const h=new Wn;h.fromArray(s.matrix),d.applyMatrix4(h)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,s=new wf;r.name&&(s.name=i.createUniqueName(r.name)),cf(s,r),r.extensions&&Kg(n,s,r);const a=r.nodes||[],o=[];for(let l=0,u=a.length;l<u;l++)o.push(i.getDependency("node",a[l]));return Promise.all(o).then(function(l){for(let d=0,h=l.length;d<h;d++)s.add(l[d]);const u=d=>{const h=new Map;for(const[p,f]of i.associations)(p instanceof Ta||p instanceof ui)&&h.set(p,f);return d.traverse(p=>{const f=i.associations.get(p);f!=null&&h.set(p,f)}),h};return i.associations=u(s),s})}_createAnimationTracks(e,n,r,i,s){const a=[],o=e.name?e.name:e.uuid,l=[];kp[s.path]===kp.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(o);let u;switch(kp[s.path]){case kp.weights:u=_x;break;case kp.rotation:u=eg;break;case kp.position:case kp.scale:u=Sx;break;default:switch(r.itemSize){case 1:u=_x;break;case 2:case 3:default:u=Sx;break}break}const d=i.interpolation!==void 0?THe[i.interpolation]:bx,h=this._getArrayFromAccessor(r);for(let p=0,f=l.length;p<f;p++){const m=new u(l[p]+"."+kp[s.path],n.array,h,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),a.push(m)}return a}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const r=XD(n.constructor),i=new Float32Array(n.length);for(let s=0,a=n.length;s<a;s++)i[s]=n[s]*r;n=i}return n}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(r){const i=this instanceof eg?NHe:Jle;return new i(this.times,this.values,this.getValueSize()/3,r)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function BHe(t,e,n){const r=e.attributes,i=new ma;if(r.POSITION!==void 0){const o=n.json.accessors[r.POSITION],l=o.min,u=o.max;if(l!==void 0&&u!==void 0){if(i.set(new Ie(l[0],l[1],l[2]),new Ie(u[0],u[1],u[2])),o.normalized){const d=XD(vb[o.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const o=new Ie,l=new Ie;for(let u=0,d=s.length;u<d;u++){const h=s[u];if(h.POSITION!==void 0){const p=n.json.accessors[h.POSITION],f=p.min,m=p.max;if(f!==void 0&&m!==void 0){if(l.setX(Math.max(Math.abs(f[0]),Math.abs(m[0]))),l.setY(Math.max(Math.abs(f[1]),Math.abs(m[1]))),l.setZ(Math.max(Math.abs(f[2]),Math.abs(m[2]))),p.normalized){const x=XD(vb[p.componentType]);l.multiplyScalar(x)}o.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(o)}t.boundingBox=i;const a=new Xa;i.getCenter(a.center),a.radius=i.min.distanceTo(i.max)/2,t.boundingSphere=a}function tK(t,e,n){const r=e.attributes,i=[];function s(a,o){return n.getDependency("accessor",a).then(function(l){t.setAttribute(o,l)})}for(const a in r){const o=qD[a]||a.toLowerCase();o in t.attributes||i.push(s(r[a],o))}if(e.indices!==void 0&&!t.index){const a=n.getDependency("accessor",e.indices).then(function(o){t.setIndex(o)});i.push(a)}return cf(t,e),BHe(t,e,n),Promise.all(i).then(function(){return e.targets!==void 0?RHe(t,e.targets,n):t})}const FHe={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:` 4612 varying vec2 vUv; 4613 4614 void main() { 4615 4616 vUv = uv; 4617 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4618 4619 } 4620 `,fragmentShader:` 4621 uniform sampler2D tDiffuse; 4622 uniform float h; 4623 4624 varying vec2 vUv; 4625 4626 void main() { 4627 4628 vec4 sum = vec4( 0.0 ); 4629 4630 sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051; 4631 sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918; 4632 sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245; 4633 sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531; 4634 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 4635 sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531; 4636 sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245; 4637 sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918; 4638 sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051; 4639 4640 gl_FragColor = sum; 4641 4642 } 4643 `},OHe={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:` 4644 varying vec2 vUv; 4645 4646 void main() { 4647 4648 vUv = uv; 4649 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4650 4651 } 4652 `,fragmentShader:` 4653 4654 uniform sampler2D tDiffuse; 4655 uniform float v; 4656 4657 varying vec2 vUv; 4658 4659 void main() { 4660 4661 vec4 sum = vec4( 0.0 ); 4662 4663 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051; 4664 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918; 4665 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245; 4666 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531; 4667 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633; 4668 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531; 4669 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245; 4670 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918; 4671 sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051; 4672 4673 gl_FragColor = sum; 4674 4675 } 4676 `};class zHe extends l6{constructor(e){super(e),this.type=Na}parse(e){const a=function(T,C){switch(T){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(C||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(C||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(C||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(C||""))}},d=` 4677`,h=function(T,C,R){C=C||1024;let j=T.pos,G=-1,B=0,$="",U=String.fromCharCode.apply(null,new Uint16Array(T.subarray(j,j+128)));for(;0>(G=U.indexOf(d))&&B<C&&j<T.byteLength;)$+=U,B+=U.length,j+=128,U+=String.fromCharCode.apply(null,new Uint16Array(T.subarray(j,j+128)));return-1<G?(T.pos+=B+G+1,$+U.slice(0,G)):!1},p=function(T){const C=/^#\?(\S+)/,R=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,P=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,j=/^\s*FORMAT=(\S+)\s*$/,G=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,B={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let $,U;for((T.pos>=T.byteLength||!($=h(T)))&&a(1,"no header found"),(U=$.match(C))||a(3,"bad initial token"),B.valid|=1,B.programtype=U[1],B.string+=$+` 4678`;$=h(T),$!==!1;){if(B.string+=$+` 4679`,$.charAt(0)==="#"){B.comments+=$+` 4680`;continue}if((U=$.match(R))&&(B.gamma=parseFloat(U[1])),(U=$.match(P))&&(B.exposure=parseFloat(U[1])),(U=$.match(j))&&(B.valid|=2,B.format=U[1]),(U=$.match(G))&&(B.valid|=4,B.height=parseInt(U[1],10),B.width=parseInt(U[2],10)),B.valid&2&&B.valid&4)break}return B.valid&2||a(3,"missing format specifier"),B.valid&4||a(3,"missing image size specifier"),B},f=function(T,C,R){const P=C;if(P<8||P>32767||T[0]!==2||T[1]!==2||T[2]&128)return new Uint8Array(T);P!==(T[2]<<8|T[3])&&a(3,"wrong scanline width");const j=new Uint8Array(4*C*R);j.length||a(4,"unable to allocate buffer space");let G=0,B=0;const $=4*P,U=new Uint8Array(4),Z=new Uint8Array($);let V=R;for(;V>0&&B<T.byteLength;){B+4>T.byteLength&&a(1),U[0]=T[B++],U[1]=T[B++],U[2]=T[B++],U[3]=T[B++],(U[0]!=2||U[1]!=2||(U[2]<<8|U[3])!=P)&&a(3,"bad rgbe scanline format");let W=0,O;for(;W<$&&B<T.byteLength;){O=T[B++];const z=O>128;if(z&&(O-=128),(O===0||W+O>$)&&a(3,"bad scanline data"),z){const I=T[B++];for(let q=0;q<O;q++)Z[W++]=I}else Z.set(T.subarray(B,B+O),W),W+=O,B+=O}const Y=P;for(let z=0;z<Y;z++){let I=0;j[G]=Z[z+I],I+=P,j[G+1]=Z[z+I],I+=P,j[G+2]=Z[z+I],I+=P,j[G+3]=Z[z+I],G+=4}V--}return j},m=function(T,C,R,P){const j=T[C+3],G=Math.pow(2,j-128)/255;R[P+0]=T[C+0]*G,R[P+1]=T[C+1]*G,R[P+2]=T[C+2]*G,R[P+3]=1},x=function(T,C,R,P){const j=T[C+3],G=Math.pow(2,j-128)/255;R[P+0]=E0.toHalfFloat(Math.min(T[C+0]*G,65504)),R[P+1]=E0.toHalfFloat(Math.min(T[C+1]*G,65504)),R[P+2]=E0.toHalfFloat(Math.min(T[C+2]*G,65504)),R[P+3]=E0.toHalfFloat(1)},v=new Uint8Array(e);v.pos=0;const g=p(v),b=g.width,y=g.height,S=f(v.subarray(v.pos),b,y);let A,k,M;switch(this.type){case Zs:M=S.length/4;const T=new Float32Array(M*4);for(let R=0;R<M;R++)m(S,R*4,T,R*4);A=T,k=Zs;break;case Na:M=S.length/4;const C=new Uint16Array(M*4);for(let R=0;R<M;R++)x(S,R*4,C,R*4);A=C,k=Na;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:b,height:y,data:A,header:g.string,gamma:g.gamma,exposure:g.exposure,type:k}}setDataType(e){return this.type=e,this}load(e,n,r,i){function s(a,o){switch(a.type){case Zs:case Na:"colorSpace"in a?a.colorSpace="srgb-linear":a.encoding=3e3,a.minFilter=zr,a.magFilter=zr,a.generateMipmaps=!1,a.flipY=!0;break}n&&n(a,o)}return super.load(e,s,r,i)}}const f_=E6>=152;class UHe extends l6{constructor(e){super(e),this.type=Na}parse(e){const C=Math.pow(2.7182818,2.2);function R(de,ke){for(var Ye=0,ce=0;ce<65536;++ce)(ce==0||de[ce>>3]&1<<(ce&7))&&(ke[Ye++]=ce);for(var Pe=Ye-1;Ye<65536;)ke[Ye++]=0;return Pe}function P(de){for(var ke=0;ke<16384;ke++)de[ke]={},de[ke].len=0,de[ke].lit=0,de[ke].p=null}const j={l:0,c:0,lc:0};function G(de,ke,Ye,ce,Pe){for(;Ye<de;)ke=ke<<8|Ze(ce,Pe),Ye+=8;Ye-=de,j.l=ke>>Ye&(1<<de)-1,j.c=ke,j.lc=Ye}const B=new Array(59);function $(de){for(var ke=0;ke<=58;++ke)B[ke]=0;for(var ke=0;ke<65537;++ke)B[de[ke]]+=1;for(var Ye=0,ke=58;ke>0;--ke){var ce=Ye+B[ke]>>1;B[ke]=Ye,Ye=ce}for(var ke=0;ke<65537;++ke){var Pe=de[ke];Pe>0&&(de[ke]=Pe|B[Pe]++<<6)}}function U(de,ke,Ye,ce,Pe,De,qe){for(var $e=Ye,mt=0,vt=0;Pe<=De;Pe++){if($e.value-Ye.value>ce)return!1;G(6,mt,vt,de,$e);var wt=j.l;if(mt=j.c,vt=j.lc,qe[Pe]=wt,wt==63){if($e.value-Ye.value>ce)throw"Something wrong with hufUnpackEncTable";G(8,mt,vt,de,$e);var nt=j.l+6;if(mt=j.c,vt=j.lc,Pe+nt>De+1)throw"Something wrong with hufUnpackEncTable";for(;nt--;)qe[Pe++]=0;Pe--}else if(wt>=59){var nt=wt-59+2;if(Pe+nt>De+1)throw"Something wrong with hufUnpackEncTable";for(;nt--;)qe[Pe++]=0;Pe--}}$(qe)}function Z(de){return de&63}function V(de){return de>>6}function W(de,ke,Ye,ce){for(;ke<=Ye;ke++){var Pe=V(de[ke]),De=Z(de[ke]);if(Pe>>De)throw"Invalid table entry";if(De>14){var qe=ce[Pe>>De-14];if(qe.len)throw"Invalid table entry";if(qe.lit++,qe.p){var $e=qe.p;qe.p=new Array(qe.lit);for(var mt=0;mt<qe.lit-1;++mt)qe.p[mt]=$e[mt]}else qe.p=new Array(1);qe.p[qe.lit-1]=ke}else if(De)for(var vt=0,mt=1<<14-De;mt>0;mt--){var qe=ce[(Pe<<14-De)+vt];if(qe.len||qe.p)throw"Invalid table entry";qe.len=De,qe.lit=ke,vt++}}return!0}const O={c:0,lc:0};function Y(de,ke,Ye,ce){de=de<<8|Ze(Ye,ce),ke+=8,O.c=de,O.lc=ke}const z={c:0,lc:0};function I(de,ke,Ye,ce,Pe,De,qe,$e,mt,vt){if(de==ke){ce<8&&(Y(Ye,ce,Pe,qe),Ye=O.c,ce=O.lc),ce-=8;var wt=Ye>>ce,wt=new Uint8Array([wt])[0];if(mt.value+wt>vt)return!1;for(var nt=$e[mt.value-1];wt-- >0;)$e[mt.value++]=nt}else if(mt.value<vt)$e[mt.value++]=de;else return!1;z.c=Ye,z.lc=ce}function q(de){return de&65535}function te(de){var ke=q(de);return ke>32767?ke-65536:ke}const se={a:0,b:0};function ie(de,ke){var Ye=te(de),ce=te(ke),Pe=ce,De=Ye+(Pe&1)+(Pe>>1),qe=De,$e=De-Pe;se.a=qe,se.b=$e}function le(de,ke){var Ye=q(de),ce=q(ke),Pe=Ye-(ce>>1)&65535,De=ce+Pe-32768&65535;se.a=De,se.b=Pe}function xe(de,ke,Ye,ce,Pe,De,qe){for(var $e=qe<16384,mt=Ye>Pe?Pe:Ye,vt=1,wt;vt<=mt;)vt<<=1;for(vt>>=1,wt=vt,vt>>=1;vt>=1;){for(var nt=0,Xt=nt+De*(Pe-wt),ft=De*vt,ve=De*wt,rt=ce*vt,At=ce*wt,Gt,Wt,zt,Ut;nt<=Xt;nt+=ve){for(var pn=nt,an=nt+ce*(Ye-wt);pn<=an;pn+=At){var Cn=pn+rt,on=pn+ft,Hr=on+rt;$e?(ie(de[pn+ke],de[on+ke]),Gt=se.a,zt=se.b,ie(de[Cn+ke],de[Hr+ke]),Wt=se.a,Ut=se.b,ie(Gt,Wt),de[pn+ke]=se.a,de[Cn+ke]=se.b,ie(zt,Ut),de[on+ke]=se.a,de[Hr+ke]=se.b):(le(de[pn+ke],de[on+ke]),Gt=se.a,zt=se.b,le(de[Cn+ke],de[Hr+ke]),Wt=se.a,Ut=se.b,le(Gt,Wt),de[pn+ke]=se.a,de[Cn+ke]=se.b,le(zt,Ut),de[on+ke]=se.a,de[Hr+ke]=se.b)}if(Ye&vt){var on=pn+ft;$e?ie(de[pn+ke],de[on+ke]):le(de[pn+ke],de[on+ke]),Gt=se.a,de[on+ke]=se.b,de[pn+ke]=Gt}}if(Pe&vt)for(var pn=nt,an=nt+ce*(Ye-wt);pn<=an;pn+=At){var Cn=pn+rt;$e?ie(de[pn+ke],de[Cn+ke]):le(de[pn+ke],de[Cn+ke]),Gt=se.a,de[Cn+ke]=se.b,de[pn+ke]=Gt}wt=vt,vt>>=1}return nt}function Ee(de,ke,Ye,ce,Pe,De,qe,$e,mt,vt){for(var wt=0,nt=0,Xt=$e,ft=Math.trunc(Pe.value+(De+7)/8);Pe.value<ft;)for(Y(wt,nt,Ye,Pe),wt=O.c,nt=O.lc;nt>=14;){var ve=wt>>nt-14&16383,rt=ke[ve];if(rt.len)nt-=rt.len,I(rt.lit,qe,wt,nt,Ye,ce,Pe,mt,vt,Xt),wt=z.c,nt=z.lc;else{if(!rt.p)throw"hufDecode issues";var At;for(At=0;At<rt.lit;At++){for(var Gt=Z(de[rt.p[At]]);nt<Gt&&Pe.value<ft;)Y(wt,nt,Ye,Pe),wt=O.c,nt=O.lc;if(nt>=Gt&&V(de[rt.p[At]])==(wt>>nt-Gt&(1<<Gt)-1)){nt-=Gt,I(rt.p[At],qe,wt,nt,Ye,ce,Pe,mt,vt,Xt),wt=z.c,nt=z.lc;break}}if(At==rt.lit)throw"hufDecode issues"}}var Wt=8-De&7;for(wt>>=Wt,nt-=Wt;nt>0;){var rt=ke[wt<<14-nt&16383];if(rt.len)nt-=rt.len,I(rt.lit,qe,wt,nt,Ye,ce,Pe,mt,vt,Xt),wt=z.c,nt=z.lc;else throw"hufDecode issues"}return!0}function ae(de,ke,Ye,ce,Pe,De){var qe={value:0},$e=Ye.value,mt=Je(ke,Ye),vt=Je(ke,Ye);Ye.value+=4;var wt=Je(ke,Ye);if(Ye.value+=4,mt<0||mt>=65537||vt<0||vt>=65537)throw"Something wrong with HUF_ENCSIZE";var nt=new Array(65537),Xt=new Array(16384);P(Xt);var ft=ce-(Ye.value-$e);if(U(de,ke,Ye,ft,mt,vt,nt),wt>8*(ce-(Ye.value-$e)))throw"Something wrong with hufUncompress";W(nt,mt,vt,Xt),Ee(nt,Xt,de,ke,Ye,wt,vt,De,Pe,qe)}function Q(de,ke,Ye){for(var ce=0;ce<Ye;++ce)ke[ce]=de[ke[ce]]}function we(de){for(var ke=1;ke<de.length;ke++){var Ye=de[ke-1]+de[ke]-128;de[ke]=Ye}}function Ae(de,ke){for(var Ye=0,ce=Math.floor((de.length+1)/2),Pe=0,De=de.length-1;!(Pe>De||(ke[Pe++]=de[Ye++],Pe>De));)ke[Pe++]=de[ce++]}function K(de){for(var ke=de.byteLength,Ye=new Array,ce=0,Pe=new DataView(de);ke>0;){var De=Pe.getInt8(ce++);if(De<0){var qe=-De;ke-=qe+1;for(var $e=0;$e<qe;$e++)Ye.push(Pe.getUint8(ce++))}else{var qe=De;ke-=2;for(var mt=Pe.getUint8(ce++),$e=0;$e<qe+1;$e++)Ye.push(mt)}}return Ye}function pe(de,ke,Ye,ce,Pe,De){var Cn=new DataView(De.buffer),qe=Ye[de.idx[0]].width,$e=Ye[de.idx[0]].height,mt=3,vt=Math.floor(qe/8),wt=Math.ceil(qe/8),nt=Math.ceil($e/8),Xt=qe-(wt-1)*8,ft=$e-(nt-1)*8,ve={value:0},rt=new Array(mt),At=new Array(mt),Gt=new Array(mt),Wt=new Array(mt),zt=new Array(mt);for(let Zn=0;Zn<mt;++Zn)zt[Zn]=ke[de.idx[Zn]],rt[Zn]=Zn<1?0:rt[Zn-1]+wt*nt,At[Zn]=new Float32Array(64),Gt[Zn]=new Uint16Array(64),Wt[Zn]=new Uint16Array(wt*64);for(let Zn=0;Zn<nt;++Zn){var Ut=8;Zn==nt-1&&(Ut=ft);var pn=8;for(let zn=0;zn<wt;++zn){zn==wt-1&&(pn=Xt);for(let Ln=0;Ln<mt;++Ln)Gt[Ln].fill(0),Gt[Ln][0]=Pe[rt[Ln]++],ye(ve,ce,Gt[Ln]),Se(Gt[Ln],At[Ln]),ee(At[Ln]);re(At);for(let Ln=0;Ln<mt;++Ln)me(At[Ln],Wt[Ln],zn*64)}let Sr=0;for(let zn=0;zn<mt;++zn){const Ln=Ye[de.idx[zn]].type;for(let rr=8*Zn;rr<8*Zn+Ut;++rr){Sr=zt[zn][rr];for(let Cs=0;Cs<vt;++Cs){const Wi=Cs*64+(rr&7)*8;Cn.setUint16(Sr+0*2*Ln,Wt[zn][Wi+0],!0),Cn.setUint16(Sr+1*2*Ln,Wt[zn][Wi+1],!0),Cn.setUint16(Sr+2*2*Ln,Wt[zn][Wi+2],!0),Cn.setUint16(Sr+3*2*Ln,Wt[zn][Wi+3],!0),Cn.setUint16(Sr+4*2*Ln,Wt[zn][Wi+4],!0),Cn.setUint16(Sr+5*2*Ln,Wt[zn][Wi+5],!0),Cn.setUint16(Sr+6*2*Ln,Wt[zn][Wi+6],!0),Cn.setUint16(Sr+7*2*Ln,Wt[zn][Wi+7],!0),Sr+=8*2*Ln}}if(vt!=wt)for(let rr=8*Zn;rr<8*Zn+Ut;++rr){const Cs=zt[zn][rr]+8*vt*2*Ln,Wi=vt*64+(rr&7)*8;for(let Za=0;Za<pn;++Za)Cn.setUint16(Cs+Za*2*Ln,Wt[zn][Wi+Za],!0)}}}for(var an=new Uint16Array(qe),Cn=new DataView(De.buffer),on=0;on<mt;++on){Ye[de.idx[on]].decoded=!0;var Hr=Ye[de.idx[on]].type;if(Ye[on].type==2)for(var wr=0;wr<$e;++wr){const Zn=zt[on][wr];for(var Jn=0;Jn<qe;++Jn)an[Jn]=Cn.getUint16(Zn+Jn*2*Hr,!0);for(var Jn=0;Jn<qe;++Jn)Cn.setFloat32(Zn+Jn*2*Hr,Fe(an[Jn]),!0)}}}function ye(de,ke,Ye){for(var ce,Pe=1;Pe<64;)ce=ke[de.value],ce==65280?Pe=64:ce>>8==255?Pe+=ce&255:(Ye[Pe]=ce,Pe++),de.value++}function Se(de,ke){ke[0]=Fe(de[0]),ke[1]=Fe(de[1]),ke[2]=Fe(de[5]),ke[3]=Fe(de[6]),ke[4]=Fe(de[14]),ke[5]=Fe(de[15]),ke[6]=Fe(de[27]),ke[7]=Fe(de[28]),ke[8]=Fe(de[2]),ke[9]=Fe(de[4]),ke[10]=Fe(de[7]),ke[11]=Fe(de[13]),ke[12]=Fe(de[16]),ke[13]=Fe(de[26]),ke[14]=Fe(de[29]),ke[15]=Fe(de[42]),ke[16]=Fe(de[3]),ke[17]=Fe(de[8]),ke[18]=Fe(de[12]),ke[19]=Fe(de[17]),ke[20]=Fe(de[25]),ke[21]=Fe(de[30]),ke[22]=Fe(de[41]),ke[23]=Fe(de[43]),ke[24]=Fe(de[9]),ke[25]=Fe(de[11]),ke[26]=Fe(de[18]),ke[27]=Fe(de[24]),ke[28]=Fe(de[31]),ke[29]=Fe(de[40]),ke[30]=Fe(de[44]),ke[31]=Fe(de[53]),ke[32]=Fe(de[10]),ke[33]=Fe(de[19]),ke[34]=Fe(de[23]),ke[35]=Fe(de[32]),ke[36]=Fe(de[39]),ke[37]=Fe(de[45]),ke[38]=Fe(de[52]),ke[39]=Fe(de[54]),ke[40]=Fe(de[20]),ke[41]=Fe(de[22]),ke[42]=Fe(de[33]),ke[43]=Fe(de[38]),ke[44]=Fe(de[46]),ke[45]=Fe(de[51]),ke[46]=Fe(de[55]),ke[47]=Fe(de[60]),ke[48]=Fe(de[21]),ke[49]=Fe(de[34]),ke[50]=Fe(de[37]),ke[51]=Fe(de[47]),ke[52]=Fe(de[50]),ke[53]=Fe(de[56]),ke[54]=Fe(de[59]),ke[55]=Fe(de[61]),ke[56]=Fe(de[35]),ke[57]=Fe(de[36]),ke[58]=Fe(de[48]),ke[59]=Fe(de[49]),ke[60]=Fe(de[57]),ke[61]=Fe(de[58]),ke[62]=Fe(de[62]),ke[63]=Fe(de[63])}function ee(de){const ke=.5*Math.cos(.7853975),Ye=.5*Math.cos(3.14159/16),ce=.5*Math.cos(3.14159/8),Pe=.5*Math.cos(3*3.14159/16),De=.5*Math.cos(5*3.14159/16),qe=.5*Math.cos(3*3.14159/8),$e=.5*Math.cos(7*3.14159/16);for(var mt=new Array(4),vt=new Array(4),wt=new Array(4),nt=new Array(4),Xt=0;Xt<8;++Xt){var ft=Xt*8;mt[0]=ce*de[ft+2],mt[1]=qe*de[ft+2],mt[2]=ce*de[ft+6],mt[3]=qe*de[ft+6],vt[0]=Ye*de[ft+1]+Pe*de[ft+3]+De*de[ft+5]+$e*de[ft+7],vt[1]=Pe*de[ft+1]-$e*de[ft+3]-Ye*de[ft+5]-De*de[ft+7],vt[2]=De*de[ft+1]-Ye*de[ft+3]+$e*de[ft+5]+Pe*de[ft+7],vt[3]=$e*de[ft+1]-De*de[ft+3]+Pe*de[ft+5]-Ye*de[ft+7],wt[0]=ke*(de[ft+0]+de[ft+4]),wt[3]=ke*(de[ft+0]-de[ft+4]),wt[1]=mt[0]+mt[3],wt[2]=mt[1]-mt[2],nt[0]=wt[0]+wt[1],nt[1]=wt[3]+wt[2],nt[2]=wt[3]-wt[2],nt[3]=wt[0]-wt[1],de[ft+0]=nt[0]+vt[0],de[ft+1]=nt[1]+vt[1],de[ft+2]=nt[2]+vt[2],de[ft+3]=nt[3]+vt[3],de[ft+4]=nt[3]-vt[3],de[ft+5]=nt[2]-vt[2],de[ft+6]=nt[1]-vt[1],de[ft+7]=nt[0]-vt[0]}for(var ve=0;ve<8;++ve)mt[0]=ce*de[16+ve],mt[1]=qe*de[16+ve],mt[2]=ce*de[48+ve],mt[3]=qe*de[48+ve],vt[0]=Ye*de[8+ve]+Pe*de[24+ve]+De*de[40+ve]+$e*de[56+ve],vt[1]=Pe*de[8+ve]-$e*de[24+ve]-Ye*de[40+ve]-De*de[56+ve],vt[2]=De*de[8+ve]-Ye*de[24+ve]+$e*de[40+ve]+Pe*de[56+ve],vt[3]=$e*de[8+ve]-De*de[24+ve]+Pe*de[40+ve]-Ye*de[56+ve],wt[0]=ke*(de[ve]+de[32+ve]),wt[3]=ke*(de[ve]-de[32+ve]),wt[1]=mt[0]+mt[3],wt[2]=mt[1]-mt[2],nt[0]=wt[0]+wt[1],nt[1]=wt[3]+wt[2],nt[2]=wt[3]-wt[2],nt[3]=wt[0]-wt[1],de[0+ve]=nt[0]+vt[0],de[8+ve]=nt[1]+vt[1],de[16+ve]=nt[2]+vt[2],de[24+ve]=nt[3]+vt[3],de[32+ve]=nt[3]-vt[3],de[40+ve]=nt[2]-vt[2],de[48+ve]=nt[1]-vt[1],de[56+ve]=nt[0]-vt[0]}function re(de){for(var ke=0;ke<64;++ke){var Ye=de[0][ke],ce=de[1][ke],Pe=de[2][ke];de[0][ke]=Ye+1.5747*Pe,de[1][ke]=Ye-.1873*ce-.4682*Pe,de[2][ke]=Ye+1.8556*ce}}function me(de,ke,Ye){for(var ce=0;ce<64;++ce)ke[Ye+ce]=E0.toHalfFloat(Ge(de[ce]))}function Ge(de){return de<=1?Math.sign(de)*Math.pow(Math.abs(de),2.2):Math.sign(de)*Math.pow(C,Math.abs(de)-1)}function He(de){return new DataView(de.array.buffer,de.offset.value,de.size)}function _e(de){var ke=de.viewer.buffer.slice(de.offset.value,de.offset.value+de.size),Ye=new Uint8Array(K(ke)),ce=new Uint8Array(Ye.length);return we(Ye),Ae(Ye,ce),new DataView(ce.buffer)}function Ne(de){var ke=de.array.slice(de.offset.value,de.offset.value+de.size),Ye=aC(ke),ce=new Uint8Array(Ye.length);return we(Ye),Ae(Ye,ce),new DataView(ce.buffer)}function ue(de){for(var ke=de.viewer,Ye={value:de.offset.value},ce=new Uint16Array(de.width*de.scanlineBlockSize*(de.channels*de.type)),Pe=new Uint8Array(8192),De=0,qe=new Array(de.channels),$e=0;$e<de.channels;$e++)qe[$e]={},qe[$e].start=De,qe[$e].end=qe[$e].start,qe[$e].nx=de.width,qe[$e].ny=de.lines,qe[$e].size=de.type,De+=qe[$e].nx*qe[$e].ny*qe[$e].size;var mt=Le(ke,Ye),vt=Le(ke,Ye);if(vt>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(mt<=vt)for(var $e=0;$e<vt-mt+1;$e++)Pe[$e+mt]=Me(ke,Ye);var wt=new Uint16Array(65536),nt=R(Pe,wt),Xt=Je(ke,Ye);ae(de.array,ke,Ye,Xt,ce,De);for(var $e=0;$e<de.channels;++$e)for(var ft=qe[$e],ve=0;ve<qe[$e].size;++ve)xe(ce,ft.start+ve,ft.nx,ft.size,ft.ny,ft.nx*ft.size,nt);Q(wt,ce,De);for(var rt=0,At=new Uint8Array(ce.buffer.byteLength),Gt=0;Gt<de.lines;Gt++)for(var Wt=0;Wt<de.channels;Wt++){var ft=qe[Wt],zt=ft.nx*ft.size,Ut=new Uint8Array(ce.buffer,ft.end*2,zt*2);At.set(Ut,rt),rt+=zt*2,ft.end+=zt}return new DataView(At.buffer)}function Ce(de){var ke=de.array.slice(de.offset.value,de.offset.value+de.size),Ye=aC(ke);const ce=de.lines*de.channels*de.width,Pe=de.type==1?new Uint16Array(ce):new Uint32Array(ce);let De=0,qe=0;const $e=new Array(4);for(let mt=0;mt<de.lines;mt++)for(let vt=0;vt<de.channels;vt++){let wt=0;switch(de.type){case 1:$e[0]=De,$e[1]=$e[0]+de.width,De=$e[1]+de.width;for(let nt=0;nt<de.width;++nt){const Xt=Ye[$e[0]++]<<8|Ye[$e[1]++];wt+=Xt,Pe[qe]=wt,qe++}break;case 2:$e[0]=De,$e[1]=$e[0]+de.width,$e[2]=$e[1]+de.width,De=$e[2]+de.width;for(let nt=0;nt<de.width;++nt){const Xt=Ye[$e[0]++]<<24|Ye[$e[1]++]<<16|Ye[$e[2]++]<<8;wt+=Xt,Pe[qe]=wt,qe++}break}}return new DataView(Pe.buffer)}function Ke(de){var ke=de.viewer,Ye={value:de.offset.value},ce=new Uint8Array(de.width*de.lines*(de.channels*de.type*2)),Pe={version:Xe(ke,Ye),unknownUncompressedSize:Xe(ke,Ye),unknownCompressedSize:Xe(ke,Ye),acCompressedSize:Xe(ke,Ye),dcCompressedSize:Xe(ke,Ye),rleCompressedSize:Xe(ke,Ye),rleUncompressedSize:Xe(ke,Ye),rleRawSize:Xe(ke,Ye),totalAcUncompressedCount:Xe(ke,Ye),totalDcUncompressedCount:Xe(ke,Ye),acCompression:Xe(ke,Ye)};if(Pe.version<2)throw"EXRLoader.parse: "+br.compression+" version "+Pe.version+" is unsupported";for(var De=new Array,qe=Le(ke,Ye)-2;qe>0;){var $e=Qe(ke.buffer,Ye),mt=Me(ke,Ye),vt=mt>>2&3,wt=(mt>>4)-1,nt=new Int8Array([wt])[0],Xt=Me(ke,Ye);De.push({name:$e,index:nt,type:Xt,compression:vt}),qe-=$e.length+3}for(var ft=br.channels,ve=new Array(de.channels),rt=0;rt<de.channels;++rt){var At=ve[rt]={},Gt=ft[rt];At.name=Gt.name,At.compression=0,At.decoded=!1,At.type=Gt.pixelType,At.pLinear=Gt.pLinear,At.width=de.width,At.height=de.lines}for(var Wt={idx:new Array(3)},zt=0;zt<de.channels;++zt)for(var At=ve[zt],rt=0;rt<De.length;++rt){var Ut=De[rt];At.name==Ut.name&&(At.compression=Ut.compression,Ut.index>=0&&(Wt.idx[Ut.index]=zt),At.offset=zt)}if(Pe.acCompressedSize>0)switch(Pe.acCompression){case 0:var Cn=new Uint16Array(Pe.totalAcUncompressedCount);ae(de.array,ke,Ye,Pe.acCompressedSize,Cn,Pe.totalAcUncompressedCount);break;case 1:var pn=de.array.slice(Ye.value,Ye.value+Pe.totalAcUncompressedCount),an=aC(pn),Cn=new Uint16Array(an.buffer);Ye.value+=Pe.totalAcUncompressedCount;break}if(Pe.dcCompressedSize>0){var on={array:de.array,offset:Ye,size:Pe.dcCompressedSize},Hr=new Uint16Array(Ne(on).buffer);Ye.value+=Pe.dcCompressedSize}if(Pe.rleRawSize>0){var pn=de.array.slice(Ye.value,Ye.value+Pe.rleCompressedSize),an=aC(pn),wr=K(an.buffer);Ye.value+=Pe.rleCompressedSize}for(var Jn=0,Zn=new Array(ve.length),rt=0;rt<Zn.length;++rt)Zn[rt]=new Array;for(var Sr=0;Sr<de.lines;++Sr)for(var zn=0;zn<ve.length;++zn)Zn[zn].push(Jn),Jn+=ve[zn].width*de.type*2;pe(Wt,Zn,ve,Cn,Hr,ce);for(var rt=0;rt<ve.length;++rt){var At=ve[rt];if(!At.decoded)switch(At.compression){case 2:for(var Ln=0,rr=0,Sr=0;Sr<de.lines;++Sr){for(var Cs=Zn[rt][Ln],Wi=0;Wi<At.width;++Wi){for(var Za=0;Za<2*At.type;++Za)ce[Cs++]=wr[rr+Za*At.width*At.height];rr++}Ln++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(ce.buffer)}function Qe(de,ke){for(var Ye=new Uint8Array(de),ce=0;Ye[ke.value+ce]!=0;)ce+=1;var Pe=new TextDecoder().decode(Ye.slice(ke.value,ke.value+ce));return ke.value=ke.value+ce+1,Pe}function je(de,ke,Ye){var ce=new TextDecoder().decode(new Uint8Array(de).slice(ke.value,ke.value+Ye));return ke.value=ke.value+Ye,ce}function We(de,ke){var Ye=et(de,ke),ce=Je(de,ke);return[Ye,ce]}function xt(de,ke){var Ye=Je(de,ke),ce=Je(de,ke);return[Ye,ce]}function et(de,ke){var Ye=de.getInt32(ke.value,!0);return ke.value=ke.value+4,Ye}function Je(de,ke){var Ye=de.getUint32(ke.value,!0);return ke.value=ke.value+4,Ye}function Ze(de,ke){var Ye=de[ke.value];return ke.value=ke.value+1,Ye}function Me(de,ke){var Ye=de.getUint8(ke.value);return ke.value=ke.value+1,Ye}const Xe=function(de,ke){let Ye;return"getBigInt64"in DataView.prototype?Ye=Number(de.getBigInt64(ke.value,!0)):Ye=de.getUint32(ke.value+4,!0)+Number(de.getUint32(ke.value,!0)<<32),ke.value+=8,Ye};function ut(de,ke){var Ye=de.getFloat32(ke.value,!0);return ke.value+=4,Ye}function lt(de,ke){return E0.toHalfFloat(ut(de,ke))}function Fe(de){var ke=(de&31744)>>10,Ye=de&1023;return(de>>15?-1:1)*(ke?ke===31?Ye?NaN:1/0:Math.pow(2,ke-15)*(1+Ye/1024):6103515625e-14*(Ye/1024))}function Le(de,ke){var Ye=de.getUint16(ke.value,!0);return ke.value+=2,Ye}function bt(de,ke){return Fe(Le(de,ke))}function dt(de,ke,Ye,ce){for(var Pe=Ye.value,De=[];Ye.value<Pe+ce-1;){var qe=Qe(ke,Ye),$e=et(de,Ye),mt=Me(de,Ye);Ye.value+=3;var vt=et(de,Ye),wt=et(de,Ye);De.push({name:qe,pixelType:$e,pLinear:mt,xSampling:vt,ySampling:wt})}return Ye.value+=1,De}function Nt(de,ke){var Ye=ut(de,ke),ce=ut(de,ke),Pe=ut(de,ke),De=ut(de,ke),qe=ut(de,ke),$e=ut(de,ke),mt=ut(de,ke),vt=ut(de,ke);return{redX:Ye,redY:ce,greenX:Pe,greenY:De,blueX:qe,blueY:$e,whiteX:mt,whiteY:vt}}function _t(de,ke){var Ye=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],ce=Me(de,ke);return Ye[ce]}function Lt(de,ke){var Ye=Je(de,ke),ce=Je(de,ke),Pe=Je(de,ke),De=Je(de,ke);return{xMin:Ye,yMin:ce,xMax:Pe,yMax:De}}function Dt(de,ke){var Ye=["INCREASING_Y"],ce=Me(de,ke);return Ye[ce]}function en(de,ke){var Ye=ut(de,ke),ce=ut(de,ke);return[Ye,ce]}function Mt(de,ke){var Ye=ut(de,ke),ce=ut(de,ke),Pe=ut(de,ke);return[Ye,ce,Pe]}function nn(de,ke,Ye,ce,Pe){if(ce==="string"||ce==="stringvector"||ce==="iccProfile")return je(ke,Ye,Pe);if(ce==="chlist")return dt(de,ke,Ye,Pe);if(ce==="chromaticities")return Nt(de,Ye);if(ce==="compression")return _t(de,Ye);if(ce==="box2i")return Lt(de,Ye);if(ce==="lineOrder")return Dt(de,Ye);if(ce==="float")return ut(de,Ye);if(ce==="v2f")return en(de,Ye);if(ce==="v3f")return Mt(de,Ye);if(ce==="int")return et(de,Ye);if(ce==="rational")return We(de,Ye);if(ce==="timecode")return xt(de,Ye);if(ce==="preview")return Ye.value+=Pe,"skipped";Ye.value+=Pe}function Tn(de,ke,Ye){const ce={};if(de.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";ce.version=de.getUint8(4);const Pe=de.getUint8(5);ce.spec={singleTile:!!(Pe&2),longName:!!(Pe&4),deepFormat:!!(Pe&8),multiPart:!!(Pe&16)},Ye.value=8;for(var De=!0;De;){var qe=Qe(ke,Ye);if(qe==0)De=!1;else{var $e=Qe(ke,Ye),mt=Je(de,Ye),vt=nn(de,ke,Ye,$e,mt);vt===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${$e}'.`):ce[qe]=vt}}if(Pe&-5)throw console.error("EXRHeader:",ce),"THREE.EXRLoader: provided file is currently unsupported.";return ce}function Fn(de,ke,Ye,ce,Pe){const De={size:0,viewer:ke,array:Ye,offset:ce,width:de.dataWindow.xMax-de.dataWindow.xMin+1,height:de.dataWindow.yMax-de.dataWindow.yMin+1,channels:de.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:de.channels[0].pixelType,uncompress:null,getter:null,format:null,[f_?"colorSpace":"encoding"]:null};switch(de.compression){case"NO_COMPRESSION":De.lines=1,De.uncompress=He;break;case"RLE_COMPRESSION":De.lines=1,De.uncompress=_e;break;case"ZIPS_COMPRESSION":De.lines=1,De.uncompress=Ne;break;case"ZIP_COMPRESSION":De.lines=16,De.uncompress=Ne;break;case"PIZ_COMPRESSION":De.lines=32,De.uncompress=ue;break;case"PXR24_COMPRESSION":De.lines=16,De.uncompress=Ce;break;case"DWAA_COMPRESSION":De.lines=32,De.uncompress=Ke;break;case"DWAB_COMPRESSION":De.lines=256,De.uncompress=Ke;break;default:throw"EXRLoader.parse: "+de.compression+" is unsupported"}if(De.scanlineBlockSize=De.lines,De.type==1)switch(Pe){case Zs:De.getter=bt,De.inputSize=2;break;case Na:De.getter=Le,De.inputSize=2;break}else if(De.type==2)switch(Pe){case Zs:De.getter=ut,De.inputSize=4;break;case Na:De.getter=lt,De.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+De.type+" for "+de.compression+".";De.blockCount=(de.dataWindow.yMax+1)/De.scanlineBlockSize;for(var qe=0;qe<De.blockCount;qe++)Xe(ke,ce);De.outputChannels=De.channels==3?4:De.channels;const $e=De.width*De.height*De.outputChannels;switch(Pe){case Zs:De.byteArray=new Float32Array($e),De.channels<De.outputChannels&&De.byteArray.fill(1,0,$e);break;case Na:De.byteArray=new Uint16Array($e),De.channels<De.outputChannels&&De.byteArray.fill(15360,0,$e);break;default:console.error("THREE.EXRLoader: unsupported type: ",Pe);break}return De.bytesPerLine=De.width*De.inputSize*De.channels,De.outputChannels==4?De.format=fa:De.format=Mz,f_?De.colorSpace="srgb-linear":De.encoding=3e3,De}const lr=new DataView(e),mr=new Uint8Array(e),gr={value:0},br=Tn(lr,e,gr),sn=Fn(br,lr,mr,gr,this.type),Mr={value:0},yi={R:0,G:1,B:2,A:3,Y:0};for(let de=0;de<sn.height/sn.scanlineBlockSize;de++){const ke=Je(lr,gr);sn.size=Je(lr,gr),sn.lines=ke+sn.scanlineBlockSize>sn.height?sn.height-ke:sn.scanlineBlockSize;const ce=sn.size<sn.lines*sn.bytesPerLine?sn.uncompress(sn):He(sn);gr.value+=sn.size;for(let Pe=0;Pe<sn.scanlineBlockSize;Pe++){const De=Pe+de*sn.scanlineBlockSize;if(De>=sn.height)break;for(let qe=0;qe<sn.channels;qe++){const $e=yi[br.channels[qe].name];for(let mt=0;mt<sn.width;mt++){Mr.value=(Pe*(sn.channels*sn.width)+qe*sn.width+mt)*sn.inputSize;const vt=(sn.height-1-De)*(sn.width*sn.outputChannels)+mt*sn.outputChannels+$e;sn.byteArray[vt]=sn.getter(ce,Mr)}}}}return{header:br,width:sn.width,height:sn.height,data:sn.byteArray,format:sn.format,[f_?"colorSpace":"encoding"]:sn[f_?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,n,r,i){function s(a,o){f_?a.colorSpace=o.colorSpace:a.encoding=o.encoding,a.minFilter=zr,a.magFilter=zr,a.generateMipmaps=!1,a.flipY=!1,n&&n(a,o)}return super.load(e,s,r,i)}}const LP=new WeakMap;class HHe extends wo{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,n,r,i){const s=new xo(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,a=>{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(a,o).then(n).catch(i)},r,i)}decodeDracoFile(e,n,r,i){const s={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,s).then(n)}decodeGeometry(e,n){for(const l in n.attributeTypes){const u=n.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[l]=u.name)}const r=JSON.stringify(n);if(LP.has(e)){const l=LP.get(e);if(l.key===r)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const s=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(s,a).then(l=>(i=l,new Promise((u,d)=>{i._callbacks[s]={resolve:u,reject:d},i.postMessage({type:"decode",id:s,taskConfig:n,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),LP.set(e,{key:r,promise:o}),o}_createGeometry(e){const n=new or;e.index&&n.setIndex(new Yr(e.index.array,1));for(let r=0;r<e.attributes.length;r++){const i=e.attributes[r],s=i.name,a=i.array,o=i.itemSize;n.setAttribute(s,new Yr(a,o))}return n}_loadLibrary(e,n){const r=new xo(this.manager);return r.setPath(this.decoderPath),r.setResponseType(n),r.setWithCredentials(this.withCredentials),new Promise((i,s)=>{r.load(e,i,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(r=>{const i=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const s=GHe.toString(),a=["/* draco decoder */",i,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` 4681`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(s){const a=s.data;switch(a.type){case"decode":i._callbacks[a.id].resolve(a);break;case"error":i._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,s){return i._taskLoad>s._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=n,r._taskLoad+=n,r})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function GHe(){let t,e;onmessage=function(a){const o=a.data;switch(o.type){case"init":t=o.decoderConfig,e=new Promise(function(d){t.onModuleLoaded=function(h){d({draco:h})},DracoDecoderModule(t)});break;case"decode":const l=o.buffer,u=o.taskConfig;e.then(d=>{const h=d.draco,p=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{const m=n(h,p,f,u),x=m.attributes.map(v=>v.array.buffer);m.index&&x.push(m.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:m},x)}catch(m){console.error(m),self.postMessage({type:"error",id:o.id,error:m.message})}finally{h.destroy(f),h.destroy(p)}});break}};function n(a,o,l,u){const d=u.attributeIDs,h=u.attributeTypes;let p,f;const m=o.GetEncodedGeometryType(l);if(m===a.TRIANGULAR_MESH)p=new a.Mesh,f=o.DecodeBufferToMesh(l,p);else if(m===a.POINT_CLOUD)p=new a.PointCloud,f=o.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const x={index:null,attributes:[]};for(const v in d){const g=self[h[v]];let b,y;if(u.useUniqueIDs)y=d[v],b=o.GetAttributeByUniqueId(p,y);else{if(y=o.GetAttributeId(p,a[d[v]]),y===-1)continue;b=o.GetAttribute(p,y)}x.attributes.push(i(a,o,p,v,g,b))}return m===a.TRIANGULAR_MESH&&(x.index=r(a,o,p)),a.destroy(p),x}function r(a,o,l){const d=l.num_faces()*3,h=d*4,p=a._malloc(h);o.GetTrianglesUInt32Array(l,h,p);const f=new Uint32Array(a.HEAPF32.buffer,p,d).slice();return a._free(p),{array:f,itemSize:1}}function i(a,o,l,u,d,h){const p=h.num_components(),m=l.num_points()*p,x=m*d.BYTES_PER_ELEMENT,v=s(a,d),g=a._malloc(x);o.GetAttributeDataArrayForAllPoints(l,h,v,x,g);const b=new d(a.HEAPF32.buffer,g,m).slice();return a._free(g),{name:u,array:b,itemSize:p}}function s(a,o){switch(o){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}let lC;const IP=()=>{if(lC)return lC;
4681const t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIA
4681LAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMG
4681XAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new
4681Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let i=t;WebAssembly.validate(n)&&(i=e);let s;const a=WebAssembly.instantiate(o(i),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function o(h){const p=new Uint8Array(h.length);for(let m=0;m<h.length;++m){const x=h.charCodeAt(m);p[m]=x>96?x-71:x>64?x-65:x>47?x+4:x>46?63:62}let f=0;for(let m=0;m<h.length;++m)p[f++]=p[m]<60?r[p[m]]:(p[m]-60)*64+p[++m];return p.buffer.slice(0,f)}function l(h,p,f,m,x,v){const g=s.exports.sbrk,b=f+3&-4,y=g(b*m),S=g(x.length),A=new Uint8Array(s.exports.memory.buffer);A.set(x,S);const k=h(y,f,m,S,x.length);if(k===0&&v&&v(y,b,m),p.set(A.subarray(y,y+f*m)),g(y-g(0)),k!==0)throw new Error(`Malformed buffer data: ${k}`)}const u={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},d={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return lC={ready:a,supported:!0,decodeVertexBuffer(h,p,f,m,x){l(s.exports.meshopt_decodeVertexBuffer,h,p,f,m,s.exports[u[x]])},decodeIndexBuffer(h,p,f,m){l(s.exports.meshopt_decodeIndexBuffer,h,p,f,m)},decodeIndexSequence(h,p,f,m){l(s.exports.meshopt_decodeIndexSequence,h,p,f,m)},decodeGltfBuffer(h,p,f,m,x,v){l(s.exports[d[x]],h,p,f,m,s.exports[u[v]])}},lC};function VHe(){var t=Object.create(null);function e(i,s){var a=i.id,o=i.name,l=i.dependencies;l===void 0&&(l=[]);var u=i.init;u===void 0&&(u=function(){});var d=i.getTransferables;if(d===void 0&&(d=null),!t[a])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(f){if(f instanceof Error)throw f}),p=t[p.id].value),p}),u=r("<"+o+">.init",u),d&&(d=r("<"+o+">.getTransferables",d));var h=null;typeof u=="function"?h=u.apply(void 0,l):console.error("worker module init function failed to rehydrate"),t[a]={id:a,value:h,getTransferables:d},s(h)}catch(p){p&&p.noLog||console.error(p),s(p)}}function n(i,s){var a,o=i.id,l=i.args;(!t[o]||typeof t[o].value!="function")&&s(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var u=(a=t[o]).value.apply(a,l);u&&typeof u.then=="function"?u.then(d,function(h){return s(h instanceof Error?h:new Error(""+h))}):d(u)}catch(h){s(h)}function d(h){try{var p=t[o].getTransferables&&t[o].getTransferables(h);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(h,p)}catch(f){console.error(f),s(f)}}}function r(i,s){var a=void 0;self.troikaDefine=function(l){return a=l};var o=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ 4682 4683troikaDefine( 4684`+s+` 4685)`],{type:"application/javascript"}));try{importScripts(o)}catch(l){console.error(l)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}self.addEventListener("message",function(i){var s=i.data,a=s.messageId,o=s.action,l=s.data;try{o==="registerModule"&&e(l,function(u){u instanceof Error?postMessage({messageId:a,success:!1,error:u.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof u=="function"}})}),o==="callModule"&&n(l,function(u,d){u instanceof Error?postMessage({messageId:a,success:!1,error:u.message}):postMessage({messageId:a,success:!0,result:u},d||void 0)})}catch(u){postMessage({messageId:a,success:!1,error:u.stack})}})}function WHe(t){var e=function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];return e._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,n);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var n=t.dependencies,r=t.init;n=Array.isArray(n)?n.map(function(s){return s&&(s=s.onMainThread||s,s._getInitResult&&(s=s._getInitResult())),s}):[];var i=Promise.all(n).then(function(s){return r.apply(null,s)});return e._getInitResult=function(){return i},i},e}var Zle=function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(n){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return Zle=function(){return t},t},$He=0,KHe=0,DP=!1,m2=Object.create(null),g2=Object.create(null),YD=Object.create(null);function aw(t){if((!t||typeof t.init!="function")&&!DP)throw new Error("requires `options.init` function");
4685var e=t.dependencies,n=t.init,r=t.getTransferables,i=t.workerId,s=WHe(t);i==null&&(i="#default");var a="workerModule"+ ++$He,o=t.name||a,l=null;e=e&&e.map(function(d){return typeof d=="function"&&!d.workerModuleData&&(DP=!0,d=aw({workerId:i,name:"<"+o+"> function dependency: "+d.name,init:`function(){return ( 4686`+mN(d)+` 4687)}`}),DP=!1),d&&d.workerModuleData&&(d=d.workerModuleData),d});function u(){for(var d=[],h=arguments.length;h--;)d[h]=arguments[h];if(!Zle())return s.apply(void 0,d);if(!l){l=nK(i,"registerModule",u.workerModuleData);var p=function(){l=null,g2[i].delete(p)};(g2[i]||(g2[i]=new Set)).add(p)}return l.then(function(f){var m=f.isCallable;if(m)return nK(i,"callModule",{id:a,args:d});throw new Error("Worker module function was called but `init` did not return a callable function")})}return u.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:e,init:mN(n),getTransferables:r&&mN(r)},u.onMainThread=s,u}function qHe(t){g2[t]&&g2[t].forEach(function(e){e()}),m2[t]&&(m2[t].terminate(),delete m2[t])}function mN(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function XHe(t){var e=m2[t];if(!e){var n=mN(VHe);e=m2[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+` **/ 4688 4689;(`+n+")()"],{type:"application/javascript"}))),e.onmessage=function(r){var i=r.data,s=i.messageId,a=YD[s];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete YD[s],a(i)}}return e}function nK(t,e,n){return new Promise(function(r,i){var s=++KHe;YD[s]=function(a){a.success?r(a.result):i(new Error("Error in worker "+e+" call: "+a.error))},XHe(t).postMessage({messageId:s,action:e,data:n})})}function Qle(){var t=function(e){function n(W,O,Y,z,I,q,te,se){var ie=1-te;se.x=ie*ie*W+2*ie*te*Y+te*te*I,se.y=ie*ie*O+2*ie*te*z+te*te*q}function r(W,O,Y,z,I,q,te,se,ie,le){var xe=1-ie;le.x=xe*xe*xe*W+3*xe*xe*ie*Y+3*xe*ie*ie*I+ie*ie*ie*te,le.y=xe*xe*xe*O+3*xe*xe*ie*z+3*xe*ie*ie*q+ie*ie*ie*se}function i(W,O){for(var Y=/([MLQCZ])([^MLQCZ]*)/g,z,I,q,te,se;z=Y.exec(W);){var ie=z[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(le){return parseFloat(le)});switch(z[1]){case"M":te=I=ie[0],se=q=ie[1];break;case"L":(ie[0]!==te||ie[1]!==se)&&O("L",te,se,te=ie[0],se=ie[1]);break;case"Q":{O("Q",te,se,te=ie[2],se=ie[3],ie[0],ie[1]);break}case"C":{O("C",te,se,te=ie[4],se=ie[5],ie[0],ie[1],ie[2],ie[3]);break}case"Z":(te!==I||se!==q)&&O("L",te,se,I,q);break}}}function s(W,O,Y){Y===void 0&&(Y=16);var z={x:0,y:0};i(W,function(I,q,te,se,ie,le,xe,Ee,ae){switch(I){case"L":O(q,te,se,ie);break;case"Q":{for(var Q=q,we=te,Ae=1;Ae<Y;Ae++)n(q,te,le,xe,se,ie,Ae/(Y-1),z),O(Q,we,z.x,z.y),Q=z.x,we=z.y;break}case"C":{for(var K=q,pe=te,ye=1;ye<Y;ye++)r(q,te,le,xe,Ee,ae,se,ie,ye/(Y-1),z),O(K,pe,z.x,z.y),K=z.x,pe=z.y;break}}})}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,u={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function d(W,O){var Y=W.getContext?W.getContext("webgl",u):W,z=l.get(Y);if(!z){let xe=function(K){var pe=q[K];if(!pe&&(pe=q[K]=Y.getExtension(K),!pe))throw new Error(K+" not supported");return pe},Ee=function(K,pe){var ye=Y.createShader(pe);return Y.shaderSource(ye,K),Y.compileShader(ye),ye},ae=function(K,pe,ye,Se){if(!te[K]){var ee={},re={},me=Y.createProgram();Y.attachShader(me,Ee(pe,Y.VERTEX_SHADER)),Y.attachShader(me,Ee(ye,Y.FRAGMENT_SHADER)),Y.linkProgram(me),te[K]={program:me,transaction:function(He){Y.useProgram(me),He({setUniform:function(Ne,ue){for(var Ce=[],Ke=arguments.length-2;Ke-- >0;)Ce[Ke]=arguments[Ke+2];var Qe=re[ue]||(re[ue]=Y.getUniformLocation(me,ue));Y["uniform"+Ne].apply(Y,[Qe].concat(Ce))},setAttribute:function(Ne,ue,Ce,Ke,Qe){var je=ee[Ne];je||(je=ee[Ne]={buf:Y.createBuffer(),loc:Y.getAttribLocation(me,Ne),data:null}),Y.bindBuffer(Y.ARRAY_BUFFER,je.buf),Y.vertexAttribPointer(je.loc,ue,Y.FLOAT,!1,0,0),Y.enableVertexAttribArray(je.loc),I?Y.vertexAttribDivisor(je.loc,Ke):xe("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(je.loc,Ke),Qe!==je.data&&(Y.bufferData(Y.ARRAY_BUFFER,Qe,Ce),je.data=Qe)}})}}}te[K].transaction(Se)},Q=function(K,pe){ie++;try{Y.activeTexture(Y.TEXTURE0+ie);var ye=se[K];ye||(ye=se[K]=Y.createTexture(),Y.bindTexture(Y.TEXTURE_2D,ye),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MIN_FILTER,Y.NEAREST),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MAG_FILTER,Y.NEAREST)),Y.bindTexture(Y.TEXTURE_2D,ye),pe(ye,ie)}finally{ie--}},we=function(K,pe,ye){var Se=Y.createFramebuffer();le.push(Se),Y.bindFramebuffer(Y.FRAMEBUFFER,Se),Y.activeTexture(Y.TEXTURE0+pe),Y.bindTexture(Y.TEXTURE_2D,K),Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_2D,K,0);try{ye(Se)}finally{Y.deleteFramebuffer(Se),Y.bindFramebuffer(Y.FRAMEBUFFER,le[--le.length-1]||null)}},Ae=function(){q={},te={},se={},ie=-1,le.length=0};var I=typeof WebGL2RenderingContext<"u"&&Y instanceof WebGL2RenderingContext,q={},te={},se={},ie=-1,le=[];
4689Y.canvas.addEventListener("webglcontextlost",function(K){Ae(),K.preventDefault()},!1),l.set(Y,z={gl:Y,isWebGL2:I,getExtension:xe,withProgram:ae,withTexture:Q,withTextureFramebuffer:we,handleContextLoss:Ae})}O(z)}function h(W,O,Y,z,I,q,te,se){te===void 0&&(te=15),se===void 0&&(se=null),d(W,function(ie){var le=ie.gl,xe=ie.withProgram,Ee=ie.withTexture;Ee("copy",function(ae,Q){le.texImage2D(le.TEXTURE_2D,0,le.RGBA,I,q,0,le.RGBA,le.UNSIGNED_BYTE,O),xe("copy",a,o,function(we){var Ae=we.setUniform,K=we.setAttribute;K("aUV",2,le.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Ae("1i","image",Q),le.bindFramebuffer(le.FRAMEBUFFER,se||null),le.disable(le.BLEND),le.colorMask(te&8,te&4,te&2,te&1),le.viewport(Y,z,I,q),le.scissor(Y,z,I,q),le.drawArrays(le.TRIANGLES,0,3)})})})}function p(W,O,Y){var z=W.width,I=W.height;d(W,function(q){var te=q.gl,se=new Uint8Array(z*I*4);te.readPixels(0,0,z,I,te.RGBA,te.UNSIGNED_BYTE,se),W.width=O,W.height=Y,h(te,se,0,0,z,I)})}var f=Object.freeze({__proto__:null,withWebGLContext:d,renderImageData:h,resizeWebGLCanvasWithoutClearing:p});function m(W,O,Y,z,I,q){q===void 0&&(q=1);var te=new Uint8Array(W*O),se=z[2]-z[0],ie=z[3]-z[1],le=[];s(Y,function(K,pe,ye,Se){le.push({x1:K,y1:pe,x2:ye,y2:Se,minX:Math.min(K,ye),minY:Math.min(pe,Se),maxX:Math.max(K,ye),maxY:Math.max(pe,Se)})}),le.sort(function(K,pe){return K.maxX-pe.maxX});for(var xe=0;xe<W;xe++)for(var Ee=0;Ee<O;Ee++){var ae=we(z[0]+se*(xe+.5)/W,z[1]+ie*(Ee+.5)/O),Q=Math.pow(1-Math.abs(ae)/I,q)/2;ae<0&&(Q=1-Q),Q=Math.max(0,Math.min(255,Math.round(Q*255))),te[Ee*W+xe]=Q}return te;function we(K,pe){for(var ye=1/0,Se=1/0,ee=le.length;ee--;){var re=le[ee];if(re.maxX+Se<=K)break;if(K+Se>re.minX&&pe-Se<re.maxY&&pe+Se>re.minY){var me=g(K,pe,re.x1,re.y1,re.x2,re.y2);me<ye&&(ye=me,Se=Math.sqrt(ye))}}return Ae(K,pe)&&(Se=-Se),Se}function Ae(K,pe){for(var ye=0,Se=le.length;Se--;){var ee=le[Se];if(ee.maxX<=K)break;var re=ee.y1>pe!=ee.y2>pe&&K<(ee.x2-ee.x1)*(pe-ee.y1)/(ee.y2-ee.y1)+ee.x1;re&&(ye+=ee.y1<ee.y2?1:-1)}return ye!==0}}function x(W,O,Y,z,I,q,te,se,ie,le){q===void 0&&(q=1),se===void 0&&(se=0),ie===void 0&&(ie=0),le===void 0&&(le=0),v(W,O,Y,z,I,q,te,null,se,ie,le)}function v(W,O,Y,z,I,q,te,se,ie,le,xe){q===void 0&&(q=1),ie===void 0&&(ie=0),le===void 0&&(le=0),xe===void 0&&(xe=0);for(var Ee=m(W,O,Y,z,I,q),ae=new Uint8Array(Ee.length*4),Q=0;Q<Ee.length;Q++)ae[Q*4+xe]=Ee[Q];h(te,ae,ie,le,W,O,1<<3-xe,se)}function g(W,O,Y,z,I,q){var te=I-Y,se=q-z,ie=te*te+se*se,le=ie?Math.max(0,Math.min(1,((W-Y)*te+(O-z)*se)/ie)):0,xe=W-(Y+le*te),Ee=O-(z+le*se);return xe*xe+Ee*Ee}var b=Object.freeze({__proto__:null,generate:m,generateIntoCanvas:x,generateIntoFramebuffer:v}),y="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",S="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",A="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",k=new Float32Array([0,0,2,0,0,2]),M=null,T=!1,C={},R=new WeakMap;function P(W){if(!T&&!$(W))throw new Error("WebGL generation not supported")}function j(W,O,Y,z,I,q,te){if(q===void 0&&(q=1),te===void 0&&(te=null),!te&&(te=M,!te)){var se=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!se)throw new Error("OffscreenCanvas or DOM canvas not supported");te=M=se.getContext("webgl",{depth:!1}
4689)}P(te);var ie=new Uint8Array(W*O*4);d(te,function(ae){var Q=ae.gl,we=ae.withTexture,Ae=ae.withTextureFramebuffer;we("readable",function(K,pe){Q.texImage2D(Q.TEXTURE_2D,0,Q.RGBA,W,O,0,Q.RGBA,Q.UNSIGNED_BYTE,null),Ae(K,pe,function(ye){B(W,O,Y,z,I,q,Q,ye,0,0,0),Q.readPixels(0,0,W,O,Q.RGBA,Q.UNSIGNED_BYTE,ie)})})});for(var le=new Uint8Array(W*O),xe=0,Ee=0;xe<ie.length;xe+=4)le[Ee++]=ie[xe];return le}function G(W,O,Y,z,I,q,te,se,ie,le){q===void 0&&(q=1),se===void 0&&(se=0),ie===void 0&&(ie=0),le===void 0&&(le=0),B(W,O,Y,z,I,q,te,null,se,ie,le)}function B(W,O,Y,z,I,q,te,se,ie,le,xe){q===void 0&&(q=1),ie===void 0&&(ie=0),le===void 0&&(le=0),xe===void 0&&(xe=0),P(te);var Ee=[];s(Y,function(ae,Q,we,Ae){Ee.push(ae,Q,we,Ae)}),Ee=new Float32Array(Ee),d(te,function(ae){var Q=ae.gl,we=ae.isWebGL2,Ae=ae.getExtension,K=ae.withProgram,pe=ae.withTexture,ye=ae.withTextureFramebuffer,Se=ae.handleContextLoss;if(pe("rawDistances",function(ee,re){(W!==ee._lastWidth||O!==ee._lastHeight)&&Q.texImage2D(Q.TEXTURE_2D,0,Q.RGBA,ee._lastWidth=W,ee._lastHeight=O,0,Q.RGBA,Q.UNSIGNED_BYTE,null),K("main",y,S,function(me){var Ge=me.setAttribute,He=me.setUniform,_e=!we&&Ae("ANGLE_instanced_arrays"),Ne=!we&&Ae("EXT_blend_minmax");Ge("aUV",2,Q.STATIC_DRAW,0,k),Ge("aLineSegment",4,Q.DYNAMIC_DRAW,1,Ee),He.apply(void 0,["4f","uGlyphBounds"].concat(z)),He("1f","uMaxDistance",I),He("1f","uExponent",q),ye(ee,re,function(ue){Q.enable(Q.BLEND),Q.colorMask(!0,!0,!0,!0),Q.viewport(0,0,W,O),Q.scissor(0,0,W,O),Q.blendFunc(Q.ONE,Q.ONE),Q.blendEquationSeparate(Q.FUNC_ADD,we?Q.MAX:Ne.MAX_EXT),Q.clear(Q.COLOR_BUFFER_BIT),we?Q.drawArraysInstanced(Q.TRIANGLES,0,3,Ee.length/4):_e.drawArraysInstancedANGLE(Q.TRIANGLES,0,3,Ee.length/4)})}),K("post",a,A,function(me){me.setAttribute("aUV",2,Q.STATIC_DRAW,0,k),me.setUniform("1i","tex",re),Q.bindFramebuffer(Q.FRAMEBUFFER,se),Q.disable(Q.BLEND),Q.colorMask(xe===0,xe===1,xe===2,xe===3),Q.viewport(ie,le,W,O),Q.scissor(ie,le,W,O),Q.drawArrays(Q.TRIANGLES,0,3)})}),Q.isContextLost())throw Se(),new Error("webgl context lost")})}function $(W){var O=!W||W===M?C:W.canvas||W,Y=R.get(O);if(Y===void 0){T=!0;var z=null;try{var I=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],q=j(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,W);Y=q&&I.length===q.length&&q.every(function(te,se){return te===I[se]}),Y||(z="bad trial run results",console.info(I,q))}catch(te){Y=!1,z=te.message}z&&console.warn("WebGL SDF generation not supported:",z),T=!1,R.set(O,Y)}return Y}var U=Object.freeze({__proto__:null,generate:j,generateIntoCanvas:G,generateIntoFramebuffer:B,isSupported:$});function Z(W,O,Y,z,I,q){I===void 0&&(I=Math.max(z[2]-z[0],z[3]-z[1])/2),q===void 0&&(q=1);try{return j.apply(U,arguments)}catch(te){return console.info("WebGL SDF generation failed, falling back to JS",te),m.apply(b,arguments)}}function V(W,O,Y,z,I,q,te,se,ie,le){I===void 0&&(I=Math.max(z[2]-z[0],z[3]-z[1])/2),q===void 0&&(q=1),se===void 0&&(se=0),ie===void 0&&(ie=0),le===void 0&&(le=0);try{return G.apply(U,arguments)}catch(xe){return console.info("WebGL SDF generation failed, falling back to JS",xe),x.apply(b,arguments)}}return e.forEachPathCommand=i,e.generate=Z,e.generateIntoCanvas=V,e.javascript=b,e.pathToLineSegments=s,e.webgl=U,e.webglUtils=f,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}function YHe(){var t=function(e){var n={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,
4689119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(n).forEach(function(Se,ee){r[Se]=1<<ee+1,i[r[Se]]=Se}),Object.freeze(r);var s=r.LRI|r.RLI|r.FSI,a=r.L|r.R|r.AL,o=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,l=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,u=r.S|r.WS|r.B|s|r.PDI|l,d=null;function h(){if(!d){d=new Map;var Se=function(re){if(n.hasOwnProperty(re)){var me=0;n[re].split(",").forEach(function(Ge){var He=Ge.split("+"),_e=He[0],Ne=He[1];_e=parseInt(_e,36),Ne=Ne?parseInt(Ne,36):0,d.set(me+=_e,r[re]);for(var ue=0;ue<Ne;ue++)d.set(++me,r[re])})}};for(var ee in n)Se(ee)}}function p(Se){return h(),d.get(Se.codePointAt(0))||r.L}function f(Se){return i[p(Se)]}var m={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function x(Se,ee){var re=36,me=0,Ge=new Map,He=ee&&new Map,_e;return Se.split(",").forEach(function Ne(ue){if(ue.indexOf("+")!==-1)for(var Ce=+ue;Ce--;)Ne(_e);else{_e=ue;var Ke=ue.split(">"),Qe=Ke[0],je=Ke[1];Qe=String.fromCodePoint(me+=parseInt(Qe,re)),je=String.fromCodePoint(me+=parseInt(je,re)),Ge.set(Qe,je),ee&&He.set(je,Qe)}}),{map:Ge,reverseMap:He}}var v,g,b;function y(){if(!v){var Se=x(m.pairs,!0),ee=Se.map,re=Se.reverseMap;v=ee,g=re,b=x(m.canonical,!1).map}}function S(Se){return y(),v.get(Se)||null}function A(Se){return y(),g.get(Se)||null}function k(Se){return y(),b.get(Se)||null}var M=r.L,T=r.R,C=r.EN,R=r.ES,P=r.ET,j=r.AN,G=r.CS,B=r.B,$=r.S,U=r.ON,Z=r.BN,V=r.NSM,W=r.AL,O=r.LRO,Y=r.RLO,z=r.LRE,I=r.RLE,q=r.PDF,te=r.LRI,se=r.RLI,ie=r.FSI,le=r.PDI;function xe(Se,ee){for(var re=125,me=new Uint32Array(Se.length),Ge=0;Ge<Se.length;Ge++)me[Ge]=p(Se[Ge]);var He=new Map;function _e(cs,us){var Ii=me[cs];me[cs]=us,He.set(Ii,He.get(Ii)-1),Ii&o&&He.set(o,He.get(o)-1),He.set(us,(He.get(us)||0)+1),us&o&&He.set(o,(He.get(o)||0)+1)}for(var Ne=new Uint8Array(Se.length),ue=new Map,Ce=[],Ke=null,Qe=0;Qe<Se.length;Qe++)Ke||Ce.push(Ke={start:Qe,end:Se.length-1,level:ee==="rtl"?1:ee==="ltr"?0:Du(Qe,!1)}),me[Qe]&B&&(Ke.end=Qe,Ke=null);for(var je=I|z|Y|O|s|le|q|B,We=function(cs){return cs+(cs&1?1:2)},xt=function(cs){return cs+(cs&1?2:1)},et=0;et<Ce.length;et++){Ke=Ce[et];var Je=[{_level:Ke.level,_override:0,_isolate:0}],Ze=void 0,Me=0,Xe=0,ut=0;He.clear();for(var lt=Ke.start;lt<=Ke.end;lt++){var Fe=me[lt];if(Ze=Je[Je.length-1],He.set(Fe,(He.get(Fe)||0)+1),Fe&o&&He.set(o,(He.get(o)||0)+1),Fe&je)if(Fe&(I|z)){Ne[lt]=Ze._level;var Le=(Fe===I?xt:We)(Ze._level);Le<=re&&!Me&&!Xe?Je.push({_level:Le,_override:0,_isolate:0}):Me||Xe++}else if(Fe&(Y|O)){Ne[lt]=Ze._level;var bt=(Fe===Y?xt:We)(Ze._level);bt<=re&&!Me&&!Xe?Je.push({_level:bt,_override:Fe&Y?T:M,_isolate:0}):Me||Xe++}else if(Fe&s){Fe&ie&&(Fe=Du(lt+1,!0)===1?se:te),Ne[lt]=Ze._level,Ze._override&&_e(lt,Ze._override);var dt=(Fe===se?xt:We)(Ze._level);dt<=re&&Me===0&&Xe===0?(ut++,Je.push({_level:dt,_override:0,_isolate:1,_isolInitIndex:lt})):Me++}else if(Fe&le){if(Me>0)Me--;else if(ut>0){for(Xe=0;!Je[Je.length-1]._isolate;)Je.pop();var Nt=Je[Je.length-1]._isolInitIndex;Nt!=null&&(ue.set(Nt,lt),ue.set(lt,Nt)),Je.pop(),ut--}Ze=Je[Je.length-1],Ne[lt]=Ze._level,Ze._override&&_e(lt,Ze._override)}else Fe&q?(Me===0&&(Xe>0?Xe--:!Ze._isolate&&Je.length>1&&(Je.pop(),Ze=Je[Je.length-1])),Ne[lt]=Ze._level):Fe&B&&(Ne[lt]=Ke.level);else Ne[lt]=Ze._level,Ze._override&&Fe!==Z&&_e(lt,Ze._override)}for(var _t=[],Lt=null,Dt=Ke.start;Dt<=Ke.end;Dt++){var en=me[Dt];if(!(en&l)){var Mt=Ne[Dt],nn=en&s,Tn=en===le;Lt&&Mt===Lt._level?(Lt._end=Dt,Lt._endsWithIsolInit=nn):_t.push(Lt={_start:Dt,_end:Dt,_level:Mt,_startsWithPDI:Tn,_endsWithIsolInit:nn})}}for(var Fn=[],lr=0;lr<_t.length;lr++){var mr=_t[lr];if(!mr._startsWithPDI||mr._startsWithPDI&&!ue.has(mr._start)){for(var gr=[Lt=mr],br=void 0;Lt&&Lt._endsWithIsolInit&&(br=ue.get(Lt._end))!=null;)for(var sn=lr+1;sn<_t.length;sn++)if(_t[sn]._start===br){gr.push(Lt=_t[sn]);break}for(var Mr=[],yi=0;yi<gr.length;yi++)for(var de=gr[yi],ke=de._start;ke<=de._end;ke++)Mr.push(ke);for(var Ye=Ne[Mr[0]],ce=Ke.level,Pe=Mr[0]-1;Pe>=0;Pe--)if(!(me[Pe]&l)){ce=Ne[Pe];break}var De=Mr[Mr.length-1],qe=Ne[De],$e=Ke.level;if(!(me[De]&s)){for(var mt=De+1;mt<=Ke.end;mt++)if(!(me[mt]&l)){$e=Ne[mt];break}}Fn.push({_seqIndices:Mr,_sosType:Math.max(ce,Ye)%2?T:M,_eosType:Math.max($e,qe)%2?T:M})}}for(var vt=0;vt<Fn.length;vt++){var wt=Fn[vt],nt=wt._seqIndices,Xt=wt._sosType,ft=wt._eosType,ve=Ne[nt[0]]&1?T:M;if(He.get(V))for(var rt=0;rt<nt.length;rt++){var At=nt[rt];if(me[At]&V){for(var Gt=Xt,Wt=rt-1;Wt>=0;Wt--)if(!(me[nt[Wt]]&l)){Gt=me[nt[Wt]];break}_e(At,Gt&(s|le)?U:Gt)}}if(He.get(C))for(var zt=0;zt<nt.length;zt++){var Ut=nt[zt];if(me[Ut]&C)for(var pn=zt-1;pn>=-1;pn--){var an=pn===-1?Xt:me[nt[pn]];if(an&a){an===W&&_e(Ut,j);break}}}if(He.get(W))for(var Cn=0;Cn<nt.length;Cn++){var on=nt[Cn];me[on]&W&&_e(on,T)}if(He.get(R)||He.get(G))for(var Hr=1;Hr<nt.length-1;Hr++){var wr=nt[Hr];if(me[wr]&(R|G)){for(var Jn=0,Zn=0,Sr=Hr-1;Sr>=0&&(Jn=me[nt[Sr]],!!(Jn&l));Sr--);for(var zn=Hr+1;zn<nt.length&&(Zn=me[nt[zn]],!!(Zn&l));zn++);Jn===Zn&&(me[wr]===R?Jn===C:Jn&(C|j))&&_e(wr,Jn)}}if(He.get(C))for(var Ln=0;Ln<nt.length;Ln++){var rr=nt[Ln];if(me[rr]&C){for(var Cs=Ln-1;Cs>=0&&me[nt[Cs]]&(P|l);Cs--)_e(nt[Cs],C);for(Ln++;Ln<nt.length&&me[nt[Ln]]&(P|l|C);Ln++)me[nt[Ln]]!==C&&_e(nt[Ln],C)}}if(He.get(P)||He.get(R)||He.get(G))for(var Wi=0;Wi<nt.length;Wi++){var Za=nt[Wi];if(me[Za]&(P|R|G)){_e(Za,U);for(var ec=Wi-1;ec>=0&&me[nt[ec]]&l;
vendor: 2,087 bytes, line 4689
4689ec--)_e(nt[ec],U);for(var Qs=Wi+1;Qs<nt.length&&me[nt[Qs]]&l;Qs++)_e(nt[Qs],U)}}if(He.get(C))for(var El=0,kl=Xt;El<nt.length;El++){var Mu=nt[El],Ru=me[Mu];Ru&C?kl===M&&_e(Mu,M):Ru&a&&(kl=Ru)}if(He.get(o)){var tc=T|C|j,jd=tc|M,Cl=[];{for(var Qa=[],Zo=0;Zo<nt.length;Zo++)if(me[nt[Zo]]&o){var er=Se[nt[Zo]],Dh=void 0;if(S(er)!==null)if(Qa.length<63)Qa.push({char:er,seqIndex:Zo});else break;else if((Dh=A(er))!==null)for(var eo=Qa.length-1;eo>=0;eo--){var On=Qa[eo].char;if(On===Dh||On===A(k(er))||S(k(On))===er){Cl.push([Qa[eo].seqIndex,Zo]),Qa.length=eo;break}}}Cl.sort(function(cs,us){return cs[0]-us[0]})}for(var Bh=0;Bh<Cl.length;Bh++){for(var Qf=Cl[Bh],Ni=Qf[0],ju=Qf[1],ep=!1,$i=0,Qo=Ni+1;Qo<ju;Qo++){var Pu=nt[Qo];if(me[Pu]&jd){ep=!0;var to=me[Pu]&tc?T:M;if(to===ve){$i=to;break}}}if(ep&&!$i){$i=Xt;for(var Oc=Ni-1;Oc>=0;Oc--){var Pd=nt[Oc];if(me[Pd]&jd){var ts=me[Pd]&tc?T:M;ts!==ve?$i=ts:$i=ve;break}}}if($i){if(me[nt[Ni]]=me[nt[ju]]=$i,$i!==ve){for(var xa=Ni+1;xa<nt.length;xa++)if(!(me[nt[xa]]&l)){p(Se[nt[xa]])&V&&(me[nt[xa]]=$i);break}}if($i!==ve){for(var no=ju+1;no<nt.length;no++)if(!(me[nt[no]]&l)){p(Se[nt[no]])&V&&(me[nt[no]]=$i);break}}}}for(var _o=0;_o<nt.length;_o++)if(me[nt[_o]]&o){for(var Lu=_o,Nl=_o,ea=Xt,el=_o-1;el>=0;el--)if(me[nt[el]]&l)Lu=el;else{ea=me[nt[el]]&tc?T:M;break}for(var nc=ft,Tl=_o+1;Tl<nt.length;Tl++)if(me[nt[Tl]]&(o|l))Nl=Tl;else{nc=me[nt[Tl]]&tc?T:M;break}for(var Hs=Lu;Hs<=Nl;Hs++)me[nt[Hs]]=ea===nc?ea:ve;_o=Nl}}}for(var Ki=Ke.start;Ki<=Ke.end;Ki++){var Iu=Ne[Ki],Gs=me[Ki];if(Iu&1?Gs&(M|C|j)&&Ne[Ki]++:Gs&T?Ne[Ki]++:Gs&(j|C)&&(Ne[Ki]+=2),Gs&l&&(Ne[Ki]=Ki===0?Ke.level:Ne[Ki-1]),Ki===Ke.end||p(Se[Ki])&($|B))for(var La=Ki;La>=0&&p(Se[La])&u;La--)Ne[La]=Ke.level}}return{levels:Ne,paragraphs:Ce};function Du(cs,us){for(var Ii=cs;Ii<Se.length;Ii++){var H=me[Ii];if(H&(T|W))return 1;if(H&(B|M)||us&&H===le)return 0;if(H&s){var he=Fh(Ii);Ii=he===-1?Se.length:he}}return 0}function Fh(cs){for(var us=1,Ii=cs+1;Ii<Se.length;Ii++){var H=me[Ii];if(H&B)break;if(H&le){if(--us===0)return Ii}else H&s&&us++}return-1}}var Ee="14>1,j>2,t>2,u>2,1a>g,2v3>
46891,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",ae;function Q(){if(!ae){var Se=x(Ee,!0),ee=Se.map,re=Se.reverseMap;re.forEach(function(me,Ge){ee.set(Ge,me)}),ae=ee}}function we(Se){return Q(),ae.get(Se)||null}function Ae(Se,ee,re,me){var Ge=Se.length;re=Math.max(0,re==null?0:+re),me=Math.min(Ge-1,me==null?Ge-1:+me);for(var He=new Map,_e=re;_e<=me;_e++)if(ee[_e]&1){var Ne=we(Se[_e]);Ne!==null&&He.set(_e,Ne)}return He}function K(Se,ee,re,me){var Ge=Se.length;re=Math.max(0,re==null?0:+re),me=Math.min(Ge-1,me==null?Ge-1:+me);var He=[];return ee.paragraphs.forEach(function(_e){var Ne=Math.max(re,_e.start),ue=Math.min(me,_e.end);if(Ne<ue){for(var Ce=ee.levels.slice(Ne,ue+1),Ke=ue;Ke>=Ne&&p(Se[Ke])&u;Ke--)Ce[Ke]=_e.level;for(var Qe=_e.level,je=1/0,We=0;We<Ce.length;We++){var xt=Ce[We];xt>Qe&&(Qe=xt),xt<je&&(je=xt|1)}for(var et=Qe;et>=je;et--)for(var Je=0;Je<Ce.length;Je++)if(Ce[Je]>=et){for(var Ze=Je;Je+1<Ce.length&&Ce[Je+1]>=et;)Je++;Je>Ze&&He.push([Ze+Ne,Je+Ne])}}}),He}function pe(Se,ee,re,me){var Ge=ye(Se,ee,re,me),He=[].concat(Se);return Ge.forEach(function(_e,Ne){He[Ne]=(ee.levels[_e]&1?we(Se[_e]):null)||Se[_e]}),He.join("")}function ye(Se,ee,re,me){for(var Ge=K(Se,ee,re,me),He=[],_e=0;_e<Se.length;_e++)He[_e]=_e;return Ge.forEach(function(Ne){for(var ue=Ne[0],Ce=Ne[1],Ke=He.slice(ue,Ce+1),Qe=Ke.length;Qe--;)He[Ce-Qe]=Ke[Qe]}),He}return e.closingToOpeningBracket=A,e.getBidiCharType=p,e.getBidiCharTypeName=f,e.getCanonicalBracket=k,e.getEmbeddingLevels=xe,e.getMirroredCharacter=we,e.getMirroredCharactersMap=Ae,e.getReorderSegments=K,e.getReorderedIndices=ye,e.getReorderedString=pe,e.openingToClosingBracket=S,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}const ece=/\bvoid\s+main\s*\(\s*\)\s*{/g;function JD(t){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(r,i){let s=_r[i];return s?JD(s):r}return t.replace(e,n)}const lo=[];for(let t=0;t<256;t++)lo[t]=(t<16?"0":"")+t.toString(16);function JHe(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(lo[t&255]+lo[t>>8&255]+lo[t>>16&255]+lo[t>>24&255]+"-"+lo[e&255]+lo[e>>
46898&255]+"-"+lo[e>>16&15|64]+lo[e>>24&255]+"-"+lo[n&63|128]+lo[n>>8&255]+"-"+lo[n>>16&255]+lo[n>>24&255]+lo[r&255]+lo[r>>8&255]+lo[r>>16&255]+lo[r>>24&255]).toUpperCase()}const qg=Object.assign||function(){let t=arguments[0];for(let e=1,n=arguments.length;e<n;e++){let r=arguments[e];if(r)for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ZHe=Date.now(),rK=new WeakMap,iK=new Map;let QHe=1e10;function ZD(t,e){const n=rGe(e);let r=rK.get(t);if(r||rK.set(t,r=Object.create(null)),r[n])return new r[n];const i=`_onBeforeCompile${n}`,s=function(u,d){t.onBeforeCompile.call(this,u,d);const h=this.customProgramCacheKey()+"|"+u.vertexShader+"|"+u.fragmentShader;let p=iK[h];if(!p){const f=eGe(this,u,e,n);p=iK[h]=f}u.vertexShader=p.vertexShader,u.fragmentShader=p.fragmentShader,qg(u.uniforms,this.uniforms),e.timeUniform&&(u.uniforms[e.timeUniform]={get value(){return Date.now()-ZHe}}),this[i]&&this[i](u)},a=function(){return o(e.chained?t:t.clone())},o=function(u){const d=Object.create(u,l);return Object.defineProperty(d,"baseMaterial",{value:t}),Object.defineProperty(d,"id",{value:QHe++}),d.uuid=JHe(),d.uniforms=qg({},u.uniforms,e.uniforms),d.defines=qg({},u.defines,e.defines),d.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",d.extensions=qg({},u.extensions,e.extensions),d._listeners=void 0,d},l={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>t.type,set:u=>{t.type=u}},isDerivedFrom:{writable:!0,configurable:!0,value:function(u){const d=this.baseMaterial;return u===d||d.isDerivedMaterial&&d.isDerivedFrom(u)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return t.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get(){return s},set(u){this[i]=u}},copy:{writable:!0,configurable:!0,value:function(u){return t.copy.call(this,u),!t.isShaderMaterial&&!t.isDerivedMaterial&&(qg(this.extensions,u.extensions),qg(this.defines,u.defines),qg(this.uniforms,Wz.clone(u.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const u=new t.constructor;return o(u).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let u=this._depthMaterial;return u||(u=this._depthMaterial=ZD(t.isDerivedMaterial?t.getDepthMaterial():new IA({depthPacking:Fz}),e),u.defines.IS_DEPTH_MATERIAL="",u.uniforms=this.uniforms),u}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let u=this._distanceMaterial;return u||(u=this._distanceMaterial=ZD(t.isDerivedMaterial?t.getDistanceMaterial():new RM,e),u.defines.IS_DISTANCE_MATERIAL="",u.uniforms=this.uniforms),u}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:u,_distanceMaterial:d}=this;u&&u.dispose(),d&&d.dispose(),t.dispose.call(this)}}};return r[n]=a,new a}function eGe(t,{vertexShader:e,fragmentShader:n},r,i){let{vertexDefs:s,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:l,fragmentDefs:u,fragmentMainIntro:d,fragmentMainOutro:h,fragmentColorTransform:p,customRewriter:f,timeUniform:m}=r;if(s=s||"",a=a||"",o=o||"",u=u||"",d=d||"",h=h||"",(l||f)&&(e=JD(e)),(p||f)&&(n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,` 4690//!BEGIN_POST_CHUNK $1 4691$& 4692//!END_POST_CHUNK 4693`),n=JD(n)),f){let x=f({vertexShader:e,fragmentShader:n});e=x.vertexShader,n=x.fragmentShader}if(p){let x=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,v=>(x.push(v),"")),h=`${p} 4694${x.join(` 4695`)} 4696${h}`}if(m){const x=` 4697uniform float ${m}; 4698`;s=x+s,u=x+u}return l&&(e=`vec3 troika_position_${i}; 4699vec3 troika_normal_${i}; 4700vec2 troika_uv_${i}; 4701${e} 4702`,s=`${s} 4703void troikaVertexTransform${i}(inout vec3 position, inout vec3 normal, inout vec2 uv) { 4704 ${l} 4705} 4706`,a=` 4707troika_position_${i} = vec3(position); 4708troika_normal_${i} = vec3(normal); 4709troika_uv_${i} = vec2(uv); 4710troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); 4711${a} 4712`,e=e.replace(/\b(position|normal|uv)\b/g,(x,v,g,b)=>/\battribute\s+vec[23]\s+$/.test(b.substr(0,g))?v:`troika_${v}_${i}`),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),e=sK(e,i,s,a,o),n=sK(n,i,u,d,h),{vertexShader:e,fragmentShader:n}}function sK(t,e,n,r,i){return(r||i||n)&&(t=t.replace(ece,` 4713${n} 4714void troikaOrigMain${e}() {`),t+=` 4715void main() { 4716 ${r} 4717 troikaOrigMain${e}(); 4718 ${i} 4719}`),t}function tGe(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let nGe=0;const aK=new Map;function rGe(t){const e=JSON.stringify(t,tGe);let n=aK.get(e);return n==null&&aK.set(e,n=++nGe),n}/*!
4720Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. 4721Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE 4722*/function iGe(){return typeof window>"u"&&(self.window=self),function(t){var e={parse:function(i){var s=e._bin,a=new Uint8Array(i);if(s.readASCII(a,0,4)=="ttcf"){var o=4;s.readUshort(a,o),o+=2,s.readUshort(a,o),o+=2;var l=s.readUint(a,o);o+=4;for(var u=[],d=0;d<l;d++){var h=s.readUint(a,o);o+=4,u.push(e._readFont(a,h))}return u}return[e._readFont(a,0)]},_readFont:function(i,s){var a=e._bin,o=s;a.readFixed(i,s),s+=4;var l=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2;for(var u=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],d={_data:i,_offset:o},h={},p=0;p<l;p++){var f=a.readASCII(i,s,4);s+=4,a.readUint(i,s),s+=4;var m=a.readUint(i,s);s+=4;var x=a.readUint(i,s);s+=4,h[f]={offset:m,length:x}}for(p=0;p<u.length;p++){var v=u[p];h[v]&&(d[v.trim()]=e[v.trim()].parse(i,h[v].offset,h[v].length,d))}return d},_tabOffset:function(i,s,a){for(var o=e._bin,l=o.readUshort(i,a+4),u=a+12,d=0;d<l;d++){var h=o.readASCII(i,u,4);u+=4,o.readUint(i,u),u+=4;var p=o.readUint(i,u);if(u+=4,o.readUint(i,u),u+=4,h==s)return p}return 0}};e._bin={readFixed:function(i,s){return(i[s]<<8|i[s+1])+(i[s+2]<<8|i[s+3])/65540},readF2dot14:function(i,s){return e._bin.readShort(i,s)/16384},readInt:function(i,s){return e._bin._view(i).getInt32(s)},readInt8:function(i,s){return e._bin._view(i).getInt8(s)},readShort:function(i,s){return e._bin._view(i).getInt16(s)},readUshort:function(i,s){return e._bin._view(i).getUint16(s)},readUshorts:function(i,s,a){for(var o=[],l=0;l<a;l++)o.push(e._bin.readUshort(i,s+2*l));return o},readUint:function(i,s){return e._bin._view(i).getUint32(s)},readUint64:function(i,s){return 4294967296*e._bin.readUint(i,s)+e._bin.readUint(i,s+4)},readASCII:function(i,s,a){for(var o="",l=0;l<a;l++)o+=String.fromCharCode(i[s+l]);return o},readUnicode:function(i,s,a){for(var o="",l=0;l<a;l++){var u=i[s++]<<8|i[s++];o+=String.fromCharCode(u)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(i,s,a){var o=e._bin._tdec;return o&&s==0&&a==i.length?o.decode(i):e._bin.readASCII(i,s,a)},readBytes:function(i,s,a){for(var o=[],l=0;l<a;l++)o.push(i[s+l]);return o},readASCIIArray:function(i,s,a){for(var o=[],l=0;l<a;l++)o.push(String.fromCharCode(i[s+l]));return o},_view:function(i){return i._dataView||(i._dataView=i.buffer?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(new Uint8Array(i).buffer))}},e._lctf={},e._lctf.parse=function(i,s,a,o,l){var u=e._bin,d={},h=s;u.readFixed(i,s),s+=4;var p=u.readUshort(i,s);s+=2;var f=u.readUshort(i,s);s+=2;var m=u.readUshort(i,s);return s+=2,d.scriptList=e._lctf.readScriptList(i,h+p),d.featureList=e._lctf.readFeatureList(i,h+f),d.lookupList=e._lctf.readLookupList(i,h+m,l),d},e._lctf.readLookupList=function(i,s,a){var o=e._bin,l=s,u=[],d=o.readUshort(i,s);s+=2;for(var h=0;h<d;h++){var p=o.readUshort(i,s);s+=2;var f=e._lctf.readLookupTable(i,l+p,a);u.push(f)}return u},e._lctf.readLookupTable=function(i,s,a){var o=e._bin,l=s,u={tabs:[]};u.ltype=o.readUshort(i,s),s+=2,u.flag=o.readUshort(i,s),s+=2;var d=o.readUshort(i,s);s+=2;for(var h=u.ltype,p=0;p<d;p++){var f=o.readUshort(i,s);s+=2;var m=a(i,h,l+f,u);u.tabs.push(m)}return u},e._lctf.numOfOnes=function(i){for(var s=0,a=0;a<32;a++)i>>>a&1&&s++;return s},e._lctf.readClassDef=function(i,s){var a=e._bin,o=[],l=a.readUshort(i,s);if(s+=2,l==1){var u=a.readUshort(i,s);s+=2;var d=a.readUshort(i,s);s+=2;for(var h=0;h<d;h++)o.push(u+h),o.push(u+h),o.push(a.readUshort(i,s)),s+=2}if(l==2){var p=a.readUshort(i,s);for(s+=2,h=0;h<p;h++)o.push(a.readUshort(i,s)),s+=2,o.push(a.readUshort(i,s)),s+=2,o.push(a.readUshort(i,s)),s+=2}return o},e._lctf.getInterval=function(i,s){for(var a=0;a<i.length;a+=3){var o=i[a],l=i[a+1];if(i[a+2],o<=s&&s<=l)return a}return-1},e._lctf.readCoverage=function(i,s){var a=e._bin,o={};o.fmt=a.readUshort(i,s),s+=2;var l=a.readUshort(i,s);return s+=2,o.fmt==1&&(o.tab=a.readUshorts(i,s,l)),o.fmt==2&&(o.tab=a.readUshorts(i,s,3*l)),o},e._lctf.coverageIndex=function(i,s){var a=i.tab;if(i.fmt==1)return a.indexOf(s);if(i.fmt==2){var o=e._lctf.getInterval(a,s);if(o!=-1)return a[o+2]+(s-a[o])}return-1},e._lctf.readFeatureList=function(i,s){var a=e._bin,o=s,l=[],u=a.readUshort(i,s);s+=2;for(var d=0;d<u;d++){var h=a.readASCII(i,s,4);s+=4;var p=a.readUshort(i,s);s+=2;var f=e._lctf.readFeatureTable(i,o+p);f.tag=h.trim(),l.push(f)}return l},e._lctf.readFeatureTable=function(i,s){var a=e._bin,o=s,l={},u=a.readUshort(i,s);s+=2,u>
47220&&(l.featureParams=o+u);var d=a.readUshort(i,s);s+=2,l.tab=[];for(var h=0;h<d;h++)l.tab.push(a.readUshort(i,s+2*h));return l},e._lctf.readScriptList=function(i,s){var a=e._bin,o=s,l={},u=a.readUshort(i,s);s+=2;for(var d=0;d<u;d++){var h=a.readASCII(i,s,4);s+=4;var p=a.readUshort(i,s);s+=2,l[h.trim()]=e._lctf.readScriptTable(i,o+p)}return l},e._lctf.readScriptTable=function(i,s){var a=e._bin,o=s,l={},u=a.readUshort(i,s);s+=2,u>0&&(l.default=e._lctf.readLangSysTable(i,o+u));var d=a.readUshort(i,s);s+=2;for(var h=0;h<d;h++){var p=a.readASCII(i,s,4);s+=4;var f=a.readUshort(i,s);s+=2,l[p.trim()]=e._lctf.readLangSysTable(i,o+f)}return l},e._lctf.readLangSysTable=function(i,s){var a=e._bin,o={};a.readUshort(i,s),s+=2,o.reqFeature=a.readUshort(i,s),s+=2;var l=a.readUshort(i,s);return s+=2,o.features=a.readUshorts(i,s,l),o},e.CFF={},e.CFF.parse=function(i,s,a){var o=e._bin;(i=new Uint8Array(i.buffer,s,a))[s=0],i[++s],i[++s],i[++s],s++;var l=[];s=e.CFF.readIndex(i,s,l);for(var u=[],d=0;d<l.length-1;d++)u.push(o.readASCII(i,s+l[d],l[d+1]-l[d]));s+=l[l.length-1];var h=[];s=e.CFF.readIndex(i,s,h);var p=[];for(d=0;d<h.length-1;d++)p.push(e.CFF.readDict(i,s+h[d],s+h[d+1]));s+=h[h.length-1];var f=p[0],m=[];s=e.CFF.readIndex(i,s,m);var x=[];for(d=0;d<m.length-1;d++)x.push(o.readASCII(i,s+m[d],m[d+1]-m[d]));if(s+=m[m.length-1],e.CFF.readSubrs(i,s,f),f.CharStrings){s=f.CharStrings,m=[],s=e.CFF.readIndex(i,s,m);var v=[];for(d=0;d<m.length-1;d++)v.push(o.readBytes(i,s+m[d],m[d+1]-m[d]));f.CharStrings=v}if(f.ROS){s=f.FDArray;var g=[];for(s=e.CFF.readIndex(i,s,g),f.FDArray=[],d=0;d<g.length-1;d++){var b=e.CFF.readDict(i,s+g[d],s+g[d+1]);e.CFF._readFDict(i,b,x),f.FDArray.push(b)}s+=g[g.length-1],s=f.FDSelect,f.FDSelect=[];var y=i[s];if(s++,y!=3)throw y;var S=o.readUshort(i,s);for(s+=2,d=0;d<S+1;d++)f.FDSelect.push(o.readUshort(i,s),i[s+2]),s+=3}return f.Encoding&&(f.Encoding=e.CFF.readEncoding(i,f.Encoding,f.CharStrings.length)),f.charset&&(f.charset=e.CFF.readCharset(i,f.charset,f.CharStrings.length)),e.CFF._readFDict(i,f,x),f},e.CFF._readFDict=function(i,s,a){var o;for(var l in s.Private&&(o=s.Private[1],s.Private=e.CFF.readDict(i,o,o+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(i,o+s.Private.Subrs,s.Private)),s)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(s[l]=a[s[l]-426+35])},e.CFF.readSubrs=function(i,s,a){var o=e._bin,l=[];s=e.CFF.readIndex(i,s,l);var u,d=l.length;u=d<1240?107:d<33900?1131:32768,a.Bias=u,a.Subrs=[];for(var h=0;h<l.length-1;h++)a.Subrs.push(o.readBytes(i,s+l[h],l[h+1]-l[h]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(i,s){for(var a=0;a<i.charset.length;a++)if(i.charset[a]==s)return a;return-1},e.CFF.glyphBySE=function(i,s){return s<0||s>
4722255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[s])},e.CFF.readEncoding=function(i,s,a){e._bin;var o=[".notdef"],l=i[s];if(s++,l!=0)throw"error: unknown encoding format: "+l;var u=i[s];s++;for(var d=0;d<u;d++)o.push(i[s+d]);return o},e.CFF.readCharset=function(i,s,a){var o=e._bin,l=[".notdef"],u=i[s];if(s++,u==0)for(var d=0;d<a;d++){var h=o.readUshort(i,s);s+=2,l.push(h)}else{if(u!=1&&u!=2)throw"error: format: "+u;for(;l.length<a;){h=o.readUshort(i,s),s+=2;var p=0;for(u==1?(p=i[s],s++):(p=o.readUshort(i,s),s+=2),d=0;d<=p;d++)l.push(h),h++}}return l},e.CFF.readIndex=function(i,s,a){var o=e._bin,l=o.readUshort(i,s)+1,u=i[s+=2];if(s++,u==1)for(var d=0;d<l;d++)a.push(i[s+d]);else if(u==2)for(d=0;d<l;d++)a.push(o.readUshort(i,s+2*d));else if(u==3)for(d=0;d<l;d++)a.push(16777215&o.readUint(i,s+3*d-1));else if(l!=1)throw"unsupported offset size: "+u+", count: "+l;return(s+=l*u)-1},e.CFF.getCharString=function(i,s,a){var o=e._bin,l=i[s],u=i[s+1];i[s+2],i[s+3],i[s+4];var d=1,h=null,p=null;l<=20&&(h=l,d=1),l==12&&(h=100*l+u,d=2),21<=l&&l<=27&&(h=l,d=1),l==28&&(p=o.readShort(i,s+1),d=3),29<=l&&l<=31&&(h=l,d=1),32<=l&&l<=246&&(p=l-139,d=1),247<=l&&l<=250&&(p=256*(l-247)+u+108,d=2),251<=l&&l<=254&&(p=256*-(l-251)-u-108,d=2),l==255&&(p=o.readInt(i,s+1)/65535,d=5),a.val=p??"o"+h,a.size=d},e.CFF.readCharString=function(i,s,a){for(var o=s+a,l=e._bin,u=[];s<o;){var d=i[s],h=i[s+1];i[s+2],i[s+3],i[s+4];var p=1,f=null,m=null;d<=20&&(f=d,p=1),d==12&&(f=100*d+h,p=2),d!=19&&d!=20||(f=d,p=2),21<=d&&d<=27&&(f=d,p=1),d==28&&(m=l.readShort(i,s+1),p=3),29<=d&&d<=31&&(f=d,p=1),32<=d&&d<=246&&(m=d-139,p=1),247<=d&&d<=250&&(m=256*(d-247)+h+108,p=2),251<=d&&d<=254&&(m=256*-(d-251)-h-108,p=2),d==255&&(m=l.readInt(i,s+1)/65535,p=5),u.push(m??"o"+f),s+=p}return u},e.CFF.readDict=function(i,s,a){for(var o=e._bin,l={},u=[];s<a;){var d=i[s],h=i[s+1];i[s+2],i[s+3],i[s+4];var p=1,f=null,m=null;if(d==28&&(m=o.readShort(i,s+1),p=3),d==29&&(m=o.readInt(i,s+1),p=5),32<=d&&d<=246&&(m=d-139,p=1),247<=d&&d<=250&&(m=256*(d-247)+h+108,p=2),251<=d&&d<=254&&(m=256*-(d-251)-h-108,p=2),d==255)throw m=o.readInt(i,s+1)/65535,p=5,"unknown number";if(d==30){var x=[];for(p=1;;){var v=i[s+p];p++;var g=v>>4,b=15&v;if(g!=15&&x.push(g),b!=15&&x.push(b),b==15)break}for(var y="",S=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],A=0;A<x.length;A++)y+=S[x[A]];m=parseFloat(y)}d<=21&&(f=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][d],p=1,d==12&&(f=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][h],p=2)),f!=null?(l[f]=u.length==1?u[0]:u,u=[]):u.push(m),s+=p}return l},e.cmap={},e.cmap.parse=function(i,s,a){i=new Uint8Array(i.buffer,s,a),s=0;var o=e._bin,l={};o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2;var d=[];l.tables=[];for(var h=0;h<u;h++){var p=o.readUshort(i,s);s+=2;var f=o.readUshort(i,s);s+=2;var m=o.readUint(i,s);s+=4;var x="p"+p+"e"+f,v=d.indexOf(m);if(v==-1){var g;v=l.tables.length,d.push(m);var b=o.readUshort(i,m);b==0?g=e.cmap.parse0(i,m):b==4?g=e.cmap.parse4(i,m):b==6?g=e.cmap.parse6(i,m):b==12?g=e.cmap.parse12(i,m):console.debug("unknown format: "+b,p,f,m),l.tables.push(g)}if(l[x]!=null)throw"multiple tables for one platform+encoding";l[x]=v}return l},e.cmap.parse0=function(i,s){var a=e._bin,o={};o.format=a.readUshort(i,s),s+=2;var l=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2,o.map=[];for(var u=0;u<l-6;u++)o.map.push(i[s+u]);return o},e.cmap.parse4=function(i,s){var a=e._bin,o=s,l={};l.format=a.readUshort(i,s),s+=2;var u=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2;var d=a.readUshort(i,s);s+=2;var h=d/2;
4722l.searchRange=a.readUshort(i,s),s+=2,l.entrySelector=a.readUshort(i,s),s+=2,l.rangeShift=a.readUshort(i,s),s+=2,l.endCount=a.readUshorts(i,s,h),s+=2*h,s+=2,l.startCount=a.readUshorts(i,s,h),s+=2*h,l.idDelta=[];for(var p=0;p<h;p++)l.idDelta.push(a.readShort(i,s)),s+=2;for(l.idRangeOffset=a.readUshorts(i,s,h),s+=2*h,l.glyphIdArray=[];s<o+u;)l.glyphIdArray.push(a.readUshort(i,s)),s+=2;return l},e.cmap.parse6=function(i,s){var a=e._bin,o={};o.format=a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,o.firstCode=a.readUshort(i,s),s+=2;var l=a.readUshort(i,s);s+=2,o.glyphIdArray=[];for(var u=0;u<l;u++)o.glyphIdArray.push(a.readUshort(i,s)),s+=2;return o},e.cmap.parse12=function(i,s){var a=e._bin,o={};o.format=a.readUshort(i,s),s+=2,s+=2,a.readUint(i,s),s+=4,a.readUint(i,s),s+=4;var l=a.readUint(i,s);s+=4,o.groups=[];for(var u=0;u<l;u++){var d=s+12*u,h=a.readUint(i,d+0),p=a.readUint(i,d+4),f=a.readUint(i,d+8);o.groups.push([h,p,f])}return o},e.glyf={},e.glyf.parse=function(i,s,a,o){for(var l=[],u=0;u<o.maxp.numGlyphs;u++)l.push(null);return l},e.glyf._parseGlyf=function(i,s){var a=e._bin,o=i._data,l=e._tabOffset(o,"glyf",i._offset)+i.loca[s];if(i.loca[s]==i.loca[s+1])return null;var u={};if(u.noc=a.readShort(o,l),l+=2,u.xMin=a.readShort(o,l),l+=2,u.yMin=a.readShort(o,l),l+=2,u.xMax=a.readShort(o,l),l+=2,u.yMax=a.readShort(o,l),l+=2,u.xMin>=u.xMax||u.yMin>=u.yMax)return null;if(u.noc>0){u.endPts=[];for(var d=0;d<u.noc;d++)u.endPts.push(a.readUshort(o,l)),l+=2;var h=a.readUshort(o,l);if(l+=2,o.length-l<h)return null;u.instructions=a.readBytes(o,l,h),l+=h;var p=u.endPts[u.noc-1]+1;for(u.flags=[],d=0;d<p;d++){var f=o[l];if(l++,u.flags.push(f),(8&f)!=0){var m=o[l];l++;for(var x=0;x<m;x++)u.flags.push(f),d++}}for(u.xs=[],d=0;d<p;d++){var v=(2&u.flags[d])!=0,g=(16&u.flags[d])!=0;v?(u.xs.push(g?o[l]:-o[l]),l++):g?u.xs.push(0):(u.xs.push(a.readShort(o,l)),l+=2)}for(u.ys=[],d=0;d<p;d++)v=(4&u.flags[d])!=0,g=(32&u.flags[d])!=0,v?(u.ys.push(g?o[l]:-o[l]),l++):g?u.ys.push(0):(u.ys.push(a.readShort(o,l)),l+=2);var b=0,y=0;for(d=0;d<p;d++)b+=u.xs[d],y+=u.ys[d],u.xs[d]=b,u.ys[d]=y}else{var S;u.parts=[];do{S=a.readUshort(o,l),l+=2;var A={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(u.parts.push(A),A.glyphIndex=a.readUshort(o,l),l+=2,1&S){var k=a.readShort(o,l);l+=2;var M=a.readShort(o,l);l+=2}else k=a.readInt8(o,l),l++,M=a.readInt8(o,l),l++;2&S?(A.m.tx=k,A.m.ty=M):(A.p1=k,A.p2=M),8&S?(A.m.a=A.m.d=a.readF2dot14(o,l),l+=2):64&S?(A.m.a=a.readF2dot14(o,l),l+=2,A.m.d=a.readF2dot14(o,l),l+=2):128&S&&(A.m.a=a.readF2dot14(o,l),l+=2,A.m.b=a.readF2dot14(o,l),l+=2,A.m.c=a.readF2dot14(o,l),l+=2,A.m.d=a.readF2dot14(o,l),l+=2)}while(32&S);if(256&S){var T=a.readUshort(o,l);for(l+=2,u.instr=[],d=0;d<T;d++)u.instr.push(o[l]),l++}}return u},e.GDEF={},e.GDEF.parse=function(i,s,a,o){var l=s;s+=4;var u=e._bin.readUshort(i,s);return{glyphClassDef:u===0?null:e._lctf.readClassDef(i,l+u)}},e.GPOS={},e.GPOS.parse=function(i,s,a,o){return e._lctf.parse(i,s,a,o,e.GPOS.subt)},e.GPOS.subt=function(i,s,a,o){var l=e._bin,u=a,d={};if(d.fmt=l.readUshort(i,a),a+=2,s==1||s==2||s==3||s==7||s==8&&d.fmt<=2){var h=l.readUshort(i,a);a+=2,d.coverage=e._lctf.readCoverage(i,h+u)}if(s==1&&d.fmt==1){var p=l.readUshort(i,a);a+=2,p!=0&&(d.pos=e.GPOS.readValueRecord(i,a,p))}else if(s==2&&d.fmt>=1&&d.fmt<=2){p=l.readUshort(i,a),a+=2;var f=l.readUshort(i,a);a+=2;var m=e._lctf.numOfOnes(p),x=e._lctf.numOfOnes(f);if(d.fmt==1){d.pairsets=[];var v=l.readUshort(i,a);a+=2;for(var g=0;g<v;g++){var b=u+l.readUshort(i,a);a+=2;var y=l.readUshort(i,b);b+=2;for(var S=[],A=0;A<y;A++){var k=l.readUshort(i,b);b+=2,p!=0&&(j=e.GPOS.readValueRecord(i,b,p),b+=2*m),f!=0&&(G=e.GPOS.readValueRecord(i,b,f),b+=2*x),S.push({gid2:k,val1:j,val2:G})}d.pairsets.push(S)}}if(d.fmt==2){var M=l.readUshort(i,a);a+=2;var T=l.readUshort(i,a);a+=2;var C=l.readUshort(i,a);a+=2;var R=l.readUshort(i,a);for(a+=2,d.classDef1=e._lctf.readClassDef(i,u+M),d.classDef2=e._lctf.readClassDef(i,u+T),d.matrix=[],g=0;g<C;g++){var P=[];for(A=0;A<R;A++){var j=null,G=null;p!=0&&(j=e.GPOS.readValueRecord(i,a,p),a+=2*m),f!=0&&(G=e.GPOS.readValueRecord(i,a,f),a+=2*x),P.push({val1:j,val2:G})}d.matrix.push(P)}}}else if(s==4&&d.fmt==1)d.markCoverage=e._lctf.readCoverage(i,l.readUshort(i,a)+u),d.baseCoverage=e._lctf.readCoverage(i,l.readUshort(i,a+2)+u),d.markClassCount=l.readUshort(i,a+4),d.markArray=e.GPOS.readMarkArray(i,l.readUshort(i,a+6)+u),d.baseArray=e.GPOS.readBaseArray(i,l.readUshort(i,a+8)+u,d.markClassCount);else if(s==6&&d.fmt==1)d.mark1Coverage=e._lctf.readCoverage(i,l.readUshort(i,a)+u),d.mark2Coverage=e._lctf.readCoverage(i,l.readUshort(i,a+2)+u),d.markClassCount=l.readUshort(i,a+4),d.mark1Array=e.GPOS.readMarkArray(i,l.readUshort(i,a+6)+u),d.mark2Array=e.GPOS.readBaseArray(i,l.readUshort(i,a+8)+u,d.markClassCount);else{if(s==9&&d.fmt==1){var B=l.readUshort(i,a);a+=2;var $=l.readUint(i,a);if(a+=4,o.ltype==9)o.ltype=B;else if(o.ltype!=B)throw"invalid extension substitution";return e.GPOS.subt(i,o.ltype,u+$)}console.debug("unsupported GPOS table LookupType",s,"format",d.fmt)}return d},e.GPOS.readValueRecord=function(i,s,a){var o=e._bin,l=[];return l.push(1&a?o.readShort(i,s):0),s+=1&a?2:0,l.push(2&a?o.readShort(i,s):0),s+=2&a?2:0,l.push(4&a?o.readShort(i,s):0),s+=4&a?2:0,l.push(8&a?o.readShort(i,s):0),s+=8&a?2:0,l},e.GPOS.readBaseArray=function(i,s,a){var o=e._bin,l=[],u=s,d=o.readUshort(i,s);s+=2;for(var h=0;h<d;h++){for(var p=[],f=0;f<a;f++)p.push(e.GPOS.readAnchorRecord(i,u+o.readUshort(i,s))),s+=2;l.push(p)}return l},e.GPOS.readMarkArray=function(i,s){var a=e._bin,o=[],l=s,u=a.readUshort(i,s);s+=2;for(var d=0;d<u;d++){var h=e.GPOS.readAnchorRecord(i,a.readUshort(i,s+2)+l);h.markClass=a.readUshort(i,s),o.push(h),s+=4}return o},e.GPOS.readAnchorRecord=function(i,s){var a=e._bin,o={};return o.fmt=a.readUshort(i,s),o.x=a.readShort(i,s+2),o.y=a.readShort(i,s+4),o},e.GSUB={},e.GSUB.parse=function(i,s,a,o){return e._lctf.parse(i,s,a,o,e.GSUB.subt)},e.GSUB.subt=function(i,s,a,o){var l=e._bin,u=a,d={};
4722if(d.fmt=l.readUshort(i,a),a+=2,s!=1&&s!=2&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==2||s==4||s==5&&d.fmt<=2||s==6&&d.fmt<=2){var h=l.readUshort(i,a);a+=2,d.coverage=e._lctf.readCoverage(i,u+h)}if(s==1&&d.fmt>=1&&d.fmt<=2){if(d.fmt==1)d.delta=l.readShort(i,a),a+=2;else if(d.fmt==2){var p=l.readUshort(i,a);a+=2,d.newg=l.readUshorts(i,a,p),a+=2*d.newg.length}}else if(s==2&&d.fmt==1){p=l.readUshort(i,a),a+=2,d.seqs=[];for(var f=0;f<p;f++){var m=l.readUshort(i,a)+u;a+=2;var x=l.readUshort(i,m);d.seqs.push(l.readUshorts(i,m+2,x))}}else if(s==4)for(d.vals=[],p=l.readUshort(i,a),a+=2,f=0;f<p;f++){var v=l.readUshort(i,a);a+=2,d.vals.push(e.GSUB.readLigatureSet(i,u+v))}else if(s==5&&d.fmt==2){if(d.fmt==2){var g=l.readUshort(i,a);a+=2,d.cDef=e._lctf.readClassDef(i,u+g),d.scset=[];var b=l.readUshort(i,a);for(a+=2,f=0;f<b;f++){var y=l.readUshort(i,a);a+=2,d.scset.push(y==0?null:e.GSUB.readSubClassSet(i,u+y))}}}else if(s==6&&d.fmt==3){if(d.fmt==3){for(f=0;f<3;f++){p=l.readUshort(i,a),a+=2;for(var S=[],A=0;A<p;A++)S.push(e._lctf.readCoverage(i,u+l.readUshort(i,a+2*A)));a+=2*p,f==0&&(d.backCvg=S),f==1&&(d.inptCvg=S),f==2&&(d.ahedCvg=S)}p=l.readUshort(i,a),a+=2,d.lookupRec=e.GSUB.readSubstLookupRecords(i,a,p)}}else{if(s==7&&d.fmt==1){var k=l.readUshort(i,a);a+=2;var M=l.readUint(i,a);if(a+=4,o.ltype==9)o.ltype=k;else if(o.ltype!=k)throw"invalid extension substitution";return e.GSUB.subt(i,o.ltype,u+M)}console.debug("unsupported GSUB table LookupType",s,"format",d.fmt)}return d},e.GSUB.readSubClassSet=function(i,s){var a=e._bin.readUshort,o=s,l=[],u=a(i,s);s+=2;for(var d=0;d<u;d++){var h=a(i,s);s+=2,l.push(e.GSUB.readSubClassRule(i,o+h))}return l},e.GSUB.readSubClassRule=function(i,s){var a=e._bin.readUshort,o={},l=a(i,s),u=a(i,s+=2);s+=2,o.input=[];for(var d=0;d<l-1;d++)o.input.push(a(i,s)),s+=2;return o.substLookupRecords=e.GSUB.readSubstLookupRecords(i,s,u),o},e.GSUB.readSubstLookupRecords=function(i,s,a){for(var o=e._bin.readUshort,l=[],u=0;u<a;u++)l.push(o(i,s),o(i,s+2)),s+=4;return l},e.GSUB.readChainSubClassSet=function(i,s){var a=e._bin,o=s,l=[],u=a.readUshort(i,s);s+=2;for(var d=0;d<u;d++){var h=a.readUshort(i,s);s+=2,l.push(e.GSUB.readChainSubClassRule(i,o+h))}return l},e.GSUB.readChainSubClassRule=function(i,s){for(var a=e._bin,o={},l=["backtrack","input","lookahead"],u=0;u<l.length;u++){var d=a.readUshort(i,s);s+=2,u==1&&d--,o[l[u]]=a.readUshorts(i,s,d),s+=2*o[l[u]].length}return d=a.readUshort(i,s),s+=2,o.subst=a.readUshorts(i,s,2*d),s+=2*o.subst.length,o},e.GSUB.readLigatureSet=function(i,s){var a=e._bin,o=s,l=[],u=a.readUshort(i,s);s+=2;for(var d=0;d<u;d++){var h=a.readUshort(i,s);s+=2,l.push(e.GSUB.readLigature(i,o+h))}return l},e.GSUB.readLigature=function(i,s){var a=e._bin,o={chain:[]};o.nglyph=a.readUshort(i,s),s+=2;var l=a.readUshort(i,s);s+=2;for(var u=0;u<l-1;u++)o.chain.push(a.readUshort(i,s)),s+=2;return o},e.head={},e.head.parse=function(i,s,a){var o=e._bin,l={};return o.readFixed(i,s),s+=4,l.fontRevision=o.readFixed(i,s),s+=4,o.readUint(i,s),s+=4,o.readUint(i,s),s+=4,l.flags=o.readUshort(i,s),s+=2,l.unitsPerEm=o.readUshort(i,s),s+=2,l.created=o.readUint64(i,s),s+=8,l.modified=o.readUint64(i,s),s+=8,l.xMin=o.readShort(i,s),s+=2,l.yMin=o.readShort(i,s),s+=2,l.xMax=o.readShort(i,s),s+=2,l.yMax=o.readShort(i,s),s+=2,l.macStyle=o.readUshort(i,s),s+=2,l.lowestRecPPEM=o.readUshort(i,s),s+=2,l.fontDirectionHint=o.readShort(i,s),s+=2,l.indexToLocFormat=o.readShort(i,s),s+=2,l.glyphDataFormat=o.readShort(i,s),s+=2,l},e.hhea={},e.hhea.parse=function(i,s,a){var o=e._bin,l={};return o.readFixed(i,s),s+=4,l.ascender=o.readShort(i,s),s+=2,l.descender=o.readShort(i,s),s+=2,l.lineGap=o.readShort(i,s),s+=2,l.advanceWidthMax=o.readUshort(i,s),s+=2,l.minLeftSideBearing=o.readShort(i,s),s+=2,l.minRightSideBearing=o.readShort(i,s),s+=2,l.xMaxExtent=o.readShort(i,s),s+=2,l.caretSlopeRise=o.readShort(i,s),s+=2,l.caretSlopeRun=o.readShort(i,s),s+=2,l.caretOffset=o.readShort(i,s),s+=2,s+=8,l.metricDataFormat=o.readShort(i,s),s+=2,l.numberOfHMetrics=o.readUshort(i,s),s+=2,l},e.hmtx={},e.hmtx.parse=function(i,s,a,o){for(var l=e._bin,u={aWidth:[],lsBearing:[]},d=0,h=0,p=0;p<o.maxp.numGlyphs;p++)p<o.hhea.numberOfHMetrics&&(d=l.readUshort(i,s),s+=2,h=l.readShort(i,s),s+=2),u.aWidth.push(d),u.lsBearing.push(h);return u},e.kern={},e.kern.parse=function(i,s,a,o){var l=e._bin,u=l.readUshort(i,s);if(s+=2,u==1)return e.kern.parseV1(i,s-2,a,o);var d=l.readUshort(i,s);s+=2;for(var h={glyph1:[],rval:[]},p=0;p<d;p++){s+=2,a=l.readUshort(i,s),s+=2;var f=l.readUshort(i,s);s+=2;var m=f>>>8;if((m&=15)!=0)throw"unknown kern table format: "+m;s=e.kern.readFormat0(i,s,h)}return h},e.kern.parseV1=function(i,s,a,o){var l=e._bin;l.readFixed(i,s),s+=4;var u=l.readUint(i,s);s+=4;for(var d={glyph1:[],rval:[]},h=0;h<u;h++){l.readUint(i,s),s+=4;var p=l.readUshort(i,s);s+=2,l.readUshort(i,s),s+=2;var f=p>>>8;if((f&=15)!=0)throw"unknown kern table format: "+f;s=e.kern.readFormat0(i,s,d)}return d},e.kern.readFormat0=function(i,s,a){var o=e._bin,l=-1,u=o.readUshort(i,s);s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2,o.readUshort(i,s),s+=2;for(var d=0;d<u;d++){var h=o.readUshort(i,s);s+=2;var p=o.readUshort(i,s);s+=2;var f=o.readShort(i,s);s+=2,h!=l&&(a.glyph1.push(h),a.rval.push({glyph2:[],vals:[]}));var m=a.rval[a.rval.length-1];m.glyph2.push(p),m.vals.push(f),l=h}return s},e.loca={},e.loca.parse=function(i,s,a,o){var l=e._bin,u=[],d=o.head.indexToLocFormat,h=o.maxp.numGlyphs+1;if(d==0)for(var p=0;p<h;p++)u.push(l.readUshort(i,s+(p<<1))<<1);if(d==1)for(p=0;p<h;p++)u.push(l.readUint(i,s+(p<<2)));return u},e.maxp={},e.maxp.parse=function(i,s,a){var o=e._bin,l={},u=o.readUint(i,s);return s+=4,l.numGlyphs=o.readUshort(i,s),s+=2,u==65536&&(l.maxPoints=o.readUshort(i,s),s+=2,l.maxContours=o.readUshort(i,s),s+=2,l.maxCompositePoints=o.readUshort(i,s),s+=2,l.maxCompositeContours=o.readUshort(i,s),s+=2,l.maxZones=o.readUshort(i,s),s+=2,l.maxTwilightPoints=o.readUshort(i,s),s+=2,l.maxStorage=o.readUshort(i,s),s+=2,l.maxFunctionDefs=o.readUshort(i,s),s+=2,l.maxInstructionDefs=o.readUshort(i,s),s+=2,l.maxStackElements=o.readUshort(i,s),s+=2,l.maxSizeOfInstru
4722ctions=o.readUshort(i,s),s+=2,l.maxComponentElements=o.readUshort(i,s),s+=2,l.maxComponentDepth=o.readUshort(i,s),s+=2),l},e.name={},e.name.parse=function(i,s,a){var o=e._bin,l={};o.readUshort(i,s),s+=2;var u=o.readUshort(i,s);s+=2,o.readUshort(i,s);for(var d,h=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],p=s+=2,f=0;f<u;f++){var m=o.readUshort(i,s);s+=2;var x=o.readUshort(i,s);s+=2;var v=o.readUshort(i,s);s+=2;var g=o.readUshort(i,s);s+=2;var b=o.readUshort(i,s);s+=2;var y=o.readUshort(i,s);s+=2;var S,A=h[g],k=p+12*u+y;if(m==0)S=o.readUnicode(i,k,b/2);else if(m==3&&x==0)S=o.readUnicode(i,k,b/2);else if(x==0)S=o.readASCII(i,k,b);else if(x==1)S=o.readUnicode(i,k,b/2);else if(x==3)S=o.readUnicode(i,k,b/2);else{if(m!=1)throw"unknown encoding "+x+", platformID: "+m;S=o.readASCII(i,k,b),console.debug("reading unknown MAC encoding "+x+" as ASCII")}var M="p"+m+","+v.toString(16);l[M]==null&&(l[M]={}),l[M][A!==void 0?A:g]=S,l[M]._lang=v}for(var T in l)if(l[T].postScriptName!=null&&l[T]._lang==1033)return l[T];for(var T in l)if(l[T].postScriptName!=null&&l[T]._lang==0)return l[T];for(var T in l)if(l[T].postScriptName!=null&&l[T]._lang==3084)return l[T];for(var T in l)if(l[T].postScriptName!=null)return l[T];for(var T in l){d=T;break}return console.debug("returning name table with languageID "+l[d]._lang),l[d]},e["OS/2"]={},e["OS/2"].parse=function(i,s,a){var o=e._bin.readUshort(i,s);s+=2;var l={};if(o==0)e["OS/2"].version0(i,s,l);else if(o==1)e["OS/2"].version1(i,s,l);else if(o==2||o==3||o==4)e["OS/2"].version2(i,s,l);else{if(o!=5)throw"unknown OS/2 table version: "+o;e["OS/2"].version5(i,s,l)}return l},e["OS/2"].version0=function(i,s,a){var o=e._bin;return a.xAvgCharWidth=o.readShort(i,s),s+=2,a.usWeightClass=o.readUshort(i,s),s+=2,a.usWidthClass=o.readUshort(i,s),s+=2,a.fsType=o.readUshort(i,s),s+=2,a.ySubscriptXSize=o.readShort(i,s),s+=2,a.ySubscriptYSize=o.readShort(i,s),s+=2,a.ySubscriptXOffset=o.readShort(i,s),s+=2,a.ySubscriptYOffset=o.readShort(i,s),s+=2,a.ySuperscriptXSize=o.readShort(i,s),s+=2,a.ySuperscriptYSize=o.readShort(i,s),s+=2,a.ySuperscriptXOffset=o.readShort(i,s),s+=2,a.ySuperscriptYOffset=o.readShort(i,s),s+=2,a.yStrikeoutSize=o.readShort(i,s),s+=2,a.yStrikeoutPosition=o.readShort(i,s),s+=2,a.sFamilyClass=o.readShort(i,s),s+=2,a.panose=o.readBytes(i,s,10),s+=10,a.ulUnicodeRange1=o.readUint(i,s),s+=4,a.ulUnicodeRange2=o.readUint(i,s),s+=4,a.ulUnicodeRange3=o.readUint(i,s),s+=4,a.ulUnicodeRange4=o.readUint(i,s),s+=4,a.achVendID=[o.readInt8(i,s),o.readInt8(i,s+1),o.readInt8(i,s+2),o.readInt8(i,s+3)],s+=4,a.fsSelection=o.readUshort(i,s),s+=2,a.usFirstCharIndex=o.readUshort(i,s),s+=2,a.usLastCharIndex=o.readUshort(i,s),s+=2,a.sTypoAscender=o.readShort(i,s),s+=2,a.sTypoDescender=o.readShort(i,s),s+=2,a.sTypoLineGap=o.readShort(i,s),s+=2,a.usWinAscent=o.readUshort(i,s),s+=2,a.usWinDescent=o.readUshort(i,s),s+=2},e["OS/2"].version1=function(i,s,a){var o=e._bin;return s=e["OS/2"].version0(i,s,a),a.ulCodePageRange1=o.readUint(i,s),s+=4,a.ulCodePageRange2=o.readUint(i,s),s+=4},e["OS/2"].version2=function(i,s,a){var o=e._bin;return s=e["OS/2"].version1(i,s,a),a.sxHeight=o.readShort(i,s),s+=2,a.sCapHeight=o.readShort(i,s),s+=2,a.usDefault=o.readUshort(i,s),s+=2,a.usBreak=o.readUshort(i,s),s+=2,a.usMaxContext=o.readUshort(i,s),s+=2},e["OS/2"].version5=function(i,s,a){var o=e._bin;return s=e["OS/2"].version2(i,s,a),a.usLowerOpticalPointSize=o.readUshort(i,s),s+=2,a.usUpperOpticalPointSize=o.readUshort(i,s),s+=2},e.post={},e.post.parse=function(i,s,a){var o=e._bin,l={};return l.version=o.readFixed(i,s),s+=4,l.italicAngle=o.readFixed(i,s),s+=4,l.underlinePosition=o.readShort(i,s),s+=2,l.underlineThickness=o.readShort(i,s),s+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(i,s){var a=i.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var l=a.tables[o];if(l.format==0)return s>=l.map.length?0:l.map[s];if(l.format==4){for(var u=-1,d=0;d<l.endCount.length;d++)if(s<=l.endCount[d]){u=d;break}return u==-1||l.startCount[u]>s?0:65535&(l.idRangeOffset[u]!=0?l.glyphIdArray[s-l.startCount[u]+(l.idRangeOffset[u]>>1)-(l.idRangeOffset.length-u)]:s+l.idDelta[u])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(d=0;d<l.groups.length;d++){var h=l.groups[d];
4722if(h[0]<=s&&s<=h[1])return h[2]+(s-h[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(i,s){var a={cmds:[],crds:[]};if(i.SVG&&i.SVG.entries[s]){var o=i.SVG.entries[s];return o==null?a:(typeof o=="string"&&(o=e.SVG.toPath(o),i.SVG.entries[s]=o),o)}if(i.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:i.CFF.Private?i.CFF.Private.defaultWidthX:0,open:!1},u=i.CFF,d=i.CFF.Private;if(u.ROS){for(var h=0;u.FDSelect[h+2]<=s;)h+=2;d=u.FDArray[u.FDSelect[h+1]].Private}e.U._drawCFF(i.CFF.CharStrings[s],l,u,d,a)}else i.glyf&&e.U._drawGlyf(s,i,a);return a},e.U._drawGlyf=function(i,s,a){var o=s.glyf[i];o==null&&(o=s.glyf[i]=e.glyf._parseGlyf(s,i)),o!=null&&(o.noc>-1?e.U._simpleGlyph(o,a):e.U._compoGlyph(o,s,a))},e.U._simpleGlyph=function(i,s){for(var a=0;a<i.noc;a++){for(var o=a==0?0:i.endPts[a-1]+1,l=i.endPts[a],u=o;u<=l;u++){var d=u==o?l:u-1,h=u==l?o:u+1,p=1&i.flags[u],f=1&i.flags[d],m=1&i.flags[h],x=i.xs[u],v=i.ys[u];if(u==o)if(p){if(!f){e.U.P.moveTo(s,x,v);continue}e.U.P.moveTo(s,i.xs[d],i.ys[d])}else f?e.U.P.moveTo(s,i.xs[d],i.ys[d]):e.U.P.moveTo(s,(i.xs[d]+x)/2,(i.ys[d]+v)/2);p?f&&e.U.P.lineTo(s,x,v):m?e.U.P.qcurveTo(s,x,v,i.xs[h],i.ys[h]):e.U.P.qcurveTo(s,x,v,(x+i.xs[h])/2,(v+i.ys[h])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(i,s,a){for(var o=0;o<i.parts.length;o++){var l={cmds:[],crds:[]},u=i.parts[o];e.U._drawGlyf(u.glyphIndex,s,l);for(var d=u.m,h=0;h<l.crds.length;h+=2){var p=l.crds[h],f=l.crds[h+1];a.crds.push(p*d.a+f*d.b+d.tx),a.crds.push(p*d.c+f*d.d+d.ty)}for(h=0;h<l.cmds.length;h++)a.cmds.push(l.cmds[h])}},e.U._getGlyphClass=function(i,s){var a=e._lctf.getInterval(s,i);return a==-1?0:s[a+2]},e.U._applySubs=function(i,s,a,o){for(var l=i.length-s-1,u=0;u<a.tabs.length;u++)if(a.tabs[u]!=null){var d,h=a.tabs[u];if(!h.coverage||(d=e._lctf.coverageIndex(h.coverage,i[s]))!=-1){if(a.ltype==1)i[s],h.fmt==1?i[s]=i[s]+h.delta:i[s]=h.newg[d];else if(a.ltype==4)for(var p=h.vals[d],f=0;f<p.length;f++){var m=p[f],x=m.chain.length;if(!(x>l)){for(var v=!0,g=0,b=0;b<x;b++){for(;i[s+g+(1+b)]==-1;)g++;m.chain[b]!=i[s+g+(1+b)]&&(v=!1)}if(v){for(i[s]=m.nglyph,b=0;b<x+g;b++)i[s+b+1]=-1;break}}}else if(a.ltype==5&&h.fmt==2)for(var y=e._lctf.getInterval(h.cDef,i[s]),S=h.cDef[y+2],A=h.scset[S],k=0;k<A.length;k++){var M=A[k],T=M.input;if(!(T.length>l)){for(v=!0,b=0;b<T.length;b++){var C=e._lctf.getInterval(h.cDef,i[s+1+b]);if(y==-1&&h.cDef[C+2]!=T[b]){v=!1;break}}if(v){var R=M.substLookupRecords;for(f=0;f<R.length;f+=2)R[f],R[f+1]}}}else if(a.ltype==6&&h.fmt==3){if(!e.U._glsCovered(i,h.backCvg,s-h.backCvg.length)||!e.U._glsCovered(i,h.inptCvg,s)||!e.U._glsCovered(i,h.ahedCvg,s+h.inptCvg.length))continue;var P=h.lookupRec;for(k=0;k<P.length;k+=2){y=P[k];var j=o[P[k+1]];e.U._applySubs(i,s+y,j,o)}}}}},e.U._glsCovered=function(i,s,a){for(var o=0;o<s.length;o++)if(e._lctf.coverageIndex(s[o],i[a+o])==-1)return!1;return!0},e.U.glyphsToPath=function(i,s,a){for(var o={cmds:[],crds:[]},l=0,u=0;u<s.length;u++){var d=s[u];if(d!=-1){for(var h=u<s.length-1&&s[u+1]!=-1?s[u+1]:0,p=e.U.glyphToPath(i,d),f=0;f<p.crds.length;f+=2)o.crds.push(p.crds[f]+l),o.crds.push(p.crds[f+1]);for(a&&o.cmds.push(a),f=0;f<p.cmds.length;f++)o.cmds.push(p.cmds[f]);a&&o.cmds.push("X"),l+=i.hmtx.aWidth[d],u<s.length-1&&(l+=e.U.getPairAdjustment(i,d,h))}}return o},e.U.P={},e.U.P.moveTo=function(i,s,a){i.cmds.push("M"),i.crds.push(s,a)},e.U.P.lineTo=function(i,s,a){i.cmds.push("L"),i.crds.push(s,a)},e.U.P.curveTo=function(i,s,a,o,l,u,d){i.cmds.push("C"),i.crds.push(s,a,o,l,u,d)},e.U.P.qcurveTo=function(i,s,a,o,l){i.cmds.push("Q"),i.crds.push(s,a,o,l)},e.U.P.closePath=function(i){i.cmds.push("Z")},e.U._drawCFF=function(i,s,a,o,l){for(var u=s.stack,d=s.nStems,h=s.haveWidth,p=s.width,f=s.open,m=0,x=s.x,v=s.y,g=0,b=0,y=0,S=0,A=0,k=0,M=0,T=0,C=0,R=0,P={val:0,size:0};m<i.length;){e.CFF.getCharString(i,m,P);var j=P.val;if(m+=P.size,j=="o1"||j=="o18")u.length%2!=0&&!h&&(p=u.shift()+o.nominalWidthX),d+=u.length>>1,u.length=0,h=!0;else if(j=="o3"||j=="o23")u.length%2!=0&&!h&&(p=u.shift()+o.nominalWidthX),d+=u.length>>1,u.length=0,h=!0;else if(j=="o4")u.length>1&&!h&&(p=u.shift()+o.nominalWidthX,h=!0),f&&e.U.P.closePath(l),v+=u.pop(),e.U.P.moveTo(l,x,v),f=!0;else if(j=="o5")for(;u.length>0;)x+=u.shift(),v+=u.shift(),e.U.P.lineTo(l,x,v);else if(j=="o6"||j=="o7")for(var G=u.length,B=j=="o6",$=0;$<G;$++){var U=u.shift();B?x+=U:v+=U,B=!B,e.U.P.lineTo(l,x,v)}else if(j=="o8"||j=="o24"){G=u.length;for(var Z=0;Z+6<=G;)g=x+u.shift(),b=v+u.shift(),y=g+u.shift(),S=b+u.shift(),x=y+u.shift(),v=S+u.shift(),e.U.P.curveTo(l,g,b,y,S,x,v),Z+=6;j=="o24"&&(x+=u.shift(),v+=u.shift(),e.U.P.lineTo(l,x,v))}else{if(j=="o11")break;
4722if(j=="o1234"||j=="o1235"||j=="o1236"||j=="o1237")j=="o1234"&&(b=v,y=(g=x+u.shift())+u.shift(),R=S=b+u.shift(),k=S,T=v,x=(M=(A=(C=y+u.shift())+u.shift())+u.shift())+u.shift(),e.U.P.curveTo(l,g,b,y,S,C,R),e.U.P.curveTo(l,A,k,M,T,x,v)),j=="o1235"&&(g=x+u.shift(),b=v+u.shift(),y=g+u.shift(),S=b+u.shift(),C=y+u.shift(),R=S+u.shift(),A=C+u.shift(),k=R+u.shift(),M=A+u.shift(),T=k+u.shift(),x=M+u.shift(),v=T+u.shift(),u.shift(),e.U.P.curveTo(l,g,b,y,S,C,R),e.U.P.curveTo(l,A,k,M,T,x,v)),j=="o1236"&&(g=x+u.shift(),b=v+u.shift(),y=g+u.shift(),R=S=b+u.shift(),k=S,M=(A=(C=y+u.shift())+u.shift())+u.shift(),T=k+u.shift(),x=M+u.shift(),e.U.P.curveTo(l,g,b,y,S,C,R),e.U.P.curveTo(l,A,k,M,T,x,v)),j=="o1237"&&(g=x+u.shift(),b=v+u.shift(),y=g+u.shift(),S=b+u.shift(),C=y+u.shift(),R=S+u.shift(),A=C+u.shift(),k=R+u.shift(),M=A+u.shift(),T=k+u.shift(),Math.abs(M-x)>Math.abs(T-v)?x=M+u.shift():v=T+u.shift(),e.U.P.curveTo(l,g,b,y,S,C,R),e.U.P.curveTo(l,A,k,M,T,x,v));else if(j=="o14"){if(u.length>0&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),u.length==4){var V=u.shift(),W=u.shift(),O=u.shift(),Y=u.shift(),z=e.CFF.glyphBySE(a,O),I=e.CFF.glyphBySE(a,Y);e.U._drawCFF(a.CharStrings[z],s,a,o,l),s.x=V,s.y=W,e.U._drawCFF(a.CharStrings[I],s,a,o,l)}f&&(e.U.P.closePath(l),f=!1)}else if(j=="o19"||j=="o20")u.length%2!=0&&!h&&(p=u.shift()+o.nominalWidthX),d+=u.length>>1,u.length=0,h=!0,m+=d+7>>3;else if(j=="o21")u.length>2&&!h&&(p=u.shift()+o.nominalWidthX,h=!0),v+=u.pop(),x+=u.pop(),f&&e.U.P.closePath(l),e.U.P.moveTo(l,x,v),f=!0;else if(j=="o22")u.length>1&&!h&&(p=u.shift()+o.nominalWidthX,h=!0),x+=u.pop(),f&&e.U.P.closePath(l),e.U.P.moveTo(l,x,v),f=!0;else if(j=="o25"){for(;u.length>6;)x+=u.shift(),v+=u.shift(),e.U.P.lineTo(l,x,v);g=x+u.shift(),b=v+u.shift(),y=g+u.shift(),S=b+u.shift(),x=y+u.shift(),v=S+u.shift(),e.U.P.curveTo(l,g,b,y,S,x,v)}else if(j=="o26")for(u.length%2&&(x+=u.shift());u.length>0;)g=x,b=v+u.shift(),x=y=g+u.shift(),v=(S=b+u.shift())+u.shift(),e.U.P.curveTo(l,g,b,y,S,x,v);else if(j=="o27")for(u.length%2&&(v+=u.shift());u.length>0;)b=v,y=(g=x+u.shift())+u.shift(),S=b+u.shift(),x=y+u.shift(),v=S,e.U.P.curveTo(l,g,b,y,S,x,v);else if(j=="o10"||j=="o29"){var q=j=="o10"?o:a;if(u.length==0)console.debug("error: empty stack");else{var te=u.pop(),se=q.Subrs[te+q.Bias];s.x=x,s.y=v,s.nStems=d,s.haveWidth=h,s.width=p,s.open=f,e.U._drawCFF(se,s,a,o,l),x=s.x,v=s.y,d=s.nStems,h=s.haveWidth,p=s.width,f=s.open}}else if(j=="o30"||j=="o31"){var ie=u.length,le=(Z=0,j=="o31");for(Z+=ie-(G=-3&ie);Z<G;)le?(b=v,y=(g=x+u.shift())+u.shift(),v=(S=b+u.shift())+u.shift(),G-Z==5?(x=y+u.shift(),Z++):x=y,le=!1):(g=x,b=v+u.shift(),y=g+u.shift(),S=b+u.shift(),x=y+u.shift(),G-Z==5?(v=S+u.shift(),Z++):v=S,le=!0),e.U.P.curveTo(l,g,b,y,S,x,v),Z+=4}else{if((j+"").charAt(0)=="o")throw console.debug("Unknown operation: "+j,i),j;u.push(j)}}}s.x=x,s.y=v,s.nStems=d,s.haveWidth=h,s.width=p,s.open=f};var n=e,r={Typr:n};return t.Typr=n,t.default=r,Object.defineProperty(t,"__esModule",{value:!0}),t}({}).Typr}/*! 4723Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate 4724(https://github.com/101arrowz/fflate) for use in Troika text rendering. 4725Original licenses apply: 4726- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT) 4727- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2) 4728*/function sGe(){return function(t){var e=Uint8Array,n=Uint16Array,r=Uint32Array,i=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(j,G){for(var B=new n(31),$=0;$<31;++$)B[$]=G+=1<<j[$-1];var U=new r(B[30]);for($=1;$<30;++$)for(var Z=B[$];Z<B[$+1];++Z)U[Z]=Z-B[$]<<5|$;return[B,U]},l=o(i,2),u=l[0],d=l[1];u[28]=258,d[258]=28;for(var h=o(s,0)[0],p=new n(32768),f=0;f<32768;++f){var m=(43690&f)>>>1|(21845&f)<<1;m=(61680&(m=(52428&m)>>>2|(13107&m)<<2))>>>4|(3855&m)<<4,p[f]=((65280&m)>>>8|(255&m)<<8)>>>1}var x=function(j,G,B){for(var $=j.length,U=0,Z=new n(G);U<$;++U)++Z[j[U]-1];var V,W=new n(G);for(U=0;U<G;++U)W[U]=W[U-1]+Z[U-1]<<1;{V=new n(1<<G);var O=15-G;for(U=0;U<$;++U)if(j[U])for(var Y=U<<4|j[U],z=G-j[U],I=W[j[U]-1]++<<z,q=I|(1<<z)-1;I<=q;++I)V[p[I]>>>O]=Y}return V},v=new e(288);for(f=0;f<144;++f)v[f]=8;for(f=144;f<256;++f)v[f]=9;for(f=256;f<280;++f)v[f]=7;for(f=280;f<288;++f)v[f]=8;var g=new e(32);for(f=0;f<32;++f)g[f]=5;var b=x(v,9),y=x(g,5),S=function(j){for(var G=j[0],B=1;B<j.length;++B)j[B]>G&&(G=j[B]);return G},A=function(j,G,B){var $=G/8|0;return(j[$]|j[$+1]<<8)>>(7&G)&B},k=function(j,G){var B=G/8|0;return(j[B]|j[B+1]<<8|j[B+2]<<16)>>(7&G)}
4728,M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],T=function(j,G,B){var $=new Error(G||M[j]);if($.code=j,Error.captureStackTrace&&Error.captureStackTrace($,T),!B)throw $;return $},C=function(j,G,B){var $=j.length;if(!$||B&&!B.l&&$<5)return G||new e(0);var U=!G||B,Z=!B||B.i;B||(B={}),G||(G=new e(3*$));var V,W=function(Ze){var Me=G.length;if(Ze>Me){var Xe=new e(Math.max(2*Me,Ze));Xe.set(G),G=Xe}},O=B.f||0,Y=B.p||0,z=B.b||0,I=B.l,q=B.d,te=B.m,se=B.n,ie=8*$;do{if(!I){B.f=O=A(j,Y,1);var le=A(j,Y+1,3);if(Y+=3,!le){var xe=j[(re=((V=Y)/8|0)+(7&V&&1)+4)-4]|j[re-3]<<8,Ee=re+xe;if(Ee>$){Z&&T(0);break}U&&W(z+xe),G.set(j.subarray(re,Ee),z),B.b=z+=xe,B.p=Y=8*Ee;continue}if(le==1)I=b,q=y,te=9,se=5;else if(le==2){var ae=A(j,Y,31)+257,Q=A(j,Y+10,15)+4,we=ae+A(j,Y+5,31)+1;Y+=14;for(var Ae=new e(we),K=new e(19),pe=0;pe<Q;++pe)K[a[pe]]=A(j,Y+3*pe,7);Y+=3*Q;var ye=S(K),Se=(1<<ye)-1,ee=x(K,ye);for(pe=0;pe<we;){var re,me=ee[A(j,Y,Se)];if(Y+=15&me,(re=me>>>4)<16)Ae[pe++]=re;else{var Ge=0,He=0;for(re==16?(He=3+A(j,Y,3),Y+=2,Ge=Ae[pe-1]):re==17?(He=3+A(j,Y,7),Y+=3):re==18&&(He=11+A(j,Y,127),Y+=7);He--;)Ae[pe++]=Ge}}var _e=Ae.subarray(0,ae),Ne=Ae.subarray(ae);te=S(_e),se=S(Ne),I=x(_e,te),q=x(Ne,se)}else T(1);if(Y>ie){Z&&T(0);break}}U&&W(z+131072);for(var ue=(1<<te)-1,Ce=(1<<se)-1,Ke=Y;;Ke=Y){var Qe=(Ge=I[k(j,Y)&ue])>>>4;if((Y+=15&Ge)>ie){Z&&T(0);break}if(Ge||T(2),Qe<256)G[z++]=Qe;else{if(Qe==256){Ke=Y,I=null;break}var je=Qe-254;if(Qe>264){var We=i[pe=Qe-257];je=A(j,Y,(1<<We)-1)+u[pe],Y+=We}var xt=q[k(j,Y)&Ce],et=xt>>>4;if(xt||T(3),Y+=15&xt,Ne=h[et],et>3&&(We=s[et],Ne+=k(j,Y)&(1<<We)-1,Y+=We),Y>ie){Z&&T(0);break}U&&W(z+131072);for(var Je=z+je;z<Je;z+=4)G[z]=G[z-Ne],G[z+1]=G[z+1-Ne],G[z+2]=G[z+2-Ne],G[z+3]=G[z+3-Ne];z=Je}}B.l=I,B.p=Ke,B.b=z,I&&(O=1,B.m=te,B.d=q,B.n=se)}while(!O);return z==G.length?G:function(Ze,Me,Xe){(Xe==null||Xe>Ze.length)&&(Xe=Ze.length);var ut=new(Ze instanceof n?n:Ze instanceof r?r:e)(Xe-Me);return ut.set(Ze.subarray(Me,Xe)),ut}(G,0,z)},R=new e(0),P=typeof TextDecoder<"u"&&new TextDecoder;try{P.decode(R,{stream:!0})}catch{}return t.convert_streams=function(j){var G=new DataView(j),B=0;function $(){var ae=G.getUint16(B);return B+=2,ae}function U(){var ae=G.getUint32(B);return B+=4,ae}function Z(ae){xe.setUint16(Ee,ae),Ee+=2}function V(ae){xe.setUint32(Ee,ae),Ee+=4}for(var W={signature:U(),flavor:U(),length:U(),numTables:$(),reserved:$(),totalSfntSize:U(),majorVersion:$(),minorVersion:$(),metaOffset:U(),metaLength:U(),metaOrigLength:U(),privOffset:U(),privLength:U()},O=0;Math.pow(2,O)<=W.numTables;)O++;O--;for(var Y=16*Math.pow(2,O),z=16*W.numTables-Y,I=12,q=[],te=0;te<W.numTables;te++)q.push({tag:U(),offset:U(),compLength:U(),origLength:U(),origChecksum:U()}),I+=16;var se,ie=new Uint8Array(12+16*q.length+q.reduce(function(ae,Q){return ae+Q.origLength+4},0)),le=ie.buffer,xe=new DataView(le),Ee=0;return V(W.flavor),Z(W.numTables),Z(Y),Z(O),Z(z),q.forEach(function(ae){V(ae.tag),V(ae.origChecksum),V(I),V(ae.origLength),ae.outOffset=I,(I+=ae.origLength)%4!=0&&(I+=4-I%4)}),q.forEach(function(ae){var Q,we=j.slice(ae.offset,ae.offset+ae.compLength);if(ae.compLength!=ae.origLength){var Ae=new Uint8Array(ae.origLength);Q=new Uint8Array(we,2),C(Q,Ae)}else Ae=new Uint8Array(we);ie.set(Ae,ae.outOffset);var K=0;(I=ae.outOffset+ae.origLength)%4!=0&&(K=4-I%4),ie.set(new Uint8Array(K).buffer,ae.outOffset+ae.origLength),se=I+K}),le.slice(0,se)},Object.defineProperty(t,"__esModule",{value:!0}),t}({}).convert_streams}function aGe(t,e){const n={M:2,L:2,Q:4,C:6,Z:0},r={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},i=1,s=2,a=4,o=8,l=16,u=32;let d;function h(M){if(!d){const T={R:s,L:i,D:a,C:l,U:u,T:o};d=new Map;for(let C in r){let R=0;r[C].split(",").forEach(P=>{let[j,G]=P.split("+");
4728j=parseInt(j,36),G=G?parseInt(G,36):0,d.set(R+=j,T[C]);for(let B=G;B--;)d.set(++R,T[C])})}}return d.get(M)||u}const p=1,f=2,m=3,x=4,v=[null,"isol","init","fina","medi"];function g(M){const T=new Uint8Array(M.length);let C=u,R=p,P=-1;for(let j=0;j<M.length;j++){const G=M.codePointAt(j);let B=h(G)|0,$=p;B&o||(C&(i|a|l)?B&(s|a|l)?($=m,(R===p||R===m)&&T[P]++):B&(i|u)&&(R===f||R===x)&&T[P]--:C&(s|u)&&(R===f||R===x)&&T[P]--,R=T[j]=$,C=B,P=j,G>65535&&j++)}return T}function b(M,T){const C=[];for(let P=0;P<T.length;P++){const j=T.codePointAt(P);j>65535&&P++,C.push(t.U.codeToGlyph(M,j))}const R=M.GSUB;if(R){const{lookupList:P,featureList:j}=R;let G;const B=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,$=[];j.forEach(U=>{if(B.test(U.tag))for(let Z=0;Z<U.tab.length;Z++){if($[U.tab[Z]])continue;$[U.tab[Z]]=!0;const V=P[U.tab[Z]],W=/^(isol|init|fina|medi)$/.test(U.tag);W&&!G&&(G=g(T));for(let O=0;O<C.length;O++)(!G||!W||v[G[O]]===U.tag)&&t.U._applySubs(C,O,V,P)}})}return C}function y(M,T){const C=new Int16Array(T.length*3);let R=0;for(;R<T.length;R++){const B=T[R];if(B===-1)continue;C[R*3+2]=M.hmtx.aWidth[B];const $=M.GPOS;if($){const U=$.lookupList;for(let Z=0;Z<U.length;Z++){const V=U[Z];for(let W=0;W<V.tabs.length;W++){const O=V.tabs[W];if(V.ltype===1){if(t._lctf.coverageIndex(O.coverage,B)!==-1&&O.pos){G(O.pos,R);break}}else if(V.ltype===2){let Y=null,z=P();if(z!==-1){const I=t._lctf.coverageIndex(O.coverage,T[z]);if(I!==-1){if(O.fmt===1){const q=O.pairsets[I];for(let te=0;te<q.length;te++)q[te].gid2===B&&(Y=q[te])}else if(O.fmt===2){const q=t.U._getGlyphClass(T[z],O.classDef1),te=t.U._getGlyphClass(B,O.classDef2);Y=O.matrix[q][te]}if(Y){Y.val1&&G(Y.val1,z),Y.val2&&G(Y.val2,R);break}}}}else if(V.ltype===4){const Y=t._lctf.coverageIndex(O.markCoverage,B);if(Y!==-1){const z=P(j),I=z===-1?-1:t._lctf.coverageIndex(O.baseCoverage,T[z]);if(I!==-1){const q=O.markArray[Y],te=O.baseArray[I][q.markClass];C[R*3]=te.x-q.x+C[z*3]-C[z*3+2],C[R*3+1]=te.y-q.y+C[z*3+1];break}}}else if(V.ltype===6){const Y=t._lctf.coverageIndex(O.mark1Coverage,B);if(Y!==-1){const z=P();if(z!==-1){const I=T[z];if(S(M,I)===3){const q=t._lctf.coverageIndex(O.mark2Coverage,I);if(q!==-1){const te=O.mark1Array[Y],se=O.mark2Array[q][te.markClass];C[R*3]=se.x-te.x+C[z*3]-C[z*3+2],C[R*3+1]=se.y-te.y+C[z*3+1];break}}}}}}}}else if(M.kern&&!M.cff){const U=P();if(U!==-1){const Z=M.kern.glyph1.indexOf(T[U]);if(Z!==-1){const V=M.kern.rval[Z].glyph2.indexOf(B);V!==-1&&(C[U*3+2]+=M.kern.rval[Z].vals[V])}}}}return C;function P(B){for(let $=R-1;$>=0;$--)if(T[$]!==-1&&(!B||B(T[$])))return $;return-1}function j(B){return S(M,B)===1}function G(B,$){for(let U=0;U<3;U++)C[$*3+U]+=B[U]||0}}function S(M,T){const C=M.GDEF&&M.GDEF.glyphClassDef;return C?t.U._getGlyphClass(T,C):0}function A(...M){for(let T=0;T<M.length;T++)if(typeof M[T]=="number")return M[T]}function k(M){const T=Object.create(null),C=M["OS/2"],R=M.hhea,P=M.head.unitsPerEm,j=A(C&&C.sTypoAscender,R&&R.ascender,P),G={unitsPerEm:P,ascender:j,descender:A(C&&C.sTypoDescender,R&&R.descender,0),capHeight:A(C&&C.sCapHeight,j),xHeight:A(C&&C.sxHeight,j),lineGap:A(C&&C.sTypoLineGap,R&&R.lineGap),supportsCodePoint(B){return t.U.codeToGlyph(M,B)>0},forEachGlyph(B,$,U,Z){let V=0;const W=1/G.unitsPerEm*$,O=b(M,B);let Y=0;const z=y(M,O);return O.forEach((I,q)=>{if(I!==-1){let te=T[I];if(!te){const{cmds:se,crds:ie}=t.U.glyphToPath(M,I);let le="",xe=0;for(let Ae=0,K=se.length;Ae<K;Ae++){const pe=n[se[Ae]];le+=se[Ae];for(let ye=1;ye<=pe;ye++)le+=(ye>1?",":"")+ie[xe++]}let Ee,ae,Q,we;if(ie.length){Ee=ae=1/0,Q=we=-1/0;for(let Ae=0,K=ie.length;Ae<K;Ae+=2){let pe=ie[Ae],ye=ie[Ae+1];pe<Ee&&(Ee=pe),ye<ae&&(ae=ye),pe>Q&&(Q=pe),ye>we&&(we=ye)}}else Ee=Q=ae=we=0;te=T[I]={index:I,advanceWidth:M.hmtx.aWidth[I],xMin:Ee,yMin:ae,xMax:Q,yMax:we,path:le}}Z.call(null,te,V+z[q*3]*W,z[q*3+1]*W,Y),V+=z[q*3+2]*W,U&&(V+=U*$)}Y+=B.codePointAt(Y)>65535?2:1}),V}};return G}return function(T){const C=new Uint8Array(T,0,4),R=t._bin.readASCII(C,0,4);if(R==="wOFF")T=e(T);else if(R==="wOF2")throw new Error("woff2 fonts not supported");return k(t.parse(T)[0])}}
4728const oGe=aw({name:"Typr Font Parser",dependencies:[iGe,sGe,aGe],init(t,e,n){const r=t(),i=e();return n(r,i)}});/*! 4729Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver) 4730for use in Troika text rendering. 4731Original MIT license applies 4732*/function lGe(){return function(t){var e=function(){this.buckets=new Map};e.prototype.add=function(y){var S=y>>5;this.buckets.set(S,(this.buckets.get(S)||0)|1<<(31&y))},e.prototype.has=function(y){var S=this.buckets.get(y>>5);return S!==void 0&&(S&1<<(31&y))!=0},e.prototype.serialize=function(){var y=[];return this.buckets.forEach(function(S,A){y.push((+A).toString(36)+":"+S.toString(36))}),y.join(",")},e.prototype.deserialize=function(y){var S=this;this.buckets.clear(),y.split(",").forEach(function(A){var k=A.split(":");S.buckets.set(parseInt(k[0],36),parseInt(k[1],36))})};var n=Math.pow(2,8),r=n-1,i=~r;function s(y){var S=function(k){return k&i}(y).toString(16),A=function(k){return(k&i)+n-1}(y).toString(16);return"codepoint-index/plane"+(y>>16)+"/"+S+"-"+A+".json"}function a(y,S){var A=y&r,k=S.codePointAt(A/6|0);return((k=(k||48)-48)&1<<A%6)!=0}function o(y,S){var A;(A=y,A.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(k){return k.split("-").map(function(M){return parseInt(M.trim(),16)})})).forEach(function(k){var M=k[0],T=k[1];T===void 0&&(T=M),S(M,T)})}function l(y,S){o(y,function(A,k){for(var M=A;M<=k;M++)S(M)})}var u={},d={},h=new WeakMap,p="https://cdn.jsdelivr.net/gh/lojjic/[email protected]/packages/data";function f(y){var S=h.get(y);return S||(S=new e,l(y.ranges,function(A){return S.add(A)}),h.set(y,S)),S}var m,x=new Map;function v(y,S,A){return y[S]?S:y[A]?A:function(k){for(var M in k)return M}(y)}function g(y,S){var A=S;if(!y.includes(A)){A=1/0;for(var k=0;k<y.length;k++)Math.abs(y[k]-S)<Math.abs(A-S)&&(A=y[k])}return A}function b(y){return m||(m=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(S){m.add(S)})),m.has(y)}return t.CodePointSet=e,t.clearCache=function(){u={},d={}},t.getFontsForString=function(y,S){S===void 0&&(S={});var A,k=S.lang;k===void 0&&(k=new RegExp("\\p{Script=Hangul}","u").test(A=y)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(A)?"ja":"en");var M=S.category;M===void 0&&(M="sans-serif");var T=S.style;T===void 0&&(T="normal");var C=S.weight;C===void 0&&(C=400);var R=(S.dataUrl||p).replace(/\/$/g,""),P=new Map,j=new Uint8Array(y.length),G={},B={},$=new Array(y.length),U=new Map,Z=!1;function V(Y){var z=x.get(Y);return z||(z=fetch(R+"/"+Y).then(function(I){if(!I.ok)throw new Error(I.statusText);return I.json().then(function(q){if(!Array.isArray(q)||q[0]!==1)throw new Error("Incorrect schema version; need 1, got "+q[0]);return q[1]})}).catch(function(I){if(R!==p)return Z||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+I.message),Z=!0),R=p,x.delete(Y),V(Y);throw I}),x.set(Y,z)),z}for(var W=function(Y){var z=y.codePointAt(Y),I=s(z);$[Y]=I,u[I]||U.has(I)||U.set(I,V(I).then(function(q){u[I]=q})),z>65535&&(Y++,O=Y)},O=0;O<y.length;O++)W(O);return Promise.all(U.values()).then(function(){U.clear();for(var Y=function(I){var q=y.codePointAt(I),te=null,se=u[$[I]],ie=void 0;for(var le in se){var xe=B[le];if(xe===void 0&&(xe=B[le]=new RegExp(le).test(k||"en")),xe){for(var Ee in ie=le,se[le])if(a(q,se[le][Ee])){te=Ee;break}break}}if(!te){e:for(var ae in se)if(ae!==ie){for(var Q in se[ae])if(a(q,se[ae][Q])){te=Q;break e}}}te||(console.debug("No font coverage for U+"+q.toString(16)),te="latin"),$[I]=te,d[te]||U.has(te)||U.set(te,V("font-meta/"+te+".json").then(function(we){d[te]=we})),q>65535&&(I++,z=I)},z=0;z<y.length;z++)Y(z);return Promise.all(U.values())}).then(function(){for(var Y,z=null,I=0;I<y.length;I++){var q=y.codePointAt(I);if(z&&(b(q)||f(z).has(q)))j[I]=j[I-1];else{z=d[$[I]];var te=G[z.id];if(!te){var se=z.typeforms,ie=v(se,M,"sans-serif"),le=v(se[ie],T,"normal"),xe=g((Y=se[ie])===null||Y===void 0?void 0:Y[le],C);te=G[z.id]=R+"/font-files/"+z.id+"/"+ie+"."+le+"."+xe+".woff"}var Ee=P.get(te);Ee==null&&(Ee=P.size,P.set(te,Ee)),j[I]=Ee}q>65535&&(I++,j[I]=j[I-1])}return{fontUrls:Array.from(P.keys()),chars:j}})}
4732,Object.defineProperty(t,"__esModule",{value:!0}),t}({})}function cGe(t,e){const n=Object.create(null),r=Object.create(null);function i(a,o){const l=u=>{console.error(`Failure loading font ${a}`,u)};try{const u=new XMLHttpRequest;u.open("get",a,!0),u.responseType="arraybuffer",u.onload=function(){if(u.status>=400)l(new Error(u.statusText));else if(u.status>0)try{const d=t(u.response);d.src=a,o(d)}catch(d){l(d)}},u.onerror=l,u.send()}catch(u){l(u)}}function s(a,o){let l=n[a];l?o(l):r[a]?r[a].push(o):(r[a]=[o],i(a,u=>{u.src=a,n[a]=u,r[a].forEach(d=>d(u)),delete r[a]}))}return function(a,o,{lang:l,fonts:u=[],style:d="normal",weight:h="normal",unicodeFontsURL:p}={}){const f=new Uint8Array(a.length),m=[];a.length||b();const x=new Map,v=[];if(d!=="italic"&&(d="normal"),typeof h!="number"&&(h=h==="bold"?700:400),u&&!Array.isArray(u)&&(u=[u]),u=u.slice().filter(S=>!S.lang||S.lang.test(l)).reverse(),u.length){let M=0;(function T(C=0){for(let R=C,P=a.length;R<P;R++){const j=a.codePointAt(R);if(M===1&&m[f[R-1]].supportsCodePoint(j)||R>0&&/\s/.test(a[R]))f[R]=f[R-1],M===2&&(v[v.length-1][1]=R);else for(let G=f[R],B=u.length;G<=B;G++)if(G===B){const $=M===2?v[v.length-1]:v[v.length]=[R,R];$[1]=R,M=2}else{f[R]=G;const{src:$,unicodeRange:U}=u[G];if(!U||y(j,U)){const Z=n[$];if(!Z){s($,()=>{T(R)});return}if(Z.supportsCodePoint(j)){let V=x.get(Z);typeof V!="number"&&(V=m.length,m.push(Z),x.set(Z,V)),f[R]=V,M=1;break}}}j>65535&&R+1<P&&(f[R+1]=f[R],R++,M===2&&(v[v.length-1][1]=R))}g()})()}else v.push([0,a.length-1]),g();function g(){if(v.length){const S=v.map(A=>a.substring(A[0],A[1]+1)).join(` 4733`);e.getFontsForString(S,{lang:l||void 0,style:d,weight:h,dataUrl:p}).then(({fontUrls:A,chars:k})=>{const M=m.length;let T=0;v.forEach(R=>{for(let P=0,j=R[1]-R[0];P<=j;P++)f[R[0]+P]=k[T++]+M;T++});let C=0;A.forEach((R,P)=>{s(R,j=>{m[P+M]=j,++C===A.length&&b()})})})}else b()}function b(){o({chars:f,fonts:m})}function y(S,A){for(let k=0;k<A.length;k++){const[M,T=M]=A[k];if(M<=S&&S<=T)return!0}return!1}}}const uGe=aw({name:"FontResolver",dependencies:[cGe,oGe,lGe],init(t,e,n){return t(e,n())}});function dGe(t,e){const r=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i="[^\\S\\u00A0]",s=new RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function a({text:m,lang:x,fonts:v,style:g,weight:b,preResolvedFonts:y,unicodeFontsURL:S},A){const k=({chars:M,fonts:T})=>{let C,R;const P=[];for(let j=0;j<M.length;j++)M[j]!==R?(R=M[j],P.push(C={start:j,end:j,fontObj:T[M[j]]})):C.end=j;A(P)};y?k(y):t(m,k,{lang:x,fonts:v,style:g,weight:b,unicodeFontsURL:S})}function o({text:m="",font:x,lang:v,sdfGlyphSize:g=64,fontSize:b=400,fontWeight:y=1,fontStyle:S="normal",letterSpacing:A=0,lineHeight:k="normal",maxWidth:M=1/0,direction:T,textAlign:C="left",textIndent:R=0,whiteSpace:P="normal",overflowWrap:j="normal",anchorX:G=0,anchorY:B=0,metricsOnly:$=!1,unicodeFontsURL:U,preResolvedFonts:Z=null,includeCaretPositions:V=!1,chunkedBoundsSize:W=8192,colorRanges:O=null},Y){const z=h(),I={fontLoad:0,typesetting:0};m.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),m=m.replace(/\r\n/g,` 4734`).replace(/\r/g,` 4735`)),b=+b,A=+A,M=+M,k=k||"normal",R=+R,a({text:m,lang:v,style:S,weight:y,fonts:typeof x=="string"?[{src:x}]:x,unicodeFontsURL:U,preResolvedFonts:Z},q=>{I.fontLoad=h()-z;const te=isFinite(M);let se=null,ie=null,le=null,xe=null,Ee=null,ae=null,Q=null,we=null,Ae=0,K=0,pe=P!=="nowrap";const ye=new Map,Se=h();let ee=R,re=0,me=new p;const Ge=[me];q.forEach(Ce=>{const{fontObj:Ke}
4735=Ce,{ascender:Qe,descender:je,unitsPerEm:We,lineGap:xt,capHeight:et,xHeight:Je}=Ke;let Ze=ye.get(Ke);if(!Ze){const Fe=b/We,Le=k==="normal"?(Qe-je+xt)*Fe:k*b,bt=(Le-(Qe-je)*Fe)/2,dt=Math.min(Le,(Qe-je)*Fe),Nt=(Qe+je)/2*Fe+dt/2;Ze={index:ye.size,src:Ke.src,fontObj:Ke,fontSizeMult:Fe,unitsPerEm:We,ascender:Qe*Fe,descender:je*Fe,capHeight:et*Fe,xHeight:Je*Fe,lineHeight:Le,baseline:-bt-Qe*Fe,caretTop:Nt,caretBottom:Nt-dt},ye.set(Ke,Ze)}const{fontSizeMult:Me}=Ze,Xe=m.slice(Ce.start,Ce.end+1);let ut,lt;Ke.forEachGlyph(Xe,b,A,(Fe,Le,bt,dt)=>{Le+=re,dt+=Ce.start,ut=Le,lt=Fe;const Nt=m.charAt(dt),_t=Fe.advanceWidth*Me,Lt=me.count;let Dt;if("isEmpty"in Fe||(Fe.isWhitespace=!!Nt&&new RegExp(i).test(Nt),Fe.canBreakAfter=!!Nt&&s.test(Nt),Fe.isEmpty=Fe.xMin===Fe.xMax||Fe.yMin===Fe.yMax||r.test(Nt)),!Fe.isWhitespace&&!Fe.isEmpty&&K++,pe&&te&&!Fe.isWhitespace&&Le+_t+ee>M&&Lt){if(me.glyphAt(Lt-1).glyphObj.canBreakAfter)Dt=new p,ee=-Le;else for(let Mt=Lt;Mt--;)if(Mt===0&&j==="break-word"){Dt=new p,ee=-Le;break}else if(me.glyphAt(Mt).glyphObj.canBreakAfter){Dt=me.splitAt(Mt+1);const nn=Dt.glyphAt(0).x;ee-=nn;for(let Tn=Dt.count;Tn--;)Dt.glyphAt(Tn).x-=nn;break}Dt&&(me.isSoftWrapped=!0,me=Dt,Ge.push(me),Ae=M)}let en=me.glyphAt(me.count);en.glyphObj=Fe,en.x=Le+ee,en.y=bt,en.width=_t,en.charIndex=dt,en.fontData=Ze,Nt===` 4736`&&(me=new p,Ge.push(me),ee=-(Le+_t+A*b)+R)}),re=ut+lt.advanceWidth*Me+A*b});let He=0;Ge.forEach(Ce=>{let Ke=!0;for(let Qe=Ce.count;Qe--;){const je=Ce.glyphAt(Qe);Ke&&!je.glyphObj.isWhitespace&&(Ce.width=je.x+je.width,Ce.width>Ae&&(Ae=Ce.width),Ke=!1);let{lineHeight:We,capHeight:xt,xHeight:et,baseline:Je}=je.fontData;We>Ce.lineHeight&&(Ce.lineHeight=We);const Ze=Je-Ce.baseline;Ze<0&&(Ce.baseline+=Ze,Ce.cap+=Ze,Ce.ex+=Ze),Ce.cap=Math.max(Ce.cap,Ce.baseline+xt),Ce.ex=Math.max(Ce.ex,Ce.baseline+et)}Ce.baseline-=He,Ce.cap-=He,Ce.ex-=He,He+=Ce.lineHeight});let _e=0,Ne=0;if(G&&(typeof G=="number"?_e=-G:typeof G=="string"&&(_e=-Ae*(G==="left"?0:G==="center"?.5:G==="right"?1:u(G)))),B&&(typeof B=="number"?Ne=-B:typeof B=="string"&&(Ne=B==="top"?0:B==="top-baseline"?-Ge[0].baseline:B==="top-cap"?-Ge[0].cap:B==="top-ex"?-Ge[0].ex:B==="middle"?He/2:B==="bottom"?He:B==="bottom-baseline"?-Ge[Ge.length-1].baseline:u(B)*He)),!$){const Ce=e.getEmbeddingLevels(m,T);se=new Uint16Array(K),ie=new Uint8Array(K),le=new Float32Array(K*2),xe={},Q=[1/0,1/0,-1/0,-1/0],we=[],V&&(ae=new Float32Array(m.length*4)),O&&(Ee=new Uint8Array(K*3));let Ke=0,Qe=-1,je=-1,We,xt;if(Ge.forEach((et,Je)=>{let{count:Ze,width:Me}=et;if(Ze>0){let Xe=0;for(let dt=Ze;dt--&&et.glyphAt(dt).glyphObj.isWhitespace;)Xe++;let ut=0,lt=0;if(C==="center")ut=(Ae-Me)/2;else if(C==="right")ut=Ae-Me;else if(C==="justify"&&et.isSoftWrapped){let dt=0;for(let Nt=Ze-Xe;Nt--;)et.glyphAt(Nt).glyphObj.isWhitespace&&dt++;lt=(Ae-Me)/dt}if(lt||ut){let dt=0;for(let Nt=0;Nt<Ze;Nt++){let _t=et.glyphAt(Nt);const Lt=_t.glyphObj;_t.x+=ut+dt,lt!==0&&Lt.isWhitespace&&Nt<Ze-Xe&&(dt+=lt,_t.width+=lt)}}const Fe=e.getReorderSegments(m,Ce,et.glyphAt(0).charIndex,et.glyphAt(et.count-1).charIndex);for(let dt=0;dt<Fe.length;dt++){const[Nt,_t]=Fe[dt];let Lt=1/0,Dt=-1/0;for(let en=0;en<Ze;en++)if(et.glyphAt(en).charIndex>=Nt){let Mt=en,nn=en;for(;nn<Ze;nn++){let Tn=et.glyphAt(nn);if(Tn.charIndex>_t)break;nn<Ze-Xe&&(Lt=Math.min(Lt,Tn.x),Dt=Math.max(Dt,Tn.x+Tn.width))}for(let Tn=Mt;Tn<nn;Tn++){const Fn=et.glyphAt(Tn);Fn.x=Dt-(Fn.x+Fn.width-Lt)}break}}let Le;const bt=dt=>Le=dt;for(let dt=0;dt<Ze;dt++){const Nt=et.glyphAt(dt);Le=Nt.glyphObj;const _t=Le.index,Lt=Ce.levels[Nt.charIndex]&1;if(Lt){const Dt=e.getMirroredCharacter(m[Nt.charIndex]);Dt&&Nt.fontData.fontObj.forEachGlyph(Dt,0,0,bt)}if(V){const{charIndex:Dt,fontData:en}=Nt,Mt=Nt.x+_e,nn=Nt.x+Nt.width+_e;ae[Dt*4]=Lt?nn:Mt,ae[Dt*4+1]=Lt?Mt:nn,ae[Dt*4+2]=et.baseline+en.caretBottom+Ne,ae[Dt*4+3]=et.baseline+en.caretTop+Ne;const Tn=Dt-Qe;Tn>1&&d(ae,Qe,Tn),Qe=Dt}if(O){const{charIndex:Dt}=Nt;for(;Dt>je;)je++,O.hasOwnProperty(je)&&(xt=O[je])}if(!Le.isWhitespace&&!Le.isEmpty){const Dt=Ke++,{fontSizeMult:en,src:Mt,index:nn}=Nt.fontData,Tn=xe[Mt]||(xe[Mt]={});Tn[_t]||(Tn[_t]={path:Le.path,pathBounds:[Le.xMin,Le.yMin,Le.xMax,Le.yMax]});const Fn=Nt.x+_e,lr=Nt.y+et.baseline+Ne;le[Dt*2]=Fn,le[Dt*2+1]=lr;const mr=Fn+Le.xMin*en,gr=lr+Le.yMin*en,br=Fn+Le.xMax*en,sn=lr+Le.yMax*en;mr<Q[0]&&(Q[0]=mr),gr<Q[1]&&(Q[1]=gr),br>Q[2]&&(Q[2]=br),sn>Q[3]&&(Q[3]=sn),Dt%W===0&&(We={start:Dt,end:Dt,rect:[1/0,1/0,-1/0,-1/0]},we.push(We)),We.end++;const Mr=We.rect;if(mr<Mr[0]&&(Mr[0]=mr),gr<Mr[1]&&(Mr[1]=gr),br>Mr[2]&&(Mr[2]=br),sn>Mr[3]&&(Mr[3]=sn),se[Dt]=_t,ie[Dt]=nn,O){const yi=Dt*3;Ee[yi]=xt>>16&255,Ee[yi+1]=xt>>8&255,Ee[yi+2]=xt&255}}}}}),ae){const et=m.length-Qe;et>1&&d(ae,Qe,et)}}const ue=[];ye.forEach(({index:Ce,src:Ke,unitsPerEm:Qe,ascender:je,descender:We,lineHeight:xt,capHeight:et,xHeight:Je})=>{ue[Ce]={src:Ke,unitsPerEm:Qe,ascender:je,descender:We,lineHeight:xt,capHeight:et,xHeight:Je}}),I.typesetting=h()-Se,Y({glyphIds:se,glyphFontIndices:ie,glyphPositions:le,glyphData:xe,fontData:ue,caretPositions:ae,glyphColors:Ee,chunkedBounds:we,fontSize:b,topBaseline:Ne+Ge[0].baseline,blockBounds:[_e,Ne-He,_e+Ae,Ne],visibleBounds:Q,timings:I})})}function l(m,x){o({...m,metricsOnly:!0},v=>{const[g,b,y,S]=v.blockBounds;x({width:y-g,height:S-b})})}function u(m){let x=m.match(/^([\d.]+)%$/),v=x?parseFloat(x[1]):NaN;return isNaN(v)?0:v/100}function d(m,x,v){const g=m[x*4],b=m[x*4+1],y=m[x*4+2],S=m[x*4+3],A=(b-g)/v;for(let k=0;k<v;k++){const M=(x+k)*4;m[M]=g+A*k,m[M+1]=g+A*(k+1),m[M+2]=y,m[M+3]=S}}function h(){return(self.performance||Date).now()}function p(){this.data=[]}const f=["glyphObj","x","y","width","charIndex","fontData"];return p.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/f.length)},glyphAt(m){let x=p.flyweight;return x.data=this.data,x.index=m,x},splitAt(m){let x=new p;return x.data=this.data.splice(m*f.length),x}},p.flyweight=f.reduce((m,x,v,g)=>(Object.defineProperty(m,x,{get(){return this.data[this.index*f.length+v]},set(b){this.data[this.index*f.length+v]=b}}),m),{data:null,index:0}),{typeset:o,measure:l}}const X0=()=>(self.performance||Date).now(),e3=Qle();let oK;function hGe(t,e,n,r,i,s,a,o,l,u,d=!0){return d?pGe(t,e,n,r,i,s,a,o,l,u).then(null,h=>(oK||(console.warn("WebGL SDF generation failed, falling back to JS",h),oK=!0),cK(t,e,n,r,i,s,a,o,l,u))):cK(t,e,n,r,i,s,a,o,l,u)}const gN=[],fGe=5;let QD=0;function tce(){const t=X0();for(;gN.length&&X0()-t<fGe;)gN.shift()();QD=gN.length?setTimeout(tce,0):0}const pGe=(...t)=>
4736new Promise((e,n)=>{gN.push(()=>{const r=X0();try{e3.webgl.generateIntoCanvas(...t),e({timing:X0()-r})}catch(i){n(i)}}),QD||(QD=setTimeout(tce,0))}),mGe=4,gGe=2e3,lK={};let xGe=0;function cK(t,e,n,r,i,s,a,o,l,u){const d="TroikaTextSDFGenerator_JS_"+xGe++%mGe;let h=lK[d];return h||(h=lK[d]={workerModule:aw({name:d,workerId:d,dependencies:[Qle,X0],init(p,f){const m=p().javascript.generate;return function(...x){const v=f();return{textureData:m(...x),timing:f()-v}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),h.requests++,clearTimeout(h.idleTimer),h.workerModule(t,e,n,r,i,s).then(({textureData:p,timing:f})=>{const m=X0(),x=new Uint8Array(p.length*4);for(let v=0;v<p.length;v++)x[v*4+u]=p[v];return e3.webglUtils.renderImageData(a,x,o,l,t,e,1<<3-u),f+=X0()-m,--h.requests===0&&(h.idleTimer=setTimeout(()=>{qHe(d)},gGe)),{timing:f}})}function vGe(t){t._warm||(e3.webgl.isSupported(t),t._warm=!0)}const yGe=e3.webglUtils.resizeWebGLCanvasWithoutClearing,xy={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},bGe=new Qt;function Jv(){return(self.performance||Date).now()}const uK=Object.create(null);function nce(t,e){t=SGe({},t);const n=Jv(),{defaultFontURL:r}=xy,i=[];if(r&&i.push({label:"default",src:dK(r)}),t.font&&i.push({label:"user",src:dK(t.font)}),t.font=i,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||xy.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||xy.unicodeFontsURL,t.colorRanges!=null){let f={};for(let m in t.colorRanges)if(t.colorRanges.hasOwnProperty(m)){let x=t.colorRanges[m];typeof x!="number"&&(x=bGe.set(x).getHex()),f[m]=x}t.colorRanges=f}Object.freeze(t);const{textureWidth:s,sdfExponent:a}=xy,{sdfGlyphSize:o}=t,l=s/o*4;let u=uK[o];if(!u){const f=document.createElement("canvas");f.width=s,f.height=o*256/l,u=uK[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:f,sdfTexture:new ui(f,void 0,void 0,void 0,zr,zr),contextLost:!1,glyphsByFont:new Map},u.sdfTexture.generateMipmaps=!1,wGe(u)}const{sdfTexture:d,sdfCanvas:h}=u;sce(t).then(f=>{const{glyphIds:m,glyphFontIndices:x,fontData:v,glyphPositions:g,fontSize:b,timings:y}=f,S=[],A=new Float32Array(m.length*4);let k=0,M=0;const T=Jv(),C=v.map(B=>{let $=u.glyphsByFont.get(B.src);return $||u.glyphsByFont.set(B.src,$=new Map),$});m.forEach((B,$)=>{const U=x[$],{src:Z,unitsPerEm:V}=v[U];let W=C[U].get(B);if(!W){const{path:q,pathBounds:te}=f.glyphData[Z][B],se=Math.max(te[2]-te[0],te[3]-te[1])/o*(xy.sdfMargin*o+.5),ie=u.glyphCount++,le=[te[0]-se,te[1]-se,te[2]+se,te[3]+se];C[U].set(B,W={path:q,atlasIndex:ie,sdfViewBox:le}),S.push(W)}const{sdfViewBox:O}=W,Y=g[M++],z=g[M++],I=b/V;A[k++]=Y+O[0]*I,A[k++]=z+O[1]*I,A[k++]=Y+O[2]*I,A[k++]=z+O[3]*I,m[$]=W.atlasIndex}),y.quads=(y.quads||0)+(Jv()-T);const R=Jv();y.sdf={};const P=h.height,j=Math.ceil(u.glyphCount/l),G=Math.pow(2,Math.ceil(Math.log2(j*o)));G>P&&(console.info(`Increasing SDF texture size ${P}->${G}`),yGe(h,s,G),d.dispose()),Promise.all(S.map(B=>rce(B,u,t.gpuAccelerateSDF).then(({timing:$})=>{y.sdf[B.atlasIndex]=$}))).then(()=>{S.length&&!u.contextLost&&(ice(u),d.needsUpdate=!0),y.sdfTotal=Jv()-R,y.total=Jv()-n,e(Object.freeze({parameters:t,sdfTexture:d,sdfGlyphSize:o,sdfExponent:a,glyphBounds:A,glyphAtlasIndices:m,glyphColors:f.glyphColors,caretPositions:f.caretPositions,chunkedBounds:f.chunkedBounds,ascender:f.ascender,descender:f.descender,lineHeight:f.lineHeight,capHeight:f.capHeight,xHeight:f.xHeight,topBaseline:f.topBaseline,blockBounds:f.blockBounds,visibleBounds:f.visibleBounds,timings:f.timings}))})}),Promise.resolve().then(()=>{u.contextLost||vGe(h)})}function rce({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:s},a){if(s)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=xy,u=Math.max(n[2]-n[0],n[3]-n[1]),d=Math.floor(e/4),h=d%(o/r)*r,p=Math.floor(d/(o/r))*r,f=e%4;return hGe(r,r,t,n,u,l,i,h,p,f,a)}function wGe(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",n=>{console.log("Context Lost",n),n.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",n=>{console.log("Context Restored",n),t.contextLost=!1;const r=[];t.glyphsByFont.forEach(i=>
4736{i.forEach(s=>{r.push(rce(s,t,!0))})}),Promise.all(r).then(()=>{ice(t),t.sdfTexture.needsUpdate=!0})})}function _Ge({font:t,characters:e,sdfGlyphSize:n},r){let i=Array.isArray(e)?e.join(` 4737`):""+e;nce({font:t,sdfGlyphSize:n,text:i},r)}function SGe(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let cC;function dK(t){return cC||(cC=typeof document>"u"?{}:document.createElement("a")),cC.href=t,cC.href}function ice(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:r,height:i}=e,s=t.sdfCanvas.getContext("webgl");let a=n.image.data;(!a||a.length!==r*i*4)&&(a=new Uint8Array(r*i*4),n.image={width:r,height:i,data:a},n.flipY=!1,n.isDataTexture=!0),s.readPixels(0,0,r,i,s.RGBA,s.UNSIGNED_BYTE,a)}}const AGe=aw({name:"Typesetter",dependencies:[dGe,uGe,YHe],init(t,e,n){return t(e,n())}}),sce=aw({name:"Typesetter",dependencies:[AGe],init(t){return function(e){return new Promise(n=>{t.typeset(e,n)})}},getTransferables(t){const e=[];for(let n in t)t[n]&&t[n].buffer&&e.push(t[n].buffer);return e}});sce.onMainThread;const hK={};function EGe(t){let e=hK[t];return e||(e=hK[t]=new Td(1,1,t,t).translate(.5,.5,0)),e}const kGe="aTroikaGlyphBounds",fK="aTroikaGlyphIndex",CGe="aTroikaGlyphColor";class NGe extends f6{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Xa,this.boundingBox=new ma}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let n=EGe(e);["position","normal","uv"].forEach(r=>{this.attributes[r]=n.attributes[r].clone()}),this.setIndex(n.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,n,r,i,s){this.updateAttributeData(kGe,e,4),this.updateAttributeData(fK,n,1),this.updateAttributeData(CGe,s,3),this._blockBounds=r,this._chunkedBounds=i,this.instanceCount=n.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:n,boundingBox:r}=this;if(n){const{PI:i,floor:s,min:a,max:o,sin:l,cos:u}=Math,d=i/2,h=i*2,p=Math.abs(n),f=e[0]/p,m=e[2]/p,x=s((f+d)/h)!==s((m+d)/h)?-p:a(l(f)*p,l(m)*p),v=s((f-d)/h)!==s((m-d)/h)?p:o(l(f)*p,l(m)*p),g=s((f+i)/h)!==s((m+i)/h)?p*2:o(p-u(f)*p,p-u(m)*p);r.min.set(x,e[1],n<0?-g:0),r.max.set(v,e[3],n<0?0:g)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(fK).count,r=this._chunkedBounds;if(r)for(let i=r.length;i--;){n=r[i].end;let s=r[i].rect;if(s[1]<e.w&&s[3]>e.y&&s[0]<e.z&&s[2]>e.x)break}this.instanceCount=n}updateAttributeData(e,n,r){const i=this.getAttribute(e);n?i&&i.array.length===n.length?(i.array.set(n),i.needsUpdate=!0):(this.setAttribute(e,new Qm(n,r)),delete this._maxInstanceCount,this.dispose()):i&&this.deleteAttribute(e)}}const TGe=` 4738uniform vec2 uTroikaSDFTextureSize; 4739uniform float uTroikaSDFGlyphSize; 4740uniform vec4 uTroikaTotalBounds; 4741uniform vec4 uTroikaClipRect; 4742uniform mat3 uTroikaOrient; 4743uniform bool uTroikaUseGlyphColors; 4744uniform float uTroikaEdgeOffset; 4745uniform float uTroikaBlurRadius; 4746uniform vec2 uTroikaPositionOffset; 4747uniform float uTroikaCurveRadius; 4748attribute vec4 aTroikaGlyphBounds; 4749attribute float aTroikaGlyphIndex; 4750attribute vec3 aTroikaGlyphColor; 4751varying vec2 vTroikaGlyphUV; 4752varying vec4 vTroikaTextureUVBounds; 4753varying float vTroikaTextureChannel; 4754varying vec3 vTroikaGlyphColor; 4755varying vec2 vTroikaGlyphDimensions; 4756`,MGe=` 4757vec4 bounds = aTroikaGlyphBounds; 4758bounds.xz += uTroikaPositionOffset.x; 4759bounds.yw -= uTroikaPositionOffset.y; 4760 4761vec4 outlineBounds = vec4( 4762 bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius, 4763 bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius 4764); 4765vec4 clippedBounds = vec4( 4766 clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), 4767 clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) 4768); 4769 4770vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); 4771 4772position.xy = mix(bounds.xy, bounds.zw, clippedXY); 4773 4774uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); 4775 4776float rad = uTroikaCurveRadius; 4777if (rad != 0.0) { 4778 float angle = position.x / rad; 4779 position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); 4780 normal.xz = vec2(sin(angle), cos(angle)); 4781} 4782 4783position = uTroikaOrient * position; 4784normal = uTroikaOrient * normal; 4785 4786vTroikaGlyphUV = clippedXY.xy; 4787vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); 4788 4789 4790float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; 4791vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; 4792vec2 txStartUV = txUvPerSquare * vec2( 4793 mod(floor(aTroikaGlyphIndex / 4.0), txCols), 4794 floor(floor(aTroikaGlyphIndex / 4.0) / txCols) 4795); 4796vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); 4797vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); 4798`,RGe=` 4799uniform sampler2D uTroikaSDFTexture; 4800uniform vec2 uTroikaSDFTextureSize; 4801uniform float uTroikaSDFGlyphSize; 4802uniform float uTroikaSDFExponent; 4803uniform float uTroikaEdgeOffset; 4804uniform float uTroikaFillOpacity; 4805uniform float uTroikaBlurRadius; 4806uniform vec3 uTroikaStrokeColor; 4807uniform float uTroikaStrokeWidth; 4808uniform float uTroikaStrokeOpacity; 4809uniform bool uTroikaSDFDebug; 4810varying vec2 vTroikaGlyphUV; 4811varying vec4 vTroikaTextureUVBounds; 4812varying float vTroikaTextureChannel; 4813varying vec2 vTroikaGlyphDimensions; 4814 4815float troikaSdfValueToSignedDistance(float alpha) { 4816 // Inverse of exponential encoding in webgl-sdf-generator 4817 4818 float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); 4819 float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; 4820 float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); 4821 return signedDist; 4822} 4823 4824float troikaGlyphUvToSdfValue(vec2 glyphUV) { 4825 vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); 4826 vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); 4827 float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 4828 return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; 4829} 4830 4831float troikaGlyphUvToDistance(vec2 uv) { 4832 return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); 4833} 4834 4835float troikaGetAADist() { 4836 4837 #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 4838 return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; 4839 #else 4840 return vTroikaGlyphDimensions.x / 64.0; 4841 #endif 4842} 4843 4844float troikaGetFragDistValue() { 4845 vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); 4846 float distance = troikaGlyphUvToDistance(clampedGlyphUV); 4847 4848 // Extrapolate distance when outside bounds: 4849 distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 4850 length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); 4851 4852 4853 4854 return distance; 4855} 4856 4857float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { 4858 #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) 4859 float alpha = step(-distanceOffset, -distance); 4860 #else 4861 4862 float alpha = smoothstep( 4863 distanceOffset + aaDist, 4864 distanceOffset - aaDist, 4865 distance 4866 ); 4867 #endif 4868 4869 return alpha; 4870} 4871`,jGe=` 4872float aaDist = troikaGetAADist(); 4873float fragDistance = troikaGetFragDistValue(); 4874float edgeAlpha = uTroikaSDFDebug ? 4875 troikaGlyphUvToSdfValue(vTroikaGlyphUV) : 4876 troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius)); 4877 4878#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) 4879vec4 fillRGBA = gl_FragColor; 4880fillRGBA.a *= uTroikaFillOpacity; 4881vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); 4882if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; 4883gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( 4884 -uTroikaStrokeWidth - aaDist, 4885 -uTroikaStrokeWidth + aaDist, 4886 fragDistance 4887));
4888gl_FragColor.a *= edgeAlpha; 4889#endif 4890 4891if (edgeAlpha == 0.0) { 4892 discard; 4893} 4894`;function PGe(t){const e=ZD(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Rt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new gi(0,0,0,0)},uTroikaClipRect:{value:new gi(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Rt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Qt},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Nr},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:TGe,vertexTransform:MGe,fragmentDefs:RGe,fragmentColorTransform:jGe,customRewriter({vertexShader:n,fragmentShader:r}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(r)&&(r=r.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(n)||(n=n.replace(ece,`uniform vec3 diffuse; 4895$& 4896vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; 4897`))),{vertexShader:n,fragmentShader:r}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const C6=new ml({color:16777215,side:bc,transparent:!0}),pK=8421504,mK=new Wn,uC=new Ie,BP=new Ie,p_=[],LGe=new Ie,FP="+x+y";function gK(t){return Array.isArray(t)?t[0]:t}let ace=()=>{const t=new Li(new Td(1,1),C6);return ace=()=>t,t},oce=()=>{const t=new Li(new Td(1,1,32,1),C6);return oce=()=>t,t};const IGe={type:"syncstart"},DGe={type:"synccomplete"},lce=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],BGe=lce.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let cce=class extends Li{constructor(){const e=new NGe;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=pK,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=FP,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(IGe),nce({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},n=>{this._isSyncing=!1,this._textRenderInfo=n,this.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.blockBounds,n.chunkedBounds,n.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(i=>i&&i())})),this.dispatchEvent(DGe),e&&e()})))}onBeforeRender(e,n,r,i,s,a){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return PGe(e)}get material(){let e=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=C6.clone());if((!e||!e.isDerivedFrom(n))&&(e=this._derivedMaterial=this.createDerivedMaterial(n),n.addEventListener("dispose",function r(){n.removeEventListener("dispose",r),e.dispose()})),this.hasOutline()){let r=e._outlineMtl;return r||(r=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),r.isTextOutlineMaterial=!0,r.depthWrite=!1,r.map=null,e.addEventListener("dispose",function i(){e.removeEventListener("dispose",i),r.dispose()})),[r,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return gK(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return gK(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const n=e.isTextOutlineMaterial,r=e.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:o,blockBounds:l}=i;r.uTroikaSDFTexture.value=o,r.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),r.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,r.uTroikaSDFExponent.value=i.sdfExponent,r.uTroikaTotalBounds.value.fromArray(l),r.uTroikaUseGlyphColors.value=!n&&!!i.glyphColors;let u=0,d=0,h=0,p,f,m,x=0,v=0;if(n){let{outlineWidth:b,outlineOffsetX:y,outlineOffsetY:S,outlineBlur:A,outlineOpacity:k}=this;u=this._parsePercent(b)||0,d=Math.max(0,this._parsePercent(A)||0),p=k,x=this._parsePercent(y)||0,v=this._parsePercent(S)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(m=this.strokeColor,r.uTroikaStrokeColor.value.set(m??pK),f=this.strokeOpacity,f==null&&(f=1)),p=this.fillOpacity;r.uTroikaEdgeOffset.value=u,r.uTroikaPositionOffset.value.set(x,v),r.uTroikaBlurRadius.value=d,r.uTroikaStrokeWidth.value=h,r.uTroikaStrokeOpacity.value=f,r.uTroikaFillOpacity.value=p??1,r.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)r.uTroikaClipRect.value.fromArray(g);else{const b=(this.fontSize||.1)*100;r.uTroikaClipRect.value.set(l[0]-b,l[1]-b,l[2]+b,l[3]+b)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=n?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new Qt;(s!==o._input||typeof s=="object")&&o.set(o._input=s)}let a=this.orientation||FP;if(a!==e._orientation){let o=r.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==FP&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,u,d,h,p]=l;uC.set(0,0,0)[d]=u==="-"?1:-1,BP.set(0,0,0)[p]=h==="-"?-1:1,mK.lookAt(LGe,uC.cross(BP),BP),o.setFromMatrix4(mK)}else o.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let n=e.match(/^(-?[\d.]+)%$/),r=n?parseFloat(n[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,n=new Rt){n.copy(e);const r=this.curveRadius;return r&&(n.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),n}worldPositionToTextCoords(e,n=new Rt){return uC.copy(e),this.localPositionToTextCoords(this.worldToLocal(uC),n)}raycast(e,n){const{textRenderInfo:r,curveRadius:i}=this;if(r){const s=r.blockBounds,a=i?oce():ace(),o=a.geometry,{position:l,uv:u}=o.attributes;for(let d=0;d<u.count;d++){let h=s[0]+u.getX(d)*(s[2]-s[0]);const p=s[1]+u.getY(d)*(s[3]-s[1]);let f=0;i&&(f=i-Math.cos(h/i)*i,h=Math.sin(h/i)*i),l.setXYZ(d,h,p,f)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,p_.length=0,a.raycast(e,p_);for(let d=0;d<p_.length;d++)p_[d].object=this,n.push(p_[d])}}copy(e){const n=this.geometry;return super.copy(e),this.geometry=n,BGe.forEach(r=>{this[r]=e[r]}),this}clone(){return new this.constructor().copy(this)}};lce.forEach(t=>{const e="_private_"+t;Object.defineProperty(cce.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});new ma;new Qt;const j_=E.forwardRef(({sdfGlyphSize:t=64,anchorX:e="center",anchorY:n="middle",font:r,fontSize:i=1,children:s,characters:a,onSync:o,...l},u)=>{const d=bs(({invalidate:m})=>m),[h]=E.useState(()=>new cce),[p,f]=E.useMemo(()=>{const m=[];let x="";
4897return E.Children.forEach(s,v=>{typeof v=="string"||typeof v=="number"?x+=v:m.push(v)}),[m,x]},[s]);return Sle(()=>new Promise(m=>_Ge({font:r,characters:a},m)),["troika-text",r,a]),E.useLayoutEffect(()=>void h.sync(()=>{d(),o&&o(h)})),E.useEffect(()=>()=>h.dispose(),[h]),E.createElement("primitive",Ax({object:h,ref:u,font:r,text:f,anchorX:e,anchorY:n,fontSize:i,sdfGlyphSize:t},l),p)}),OP=t=>t===Object(t)&&!Array.isArray(t)&&typeof t!="function";function ow(t,e){const n=bs(s=>s.gl),r=Eu(GA,OP(t)?Object.values(t):t);return E.useLayoutEffect(()=>{e==null||e(r)},[e]),E.useEffect(()=>{if("initTexture"in n){let s=[];Array.isArray(r)?s=r:r instanceof ui?s=[r]:OP(r)&&(s=Object.values(r)),s.forEach(a=>{a instanceof ui&&n.initTexture(a)})}},[n,r]),E.useMemo(()=>{if(OP(t)){const s={};let a=0;for(const o in t)s[o]=r[a++];return s}else return r},[t,r])}ow.preload=t=>Eu.preload(GA,t);ow.clear=t=>Eu.clear(GA,t);let dC=null,uce="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function dce(t=!0,e=!0,n){return r=>{n&&n(r),t&&(dC||(dC=new HHe),dC.setDecoderPath(typeof t=="string"?t:uce),r.setDRACOLoader(dC)),e&&r.setMeshoptDecoder(typeof IP=="function"?IP():IP)}}const t3=(t,e,n,r)=>Eu(k6,t,dce(e,n,r));t3.preload=(t,e,n,r)=>Eu.preload(k6,t,dce(e,n,r));t3.clear=t=>Eu.clear(k6,t);t3.setDecoderPath=t=>{uce=t};function FGe(t,e,n){const r=bs(p=>p.size),i=bs(p=>p.viewport),s=typeof t=="number"?t:r.width*i.dpr,a=r.height*i.dpr,o=(typeof t=="number"?n:t)||{},{samples:l=0,depth:u,...d}=o,h=E.useMemo(()=>{const p=new Yo(s,a,{minFilter:zr,magFilter:zr,type:Na,...d});return u&&(p.depthTexture=new TM(s,a,Zs)),p.samples=l,p},[]);return E.useLayoutEffect(()=>{h.setSize(s,a),l&&(h.samples=l)},[l,h,s,a]),E.useEffect(()=>()=>h.dispose(),[]),h}const OGe=t=>typeof t=="function",zGe=E.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:r,children:i,...s},a)=>{const o=bs(({set:v})=>v),l=bs(({camera:v})=>v),u=bs(({size:v})=>v),d=E.useRef(null);E.useImperativeHandle(a,()=>d.current,[]);const h=E.useRef(null),p=FGe(e);E.useLayoutEffect(()=>{s.manual||(d.current.aspect=u.width/u.height)},[u,s]),E.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let f=0,m=null;const x=OGe(i);return QM(v=>{x&&(n===1/0||f<n)&&(h.current.visible=!1,v.gl.setRenderTarget(p),m=v.scene.background,t&&(v.scene.background=t),v.gl.render(v.scene,d.current),v.scene.background=m,v.gl.setRenderTarget(null),h.current.visible=!0,f++)}),E.useLayoutEffect(()=>{if(r){const v=l;return o(()=>({camera:d.current})),()=>o(()=>({camera:v}))}},[d,r,o]),E.createElement(E.Fragment,null,E.createElement("perspectiveCamera",Ax({ref:d},s),!x&&i),E.createElement("group",{ref:h},x&&i(p.texture)))}),N6=E.forwardRef(({makeDefault:t,camera:e,regress:n,domElement:r,enableDamping:i=!0,keyEvents:s=!1,onChange:a,onStart:o,onEnd:l,...u},d)=>{const h=bs(k=>k.invalidate),p=bs(k=>k.camera),f=bs(k=>k.gl),m=bs(k=>k.events),x=bs(k=>k.setEvents),v=bs(k=>k.set),g=bs(k=>k.get),b=bs(k=>k.performance),y=e||p,S=r||m.connected||f.domElement,A=E.useMemo(()=>new nHe(y),[y]);return QM(()=>{A.enabled&&A.update()},-1),E.useEffect(()=>(s&&A.connect(s===!0?S:s),A.connect(S),()=>void A.dispose()),[s,S,n,A,h]),E.useEffect(()=>{const k=C=>{h(),n&&b.regress(),a&&a(C)},M=C=>{o&&o(C)},T=C=>{l&&l(C)};return A.addEventListener("change",k),A.addEventListener("start",M),A.addEventListener("end",T),()=>{A.removeEventListener("start",M),A.removeEventListener("end",T),A.removeEventListener("change",k)}},[a,o,l,A,h,x]),E.useEffect(()=>{if(t){const k=g().controls;return v({controls:A}),()=>v({controls:k})}},[t,A]),E.createElement("primitive",Ax({ref:d,object:A,enableDamping:i},u))}),UGe=3e3,HGe=3001,hce=(t,e,n)=>{let r;switch(t){case Tc:r=new Uint8ClampedArray(e*n*4);break;case Na:r=new Uint16Array(e*n*4);break;case dh:r=new Uint32Array(e*n*4);break;case kz:r=new Int8Array(e*n*4);break;case Cz:r=new Int16Array(e*n*4);break;case EM:r=new Int32Array(e*n*4);break;case Zs:r=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return r};let hC;const GGe=(t,e,n,r)=>{if(hC!==void 0)return hC;const i=new Yo(1,1,r);e.setRenderTarget(i);const s=new Li(new Td,new ml({color:16777215}));e.render(s,n),e.setRenderTarget(null);const a=hce(t,i.width,i.height);return e.readRenderTargetPixels(i,0,0,i.width,i.height,a),i.dispose(),s.geometry.dispose(),s.material.dispose(),hC=a[0]!==0,hC};class T6{constructor(e){$n(this,"_renderer");$n(this,"_rendererIsDisposable",!1);$n(this,"_material");$n(this,"_scene");$n(this,"_camera");$n(this,"_quad");$n(this,"_renderTarget");$n(this,"_width");$n(this,"_height");$n(this,"_type");$n(this,"_colorSpace");$n(this,"_supportsReadPixels",!0);$n(this,"render",()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)});var r,i,s,a,o,l,u,d,h,p,f,m,x,v,g,b;this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace
vendor: 5,192 bytes, line 4897
4897=e.colorSpace;const n={format:fa,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((r=e.renderTargetOptions)==null?void 0:r.anisotropy)!==void 0?(i=e.renderTargetOptions)==null?void 0:i.anisotropy:1,generateMipmaps:((s=e.renderTargetOptions)==null?void 0:s.generateMipmaps)!==void 0?(a=e.renderTargetOptions)==null?void 0:a.generateMipmaps:!1,magFilter:((o=e.renderTargetOptions)==null?void 0:o.magFilter)!==void 0?(l=e.renderTargetOptions)==null?void 0:l.magFilter:zr,minFilter:((u=e.renderTargetOptions)==null?void 0:u.minFilter)!==void 0?(d=e.renderTargetOptions)==null?void 0:d.minFilter:zr,samples:((h=e.renderTargetOptions)==null?void 0:h.samples)!==void 0?(p=e.renderTargetOptions)==null?void 0:p.samples:void 0,wrapS:((f=e.renderTargetOptions)==null?void 0:f.wrapS)!==void 0?(m=e.renderTargetOptions)==null?void 0:m.wrapS:Ji,wrapT:((x=e.renderTargetOptions)==null?void 0:x.wrapT)!==void 0?(v=e.renderTargetOptions)==null?void 0:v.wrapT:Ji};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=T6.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new DA,this._camera=new _h,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!GGe(this._type,this._renderer,this._camera,n)){let y;switch(this._type){case Na:y=this._renderer.extensions.has("EXT_color_buffer_float")?Zs:void 0;break}y!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Zs}`),this._type=y):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Li(new Td,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Yo(this.width,this.height,n),this._renderTarget.texture.mapping=((g=e.renderTargetOptions)==null?void 0:g.mapping)!==void 0?(b=e.renderTargetOptions)==null?void 0:b.mapping:Xm}static instantiateRenderer(){const e=new jM;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=hce(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const n=new Tm(this.toArray(),this.width,this.height,fa,this._type,(e==null?void 0:e.mapping)||Xm,(e==null?void 0:e.wrapS)||Ji,(e==null?void 0:e.wrapT)||Ji,(e==null?void 0:e.magFilter)||zr,(e==null?void 0:e.minFilter)||zr,(e==null?void 0:e.anisotropy)||1,Pc);return n.generateMipmaps=(e==null?void 0:e.generateMipmaps)!==void 0?e==null?void 0:e.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof bl&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof ui&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof ui&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class fce extends Error{}class pce extends Error{}const m_=(t,e,n)=>{const r=new RegExp(`${e}="([^"]*)"`,"i").exec(t);if(r)return r[1];const i=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(t);if(i){const s=i[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return s&&s.length===3?s.map(a=>a.replace(/<\/?rdf:li>/g,"")):i[1].trim()}if(n!==void 0)return n;throw new Error(`Can't find ${e} in gainmap metadata`)},VGe=t=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(t):e=t.toString();let n=e.indexOf("<x:xmpmeta");for(;n!==-1;){const r=e.indexOf("x:xmpmeta>",n),i=e.slice(n,r+10);try{const s=m_(i,"hdrgm:GainMapMin","0"),a=m_(i,"hdrgm:GainMapMax"),o=m_(i,"hdrgm:Gamma","1"),l=m_(i,"hdrgm:OffsetSDR","0.015625"),u=m_(i,"hdrgm:OffsetHDR","0.015625"),d=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(i),h=d?d[1]:"0",p=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(i);if(!p)throw new Error("Incomplete gainmap metadata");const f=p[1];return{gainMapMin:Array.isArray(s)?s.map(m=>parseFloat(m)):[parseFloat(s),parseFloat(s),parseFloat(s)],gainMapMax:Array.isArray(a)?a.map(m=>parseFloat(m)):[parseFloat(a),parseFloat(a),parseFloat(a)],gamma:Array.isArray(o)?o.map(m=>parseFloat(m)):[parseFloat(o),parseFloat(o),parseFloat(o)],offsetSdr:Array.isArray(l)?l.map(m=>parseFloat(m)):[parseFloat(l),parseFloat(l),parseFloat(l)],offsetHdr:Array.isArray(u)?u.map(m=>parseFloat(m)):[parseFloat(u),parseFloat(u),parseFloat(u)],hdrCapacityMin:parseFloat(h),hdrCapacityMax:p
vendor: 4,557 bytes, lines 4897-4902
4897arseFloat(f)}}catch{}n=e.indexOf("<x:xmpmeta",r)}};class WGe{constructor(e){$n(this,"options");this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((n,r)=>{const i=this.options.debug,s=new DataView(e.buffer);if(s.getUint16(0)!==65496){r(new Error("Not a valid jpeg"));return}const a=s.byteLength;let o=2,l=0,u;for(;o<a;){if(++l>250){r(new Error(`Found no marker after ${l} loops ðµ`));return}if(s.getUint8(o)!==255){r(new Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${s.getUint8(o).toString(16)}`));return}if(u=s.getUint8(o+1),i&&console.log(`Marker: ${u.toString(16)}`),u===226){i&&console.log("Found APP2 marker (0xffe2)");const d=o+4;if(s.getUint32(d)===1297106432){const h=d+4;let p;if(s.getUint16(h)===18761)p=!1;else if(s.getUint16(h)===19789)p=!0;else{r(new Error("No valid endianness marker found in TIFF header"));return}if(s.getUint16(h+2,!p)!==42){r(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const f=s.getUint32(h+4,!p);if(f<8){r(new Error("Not valid TIFF data! (First offset less than 8)"));return}const m=h+f,x=s.getUint16(m,!p),v=m+2;let g=0;for(let A=v;A<v+12*x;A+=12)s.getUint16(A,!p)===45057&&(g=s.getUint32(A+8,!p));const y=m+2+x*12+4,S=[];for(let A=y;A<y+g*16;A+=16){const k={MPType:s.getUint32(A,!p),size:s.getUint32(A+4,!p),dataOffset:s.getUint32(A+8,!p),dependantImages:s.getUint32(A+12,!p),start:-1,end:-1,isFII:!1};k.dataOffset?(k.start=h+k.dataOffset,k.isFII=!1):(k.start=0,k.isFII=!0),k.end=k.start+k.size,S.push(k)}if(this.options.extractNonFII&&S.length){const A=new Blob([s]),k=[];for(const M of S){if(M.isFII&&!this.options.extractFII)continue;const T=A.slice(M.start,M.end+1,"image/jpeg");k.push(T)}n(k)}}}o+=2+s.getUint16(o+2)}})}}const $Ge=async t=>{const e=VGe(t);if(!e)throw new pce("Gain map XMP metadata not found");const r=await new WGe({extractFII:!0,extractNonFII:!0}).extract(t);if(r.length!==2)throw new fce("Gain map recovery image not found");return{sdr:new Uint8Array(await r[0].arrayBuffer()),gainMap:new Uint8Array(await r[1].arrayBuffer()),metadata:e}},xK=t=>new Promise((e,n)=>{const r=document.createElement("img");r.onload=()=>{e(r)},r.onerror=i=>{n(i)},r.src=URL.createObjectURL(t)});class KGe extends wo{constructor(n,r){super(r);$n(this,"_renderer");$n(this,"_renderTargetOptions");$n(this,"_internalLoadingManager");$n(this,"_config");this._config=n,n.renderer&&(this._renderer=n.renderer),this._internalLoadingManager=new JM}setRenderer(n){return this._renderer=n,this}setRenderTargetOptions(n){return this._renderTargetOptions=n,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const n=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new ui,sdr:new ui});return this._config.createQuadRenderer({width:16,height:16,type:Na,colorSpace:Pc,material:n,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(n,r,i){const s=r?new Blob([r],{type:"image/jpeg"}):void 0,a=new Blob([n],{type:"image/jpeg"});let o,l,u=!1;if(typeof createImageBitmap>"u"){const d=await Promise.all([s?xK(s):Promise.resolve(void 0),xK(a)]);l=d[0],o=d[1],u=i==="flipY"}else{const d=await Promise.all([s?createImageBitmap(s,{imageOrientation:i||"flipY"}):Promise.resolve(void 0),createImageBitmap(a,{imageOrientation:i||"flipY"})]);l=d[0],o=d[1]}return{sdrImage:o,gainMapImage:l,needsFlip:u}}createTextures(n,r,i){const s=new ui(r||new ImageData(2,2),Xm,Ji,Ji,zr,aD,fa,Tc,1,Pc);s.flipY=i,s.needsUpdate=!0;const a=new ui(n,Xm,Ji,Ji,zr,aD,fa,Tc,1,os);return a.flipY=i,a.needsUpdate=!0,{gainMap:s,sdr:a}}updateQuadRenderer(n,r,i,s,a){n.width=r.width,n.height=r.height,n.material.gainMap=i,n.material.sdr=s,n.material.gainMapMin=a.gainMapMin,n.material.gainMapMax=a.gainMapMax,n.material.offsetHdr=a.offsetHdr,n.material.offsetSdr=a.offsetSdr,n.material.gamma=a.gamma,n.material.hdrCapacityMin=a.hdrCapacityMin,n.material.hdrCapacityMax=a.hdrCapacityMax,n.material.maxDisplayBoost=Math.pow(2,a.hdrCapacityMax),n.material.needsUpdate=!0}}const qGe=` 4898varying vec2 vUv; 4899 4900void main() { 4901 vUv = uv; 4902 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
4902); 4903} 4904`,XGe=` 4905// min half float value 4906#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) 4907// max half float value 4908#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) 4909 4910uniform sampler2D sdr; 4911uniform sampler2D gainMap; 4912uniform vec3 gamma; 4913uniform vec3 offsetHdr; 4914uniform vec3 offsetSdr; 4915uniform vec3 gainMapMin; 4916uniform vec3 gainMapMax; 4917uniform float weightFactor; 4918 4919varying vec2 vUv; 4920 4921void main() { 4922 vec3 rgb = texture2D( sdr, vUv ).rgb; 4923 vec3 recovery = texture2D( gainMap, vUv ).rgb; 4924 vec3 logRecovery = pow( recovery, gamma ); 4925 vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; 4926 vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; 4927 vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); 4928 gl_FragColor = vec4( clampedHdrColor , 1.0 ); 4929} 4930`;class YGe extends bl{constructor({gamma:n,offsetHdr:r,offsetSdr:i,gainMapMin:s,gainMapMax:a,maxDisplayBoost:o,hdrCapacityMin:l,hdrCapacityMax:u,sdr:d,gainMap:h}){super({name:"GainMapDecoderMaterial",vertexShader:qGe,fragmentShader:XGe,uniforms:{sdr:{value:d},gainMap:{value:h},gamma:{value:new Ie(1/n[0],1/n[1],1/n[2])},offsetHdr:{value:new Ie().fromArray(r)},offsetSdr:{value:new Ie().fromArray(i)},gainMapMin:{value:new Ie().fromArray(s)},gainMapMax:{value:new Ie().fromArray(a)},weightFactor:{value:(Math.log2(o)-l)/(u-l)}},blending:bh,depthTest:!1,depthWrite:!1});$n(this,"_maxDisplayBoost");$n(this,"_hdrCapacityMin");$n(this,"_hdrCapacityMax");this._maxDisplayBoost=o,this._hdrCapacityMin=l,this._hdrCapacityMax=u,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(n){this.uniforms.sdr.value=n}get gainMap(){return this.uniforms.gainMap.value}set gainMap(n){this.uniforms.gainMap.value=n}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(n){this.uniforms.offsetHdr.value.fromArray(n)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(n){this.uniforms.offsetSdr.value.fromArray(n)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(n){this.uniforms.gainMapMin.value.fromArray(n)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(n){this.uniforms.gainMapMax.value.fromArray(n)}get gamma(){const n=this.uniforms.gamma.value;return[1/n.x,1/n.y,1/n.z]}set gamma(n){const r=this.uniforms.gamma.value;r.x=1/n[0],r.y=1/n[1],r.z=1/n[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(n){this._hdrCapacityMin=n,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(n){this._hdrCapacityMax=n,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(n){this._maxDisplayBoost=Math.max(1,Math.min(65504,n)),this.calculateWeight()}calculateWeight(){const n=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,n))}}class mce extends KGe{constructor(e,n){super({renderer:e,createMaterial:r=>new YGe(r),createQuadRenderer:r=>new T6(r)},n)}async render(e,n,r,i){const{sdrImage:s,gainMapImage:a,needsFlip:o}=await this.processImages(r,i,"flipY"),{gainMap:l,sdr:u}=this.createTextures(s,a,o);this.updateQuadRenderer(e,s,l,u,n),e.render()}}class JGe extends mce{load([e,n,r],i,s,a){const o=this.prepareQuadRenderer();let l,u,d;const h=async()=>{if(l&&u&&d){try{await this.render(o,d,l,u)}catch(C){this.manager.itemError(e),this.manager.itemError(n),this.manager.itemError(r),typeof a=="function"&&a(C),o.disposeOnDemandRenderer();return}typeof i=="function"&&i(o),this.manager.itemEnd(e),this.manager.itemEnd(n),this.manager.itemEnd(r),o.disposeOnDemandRenderer()}};let p=!0,f=0,m=0,x=!0,v=0,g=0,b=!0,y=0,S=0;const A=()=>{if(typeof s=="function"){const C=f+v+y,R=m+g+S,P=p&&x&&b;s(new ProgressEvent("progress",{lengthComputable:P,loaded:R,total:C}))}};this.manager.itemStart(e),this.manager.itemStart(n),this.manager.itemStart(r);const k=new xo(this._internalLoadingManager);k.setResponseType("arraybuffer"),k.setRequestHeader(this.requestHeader),k.setPath(this.path),k.setWithCredentials(this.withCredentials),k.load(e,async C=>
4930{if(typeof C=="string")throw new Error("Invalid sdr buffer");l=C,await h()},C=>{p=C.lengthComputable,m=C.loaded,f=C.total,A()},C=>{this.manager.itemError(e),typeof a=="function"&&a(C)});const M=new xo(this._internalLoadingManager);M.setResponseType("arraybuffer"),M.setRequestHeader(this.requestHeader),M.setPath(this.path),M.setWithCredentials(this.withCredentials),M.load(n,async C=>{if(typeof C=="string")throw new Error("Invalid gainmap buffer");u=C,await h()},C=>{x=C.lengthComputable,g=C.loaded,v=C.total,A()},C=>{this.manager.itemError(n),typeof a=="function"&&a(C)});const T=new xo(this._internalLoadingManager);return T.setRequestHeader(this.requestHeader),T.setPath(this.path),T.setWithCredentials(this.withCredentials),T.load(r,async C=>{if(typeof C!="string")throw new Error("Invalid metadata string");d=JSON.parse(C),await h()},C=>{b=C.lengthComputable,S=C.loaded,y=C.total,A()},C=>{this.manager.itemError(r),typeof a=="function"&&a(C)}),o}}class ZGe extends mce{load(e,n,r,i){const s=this.prepareQuadRenderer(),a=new xo(this._internalLoadingManager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,async o=>{if(typeof o=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const l=new Uint8Array(o);let u,d,h;try{const p=await $Ge(l);u=p.sdr,d=p.gainMap,h=p.metadata}catch(p){if(p instanceof pce||p instanceof fce)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),h={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},u=l;else throw p}try{await this.render(s,h,u.buffer,d==null?void 0:d.buffer)}catch(p){this.manager.itemError(e),typeof i=="function"&&i(p),s.disposeOnDemandRenderer();return}typeof n=="function"&&n(s),this.manager.itemEnd(e),s.disposeOnDemandRenderer()},r,o=>{this.manager.itemError(e),typeof i=="function"&&i(o)}),s}}const RS={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},gce="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",yb=t=>Array.isArray(t),M6=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function n3({files:t=M6,path:e="",preset:n=void 0,encoding:r=void 0,extensions:i}={}){let s=null,a=!1;n&&(R6(n),t=RS[n],e=gce),a=yb(t);const{extension:o,isCubemap:l}=j6(t);if(s=P6(o),!s)throw new Error("useEnvironment: Unrecognized file extension: "+t);const u=bs(f=>f.gl);E.useLayoutEffect(()=>{if(o!=="webp"&&o!=="jpg"&&o!=="jpeg")return;function f(){Eu.clear(s,a?[t]:t)}u.domElement.addEventListener("webglcontextlost",f,{once:!0})},[t,u.domElement]);const d=Eu(s,a?[t]:t,f=>{(o==="webp"||o==="jpg"||o==="jpeg")&&f.setRenderer(u),f.setPath==null||f.setPath(e),i&&i(f)});let h=a?d[0]:d;if(o==="jpg"||o==="jpeg"||o==="webp"){var p;h=(p=h.renderTarget)==null?void 0:p.texture}return h.mapping=l?Th:n1,"colorSpace"in h?h.colorSpace=r??l?"srgb":"srgb-linear":h.encoding=r??l?HGe:UGe,h}const QGe={files:M6,path:"",preset:void 0,extensions:void 0};n3.preload=t=>{const e={...QGe,...t};let{files:n,path:r=""}=e;
4930const{preset:i,extensions:s}=e;i&&(R6(i),n=RS[i],r=gce);const{extension:a}=j6(n);if(a==="webp"||a==="jpg"||a==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const o=P6(a);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);Eu.preload(o,yb(n)?[n]:n,l=>{l.setPath==null||l.setPath(r),s&&s(l)})};const eVe={files:M6,preset:void 0};n3.clear=t=>{const e={...eVe,...t};let{files:n}=e;const{preset:r}=e;r&&(R6(r),n=RS[r]);const{extension:i}=j6(n),s=P6(i);if(!s)throw new Error("useEnvironment: Unrecognized file extension: "+n);Eu.clear(s,yb(n)?[n]:n)};function R6(t){if(!(t in RS))throw new Error("Preset must be one of: "+Object.keys(RS).join(", "))}function j6(t){var e;const n=yb(t)&&t.length===6,r=yb(t)&&t.length===3&&t.some(a=>a.endsWith("json")),i=yb(t)?t[0]:t;return{extension:n?"cube":r?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:n,isGainmap:r}}function P6(t){return t==="cube"?ole:t==="hdr"?zHe:t==="exr"?UHe:t==="jpg"||t==="jpeg"?ZGe:t==="webp"?JGe:null}const tVe=t=>t.current&&t.current.isScene,nVe=t=>tVe(t)?t.current:t;function L6(t,e,n,r,i={}){var s,a,o,l;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const u=nVe(e||n),d=u.background,h=u.environment,p={backgroundBlurriness:u.backgroundBlurriness,backgroundIntensity:u.backgroundIntensity,backgroundRotation:(s=(a=u.backgroundRotation)==null||a.clone==null?void 0:a.clone())!==null&&s!==void 0?s:[0,0,0],environmentIntensity:u.environmentIntensity,environmentRotation:(o=(l=u.environmentRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0]};return t!=="only"&&(u.environment=r),t&&(u.background=r),Bp(u,i),()=>{t!=="only"&&(u.environment=h),t&&(u.background=d),Bp(u,p)}}function I6({scene:t,background:e=!1,map:n,...r}){const i=bs(s=>s.scene);return E.useLayoutEffect(()=>{if(n)return L6(e,t,i,n,r)}),null}function xce({background:t=!1,scene:e,blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:s,environmentIntensity:a,environmentRotation:o,...l}){const u=n3(l),d=bs(h=>h.scene);return E.useLayoutEffect(()=>L6(t,e,d,u,{backgroundBlurriness:n??r,backgroundIntensity:i,backgroundRotation:s,environmentIntensity:a,environmentRotation:o})),E.useEffect(()=>()=>{u.dispose()},[u]),null}function rVe({children:t,near:e=.1,far:n=1e3,resolution:r=256,frames:i=1,map:s,background:a=!1,blur:o,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:d,environmentIntensity:h,environmentRotation:p,scene:f,files:m,path:x,preset:v=void 0,extensions:g}){const b=bs(T=>T.gl),y=bs(T=>T.scene),S=E.useRef(null),[A]=E.useState(()=>new DA),k=E.useMemo(()=>{const T=new $z(r);return T.texture.type=Na,T},[r]);E.useEffect(()=>()=>{k.dispose()},[k]),E.useLayoutEffect(()=>{if(i===1){const T=b.autoClear;b.autoClear=!0,S.current.update(b,A),b.autoClear=T}return L6(a,f,y,k.texture,{backgroundBlurriness:o??l,backgroundIntensity:u,backgroundRotation:d,environmentIntensity:h,environmentRotation:p})},[t,A,k.texture,f,y,a,i,b]);let M=1;return QM(()=>{if(i===1/0||M<i){const T=b.autoClear;b.autoClear=!0,S.current.update(b,A),b.autoClear=T,M++}}),E.createElement(E.Fragment,null,g7e(E.createElement(E.Fragment,null,t,E.createElement("cubeCamera",{ref:S,args:[e,n,k]}),m||v?E.createElement(xce,{background:!0,files:m,preset:v,path:x,extensions:g}):s?E.createElement(I6,{background:!0,map:s,extensions:g}):null),A))}function iVe(t){var e,n,r,i;const s=n3(t),a=t.map||s;E.useMemo(()=>Cle({GroundProjectedEnvImpl:q7e}),[]),E.useEffect(()=>()=>{s.dispose()},[s]);const o=E.useMemo(()=>[a],[a]),l=(e=t.ground)==null?void 0:e.height,u=(n=t.ground)==null?void 0:n.radius,d=(r=(i=t.ground)==null?void 0:i.scale)!==null&&r!==void 0?r:1e3;return E.createElement(E.Fragment,null,E.createElement(I6,Ax({},t,{map:a})),E.createElement("groundProjectedEnvImpl",{args:o,scale:d,height:l,radius:u}))}function vce(t){return t.ground?E.createElement(iVe,t):t.map?E.createElement(I6,t):t.children?E.createElement(rVe,t):E.createElement(xce,t)}const yce=E.forwardRef(({scale:t=10,frames:e=1/0,opacity:n=1,width:r=1,height:i=1,blur:s=1,near:a=0,far:o=10,resolution:l=512,smooth:u=!0,color:d="#000000",depthWrite:h=!1,renderOrder:p,...f},m)=>{const x=E.useRef(null),v=bs(B=>B.scene),g=bs(B=>B.gl),b=E.useRef(null);r=r*(Array.isArray(t)?t[0]:t||1),i=i*(Array.isArray(t)?t[1]:t||1);const[y,S,A,k,M,T,C]=E.useMemo(()=>{const B=new Yo(l,l),$=new Yo(l,l);$.texture.generateMipmaps=B.texture.generateMipmaps=!1;const U=new Td(r,i).rotateX(Math.PI/2),Z=new Li(U),V=new IA;V.depthTest=V.depthWrite=!1,V.onBeforeCompile=Y=>{Y.uniforms={...Y.uniforms,ucolor:{value:new Qt(d)}},Y.fragmentShader=Y.fragmentShader.replace("void main() {",`uniform vec3 ucolor; 4931 void main() { 4932 `),Y.fragmentShader=Y.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const W=new bl(FHe),O=new bl(OHe);return O.depthTest=W.depthTest=!1,[B,U,V,Z,W,O,$]},[l,r,i,t,d]),R=B=>{k.visible=!0,k.material=M,M.uniforms.tDiffuse.value=y.texture,M.uniforms.h.value=B*1/256,g.setRenderTarget(C),g.render(k,b.current),k.material=T,T.uniforms.tDiffuse.value=C.texture,T.uniforms.v.value=B*1/256,g.setRenderTarget(y),g.render(k,b.current),k.visible=!1};let P=0,j,G;return QM(()=>{b.current&&(e===1/0||P<e)&&(P++,j=v.background,G=v.overrideMaterial,x.current.visible=!1,v.background=null,v.overrideMaterial=A,g.setRenderTarget(y),g.render(v,b.current),R(s),u&&R(s*.4),g.setRenderTarget(null),x.current.visible=!0,v.overrideMaterial=G,v.background=j)}),E.useImperativeHandle(m,()=>x.current,[]),E.createElement("group",Ax({"rotation-x":Math.PI/2},f,{ref:x}),E.createElement("mesh",{renderOrder:p,geometry:S,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},E.createElement("meshBasicMaterial",{transparent:!0,map:y.texture,opacity:n,depthWrite:h})),E.createElement("orthographicCamera",{ref:b,args:[-r/2,r/2,i/2,-i/2,a,o]}))}),vK=180;function sVe(t,e,n,r){const i=yz[e];if(M_(t,n,r)<0)return 0;let a=0;for(const o of t.wuerfel)pb(o,n,r)&&o.istPlattform!==!0&&a++;return i.unterboden+a*i.wuerfelHoehe+i.coverplatte}
4932function bce({hersteller:t,konfig:e,onChange:n,gesamtKonfig:r,produkte:i,mode:s,offenerBlockId:a,onNeedBlock:o,onBlockClicked:l,kontextPadding:u=0,kontextKacheln:d,innenKacheln:h,seitenBeschriftung:p=!1,removeMode:f=!1,plattformBeimErstenKlick:m=!1}){const x=yz[t],v=e.grundflaecheRasterX,g=e.grundflaecheRasterZ,b=v*x.raster,y=g*x.raster,S=Math.max(0,Math.floor(u)),A=S*x.raster,k=b+2*A,M=y+2*A,[T,C]=E.useState(null),R=E.useRef(null),P=E.useRef(null),j=E.useRef(0);function G(K){const pe=R.current;if(K===null){pe!==null&&(R.current=null,C(null));return}(!pe||pe.spalte!==K.spalte||pe.reihe!==K.reihe||pe.gx!==K.gx||pe.gz!==K.gz)&&(R.current=K,C(K))}const B=Math.sqrt(k*k+M*M),$=B*1.2+60,U=Math.max(2e3,$*12+B),Z=E.useMemo(()=>{if(d&&d.length>0)return d;if(S<=0)return[];const K=[];for(let pe=-S;pe<v+S;pe++)for(let ye=-S;ye<g+S;ye++)pe>=0&&pe<v&&ye>=0&&ye<g||K.push({dSpalte:pe,dReihe:ye,bildUrl:null,farbe:"#d8d8d4"});return K},[d,S,v,g]),V=E.useMemo(()=>{const K=new Map;return{get:(ye,Se)=>{const ee=`${ye}|${Se??""}`,re=K.get(ee);if(re)return re;const me={color:ye,metalness:0,roughness:.85,textureUrl:Se};return K.set(ee,me),me}}},[]);function W(K,pe){return K<0||pe<0||K>=v||pe>=g?null:{spalte:K,reihe:pe,gx:1,gz:1}}function O(K,pe){for(let ye=0;ye<K.gx;ye++)for(let Se=0;Se<K.gz;Se++){const ee=K.spalte+ye,re=K.reihe+Se;for(const me of e.wuerfel)if(me.stapelIndex===pe&&pb(me,ee,re))return!1}return!0}function Y(K){let pe=-1;for(let ye=0;ye<K.gx;ye++)for(let Se=0;Se<K.gz;Se++){const ee=M_(e,K.spalte+ye,K.reihe+Se);ee>pe&&(pe=ee)}return pe+1}function z(){return Math.max(0,Math.floor((vK-x.unterboden-x.coverplatte)/x.wuerfelHoehe))}function I(K){const pe=Y(K);if(pe>=z()||!O(K,pe))return!1;if(pe===0)return!0;for(let ye=0;ye<K.gx;ye++)for(let Se=0;Se<K.gz;Se++){const ee=K.spalte+ye,re=K.reihe+Se;if(!J4e(e,ee,re,pe-1))return!1}return!0}function q(){if(s!=="einzeln")return null;if(a)return a}function te(K){if(s==="einzeln"&&K.blockId&&K.blockId!==a){l==null||l(K.blockId);return}if(M_(e,K.spalte,K.reihe)===K.stapelIndex&&K.istPlattform){const Se=e.wuerfel.indexOf(K);if(Se>=0){const ee=[...e.wuerfel];ee[Se]={...K,istPlattform:!1},n({...e,wuerfel:ee})}return}const ye=W(K.spalte,K.reihe);ye&&I(ye)&&se(ye)}function se(K){if(!I(K)){if(Y(K)>=z()){const re=Date.now();re-j.current>1500&&(j.current=re,zb.error(`Maximale Stapelhöhe von ${vK/100} m erreicht.`))}return}const pe=q();if(pe===void 0){o==null||o();return}const ye=Y(K),Se=m&&ye===0,ee={spalte:K.spalte,reihe:K.reihe,stapelIndex:ye,blockId:pe,groesseX:K.gx,groesseZ:K.gz,...Se?{istPlattform:!0}:{}};n({...e,wuerfel:[...e.wuerfel,ee]})}function ie(K,pe){const ye=M_(e,K,pe);if(ye<0)return;const Se=e.wuerfel.findIndex(me=>me.stapelIndex===ye&&pb(me,K,pe));if(Se<0)return;const ee=e.wuerfel[Se];if(m&&ye===0&&ee.istPlattform!==!0){const me=[...e.wuerfel];me[Se]={...ee,istPlattform:!0},n({...e,wuerfel:me});return}const re=[...e.wuerfel];re.splice(Se,1),n({...e,wuerfel:re})}const le=E.useMemo(()=>{const K=[];for(let pe=0;pe<v;pe++)for(let ye=0;ye<g;ye++)K.push({spalte:pe,reihe:ye});return K},[v,g]),xe=E.useMemo(()=>{const K=new Map;for(const[pe,ye]of Object.entries(r.felder))K.set(pe,{boden:Mj("Boden",ye.bodenVariante,t,i,{useTexture:!0}),cube:Mj("Cube",ye.cubeVariante,t,i,{useTexture:!0}),cover:Mj("Cover",ye.coverVariante,t,i,{useTexture:!0})});return K},[r,t,i]);function Ee(K,pe){const ye=K+b/2,Se=pe+y/2;if(ye<0||Se<0||ye>b||Se>y)return null;const ee=Math.min(v-1,Math.max(0,Math.floor(ye/x.raster))),re=Math.min(g-1,Math.max(0,Math.floor(Se/x.raster)));return{spalte:ee,reihe:re}}function ae(K,pe){const ye=W(K,pe);P.current={spalte:K,reihe:pe},G(ye)}const Q=E.useMemo(()=>[...e.wuerfel].sort((K,pe)=>K.stapelIndex-pe.stapelIndex),[e.wuerfel]),we=T?I(T):!1,Ae=T?(()=>{let K=0;for(let pe=0;pe<T.gx;pe++)for(let ye=0;ye<T.gz;ye++){const Se=sVe(e,t,T.spalte+pe,T.reihe+ye);Se>K&&(K=Se)}return K})():0;return c.jsxs(A6,{shadows:!0,frameloop:"demand",dpr:[1,1.5],camera:{position:[$,$*.8,$],fov:35,near:1,far:U},gl:{logarithmicDepthBuffer:!1,antialias:!1,powerPreference:"high-performance"},style:{width:"100%",height:"100%"},children:[c.jsx("color",{attach:"background",args:["#f4f5f7"]}),c.jsx("ambientLight",{intensity:.55}),c.jsx("directionalLight",{position:[200,400,200],intensity:1.1,castShadow:!0,"shadow-mapSize":[1024,1024],"shadow-bias":-5e-4}),c.jsx(vce,{preset:"apartment",resolution:64}),c.jsxs("group",{position:[-b/2,0,-y/2],children:[c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[b/2,-.5,y/2],receiveShadow:!0,raycast:()=>null,children:[c.jsx("planeGeometry",{args:[k,M]}),c.jsx("meshStandardMaterial",{color:"#eef0f2",polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1})]}),Z.map(K=>c.jsx(bK,{kachel:K,raster:x.raster,hoehe:x.unterboden,spec:V.get(K.farbe,K.bildUrl)},`ctx-${K.dSpalte}-${K.dReihe}`)),h==null?void 0:h.map(K=>c.jsx(bK,{kachel:K,raster:x.raster,hoehe:x.unterboden,spec:V.get(K.farbe,K.bildUrl)},`inn-${K.dSpalte}-${K.dReihe}`)),c.jsx(yK,{cellsX:v,cellsZ:g,raster:x.raster,offsetX:0,offsetZ:0}),(S>0||Z.length>0)&&c.jsxs(c.Fragment,{children:[c.jsx(yK,{cellsX:v+2*Math.max(S,1),cellsZ:g+2*Math.max(S,1),raster:x.raster,offsetX:-Math.max(A,x.raster),offsetZ:-Math.max(A,x.raster),color:"#cfd2d7"}),c.jsx(aVe,{totalW:b,totalD:y})]}),p&&c.jsx(oVe,{totalW:b,totalD:y,padW:Math.max(A,x.raster),raster:x.raster}),c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[b/2,0,y/2],onPointerMove:K=>{K.stopPropagation();const pe=Ee(K.point.x,K.point.z);if(!pe){G(null);return}ae(pe.spalte,pe.reihe)},onPointerOut:()=>G(null),onClick:K=>{K.stopPropagation();const pe=Ee(K.point.x,K.point.z);if(!pe)return;if(K.shiftKey||f){ie(pe.spalte,pe.reihe);return}const ye=W(pe.spalte,pe.reihe);ye&&se(ye)},children:[c.jsx("planeGeometry",{args:[b,y]}),c.jsx("meshBasicMaterial",{visible:!1})]}),Q.map((K,pe)=>{const{gx:ye,gz:Se}
4932=bM(K),ee=x.raster,re=(K.spalte+ye/2)*ee,me=(K.reihe+Se/2)*ee,Ge=Af(K).every(We=>M_(e,We.spalte,We.reihe)===K.stapelIndex),He=iN(K.spalte,K.reihe),_e=xe.get(He)??zP,Ne=r.felder[He],Ce=(Ne==null?void 0:Ne.mitBoden)!==!1?0:-x.unterboden,Ke=x.unterboden+K.stapelIndex*x.wuerfelHoehe+Ce,Qe=ye*ee,je=Se*ee;return c.jsxs("group",{children:[K.stapelIndex===0&&Af(K).map(We=>{const xt=iN(We.spalte,We.reihe),et=r.felder[xt];if((et==null?void 0:et.mitBoden)===!1)return null;const Je=xe.get(xt)??zP;return c.jsx(eB,{x:(We.spalte+.5)*ee,z:(We.reihe+.5)*ee,width:ee,height:x.unterboden,depth:ee,yCenter:x.unterboden/2,spec:Je.boden,castShadow:!0,receiveShadow:!0},`b-${We.spalte}-${We.reihe}`)}),!K.istPlattform&&c.jsxs(c.Fragment,{children:[c.jsx(eB,{x:re,z:me,width:Qe,height:x.wuerfelHoehe,depth:je,yCenter:Ke+x.wuerfelHoehe/2,spec:_e.cube,castShadow:!0,receiveShadow:!0,interactive:{onHover:()=>{G(null)},onHoverOut:()=>{},onClick:We=>{We||f?ie(K.spalte,K.reihe):te(K)}}}),(()=>{const We=(Xe,ut)=>e.wuerfel.some(lt=>lt!==K&<.stapelIndex===K.stapelIndex&&pb(lt,Xe,ut)),xt=K.spalte,et=K.reihe,Je=K.spalte+ye-1,Ze=K.reihe+Se-1,Me=[{nx:We(xt-1,et),nz:We(xt,et-1)},{nx:We(Je+1,et),nz:We(Je,et-1)},{nx:We(Je+1,Ze),nz:We(Je,Ze+1)},{nx:We(xt-1,Ze),nz:We(xt,Ze+1)}];return c.jsx(fVe,{cx:re,cy:Ke+x.wuerfelHoehe/2,cz:me,width:Qe,height:x.wuerfelHoehe,depth:je,eckprofilFarbe:hVe(K,r),cornerNeighbors:Me})})()]}),Ge&&Af(K).map(We=>{const xt=xe.get(iN(We.spalte,We.reihe))??zP,et=K.istPlattform?Ke:Ke+x.wuerfelHoehe;return c.jsx(lVe,{x:(We.spalte+.5)*ee,z:(We.reihe+.5)*ee,r:ee,thickness:x.coverplatte,yBase:et,spec:xt.cover,flush:!1,onHover:()=>G(null),onHoverOut:()=>{},onClick:Je=>{Je||f?ie(We.spalte,We.reihe):te(K)}},`c-${We.spalte}-${We.reihe}`)})]},`mod-${pe}-${K.spalte}-${K.reihe}-${K.stapelIndex}`)}),T&&c.jsx(uVe,{fp:T,yBasisCm:Ae,hersteller:t,erlaubt:we}),le.map(({spalte:K,reihe:pe})=>null)]}),c.jsx(yce,{position:[0,0,0],opacity:.35,scale:B*2,blur:2,far:50}),c.jsx(N6,{target:[0,30,0],enablePan:!0,enableDamping:!0,maxPolarAngle:Math.PI/2.05,minDistance:50,maxDistance:$*3,touches:{ONE:ud.ROTATE,TWO:ud.DOLLY_PAN}})]})}function yK({cellsX:t,cellsZ:e,raster:n,offsetX:r=0,offsetZ:i=0,color:s="#b9bdc4"}){const a=E.useMemo(()=>{const o=t*n,l=e*n,u=[],d=.05;for(let m=0;m<=t;m++){const x=r+m*n;u.push(x,d,i,x,d,i+l)}for(let m=0;m<=e;m++){const x=i+m*n;u.push(r,d,x,r+o,d,x)}const h=new or;h.setAttribute("position",new _n(u,3));const p=new Pa({color:s,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1}),f=new Ql(h,p);return f.raycast=()=>null,f},[t,e,n,r,i,s]);return c.jsx("primitive",{object:a})}function aVe({totalW:t,totalD:e}){const n=E.useMemo(()=>{const i=[0,.15,0,t,.15,0,t,.15,0,t,.15,e,t,.15,e,0,.15,e,0,.15,e,0,.15,0],s=new or;s.setAttribute("position",new _n(i,3));const a=new Pa({color:"#E6007E"}),o=new Ql(s,a);return o.raycast=()=>null,o},[t,e]);return c.jsx("primitive",{object:n})}function oVe({totalW:t,totalD:e,padW:n,raster:r}){const i=Math.max(r*.35,12),s=n+r*.35,a=4,o={fontSize:i,color:"#E6007E",anchorX:"center",anchorY:"middle",outlineWidth:i*.08,outlineColor:"#ffffff",renderOrder:10};return c.jsxs("group",{raycast:()=>null,children:[c.jsx(j_,{position:[t/2,a,e+s],rotation:[-Math.PI/2,0,0],...o,children:"Vorne"}),c.jsx(j_,{position:[t/2,a,-s],rotation:[-Math.PI/2,0,0],...o,children:"Hinten"}),c.jsx(j_,{position:[-s,a,e/2],rotation:[-Math.PI/2,0,-Math.PI/2],...o,children:"Links"}),c.jsx(j_,{position:[t+s,a,e/2],rotation:[-Math.PI/2,0,Math.PI/2],...o,children:"Rechts"})]})}function bK({kachel:t,raster:e,hoehe:n,spec:r}){return c.jsxs("group",{children:[c.jsx(eB,{x:(t.dSpalte+.5)*e,z:(t.dReihe+.5)*e,width:e,height:n,depth:e,yCenter:n/2,spec:r,receiveShadow:!0}),t.ersatz&&c.jsx(j_,{position:[(t.dSpalte+.5)*e,n+.2,(t.dReihe+.5)*e],rotation:[-Math.PI/2,0,0],fontSize:e*.32,color:"#E6007E",anchorX:"center",anchorY:"middle",outlineWidth:e*.025,outlineColor:"#ffffff",renderOrder:5,children:"BC"})]})}const zP={boden:{color:"#3a3f46",metalness:.3,roughness:.6,textureUrl:null},cube:{color:"#ffffff",metalness:.05,roughness:.5,textureUrl:null},cover:{color:"#2a2e34",metalness:.4,roughness:.5,textureUrl:null}};function lVe({x:t,z:e,r:n,thickness:r,yBase:i,spec:s,flush:a=!1,onHover:o,onHoverOut:l,onClick:u}){const d={onPointerOver:p=>{p.stopPropagation(),o()},onPointerOut:()=>l(),onClick:p=>{p.stopPropagation(),u(p.shiftKey)}},h=a?i-r/2:i+r/2;return s.textureUrl?c.jsx(E.Suspense,{fallback:c.jsxs("mesh",{position:[t,h,e],...d,children:[c.jsx("boxGeometry",{args:[n,r,n]}),c.jsx("meshStandardMaterial",{color:s.color})]}),children:c.jsx(cVe,{x:t,z:e,r:n,thickness:r,yCenter:h,spec:s,handlers:d})}):c.jsxs("mesh",{position:[t,h,e],castShadow:!0,receiveShadow:!0,...d,children:[c.jsx("boxGeometry",{args:[n,r,n]}),c.jsx("meshStandardMaterial",{color:s.color,metalness:s.metalness,roughness:s.roughness})]})}function cVe({x:t,z:e,r:n,thickness:r,yCenter:i,spec:s,handlers:a}){const o=ow(s.textureUrl),l=E.useMemo(()=>
4932{o.colorSpace=os,o.anisotropy=8;const u=new Lc({color:s.color,metalness:s.metalness,roughness:s.roughness}),d=new Lc({map:o,color:"#ffffff",metalness:s.metalness,roughness:s.roughness});return[u,u,d,u,u,u]},[o,s.color,s.metalness,s.roughness]);return c.jsx("mesh",{position:[t,i,e],castShadow:!0,receiveShadow:!0,material:l,...a,children:c.jsx("boxGeometry",{args:[n,r,n]})})}function uVe({fp:t,yBasisCm:e,hersteller:n,erlaubt:r}){const i=yz[n],s=i.raster,a=t.gx*s,o=t.gz*s,l=(t.spalte+t.gx/2)*s,u=(t.reihe+t.gz/2)*s,d=(e===0?i.unterboden:e-i.coverplatte)+.1;return c.jsxs("mesh",{position:[l,d+i.wuerfelHoehe/2,u],raycast:()=>null,renderOrder:2,children:[c.jsx("boxGeometry",{args:[a,i.wuerfelHoehe,o]}),c.jsx("meshStandardMaterial",{color:r?"#78AD48":"#dc2626",transparent:!0,opacity:.35,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2})]})}function eB({x:t,z:e,width:n,height:r,depth:i,yCenter:s,spec:a,castShadow:o,receiveShadow:l,highlight:u,interactive:d}){const h=d?{onPointerOver:x=>{x.stopPropagation(),d.onHover()},onPointerOut:()=>d.onHoverOut(),onClick:x=>{x.stopPropagation(),d.onClick(x.shiftKey)}}:{},p=d?void 0:()=>null,f=u?"#78AD48":"#000000",m=u?.35:0;return a.textureUrl?c.jsx(E.Suspense,{fallback:c.jsxs("mesh",{position:[t,s,e],raycast:p,...h,children:[c.jsx("boxGeometry",{args:[n,r,i]}),c.jsx("meshStandardMaterial",{color:a.color,metalness:a.metalness,roughness:a.roughness})]}),children:c.jsx(dVe,{x:t,z:e,width:n,height:r,depth:i,yCenter:s,spec:a,castShadow:o,receiveShadow:l,handlers:h,raycast:p})}):c.jsxs("mesh",{position:[t,s,e],castShadow:o,receiveShadow:l,raycast:p,...h,children:[c.jsx("boxGeometry",{args:[n,r,i]}),c.jsx("meshStandardMaterial",{color:a.color,metalness:a.metalness,roughness:a.roughness,emissive:f,emissiveIntensity:m})]})}function dVe({x:t,z:e,width:n,height:r,depth:i,yCenter:s,spec:a,castShadow:o,receiveShadow:l,handlers:u,raycast:d}){const h=ow(a.textureUrl),p=E.useMemo(()=>
4932(h.colorSpace=os,h.anisotropy=8,new Lc({map:h,color:"#ffffff",metalness:a.metalness,roughness:a.roughness})),[h,a.metalness,a.roughness]);return c.jsx("mesh",{position:[t,s,e],castShadow:o,receiveShadow:l,raycast:d,material:p,...u,children:c.jsx("boxGeometry",{args:[n,r,i]})})}const wK={weiÃ:"#f5f5f5",weiss:"#f5f5f5",schwarz:"#1a1d22",rot:"#c92626",blau:"#2563eb"};function hVe(t,e){const n=e.module.find(r=>r.spalte===t.spalte&&r.reihe===t.reihe&&r.stapelIndex===t.stapelIndex);return(n==null?void 0:n.eckprofilFarbe)||"weiÃ"}function fVe({cx:t,cy:e,cz:n,width:r,height:i,depth:s,eckprofilFarbe:a,cornerNeighbors:o}){const l=r/2,u=i/2,d=s/2,h=E.useMemo(()=>{const A=[];A.push(-l,u,-d,l,u,-d),A.push(l,u,-d,l,u,d),A.push(l,u,d,-l,u,d),A.push(-l,u,d,-l,u,-d),A.push(-l,-u,-d,l,-u,-d),A.push(l,-u,-d,l,-u,d),A.push(l,-u,d,-l,-u,d),A.push(-l,-u,d,-l,-u,-d);const k=new or;return k.setAttribute("position",new _n(A,3)),k},[l,u,d]),p={nx:!1,nz:!1},f=(o==null?void 0:o[0])??p,m=(o==null?void 0:o[1])??p,x=(o==null?void 0:o[2])??p,v=(o==null?void 0:o[3])??p,g=wK[a.toLowerCase()]||wK.weiÃ,b=.3,y=b/2+.05,S=[{sx:-1,sz:-1,nb:f},{sx:1,sz:-1,nb:m},{sx:1,sz:1,nb:x},{sx:-1,sz:1,nb:v}];return c.jsxs("group",{position:[t,e,n],raycast:()=>null,children:[c.jsx("lineSegments",{geometry:h,raycast:()=>null,children:c.jsx("lineBasicMaterial",{color:"#3a3f46",transparent:!0,opacity:.35})}),S.map((A,k)=>{const M=A.nb.nx?A.sx*(l-y):A.sx*(l+b/2),T=A.nb.nz?A.sz*(d-y):A.sz*(d+b/2);return c.jsxs("mesh",{position:[M,0,T],raycast:()=>null,children:[c.jsx("boxGeometry",{args:[b,i+.05,b]}),c.jsx("meshStandardMaterial",{color:g,metalness:.3,roughness:.55})]},k)})]})}function wce({produkte:t,loading:e,global:n,setGlobal:r,mode:i,onModeChange:s,bloecke:a,offenerBlockId:o,setOffenerBlockId:l,addBlock:u,updateBlock:d,closeBlock:h,removeBlock:p,wuerfelProBlock:f,onConfirmDeleteBlock:m,hideBodenWahl:x=!1}){var A;const v=Bj(t,"Boden");Bj(t,"Cube");const g=Bj(t,"Cover"),[b,y]=E.useState(null);if(e)return c.jsx("div",{className:"text-xs text-muted-foreground border-t border-border pt-3",children:"Farben werden geladenâ¦"});if(!t.length)return c.jsx("div",{className:"text-xs text-muted-foreground border-t border-border pt-3",children:"Noch keine Produkte importiert. Bitte im Admin CSV hochladen."});const S=i==="einzeln";return c.jsxs("div",{className:"border-t border-border pt-3 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-1 p-1 bg-muted rounded-md text-[11px]",children:[c.jsx("button",{type:"button",onClick:()=>s("alle-gleich"),className:`py-1.5 rounded transition ${i==="alle-gleich"?"bg-card text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:"Alle gleich"}),c.jsx("button",{type:"button",onClick:()=>s("einzeln"),className:`py-1.5 rounded transition ${i==="einzeln"?"bg-card text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:"Einzeln (Blöcke)"})]}),!S&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Auswahl gilt für alle Würfel. Cube ist immer weià â Akzente über Eckprofile."}),!x&&c.jsx(kK,{mitBoden:n.mitBoden!==!1,onToggle:k=>r(M=>({...M,mitBoden:k})),produkte:v,aktiv:n.bodenVariante,onWaehle:k=>r(M=>({...M,bodenVariante:k}))}),c.jsx(EK,{aktiv:n.eckprofilFarbe||"weiÃ",onWaehle:k=>r(M=>({...M,eckprofilFarbe:k}))}),c.jsx(AK,{produkte:g,aktiv:n.coverVariante,onWaehle:k=>r(M=>({...M,coverVariante:k}))})]}),S&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"text-[11px] text-muted-foreground leading-snug",children:"Würfel werden Blöcken zugeordnet. Jeder Block hat eigene Farben. Cube ist immer weià â Akzente über Eckprofile."}),a.length===0&&c.jsx("div",{className:"text-[11px] text-muted-foreground bg-muted/60 rounded p-2 leading-snug",children:'Noch kein Block. Klicken Sie unten auf âBlock hinzufügen", um zu starten.'}),a.map(k=>{const M=k.id===o,T=f[k.id]??0;return c.jsxs("div",{className:`border rounded-md ${M?"border-primary/60 bg-primary/5":"border-border bg-card"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1.5 text-[11px]",children:[c.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap min-w-0",children:[c.jsxs("span",{className:"font-medium text-foreground",children:["Block ",k.index]}),c.jsxs("span",{className:"text-muted-foreground",children:["(",T," Würfel)"]}),k.abgeschlossen?c.jsx("span",{className:"text-[10px] text-muted-foreground",children:"â abgeschlossen"}):M?c.jsx("span",{className:"text-[10px] text-primary font-medium",children:"â offen"}):null]}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-auto",children:[!k.abgeschlossen&&M&&c.jsx("button",{type:"button",onClick:()=>h(k.id),className:"text-[10px] text-primary hover:underline",children:"abschlieÃen"}),k.abgeschlossen&&c.jsx("button",{type:"button",onClick:()=>
4932{if(o&&o!==k.id){const C=a.find(R=>R.id===o);h(o),C&&zb.info(`Block ${C.index} abgeschlossen`)}d(k.id,{abgeschlossen:!1}),l(k.id),zb.success(`Block ${k.index} geöffnet`)},className:"text-[10px] text-muted-foreground hover:text-foreground hover:underline",children:"bearbeiten"}),c.jsx("button",{type:"button",onClick:()=>y(k.id),className:"text-[10px] text-destructive hover:underline",children:"löschen"})]})]}),M&&!k.abgeschlossen&&c.jsxs("div",{className:"border-t border-border/60 px-2 py-2 space-y-3",children:[!x&&c.jsx(kK,{mitBoden:k.mitBoden!==!1,onToggle:C=>d(k.id,{mitBoden:C}),produkte:v,aktiv:k.bodenVariante,onWaehle:C=>d(k.id,{bodenVariante:C}),compact:!0}),c.jsx(EK,{aktiv:k.eckprofilFarbe||"weiÃ",onWaehle:C=>d(k.id,{eckprofilFarbe:C}),compact:!0}),c.jsx(AK,{produkte:g,aktiv:k.coverVariante,onWaehle:C=>d(k.id,{coverVariante:C}),compact:!0})]})]},k.id)}),c.jsx("button",{type:"button",onClick:()=>u(),disabled:!!o,className:`w-full text-[11px] py-1.5 rounded border transition ${o?"border-border text-muted-foreground bg-muted/40 cursor-not-allowed":"border-primary text-primary hover:bg-primary/10"}`,title:o?"Bitte aktuellen Block zuerst abschlieÃen":"Neuen Block hinzufügen",children:"+ Block hinzufügen"})]}),c.jsx(vx,{open:!!b,onOpenChange:k=>!k&&y(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:"Block löschen?"}),c.jsx(Vm,{children:b&&`Block ${(A=a.find(k=>k.id===b))==null?void 0:A.index} wird gelöscht. Die ${f[b]??0} zugehörigen Würfel werden mitgelöscht. Möchten Sie fortfahren?`})]}),c.jsxs(Hm,{children:[c.jsx($m,{children:"Abbrechen"}),c.jsx(Wm,{onClick:()=>{b&&(m(b),p(b),y(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Löschen"})]})]})})]})}const _K=["Square wood light","Square wood dark","Light wood","Marble Travertine","Marble black","Marble white","Concrete dark","Concrete light","white","black"];function SK({cv:t,active:e,onWaehle:n}){return c.jsx("button",{type:"button",onClick:()=>n(t.variable),title:t.variable,className:`aspect-square rounded border overflow-hidden flex items-center justify-center bg-muted/40 transition ${e?"border-primary ring-2 ring-primary/40":"border-border hover:border-foreground
4932/40"}`,children:t.bild_url?c.jsx("img",{src:t.bild_url,alt:t.variable,className:"w-full h-full object-cover",loading:"lazy"}):c.jsx("span",{className:"text-[9px] text-center text-muted-foreground p-0.5 leading-tight",children:t.variable})})}function AK({produkte:t,aktiv:e,onWaehle:n,compact:r}){const{topProdukte:i,restProdukte:s}=E.useMemo(()=>{const u=new Map(t.map(f=>[f.variable,f])),d=[];for(const f of _K){const m=u.get(f);m&&d.push(m)}const h=new Set(d.map(f=>f.variable)),p=t.filter(f=>!h.has(f.variable));return{topProdukte:d,restProdukte:p}},[t]),a=!!e&&!_K.includes(e)&&s.some(u=>u.variable===e),[o,l]=E.useState(a);return c.jsxs("section",{className:"space-y-1.5",children:[c.jsx("h3",{className:`font-semibold text-foreground ${r?"text-[11px]":"text-xs"}`,children:"Cover"}),c.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:i.map(u=>c.jsx(SK,{cv:u,active:u.variable===e,onWaehle:n},u.variable))}),s.length>0&&c.jsxs("button",{type:"button",onClick:()=>l(u=>!u),className:"inline-flex items-center gap-1 text-[11px] font-medium text-foreground hover:text-primary transition",children:[o?c.jsx(g1,{className:"w-3.5 h-3.5"}):c.jsx(Su,{className:"w-3.5 h-3.5"}),o?"Weitere Cover ausblenden":`+ ${s.length} weitere Cover anzeigen`]}),o&&s.length>0&&c.jsx("div",{className:"grid grid-cols-3 gap-1.5 pt-1",children:s.map(u=>c.jsx(SK,{cv:u,active:u.variable===e,onWaehle:n},u.variable))}),e?c.jsxs("div",{className:"text-[11px] text-muted-foreground truncate",children:["Aktuell: ",c.jsx("span",{className:"text-foreground",children:e})]}):null]})}const pVe={weiÃ:"#ffffff",schwarz:"#1a1a1a",rot:"#c0282d",blau:"#1f5fb8"};function EK({aktiv:t,onWaehle:e,compact:n}){return c.jsxs("section",{className:"space-y-1.5",children:[c.jsx("h3",{className:`font-semibold text-foreground ${n?"text-[11px]":"text-xs"}`,children:"Eckprofil-Farbe"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:Z4e.map(r=>{const i=r===t;return c.jsxs("button",{type:"button",onClick:()=>e(r),title:r,className:`flex items-center gap-1 px-2 py-1 rounded-full border text-[11px] transition ${i?"border-primary ring-2 ring-primary/30 bg-primary/5":"border-border hover:border-foreground
4932/40 bg-card"}`,children:[c.jsx("span",{className:"w-3.5 h-3.5 rounded-full border border-border/60",style:{backgroundColor:pVe[r]}}),c.jsx("span",{className:"capitalize",children:r})]},r)})}),c.jsx("div",{className:"text-[10px] text-muted-foreground leading-snug",children:"Eckprofile setzen farbige Akzente an allen Würfel-Ecken (4 Stück pro Würfel)."})]})}function kK({mitBoden:t,onToggle:e,produkte:n,aktiv:r,onWaehle:i,compact:s}){return E.useEffect(()=>{t&&n.length===1&&r!==n[0].variable&&i(n[0].variable)},[t,n,r,i]),c.jsxs("section",{className:"space-y-2",children:[c.jsx("div",{className:"flex items-center justify-between",children:c.jsx("h3",{className:`font-semibold text-foreground ${s?"text-[11px]":"text-xs"}`,children:"Boden"})}),c.jsxs("div",{className:"grid grid-cols-2 gap-1 p-1 bg-muted rounded-md text-[11px]",children:[c.jsxs("button",{type:"button",onClick:()=>e(!0),className:`py-1.5 rounded transition flex items-center justify-center gap-1 ${t?"bg-card text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:["Mit Boden",c.jsx("span",{className:"text-[9px] text-primary font-medium",children:"empfohlen"})]}),c.jsx("button",{type:"button",onClick:()=>e(!1),className:`py-1.5 rounded transition ${t?"text-muted-foreground hover:text-foreground":"bg-card text-foreground shadow-sm font-medium"}`,children:"Ohne Boden"})]}),t&&n.length>1?c.jsx("div",{className:"flex flex-wrap gap-1",children:n.map(a=>{const o=a.variable===r;return c.jsx("button",{type:"button",onClick:()=>i(a.variable),className:`px-2 py-1 rounded text-[11px] border transition ${o?"bg-primary text-primary-foreground border-primary":"bg-card text-foreground border-border hover:bg-muted"}`,children:a.variable},a.variable)})}):t?null:c.jsx("div",{className:"text-[10px] text-muted-foreground leading-snug bg-muted/60 rounded px-1.5 py-1",children:"Boden entfällt â Cubes stehen direkt auf dem Untergrund. Wir empfehlen Bodenplatten für stabilen Stand und sauberen Abschluss."})]})}function mVe(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`b_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function gVe({open:t,bereich:e,bereichIndex:n,bodenConfig:r,onClose:i,onSave:s}){const{produkte:a,loading:o}=tw(),{toast:l}=HS(),u=Ph(),[d,h]=E.useState("3d"),p=E.useMemo(()=>{if(e)return{...e.global,mitBoden:!1};const I=(q,...te)=>{var se;for(const ie of te){const le=a.find(xe=>xe.bestandteil===q&&xe.variable.toLowerCase()===ie.toLowerCase());if(le)return le.variable}return((se=a.find(ie=>ie.bestandteil===q))==null?void 0:se.variable)??""};return{...Sz(),bodenVariante:I("Boden","Basic","schwarz"),cubeVariante:I("Cube","1x1","weiÃ","weiss"),coverVariante:I("Cover","black","schwarz"),mitBoden:!1}},[e,a]),[f,m]=E.useState({grundflaecheRasterX:(e==null?void 0:e.breiteRaster)??1,grundflaecheRasterZ:(e==null?void 0:e.tiefeRaster)??1,wuerfel:(e==null?void 0:e.wuerfel)??[]}),[x,v]=E.useState(p),[g,b]=E.useState((e==null?void 0:e.mode)??"alle-gleich"),[y,S]=E.useState((e==null?void 0:e.bloecke)??[]),[A,k]=E.useState(null),[M,T]=E.useState(!0);E.useEffect(()=>{!t||!e||(m({grundflaecheRasterX:e.breiteRaster,grundflaecheRasterZ:e.tiefeRaster,wuerfel:e.wuerfel}),v({...e.global,mitBoden:!1}),b(e.mode),S(e.bloecke),k(null))},[t,e]),E.useEffect(()=>{!t||!a.length||v(I=>{if(I.bodenVariante&&I.cubeVariante&&I.coverVariante)return I;const q=(te,...se)=>{var ie;for(const le of se){const xe=a.find(Ee=>Ee.bestandteil===te&&Ee.variable.toLowerCase()===le.toLowerCase());if(xe)return xe.variable}return((ie=a.find(le=>le.bestandteil===te))==null?void 0:ie.variable)??""};return{...I,bodenVariante:I.bodenVariante||q("Boden","Basic","schwarz"),cubeVariante:I.cubeVariante||q("Cube","1x1","weiÃ","weiss"),coverVariante:I.coverVariante||q("Cover","black","schwarz")}})},[t,a]);const C=E.useMemo(()=>Az(f,b0,x,g,y),[f,x,g,y]),{kontextKacheln:R,innenKacheln:P}=E.useMemo(()=>{var K;if(!e)return{kontextKacheln:[],innenKacheln:[]};const I=Math.max(1,Math.round(r.breite*2)),q=Math.max(1,Math.round(r.laenge*2)),te=new Map;for(const pe of r.finishBereiche??[])for(const ye of pe.platten)te.set(`${ye.r}_${ye.c}`,pe.designSchluessel);const se=new Set((r.ersatzPlatten??[]).map(pe=>`${pe.r}_${pe.c}`)),ie=r.bodenfinishKategorie==="Plattendesign"?r.plattendesign:null,le=r.bodenfinishKategorie==="Plattendesign"&&ie?xd(ie):null,xe=ie?((K=Ho(ie))==null?void 0:K.farbe)??"#d8d8d4":"#d8d8d4",Ee=(pe,ye)=>{var Ge;const Se=e.spalte+pe,ee=e.reihe+ye;if(!(Se>=0&&Se<I&&ee>=0&&ee<q))return{dSpalte:pe,dReihe:ye,bildUrl:null,farbe:"#eef0f2"};const me=te.get(`${ee}_${Se}`);return me?{dSpalte:pe,dReihe:ye,bildUrl:xd(me),farbe:((Ge=Ho(me))==null?void 0:Ge.farbe)??xe,ersatz:se.has(`${ee}_${Se}`)}:{dSpalte:pe,dReihe:ye,bildUrl:le,farbe:xe,ersatz:se.has(`${ee}_${Se}`)}},Q=e.spalte===0&&e.reihe===0&&e.breiteRaster===I&&e.tiefeRaster===q?0:1,we=[],Ae=[];for(let pe=-Q;pe<e.breiteRaster+Q;pe++)for(let ye=-Q;ye<e.tiefeRaster+Q;ye++)pe>=0&&pe<e.breiteRaster&&ye>=0&&ye<e.tiefeRaster?Ae.push(Ee(pe,ye)):we.push(Ee(pe,ye));return{kontextKacheln:we,innenKacheln:Ae}},[e,r.breite,r.laenge,r.plattendesign,r.bodenfinishKategorie,r.finishBereiche,r.ersatzPlatten]),j=E.useMemo(()=>{const I={};for(const q of f.wuerfel){const te=q.blockId;te&&(I[te]=(I[te]??0)+1)}return I},[f.wuerfel]);function G(I){const q=mVe(),te=y.reduce((le,xe)=>Math.max(le,xe.index),0)+1,se=(le,...xe)=>{var Ee;for(const ae of xe){const Q=a.find(we=>we.bestandteil===le&&we.variable.toLowerCase()===ae.toLowerCase());if(Q)return Q.variable}return((Ee=a.find(ae=>ae.bestandteil===le))==null?void 0:Ee.variable)??""},ie={id:q,index:te,bodenVariante:(I==null?void 0:I.bodenVariante)??(x.bodenVariante||se("Boden","Basic","schwarz")),cubeVariante:(I==null?void 0:I.cubeVariante)??(x.cubeVariante||se("Cube","1x1","weiÃ","weiss")),coverVariante:(I==null?void 0:I.coverVariante)??(x.coverVariante||se("Cover","black","schwarz")),eckprofilFarbe:(I==null?void 0:I.eckprofilFarbe)??(x.eckprofilFarbe||"weiÃ"),mitBoden:!1,abgeschlossen:!1};return S(le=>[...le,ie]),k(q),q}function B(I,q){S(te=>te.map(se=>se.id===I?{...se,...q}:se))}function $(I){S(q=>q.map(te=>te.id===I?{...te,abgeschlossen:!0}:te)),k(q=>q===I?null:q)}function U(I){S(q=>q.filter(te=>te.id!==I)),k(q=>q===I?null:q)}function Z(I){m(q=>({...q,wuerfel:q.wuerfel.filter(te=>te.blockId!==I)}))}const V=I=>{if(I!==g){if(I==="einzeln"&&f.wuerfel.length>0&&y.length===0){const q=G();m(te=>({...te,wuerfel:te.wuerfel.map(se=>({...se,blockId:q}))})),b("einzeln");return}b(I)}},W=f.wuerfel.length,O=!!e&&e.spalte===0&&e.reihe===0&&e.breiteRaster===Math.max(1,Math.round(r.breite*2))&&e.tiefeRaster===Math.max(1,Math.round(r.laenge*2)),Y=e?O?`Würfel platzieren · ${e.breiteRaster*Dp.raster/100} à ${e.tiefeRaster*Dp.raster/100} m Gesamtfläche`:`Würfel-Bereich ${n} · ${e.breiteRaster*Dp.raster/100} à ${e.tiefeRaster*Dp.raster/100} m`:"Würfel-Bereich";function z(){if(!e)return;const I=y.map(te=>te.abgeschlossen?te:{...te,abgeschlossen:!0});let q=f.wuerfel;if(g==="einzeln"&&I.length>0){const te=A??I[0].id;q=f.wuerfel.map(se=>se.blockId?se:{...se,blockId:te})}s({...e,wuerfel:q,global:x,mode:g,bloecke:I})}return c.jsx(qf,{open:t,onOpenChange:I=>{I||i()},children:c.jsxs(jh,{className:` 4933 p-0 flex flex-col gap-0 4934 max-w-none w-screen h-[100dvh] rounded-none border-0 4935 sm:max-w-[min(1400px,98vw)] sm:w-[98vw] sm:h-[92vh] sm:rou
4935nded-lg sm:border 4936 `,children:[c.jsx(Xf,{className:"px-4 py-3 border-b border-border shrink-0",children:c.jsx(Yf,{className:"text-base sm:text-lg pr-8 truncate",children:Y})}),e&&c.jsxs(c.Fragment,{children:[u&&c.jsxs("div",{role:"tablist",className:"flex border-b border-border bg-card shrink-0",children:[c.jsxs("button",{type:"button",role:"tab","aria-selected":d==="3d",onClick:()=>h("3d"),className:`flex-1 flex items-center justify-center gap-2 h-11 text-sm font-medium transition ${d==="3d"?"text-[hsl(var(--konfig-primary))] border-b-2 border-[hsl(var(--konfig-primary))]":"text-[#6B7280] border-b-2 border-transparent"}`,children:[c.jsx(Vfe,{className:"w-4 h-4"})," 3D-Ansicht"]}),c.jsxs("button",{type:"button",role:"tab","aria-selected":d==="farben",onClick:()=>h("farben"),className:`flex-1 flex items-center justify-center gap-2 h-11 text-sm font-medium transition ${d==="farben"?"text-[hsl(var(--konfig-primary))] border-b-2 border-[hsl(var(--konfig-primary))]":"text-[#6B7280] border-b-2 border-transparent"}`,children:[c.jsx(Uf,{className:"w-4 h-4"})," Farben & Blöcke"]})]}),c.jsxs("div",{className:` 4937 flex-1 min-h-0 overflow-hidden gap-3 p-3 4938 ${u?"flex flex-col":"grid grid-cols-1 lg:grid-cols-[280px_1fr]"} 4939 `,children:[c.jsxs("aside",{className:` 4940 bg-card border border-border rounded-lg p-3 space-y-3 4941 lg:h-full lg:overflow-y-auto 4942 ${u?d==="farben"?"flex-1 min-h-0 overflow-y-auto":"hidden":""} 4943 `,children:[c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[c.jsx("div",{className:"font-medium text-foreground",children:O?"Bodenfläche":"BereichsgröÃe"}),c.jsxs("div",{children:[e.breiteRaster," à ",e.tiefeRaster," Zellen"]}),c.jsxs("div",{children:["â ",(e.breiteRaster*Dp.raster/100).toLocaleString("de-DE")," à ",(e.tiefeRaster*Dp.raster/100).toLocaleString("de-DE")," m"]}),!O&&c.jsx("div",{className:"text-[10px] opacity-70 leading-snug",children:"Die BereichsgröÃe können Sie nicht hier ändern. SchlieÃen Sie den Editor und ziehen Sie auf dem Grundriss einen neuen Bereich."})]}),c.jsx(wce,{produkte:a,loading:o,global:x,setGlobal:v,mode:g,onModeChange:V,bloecke:y,offenerBlockId:A,setOffenerBlockId:k,addBlock:G,updateBlock:B,closeBlock:$,removeBlock:U,gesamtKonfig:C,wuerfelProBlock:j,onConfirmDeleteBlock:Z,hideBodenWahl:!0})]}),c.jsx("main",{className:` 4944 bg-card border border-border rounded-lg flex flex-col overflow-hidden lg:h-full 4945 ${u?d==="3d"?"flex-1 min-h-0":"hidden":""} 4946 `,children:c.jsxs("div",{className:"flex-1 lg:min-h-0 min-h-[420px] relative bg-muted/30",children:[c.jsx(E.Suspense,{fallback:c.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground",children:"3D-Szene wird geladenâ¦"}),children:c.jsx(bce,{hersteller:b0,konfig:f,onChange:m,gesamtKonfig:C,produkte:a,mode:g,offenerBlockId:A,onNeedBlock:()=>l({title:"Kein Block geöffnet",description:"Bitte fügen Sie zuerst einen Block hinzu."}),kontextPadding:O?0:1,kontextKacheln:R,innenKacheln:P,seitenBeschriftung:!0})}),c.jsxs("div",{className:"absolute top-3 left-3 z-20 max-w-[280px]",children:[c.jsx("button",{type:"button",onClick:()=>T(I=>!I),"aria-expanded":M,"aria-label":"Bedienungshinweise anzeigen",className:"bg-card/90 backdrop-blur border border-border rounded-full h-9 w-9 flex items-center justify-center hover:bg-card transition shadow-sm",children:c.jsx(aF,{className:"w-4 h-4 text-muted-foreground"})}),M&&c.jsxs("div",{className:"mt-2 bg-card/95 backdrop-blur border border-border rounded-md px-3 py-2 text-xs text-muted-foreground shadow-md space-y-0.5",children:[c.jsx("div",{className:"font-medium text-foreground mb-1",children:"Bedienung"}),u?c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{children:"1. Tap â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Taps â Würfel stapeln"}),c.jsx("div",{children:'Modus âEntfernen" â Tap geht eine Stufe zurück'}),c.jsx("div",{children:"1 Finger ziehen â drehen"}),c.jsx("div",{children:"2 Finger ziehen â zoomen / verschieben"})]}):c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("div",{children:"1. Klick â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Klicks â Würfel stapeln"}),c.jsx("div",{children:"Shift + Klick â eine Stufe zurück"}),c.jsxs("div",{className:"pt-1 mt-1 border-t border-border/60",children:[c.jsx("div",{children:"Linke Maustaste halten â drehen"}),c.jsx("div",{children:"Rechte Maustaste halten â verschieben"}),c.jsx("div",{children:"Mausrad â zoomen"})]})]})]})]})]})})]}),c.jsx("div",{className:"border-t border-border px-3 sm:px-4 py-2 shrink-0 bg-card",children:c.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"truncate",children:[W," Würfel · ",y.length," ",y.length===1?"Block":"Blöcke"]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[c.jsx(Pt,{variant:"outline",onClick:i,className:"h-10 sm:h-9",children:"Verwerfen"}),c.jsx(Pt,{onClick:z,className:"h-10 sm:h-9 bg-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))] text-white",children:"Speichern"})]})]})})]})]})})}function xVe(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`wb_${Math.random().toString(36).slice(2,10)}`}function vVe(t,e,...n){var r;for(const i of n){const s=t.find(a=>a.bestandteil===e&&a.variable.toLowerCase()===i.toLowerCase());if(s)return s.variable}return((r=t.find(i=>i.bestandteil===e))==null?void 0:r.variable)??""}function CK(t,e,n){if(t.length===0)return{id:xVe(),spalte:0,reihe:0,breiteRaster:e,tiefeRaster:n,wuerfel:[],global:Sz(
4946),mode:"alle-gleich",bloecke:[]};const r=[],i=[];let s="alle-gleich";for(const o of t){o.mode==="einzeln"&&(s="einzeln");for(const l of o.bloecke)i.find(u=>u.id===l.id)||i.push({...l,index:i.length+1});for(const l of o.wuerfel){const u=l.spalte+o.spalte,d=l.reihe+o.reihe;u<0||u>=e||d<0||d>=n||r.push({...l,spalte:u,reihe:d})}}const a=t[0];return{id:a.id,spalte:0,reihe:0,breiteRaster:e,tiefeRaster:n,wuerfel:r,global:a.global,mode:s,bloecke:i}}function yVe({config:t,onChange:e}){const n=Math.max(1,Math.round(t.breite*2)),r=Math.max(1,Math.round(t.laenge*2)),i=t.wuerfelBereiche??[],s=i.length>0,[a,o]=E.useState(!1),{produkte:l}=tw();E.useEffect(()=>{if(i.length<=1)return;const v=CK(i,n,r);e({wuerfelBereiche:[v]})},[i.length]);const u=i[0]??null,d=(u==null?void 0:u.wuerfel.length)??0,h=(u==null?void 0:u.bloecke.length)??0;function p(){if(i.length>0){e({wuerfelHighlightsSkipped:!1}),o(!0);return}const v=CK([],n,r);e({wuerfelBereiche:[v],wuerfelHighlightsSkipped:!1}),o(!0)}function f(){d>0&&!window.confirm(`Möchten Sie wirklich alle ${d} platzierten Würfel entfernen? Diese Aktion kann nicht rückgängig gemacht werden.`)||e({wuerfelBereiche:[],wuerfelHighlightsSkipped:!0})}function m(v){const g=vVe(l,"Cover","black","schwarz"),b={...v,global:{...v.global,coverVariante:v.global.coverVariante||g},bloecke:v.bloecke.map(y=>({...y,coverVariante:y.coverVariante||v.global.coverVariante||g}))};e({wuerfelBereiche:[b]}),o(!1)}function x(){d>0&&!window.confirm(`Möchten Sie wirklich alle ${d} platzierten Würfel entfernen? Diese Aktion kann nicht rückgängig gemacht werden.`)||e({wuerfelBereiche:[]})}return s?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Würfel-Highlights"}),c.jsx("p",{className:"text-[#6B7280] mt-1",children:'Sie können beliebig viele Würfel auf Ihrer kompletten Bodenfläche platzieren. Im 3D-Editor wählen Sie die Cover- und Würfelfarbe â für unterschiedliche Bereiche nutzen Sie den Modus âEinzeln" mit mehreren Blöcken.'})]}),c.jsx("div",{className:"border border-[#E0E0E0] rounded-lg p-4 sm:p-6 bg-white",children:c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3 sm:gap-4 flex-1 min-w-0",children:[c.jsx("div",{className:"w-12 h-12 rounded-lg bg-[hsl(var(--konfig-primary-soft))] border border-[hsl(var(--konfig-primary))]/30 flex items-center justify-center shrink-0",children:c.jsx(dJ,{className:"w-6 h-6 text-[hsl(var(--konfig-primary))]"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"font-semibold text-[hsl(var(--konfig-ink))]",children:d===0?"Noch keine Würfel platziert":`${d} Würfel platziert`}),c.jsxs("div",{className:"text-sm text-[#6B7280] mt-0.5",children:["Fläche: ",t.breite.toLocaleString("de-DE")," à ",t.laenge.toLocaleString("de-DE")," m",h>0&&` · ${h} ${h===1?"Block":"Blöcke"}`]})]})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:shrink-0",children:[c.jsxs(Pt,{onClick:()=>o(!0),className:"h-11 sm:h-9 bg-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))] text-white",children:[c.jsx(v5,{className:"w-4 h-4 mr-1.5"}),"3D-Editor öffnen"]}),c.jsxs(Pt,{variant:"outline",onClick:x,className:"h-11 sm:h-9",children:[c.jsx(yo,{className:"w-4 h-4 mr-1.5"}),"Alle entfernen"]})]})]})}),c.jsx("div",{className:"text-xs text-[#6B7280] bg-[#F9FAFB] border border-[#E0E0E0] rounded-md p-3",children:"Hinweis: Bodenplatten und Finishplatten bleiben in der Gesamtmenge unverändert. Die Coverplate jeder Kachel mit Würfel wird durch das im 3D-Editor gewählte Cover überschrieben. Pro Kachel mit Würfel wird zusätzlich ein Paneel berechnet."}),c.jsx(gVe,{open:a,bereich:u,bereichIndex:1,bodenConfig:t,onClose:()=>o(!1),onSave:m})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Würfel-Highlights (optional)"}),c.jsx("p",{className:"text-[#6B7280] mt-1",children:"Möchten Sie auf Ihrer Bodenfläche eine Würfelkonstruktion platzieren â z. B. um beworbene Produkte auf dem Messestand in Szene zu setzen? Sie öffnen einen 3D-Editor mit Ihrer kompletten Bodenfläche und platzieren Würfel an beliebigen Stellen."})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("button",{type:"button",onClick:p,className:"text-left p-6 rounded-lg border-2 border-[#
4946E0E0E0] hover:border-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-soft))] transition",children:[c.jsx("div",{className:"text-lg font-semibold text-[hsl(var(--konfig-ink))]",children:"Ja, Würfel platzieren"}),c.jsx("div",{className:"text-sm text-[#6B7280] mt-1",children:"3D-Editor mit Ihrer gesamten Bodenfläche öffnet sich. Klicken Sie beliebige Kacheln an, um Würfel zu setzen oder zu stapeln."})]}),c.jsxs("button",{type:"button",onClick:f,"aria-pressed":t.wuerfelHighlightsSkipped===!0,className:`text-left p-6 rounded-lg border-2 transition ${t.wuerfelHighlightsSkipped?"border-[hsl(var(--konfig-primary))] bg-[hsl(var(--konfig-primary-soft))]":"border-[#E0E0E0] hover:border-[hsl(var(--konfig-ink))]"}`,children:[c.jsxs("div",{className:"text-lg font-semibold text-[hsl(var(--konfig-ink))]",children:["Nein, überspringen",t.wuerfelHighlightsSkipped&&c.jsx("span",{className:"ml-2 text-xs font-medium text-[hsl(var(--konfig-primary))]",children:"â Ausgewählt"})]}),c.jsx("div",{className:"text-sm text-[#6B7280] mt-1",children:"Weiter zur Transport-Auswahl."})]})]})]})}const NK="Würfel:";function TK(t,e){const n=t.typ.startsWith("Transportbox"),r=n?t.typ:t.artikelname,i=n?null:e?t.typ.replace(/^Würfel:\s*/,""):t.typ,s=i?`${r} (${i})`:r;return{artikelnummer:t.sku,bezeichnung:s,menge:t.anzahl,einzelpreis:t.einzelpreis,gesamtpreis:t.gesamtpreis,gruppe:e?"Zusatzteile Würfel":"Bodenplatten & Zubehör"}}function bVe({ergebnis:t}){const{ergebnisBase:e,hatGruppen:n}=E.useMemo(()=>{const i=t.bestandteile.filter(o=>!o.typ.startsWith(NK)),s=t.bestandteile.filter(o=>o.typ.startsWith(NK)),a=[...i.map(o=>TK(o,!1)),...s.map(o=>TK(o,!0))];return{ergebnisBase:yA(a,q1),hatGruppen:s.length>0}},[t]),r=ZO(e)??e;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(YO,{positionen:r.positionen,gruppiert:n}),c.jsx("div",{className:"border-t pt-3",children:c.jsx(pM,{ergebnis:r})}),t.warnungen.length>0&&c.jsx("div",{className:"mt-3 space-y-1",children:t.warnungen.map((i,s)=>c.jsxs("div",{className:"text-sm text-amber-600",children:["â ",i]},s))})]})}function wVe({config:t,ergebnis:e,onJump:n}){var l,u;const[r,i]=E.useState(!1),{produkte:s}=tw(),a=t.transportArt==="Transportbox"?"Transportboxen / FlightCases":t.transportArt==="Palette"?"Lieferung auf Palette":"â",o=[{label:"MaÃe",value:`${t.breite.toLocaleString("de-DE",{minimumFractionDigits:1})} à ${t.laenge.toLocaleString("de-DE",{minimumFractionDigits:1})} m`,step:1},{label:"Bodenplatte",value:t.bodenplatteTyp??"â",step:2},{label:"Bodenfinish",value:((l=Ho(t.plattendesign??""))==null?void 0:l.bezeichnung)??"â",step:3},{label:"Standtyp",value:t.standtyp?CA[t.standtyp].titel:"â",step:4},{label:"Kantenprofil",value:t.kantenprofileGewuenscht&&t.kantentyp?((u=$se(t.kantentyp))==null?void 0:u.bezeichnung)??"â":"Keine",step:4},{label:"Transport",value:a,step:5}];return c.jsxs("div",{className:"space-y-6",children:[c.jsx("h2",{className:"text-2xl font-bold text-[hsl(var(--konfig-ink))]",children:"Ihre Konfiguration"}),c.jsx("div",{className:"bg-white border border-[#E0E0E0] rounded-lg p-4 divide-y divide-[#F0F0F0] sm:divide-y-0 sm:space-y-2",children:o.map(d=>c.jsxs("div",{className:"flex flex-col gap-1 py-2 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between sm:py-0 text-sm",children:[c.jsxs("span",{className:"text-[#6B7280]",children:[d.label,":"]}),c.jsxs("span",{className:"text-[hsl(var(--konfig-ink))] font-medium flex items-center justify-between sm:justify-end gap-2 break-words",children:[c.jsx("span",{className:"text-right",children:d.value}),c.jsx("button",{onClick:()=>n(d.step),className:"text-[hsl(var(--konfig-primary))] underline text-xs whitespace-nowrap",children:"Bearbeiten"})]})]},d.label))}),c.jsx(X4,{config:t,wuerfelProdukte:s}),c.jsx(bVe,{ergebnis:e}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[qO,c.jsx(Pt,{onClick:()=>i(!0),className:"flex-1 h-12 sm:h-10 bg-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))] text-white",children:"Angebot anfordern"}),c.jsx(Bf,{konfigurator:"boden",getKonfiguration:()=>t,className:"flex-1 h-12 sm:h-10"})]}),c.jsx(Px,{open:r,onOpenChange:i,konfiguratorName:"Boden-Konfigurator",tabelle:"boden_anfragen",konfiguratorTyp:"boden",konfigurationSnapshot:()=>({config:t}),buildInsertPayload:()=>({konfiguration:t,lieferumfang:e,gesamtpreis:e.gesamtpreis}),buildPdfInput:(d,h)=>({konfiguratorName:"Boden-Konfigurator",anfrageId:h,konfiguration:o.map(p=>({label:p.label,value:String(p.value)})),positionen:e.bestandteile.map(p=>({sku:p.sku,artikelname:p.artikelname,menge:p.anzahl,einzelpreis:p.einzelpreis,gesamtpreis:p.gesamtpreis})),gesamtNetto:e.gesamtpreis,mwstSatz:.19})})]})}function _Ve(t){return{id:t.id,name:t.artikelname,variable:t.schluessel,preis:Number(t.preis),sku:t.sku,bildUrl:null,produktUrl:null}}let tB=null,P_=null,g_=null;async function SVe(){const{data:t,error:e}=await Ot.from("boden_produkte").select("id, artikelname, schluessel, sku, preis").limit(5e3);if(e)return console.error("[BodenRepo] ladeAlleProdukte error:",e),[];const n=(t??[]).map(_Ve);return tB=n,P_=new Map(n.map(r=>[r.variable,r])),n}class AVe{async ladeAlleProdukte(){return tB||g_||(g_=SVe().finally(()=>{g_=null}),g_)}async warmup(){P_||await this.ladeAlleProdukte()}lookup(e){return(P_==null?void 0:P_.get(e))??null}async ladeProduktNachVariable(e){return await this.warmup(),this.lookup(e)}}const EVe={breite:4,laenge:4,bodenplatteTyp:null,ersatzPlatten:[],er
4946satzAnzahlOhnePosition:0,bodenfinishKategorie:null,plattendesign:null,finishBereiche:[],kantenprofileGewuenscht:null,standtyp:null,kantentyp:null,ledFarbvariante:null,ledFarbtemperatur:null,transportArt:"Palette",wuerfelHighlightsSkipped:!1};function kVe(){const[t,e]=E.useState(EVe),[n,r]=E.useState(1),[i,s]=E.useState(1),[a,o]=E.useState({bestandteile:[],gesamtpreis:0,warnungen:[]}),[l,u]=E.useState(!1),[d,h]=E.useState(!1),p=E.useRef(new AVe),{produkte:f}=tw(),[m]=Al(),x=!!m.get("code");m.get("embed"),Ix({expectedKonfigurator:"boden",applyKonfiguration:M=>{M!=null&&M.config&&(e(M.config),s(7),r(7))}}),E.useEffect(()=>{let M=!0;u(!0);const T=window.setTimeout(()=>{VDe(t,p.current,f).then(C=>{M&&(o(C),u(!1))})},120);return()=>{M=!1,window.clearTimeout(T)}},[t,f]);const v=M=>e(T=>{var G;const C={...T,...M},R=M.breite??T.breite,P=M.laenge??T.laenge;if(M.breite!==void 0&&M.breite!==T.breite||M.laenge!==void 0&&M.laenge!==T.laenge){const B=Math.max(1,Math.round(R*2)),$=Math.max(1,Math.round(P*2)),U=(T.ersatzPlatten??[]).filter(O=>O.r>=0&&O.r<$&&O.c>=0&&O.c<B),Z=(T.finishBereiche??[]).map(O=>({...O,platten:O.platten.filter(Y=>Y.r>=0&&Y.r<$&&Y.c>=0&&Y.c<B)})).filter(O=>O.platten.length>0),V=(T.wuerfelBereiche??[]).map(O=>({...O,breiteRaster:B,tiefeRaster:$,wuerfel:O.wuerfel.filter(Y=>Y.spalte>=0&&Y.spalte<B&&Y.reihe>=0&&Y.reihe<$)})).filter(O=>O.wuerfel.length>0),W=(((G=T.ersatzPlatten)==null?void 0:G.length)??0)-U.length+((T.finishBereiche??[]).reduce((O,Y)=>O+Y.platten.length,0)-Z.reduce((O,Y)=>O+Y.platten.length,0))+((T.wuerfelBereiche??[]).reduce((O,Y)=>O+Y.wuerfel.length,0)-V.reduce((O,Y)=>O+Y.wuerfel.length,0));if(W>0&&!window.confirm(`Durch die neuen MaÃe liegen ${W} Element${W===1?"":"e"} (Ersatzplatten, Akzente und/oder Würfel) auÃerhalb der Bodenfläche und werden entfernt. Fortfahren?`))return T;C.ersatzPlatten=U,C.finishBereiche=Z,C.wuerfelBereiche=V}return M.bodenplatteTyp!==void 0&&M.bodenplatteTyp!==T.bodenplatteTyp&&(C.ersatzPlatten=[],C.ersatzAnzahlOhnePosition=0),C}),g=E.useMemo(()=>{var M;switch(n){case 1:return t.breite>=1&&t.laenge>=1&&t.breite*t.laenge>=l2;case 2:return!!t.bodenplatteTyp;case 3:return t.bodenfinishKategorie==="Plattendesign"&&!!t.plattendesign;case 4:return t.kantenprofileGewuenscht===!1?!0:!(!t.kantenprofileGewuenscht||!t.standtyp||!t.kantentyp);case 5:return(((M=t.wuerfelBereiche)==null?void 0:M.length)??0)>0||!!t.wuerfelHighlightsSkipped;case 6:return t.transportArt!==null;default:return!1}},[n,t]);function b(){window.scrollTo({top:0,behavior:"smooth"})}function y(){if(!g)return;const M=Math.min($p.length,n+1);r(M),s(T=>Math.max(T,M)),b()}function S(){r(M=>Math.max(1,M-1)),b()}function A(){switch(n){case 1:return c.jsx(xDe,{config:t,onChange:v});case 2:return c.jsx(RDe,{config:t,onChange:v});case 3:return c.jsx(BDe,{config:t,onChange:v});case 4:return c.jsx(QDe,{config:t,onChange:v});case 5:return c.jsx(yVe,{config:t,onChange:v});case 6:return c.jsx(tBe,{config:t,ergebnis:a,pending:l,onChange:v});case 7:return c.jsx(wVe,{config:t,ergebnis:a,onJump:M=>r(M)});default:return null}}const k=a.gesamtpreis.toLocaleString("de-DE",{style:"currency",currency:"EUR"});return c.jsxs("div",{className:"min-h-screen bg-white",children:[c.jsx(B1,{konfigurator:"boden",disabled:x,onGeladen:M=>{const T=M==null?void 0:M.config;T&&(e(T),s(7),r(7))}}),c.jsx(O4e,{current:n,maxReached:i,canNext:g,onJump:M=>{M<=i?(r(M),b()):M===n+1&&g&&(r(M),s(T=>Math.max(T,M)),b())},config:t}),n!==7&&c.jsxs("div",{className:"lg:hidden border-b border-[#E0E0E0] bg-white",children:[c.jsxs("button",{type:"button",onClick:()=>h(M=>!M),className:"w-full flex items-center justify-between gap-3 px-4 py-2.5 text-sm text-[hsl(var(--konfig-ink))]","aria-expanded":d,children:[c.jsxs("span",{className:"font-medium",children:["Live-Vorschau",c.jsxs("span",{className:"ml-2 text-xs text-[#6B7280]",children:[t.breite.toLocaleString("de-DE",{minimumFractionDigits:1})," à ",t.laenge.toLocaleString("de-DE",{minimumFractionDigits:1})," m"]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-xs text-[#6B7280]",children:[d?"Ausblenden":"Anzeigen",d?c.jsx(g1,{className:"w-4 h-4"}):c.jsx(Su,{className:"w-4 h-4"})]})]}),d&&c.jsx("div",{className:"px-4 pb-3 max-h-[55vh] overflow-y-auto",children:c.jsx(X4,{config:t,step:n,wuerfelProdukte:f})})]}),c.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-6 grid grid-cols-1 lg:grid-cols-[1fr_400px] gap-6 pb-28 lg:pb-6",children:[c.jsxs("div",{children:[A(),n<$p.length&&c.jsxs("div",{className:"hidden lg:flex justify-between mt-8",children:[c.jsx(Pt,{variant:"outline",onClick:S,disabled:n===1,children:"â Zurück"}),c.jsx(Pt,{onClick:y,disabled:!g,className:"bg-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))] text-white disabled:bg-[#E0E0E0] disabled:text-[#9CA3AF] disabled:cursor-not-allowed disabled:opacity-100",children:"Weiter â"})]})]}),n!==7&&c.jsxs("div",{className:"hidden lg:block lg:sticky lg:top-24 lg:self-start space-y-3",children:[c.jsx(X4,{config:t,step:n,wuerfelProdukte:f}
4946),c.jsxs("div",{className:"rounded-lg border border-[#E0E0E0] bg-[hsl(var(--konfig-primary-soft))] px-4 py-3 shadow-sm",children:[c.jsx("div",{className:"text-xs uppercase tracking-wide text-[#6B7280] mb-0.5",children:"Gesamtpreis"}),c.jsx("div",{className:"font-bold text-[hsl(var(--konfig-primary))] text-2xl leading-tight",children:k}),c.jsx("div",{className:"text-xs text-[#6B7280] mt-0.5",children:"netto, zzgl. MwSt. & Versand"})]})]})]}),n<$p.length&&c.jsx("div",{className:"lg:hidden fixed bottom-0 left-0 right-0 z-40 border-t border-[#E0E0E0] bg-white/95 backdrop-blur shadow-[0_-2px_8px_rgba(0,0,0,0.06)]",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:c.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[c.jsx("button",{type:"button",onClick:S,disabled:n===1,"aria-label":"Zurück",className:"h-11 w-11 shrink-0 flex items-center justify-center rounded-md border border-[#E0E0E0] text-[hsl(var(--konfig-ink))] disabled:opacity-30 disabled:cursor-not-allowed",children:c.jsx(zf,{className:"w-5 h-5"})}),c.jsxs("div",{className:"flex-1 min-w-0 leading-tight",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#6B7280]",children:"Gesamtpreis"}),c.jsx("div",{className:"font-bold text-[hsl(var(--konfig-primary))] text-base truncate",children:k})]}),c.jsx(Pt,{onClick:y,disabled:!g,className:"h-11 px-5 bg-[hsl(var(--konfig-primary))] hover:bg-[hsl(var(--konfig-primary-hover))] text-white disabled:bg-[#E0E0E0] disabled:text-[#9CA3AF] disabled:cursor-not-allowed disabled:opacity-100",children:"Weiter â"})]})})]})}function CVe(){const[t]=Al(),e=t.get("embed")==="true",r=t.get("theme")==="ladenbau"?"ladenbau":"messebau";return E.useEffect(()=>{const i=document.documentElement,s=i.getAttribute("data-konfig-theme");return i.setAttribute("data-konfig-theme",r),()=>{s===null?i.removeAttribute("data-konfig-theme"):i.setAttribute("data-konfig-theme",s)}},[r]),c.jsx("div",{"data-konfig-theme":r,className:e?"":"min-h-screen bg-[#F5F5F5]",children:c.jsx(kVe,{})})}function NVe(){return c.jsx(Ed,{slug:"boden",children:c.jsx(CVe,{})})}function TVe(){return c.jsx(Q1,{title:"Produktdaten â Boden",tableName:"boden_produkte",exportPrefix:"boden-produkte",channableLabel:"Boden",channableRpc:"enrich_boden_produkte_from_produkte"})}function MVe(){return c.jsxs("div",{className:"space-y-8",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"Zwei Designs für unterschiedliche Shops: Messebau.de und Ladenbau.de. Engine, Schritte und Preise sind identisch â nur die Farbgebung unterscheidet sich."}),c.jsxs("section",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-lg font-semibold",children:["Messebau.de"," "]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktuelles Design des Boden-Konfigurators. Verwenden Sie diesen Code im Messebau-Shop."})]}),c.jsx(Km,{configuratorPath:"/boden",iframeTitle:"Boden-Konfigurator â Messebau",extraParams:{theme:"messebau"}})]}),c.jsxs("section",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-lg font-semibold",children:["Ladenbau.de"," "]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Grünes Theme passend zum Ladenbau-Shop. Verwenden Sie diesen Code im Ladenbau-Shop."})]}),c.jsx(Km,{configuratorPath:"/boden",iframeTitle:"Boden-Konfigurator â Ladenbau",extraParams:{theme:"ladenbau"}})]})]})}const fC={desktop:{label:"Desktop",width:1280,icon:g5},tablet:{label:"Tablet",width:820,icon:b5},mobile:{label:"Mobil",width:390,icon:y5}},RVe=()=>{const[t,e]=E.useState("desktop"),[n,r]=E.useState(0),i=`${window.location.origin}/boden`,s=fC[t].width;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Vorschau",description:"Live-Vorschau des Boden-Konfigurators (StandOnFloor).",actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center gap-1 border rounded-md p-1 bg-card",children:Object.keys(fC).map(a=>{const o=fC[a].icon,l=t===a;return c.jsxs(Pt,{variant:l?"default":"ghost",size:"sm",onClick:()=>e(a),className:"gap-1.5",children:[c.jsx(o,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:fC[a].label})]},a)})}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:()=>r(a=>a+1),className:"gap-1.5",children:[c.jsx(b1,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Reset"})]}),c.jsx(Pt,{variant:"outline",size:"sm",asChild:!0,className:"gap-1.5",children:c.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:[c.jsx(_d,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Neuer Tab"})]})})]})}),c.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted/30 flex justify-center p-4",children:c.jsx("div",{className:"bg-card shadow-lg transition-all duration-300 rounded-md overflow-hidden w-full",style:{maxWidth:s},children:c.jsx("iframe",{src:"/boden?embed=true",className:"w-full border-0 block",style:{height:"80vh",minHeight:600},title:"Boden-Konfigurator-Vorschau"},n)})})]})};function jVe(){const[t,e]=E.useState(new Set),[n,r]=E.useState(Date.now()),[i,s]=E.useState(null),a=E.useCallback(async()=>{const d=await K4e();e(d),r(Date.now())},[]);E.useEffect(()=>{a()},[a]);const o=E.useMemo(()=>Tj.filter(d=>!t.has(e1(d.category,d.key))).length,[t]);async function l(d,h){const p=`${d.category}/${d.key}`;s(p);try{await X4e(d.category,d.key,h),dn({title:"Bild hochgeladen",description:d.label}),await a()}catch(f){dn({title:"Upload fehlgeschlagen",description:f.message,variant:"destructive"})}finally{s(null)}}async function u(d){const h=`${d.category}/${d.key}`;s(h);try{await Y4e(d.category,d.key),dn({title:"Bild gelöscht",description:d.label}),await a()}catch(p){dn({title:"Löschen fehlgeschlagen",description:p.message,variant:"destructive"})}finally{s(null)}}return c.jsxs("div",{className:"space-y-8",children:[c.jsx(es,{icon:xc,title:"Bilder",description:c.jsxs(c.Fragment,{children:["Bilder für Schritt 2 (Bodenplatten), Schritt 3 (Plattendesigns) und Schritt 4 (Kantenprofile) und Schritt 5 (Transport). Drag & Drop direkt auf eine Karte überschreibt das Bild.",c.jsx("br",{}),Tj.length-o," / ",Tj.length," Slots befüllt",o>0&&c.jsxs("span",{className:"ml-2 text-destructive font-medium",children:["â ",o," fehlen"]})]})}),c.jsx(Zv,{title:"Schritt 2 â Bodenplatten",slots:Kse,cols:"grid-cols-1 md:grid-cols-2",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsx(Zv,{title:"Schritt 2 â Klickverbinder (Info-Sektion)",slots:Yse,cols:"grid-cols-1 sm:grid-cols-2",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsx(Zv,{title:"Schritt 3 â Plattendesigns",slots:qse,cols:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsx(Zv,{title:"Schritt 4 â Kantentypen",slots:Xse,cols:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsx(Zv,{title:"Schritt 4 â Verbinder Kantenprofile (Info-Sektion)",slots:Jse,cols:"grid-cols-1 sm:grid-cols-2",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsx(Zv,{title:"Schritt 5 â Transport (Palette / Transportboxen)",slots:Qse,cols:"grid-cols-1 sm:grid-cols-2",existing:t,version:n,busyKey:i,onUpload:l,onDelete:u}),c.jsxs("section",{children:[c.jsx("h2",{className:"font-semibold text-lg mb-1",children:"Inspirationsbilder"}),c.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Diese Bilder erscheinen ausschlieÃlich in der Inspirationskarte in Schritt 3 (Akzentbereiche) â sie er
4946setzen nicht das eigentliche Plattendesign-Bild."}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Zse.map(d=>{const h=t.has(e1(d.category,d.key)),p=`${d.category}/${d.key}`,f=i===p;return c.jsx(_ce,{slot:d,hasImage:h,imageUrl:h?Ih(d.category,d.key,n):"",busy:f,onFile:m=>l(d,m),onDelete:()=>u(d)},p)})})]})]})}function Zv(t){const{title:e,slots:n,cols:r,existing:i,version:s,busyKey:a,onUpload:o,onDelete:l}=t;return c.jsxs("section",{children:[c.jsx("h2",{className:"font-semibold text-lg mb-3",children:e}),c.jsx("div",{className:`grid ${r} gap-3`,children:n.map(u=>{const d=i.has(e1(u.category,u.key)),h=`${u.category}/${u.key}`,p=a===h;return c.jsx(_ce,{slot:u,hasImage:d,imageUrl:d?Ih(u.category,u.key,s):"",busy:p,onFile:f=>o(u,f),onDelete:()=>l(u)},h)})})]})}function _ce(t){const{slot:e,hasImage:n,imageUrl:r,busy:i,onFile:s,onDelete:a}=t,[o,l]=E.useState(!1),u=`up-${e.category}-${e.key}`;return c.jsxs("div",{className:`rounded-lg border-2 p-2 bg-card transition ${o?"border-primary bg-primary/5":n?"border-border":"border-dashed border-border"}`,onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{var p;d.preventDefault(),l(!1);const h=(p=d.dataTransfer.files)==null?void 0:p[0];h&&s(h)},children:[c.jsx("div",{className:"aspect-square rounded bg-muted flex items-center justify-center overflow-hidden mb-2",children:n?c.jsx("img",{src:r,alt:e.label,className:"max-w-full max-h-full object-contain"}):c.jsxs("div",{className:"flex flex-col items-center text-muted-foreground text-xs gap-1",children:[c.jsx(v1,{className:"w-6 h-6"}),c.jsx("span",{children:"Kein Bild"})]})}),c.jsx("div",{className:"text-xs font-medium truncate",title:e.label,children:e.label}),e.sublabel&&c.jsx("div",{className:"text-[10px] text-muted-foreground",children:e.sublabel}),c.jsxs("div",{className:"flex gap-1 mt-2",children:[c.jsx("input",{id:u,type:"file",accept:"image/*",className:"hidden",onChange:d=>{var p;const h=(p=d.target.files)==null?void 0:p[0];h&&s(h),d.currentTarget.value=""}}),c.jsx(Pt,{asChild:!0,size:"sm",variant:"outline",className:"flex-1 h-7 text-xs",disabled:i,children:c.jsxs("label",{htmlFor:u,className:"cursor-pointer",children:[c.jsx(pu,{className:"w-3 h-3 mr-1"}),i?"â¦":n?"Ersetzen":"Hochladen"]})}),n&&c.jsx(Pt,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:a,disabled:i,children:c.jsx(yo,{className:"w-3 h-3"})})]})]})}const PVe=[{key:"klickverbinder",label:"Klickverbinder â Anwendung",beschreibung:"Wird im Konfigurator (Schritt 2) im Info-Bereich âSo werden die Bodenplatten verbundenâ angezeigt.",empfehlung:"Empfohlen: MP4 (H.264), 3â10 Sekunden, max. ca. 5 MB, stumm produziert (Autoplay)."}];function LVe(){const[t,e]=E.useState({}),[n,r]=E.useState(null),i=E.useCallback(async()=>{const o=await SDe(),l={};for(const u of o)l[u.schluessel]={url:u.url,updated_at:u.updated_at};e(l)},[]);E.useEffect(()=>{i()},[i]);async function s(o,l){if(!l.type.startsWith("video/")){dn({title:"Ungültiges Format",description:"Bitte eine Videodatei (MP4, WebM oder MOV) hochladen.",variant:"destructive"});return}if(l.size>50*1024*1024){dn({title:"Datei zu groÃ",description:"Maximale GröÃe sind 50 MB.",variant:"destructive"});return}r(o.key);try{await ADe(o.key,l),dn({title:"Video hochgeladen",description:o.label}),await i()}catch(u){dn({title:"Upload fehlgeschlagen",description:(u==null?void 0:u.message)??"Unbekannter Fehler",variant:"destructive"})}finally{r(null)}}async function a(o){if(confirm(`Video â${o.label}â wirklich löschen?`)){r(o.key);try{await EDe(o.key),dn({title:"Video gelöscht",description:o.label}),await i()}catch(l){dn({title:"Löschen fehlgeschlagen",description:(l==null?void 0:l.message)??"Unbekannter Fehler",variant:"destructive"})}finally{r(null)}}}return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:IC,title:"Videos",description:"Videos für den Bodenkonfigurator. Hochgeladene Videos werden im Konfigurator automatisch eingeblendet und können hier jederzeit ersetzt oder gelöscht werden."}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:PVe.map(o=>{const l=t[o.key],u=n===o.key,d=`video-up-${o.key}`;return c.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[c.jsx(IC,{className:"w-4 h-4"}),o.label]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.beschreibung})]}),c.jsx("div",{className:"aspect-video rounded bg-muted flex items-center justify-center overflow-hidden",children:l?c.jsx("video",{src:`${l.url}?v=${l.updated_at}
4946`,controls:!0,muted:!0,playsInline:!0,className:"w-full h-full object-contain bg-black"}):c.jsxs("div",{className:"flex flex-col items-center text-muted-foreground text-xs gap-1",children:[c.jsx(IC,{className:"w-8 h-8"}),c.jsx("span",{children:"Noch kein Video hochgeladen"})]})}),c.jsx("p",{className:"text-[11px] text-muted-foreground",children:o.empfehlung}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{id:d,type:"file",accept:"video/mp4,video/webm,video/quicktime",className:"hidden",onChange:h=>{var f;const p=(f=h.target.files)==null?void 0:f[0];p&&s(o,p),h.currentTarget.value=""}}),c.jsx(Pt,{asChild:!0,variant:"outline",size:"sm",className:"flex-1",disabled:u,children:c.jsxs("label",{htmlFor:d,className:"cursor-pointer",children:[c.jsx(pu,{className:"w-4 h-4 mr-2"}),u?"Lädt â¦":l?"Video ersetzen":"Video hochladen"]})}),l&&c.jsx(Pt,{variant:"ghost",size:"sm",onClick:()=>a(o),disabled:u,children:c.jsx(yo,{className:"w-4 h-4"})})]})]},o.key)})})]})}const UP=new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"});function MK({lieferumfang:t,loading:e,onAnfrage:n,extraActions:r,variant:i="desktop"}){const{positionen:s,gesamtpreis:a,anzahlFelder:o,fehlendeSchluessel:l}=t,u=i==="mobile";return c.jsxs("aside",{className:u?"bg-card flex flex-col":"bg-card border border-border rounded-lg flex flex-col h-fit lg:sticky lg:top-4 max-h-[calc(100vh-2rem)]",children:[!u&&c.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[c.jsx("h2",{className:"text-sm font-semibold",children:"Lieferumfang"}),c.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:o===0?"Noch keine Felder belegt":`${o} Feld${o===1?"":"er"} · ${s.length} Position${s.length===1?"":"en"}`})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-2 min-h-0",children:[e&&c.jsx("div",{className:"text-xs text-muted-foreground",children:"Produkte werden geladenâ¦"}),!e&&o===0&&c.jsx("div",{className:"text-xs text-muted-foreground py-8 text-center",children:"Klicken Sie auf die Grundfläche oder einen vorhandenen Würfel, um Würfel hinzuzufügen."}),!e&&s.length>0&&c.jsx("ul",{className:"space-y-2",children:s.map(d=>{const h=d.bestandteil==="Cube"&&d.einzelpreis===0;return c.jsxs("li",{className:"flex gap-2 items-start text-xs border-b border-border/60 pb-2 last:border-b-0",children:[c.jsx("div",{className:"w-10 h-10 rounded bg-muted/60 border border-border flex items-center justify-center overflow-hidden shrink-0",children:d.bild_url?c.jsx("img",{src:d.bild_url,alt:d.name,className:"w-full h-full object-cover",loading:"lazy"}):c.jsx("span",{className:"text-[8px] text-muted-foreground text-center px-0.5 leading-tight",children:d.bestandteil})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"font-medium text-foreground truncate",title:d.name,children:[d.anzahl,"à ",d.bestandteil]}),c.jsx("div",{className:"text-muted-foreground truncate",title:d.variante,children:d.variante}),!h&&c.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[UP.format(d.einzelpreis)," / Stk"]}),h&&c.jsx("div",{className:"text-[10px] italic text-muted-foreground",children:"Preis auf Anfrage"})]}),c.jsx("div",{className:"text-right whitespace-nowrap font-medium text-foreground",children:h?"â":UP.format(d.gesamtpreis)})]},d.schluessel)})}),l.length>0&&c.jsxs("div",{className:"mt-3 p-2 rounded border border-destructive/40 bg-destructive/5 text-[11px] text-destructive",children:[c.jsxs("div",{className:"font-medium mb-1",children:["Für ",l.length," Variante",l.length===1?"":"n"," kein Produkt im Katalog:"]}),c.jsxs("ul",{className:"space-y-0.5",children:[l.slice(0,5).map(d=>c.jsxs("li",{className:"truncate",children:["⢠",d]},d)),l.length>5&&c.jsxs("li",{children:["⦠und ",l.length-5," weitere"]})]})]})]}),!u&&c.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2",children:[c.jsxs("div",{className:"flex items-baseline justify-between",children:[c.jsx("span",{className:"text-xs text-muted-foreground",children:"Gesamtpreis"}),c.jsx("span",{className:"text-lg font-semibold text-foreground",children:UP.format(a)})]}),c.jsx("button",{type:"button",disabled:o===0,onClick:n,className:"w-full px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90 transition",children:"Angebot anfordern"}),c.jsx("div",{className:"text-[10px] text-muted-foreground text-center",children:"Unverbindliches Angebot · zzgl. MwSt."}),c.jsx(JO,{className:"text-[10px] text-center"}),r]})]})}const IVe=new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"});function DVe(){var He,_e,Ne;const[t,e]=E.useState($V()),[n,r]=E.useState(null),[i,s]=E.useState(null),[a,o]=E.useState(!1),[l,u]=E.useState(!0),[d,h]=E.useState("grundflaeche"),{produkte:p,loading:f}=tw();Ix({expectedKonfigurator:"standonfloor",applyKonfiguration:ue=>ue&&e(ue)});const{global:m,mode:x,bloecke:v,offenerBlockId:g,setGlobal:b,setMode:y,setBloecke:S,setOffenerBlockId:A,addBlock:k,updateBlock:M,closeBlock:T,removeBlock:C,reset:R}=UDe(p),{toast:P}=HS(),j=E.useMemo(()=>Az(t,b0,m,x,v),[t,m,x,v]),G=E.useMemo(()=>gae(j,p),[j,p]),B=E.useMemo(()=>{const ue={};for(const Ce of t.wuerfel){const Ke=Ce.blockId;Ke&&(ue[Ke]=(ue[Ke]??0)+1)}return ue},[t.wuerfel]),$=Dp,U=t.wuerfel.filter(ue=>ue.istPlattform!==!0).length,Z=t.wuerfel.reduce((ue,Ce)=>Ce.istPlattform?ue:Math.max(ue,Ce.stapelIndex+1),0),V=t.wuerfel.some(ue=>ue.istPlattform===!0),W=x==="alle-gleich"&&m.mitBoden===!1,O=Z?(W?0:$.unterboden)+Z*$.wuerfelHoehe+$.coverplatte:V?(W?0:$.unterboden)+$.coverplatte:0,Y=()=>{e($V()),R(),o(!1)},z=ue=>
4946{if(ue!==x){if(ue==="einzeln"){if(t.wuerfel.length>0&&v.length===0){const Ce=k({bodenVariante:m.bodenVariante,cubeVariante:m.cubeVariante,coverVariante:m.coverVariante});e({...t,wuerfel:t.wuerfel.map(Ke=>({...Ke,blockId:Ce}))})}y("einzeln");return}if(v.length>0&&t.wuerfel.length>0){r("alle-gleich");return}y("alle-gleich"),S([]),A(null),e({...t,wuerfel:t.wuerfel.map(Ce=>({...Ce,blockId:null}))})}},I=()=>{const ue=v[0];ue&&b(Ce=>({...Ce,bodenVariante:ue.bodenVariante,cubeVariante:ue.cubeVariante,coverVariante:ue.coverVariante})),S([]),A(null),y("alle-gleich"),e({...t,wuerfel:t.wuerfel.map(Ce=>({...Ce,blockId:null}))}),r(null)},q=ue=>{e({...t,wuerfel:t.wuerfel.filter(Ce=>Ce.blockId!==ue)})},[te,se]=E.useState(!1),ie=()=>{G.positionen.length!==0&&se(!0)},le=ue=>{s(ue)},xe=()=>{i&&(g&&g!==i&&T(g),M(i,{abgeschlossen:!1}),A(i),s(null))},Ee=()=>{g&&T(g),k(),s(null)},ae=((He=v.find(ue=>ue.id===g))==null?void 0:He.index)??null,Q=((_e=v.find(ue=>ue.id===i))==null?void 0:_e.index)??null,we=g&&g!==i?((Ne=v.find(ue=>ue.id===g))==null?void 0:Ne.index)??null:null,Ae=c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3",children:[c.jsx("div",{className:"font-medium text-foreground",children:"Grundfläche"}),c.jsx("div",{className:"grid grid-cols-2 gap-3",children:[["Spalten","grundflaecheRasterX",t.grundflaecheRasterX],["Reihen","grundflaecheRasterZ",t.grundflaecheRasterZ]].map(([ue,Ce,Ke])=>c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:ue}),c.jsxs("div",{className:"flex items-stretch border border-border rounded overflow-hidden bg-background",children:[c.jsx("button",{type:"button","aria-label":`${ue} verringern`,onClick:()=>{const Qe=Math.max(1,Ke-1);e({...t,[Ce]:Qe,wuerfel:t.wuerfel.filter(je=>Ce==="grundflaecheRasterX"?je.spalte+(je.groesseX??1)<=Qe:je.reihe+(je.groesseZ??1)<=Qe)})},className:"h-11 w-11 lg:h-9 lg:w-9 flex items-center justify-center hover:bg-muted transition shrink-0",children:c.jsx(y1,{className:"w-4 h-4"})}),c.jsx("input",{type:"text",readOnly:!0,tabIndex:-1,"aria-label":ue,value:Ke,className:"flex-1 min-w-0 text-center bg-transparent border-x border-border text-sm font-medium text-foreground tabular-nums focus:outline-none cursor-default select-none"}),c.jsx("button",{type:"button","aria-label":`${ue} erhöhen`,onClick:()=>{const Qe=Math.min(30,Ke+1);e({...t,[Ce]:Qe})},className:"h-11 w-11 lg:h-9 lg:w-9 flex items-center justify-center hover:bg-muted transition shrink-0",children:c.jsx(ph,{className:"w-4 h-4"})})]})]},Ce))}),c.jsxs("div",{className:"text-[11px] opacity-80",children:["â ",(t.grundflaecheRasterX*$.raster).toLocaleString("de-DE")," à ",(t.grundflaecheRasterZ*$.raster).toLocaleString("de-DE")," cm"]}),c.jsxs("div",{className:"border-t border-border pt-3 space-y-1",children:[c.jsxs("div",{className:"font-medium text-foreground",children:["Geometrie ",$.label]}),c.jsxs("div",{children:["Raster: ",$.raster," cm"]}),c.jsxs("div",{children:["Unterboden: ",$.unterboden," cm"]}),c.jsxs("div",{children:["Würfelhöhe: ",$.wuerfelHoehe," cm"]}),c.jsxs("div",{children:["Coverplatte: ",$.coverplatte," cm"]})]})]}),K=c.jsx(wce,{produkte:p,loading:f,global:m,setGlobal:b,mode:x,onModeChange:z,bloecke:v,offenerBlockId:g,setOffenerBlockId:A,addBlock:k,updateBlock:M,closeBlock:T,removeBlock:C,gesamtKonfig:j,wuerfelProBlock:B,onConfirmDeleteBlock:q}),pe=c.jsx("button",{type:"button",onClick:Y,className:"w-full text-xs px-3 py-2 lg:py-2 min-h-[44px] rounded-md border border-border hover:bg-muted transition",children:"Zurücksetzen"}),ye=c.jsxs("div",{className:"relative h-full w-full bg-muted/30",children:[c.jsx(E.Suspense,{fallback:c.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground",children:"3D-Szene wird geladenâ¦"}),children:c.jsx(bce,{hersteller:b0,konfig:t,onChange:e,gesamtKonfig:j,produkte:p,mode:x,offenerBlockId:g,removeMode:a,plattformBeimErstenKlick:!0,onBlockClicked:le,onNeedBlock:()=>P({title:"Kein Block geöffnet",description:"Bitte fügen Sie zuerst einen Block hinzu, oder bearbeiten Sie einen bestehenden Block und arbeiten Sie diesen fortlaufend ab."})})}),c.jsxs("div",{className:"absolute top-3 left-3 z-20 max-w-[280px]",children:[c.jsx("button",{type:"button",onClick:()=>u(ue=>!ue),"aria-expanded":l,"aria-label":"Bedienungshinweise anzeigen",className:"bg-card/90 backdrop-blur border border-border rounded-full h-9 w-9 flex items-center justify-center hover:bg-card transition shadow-sm",children:c.jsx(aF,{className:"w-4 h-4 text-muted-foreground"})}),l&&c.jsxs("div",{className:"mt-2 bg-card/95 backdrop-blur border border-border rounded-md px-3 py-2 text-xs text-muted-foreground shadow-md space-y-0.5",children:[c.jsx("div",{className:"font-medium text-foreground mb-1",children:"Bedienung"}),c.jsxs("div",{className:"lg:hidden space-y-0.5",children:[c.jsx("div",{children:"1. Tap â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Taps â Würfel stapeln"}),c.jsx("div",{children:'Modus âEntfernen" â Tap geht eine Stufe zurück'}),c.jsx("div",{children:"1 Finger ziehen â drehen"}),c.jsx("div",{children:"2 Finger ziehen â zoomen / verschieben"})]}),c.jsxs("div",{className:"hidden lg:block space-y-0.5",children:[x==="alle-gleich"?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"1. Klick â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Klicks â Würfel stapeln"}),c.jsx("div",{children:"Shift + Klick â eine Stufe zurück"})]}):c.jsxs(c.Fragment,{children:[ae?c.jsxs("div",{children:["Neue Felder â Block"," ",c.jsx("span",{className:"text-primary font-medium",children:ae})]}):c.jsx("div",{className:"text-amber-700",children:"Bitte links Block hinzufügen"}),c.jsx("div",{children:"1. Klick â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Klicks â Würfel stapeln"}),c.jsx("div",{children:"Shift + Klick â eine Stufe zurück"})]}),c.jsxs("div",{className:"pt-1 mt-1 border-t border-border/60",children:[c.jsx("div",{children:"Linke Maustaste halten â drehen"}),c.jsx("div",{children:"Rechte Maustaste halten â verschieben"}),c.jsx("div",{children:"Mausrad â zoomen"})]})]})]})]}),O>0&&c.jsxs("div",{className:"absolute top-3 right-3 z-20 bg-card/90 backdrop-blur border border-border rounded-md px-3 py-1.5 text-xs",children:["Höhe: ",O.toLocaleStr
4946ing("de-DE")," cm"]}),c.jsx("div",{className:"lg:hidden absolute bottom-3 left-1/2 -translate-x-1/2 z-20",children:c.jsxs("div",{role:"group","aria-label":"Klick-Modus",className:"flex bg-card/95 backdrop-blur border border-border rounded-full shadow-md overflow-hidden text-xs",children:[c.jsxs("button",{type:"button",onClick:()=>o(!1),"aria-pressed":!a,className:`flex items-center gap-1.5 px-3 h-10 transition ${a?"text-muted-foreground hover:bg-muted":"bg-primary text-primary-foreground"}`,children:[c.jsx(x5,{className:"w-3.5 h-3.5"}),"Hinzufügen"]}),c.jsxs("button",{type:"button",onClick:()=>o(!0),"aria-pressed":a,className:`flex items-center gap-1.5 px-3 h-10 transition ${a?"bg-destructive text-destructive-foreground":"text-muted-foreground hover:bg-muted"}`,children:[c.jsx(pJ,{className:"w-3.5 h-3.5"}),"Entfernen"]})]})})]}),Se=c.jsxs("div",{className:"border-t border-border px-4 py-3 text-sm text-muted-foreground",children:[U," Würfel",Z>0&&` · höchster Stapel ${Z}`,x==="einzeln"&&v.length>0&&c.jsxs(c.Fragment,{children:[" · ",v.length," Block",v.length===1?"":"öcke"]})]}),[ee]=Al(),me=ee.get("theme")==="ladenbau"?"ladenbau":"messebau";E.useEffect(()=>{const ue=document.documentElement,Ce=ue.getAttribute("data-konfig-theme");return ue.setAttribute("data-konfig-theme",me),()=>{Ce===null?ue.removeAttribute("data-konfig-theme"):ue.setAttribute("data-konfig-theme",Ce)}},[me]);const Ge=!!ee.get("code");return c.jsxs("div",{"data-konfig-theme":me,className:"min-h-screen lg:h-screen lg:overflow-hidden bg-background flex flex-col",children:[c.jsx(B1,{konfigurator:"standonfloor",disabled:Ge,onGeladen:ue=>ue&&e(ue)}),c.jsx("header",{className:"border-b border-border bg-card",children:c.jsxs("div",{className:"max-w-screen-2xl mx-auto px-4 py-3 flex flex-col sm:flex-row sm:flex-wrap sm:items-center gap-1 sm:gap-4",children:[c.jsx("h1",{className:"text-base sm:text-lg font-semibold leading-tight",children:"StandOnFloor Würfelsystem-Konfigurator"}),c.jsxs("span",{className:"text-[11px] sm:text-xs font-normal text-muted-foreground",children:["(",$.material,", ",$.raster," cm Raster)"]})]})}),c.jsxs("div",{className:"hidden lg:grid flex-1 lg:min-h-0 max-w-screen-2xl w-full mx-auto px-4 py-4 grid-cols-[260px_1fr_320px] gap-4",children:[c.jsxs("aside",{className:"bg-card border border-border rounded-lg p-4 space-y-4 h-full overflow-y-auto",children:[Ae,K,c.jsx("div",{className:"sticky bottom-0 bg-card pt-2 -mx-4 px-4 -mb-4 pb-4 border-t border-border",children:pe})]}),c.jsxs("main",{className:"bg-card border border-border rounded-lg flex flex-col overflow-hidden h-full",children:[c.jsx("div",{className:"flex-1 min-h-0 relative",children:ye}),Se]}),c.jsx(MK,{lieferumfang:G,loading:f,onAnfrage:ie,extraActions:c.jsx(Bf,{konfigurator:"standonfloor",getKonfiguration:()=>t,size:"sm",className:"w-full mt-2"})})]}),c.jsxs("div",{className:"lg:hidden flex-1 flex flex-col pb-20",children:[c.jsxs("div",{className:"sticky top-0 z-30 bg-card border-b border-border",children:[c.jsx("div",{className:"h-[55vh] min-h-[340px] max-h-[480px] relative",children:ye}),c.jsxs("div",{className:"px-4 py-2 text-xs text-muted-foreground flex items-center justify-between gap-2",children:[c.jsxs("span",{children:[U," Würfel",Z>0&&` · Stapel ${Z}`]}),c.jsx("button",{type:"button",onClick:Y,className:"text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted transition",children:"Zurücksetzen"})]})]}),c.jsxs($b,{value:d,onValueChange:ue=>h(ue),className:"flex-1 flex flex-col",children:[c.jsxs(dx,{className:"sticky top-[calc(55vh+44px)] z-20 w-full justify-start overflow-x-auto rounded-none border-b border-border bg-card h-12 px-2 gap-1",children:[c.jsx(Xl,{value:"grundflaeche",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:"Grundfläche"}),c.jsx(Xl,{value:"farben",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:"Farben & Blöcke"}),c.jsxs(Xl,{value:"uebersicht",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:["Ãbersicht",G.positionen.length>0&&c.jsx("span",{className:"ml-1.5 text-[10px] bg-primary text-primary-foreground rounded-full px-1.5 py-0.5",children:G.positionen.length})]})]}),c.jsx(vu,{value:"grundflaeche",className:"p-4 m-0",children:Ae}),c.jsx(vu,{value:"farben",className:"p-4 m-0",children:K}),c.jsx(vu,{value:"uebersicht",className:"p-0 m-0",children:c.jsx(MK,{lieferumfang:G,loading:f,onAnfrage:ie,variant:"mobile",extraActions:c.jsx(Bf,{konfigurator:"standonfloor",getKonfiguration:()=>t,size:"sm",className:"w-full mt-2"})})})]})]}),c.jsxs("div",{className:"lg:hidden fixed bottom-0 left-0 right-0 z-40 bg-card border-t border-border px-4 py-3 flex items-center gap-3",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 0.75rem)"},children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Gesamtpreis"}),c.jsx("div",{className:"text-base font-semibold text-foreground truncate",children:IVe.format(G.gesamtpreis)})]}),c.jsx("button",{type:"button",onClick:ie,disabled:G.positionen.length===0,className:"h-11 px-4 roun
4946ded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90 transition",children:"Angebot anfordern"})]}),c.jsx(Px,{open:te,onOpenChange:se,konfiguratorName:"StandOnFloor Würfelsystem",tabelle:"standonfloor_wuerfel_anfragen",konfiguratorTyp:"standonfloor",konfigurationSnapshot:()=>t,buildInsertPayload:()=>({konfiguration:j,lieferumfang:G,gesamtpreis:G.gesamtpreis}),buildPdfInput:(ue,Ce)=>({konfiguratorName:"StandOnFloor Würfelsystem",anfrageId:Ce,identifier:b0,konfiguration:[{label:"Hersteller",value:b0},{label:"Anzahl Felder",value:String(G.anzahlFelder)},{label:"Anzahl Würfel",value:String(G.anzahlCubesGesamt)}],positionen:G.positionen.map(Ke=>({sku:Ke.sku,artikelname:Ke.name,menge:Ke.anzahl,einzelpreis:Ke.einzelpreis,gesamtpreis:Ke.gesamtpreis})),gesamtNetto:G.gesamtpreis,mwstSatz:.19})}),c.jsx(vx,{open:!!n,onOpenChange:ue=>!ue&&r(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:'Auf âAlle gleich" wechseln?'}),c.jsx(Vm,{children:"Alle Blöcke werden zusammengeführt. Sämtliche Würfel übernehmen die Farben von Block 1 (Boden, Würfel-Farbe, Cover). Die übrigen Blockeinstellungen gehen verloren. Möchten Sie fortfahren?"})]}),c.jsxs(Hm,{className:"flex-col-reverse sm:flex-row gap-2",children:[c.jsx($m,{className:"h-11 sm:h-10 mt-0",children:"Abbrechen"}),c.jsx(Wm,{onClick:I,className:"h-11 sm:h-10",children:"Fortfahren"})]})]})}),c.jsx(qf,{open:!!i,onOpenChange:ue=>{ue||s(null)},children:c.jsxs(jh,{children:[c.jsxs(Xf,{children:[c.jsxs(Yf,{children:["Block ",Q," bearbeiten?"]}),c.jsx(D1,{children:we?`Möchten Sie Block ${Q} bearbeiten oder einen neuen Block anlegen? Hinweis: Block ${we} wird in beiden Fällen zuvor abgeschlossen.`:`Möchten Sie Block ${Q} zur Bearbeitung öffnen oder lieber einen neuen Block anlegen?`})]}),c.jsxs(X5,{className:"gap-2 flex-col-reverse sm:flex-row",children:[c.jsx("button",{type:"button",onClick:()=>s(null),className:"h-11 sm:h-10 text-sm px-4 rounded border border-border hover:bg-muted transition",children:"Abbrechen"}),c.jsx("button",{type:"button",onClick:Ee,className:"h-11 sm:h-10 text-sm px-4 rounded border border-border hover:bg-muted transition",children:"Neuen Block hinzufügen"}),c.jsx("button",{type:"button",onClick:xe,className:"h-11 sm:h-10 text-sm px-4 rounded bg-primary text-primary-foreground hover:bg-primary/90 transition",children:"Bearbeiten"})]})]})})]})}function BVe(){return c.jsx(Ed,{slug:"standonfloor-wuerfel",children:c.jsx(DVe,{})})}function FVe(){return c.jsx(Q1,{title:"Produktdaten â StandOnFloor (Alu)",description:"Würfelsystem aus Aluminium, 50 à 50 cm Raster, 10 cm Stapelschritt.",tableName:"standonfloor_produkte",exportPrefix:"standonfloor-produkte",channableLabel:"StandOnFloor",channableRpc:"enrich_standonfloor_produkte_from_produkte"})}function OVe(){const{produkte:t,loading:e}=tw(),n=rA(),r=E.useMemo(()=>t.filter(i=>i.bestandteil==="Cover"),[t]);return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:xc,title:"Bilder â StandOnFloor Würfel",description:"Cover-Motive für das Würfelsystem. Diese Bilder sind identisch zu den Plattendesigns des Boden-Konfigurators und werden dort zentral gepflegt."}),c.jsxs("div",{className:"border border-border rounded-lg p-4 bg-muted/30 flex flex-col sm:flex-row sm:items-center gap-3",children:[c.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:'Cover-Bilder werden ausschlieÃlich unter âBilder" im Boden-Konfigurator verwaltet. Ãnderungen dort erscheinen automatisch auch hier sowie in der 3D-Vorschau des Würfel-Konfigurators.'}),c.jsx(Pt,{asChild:!0,variant:"default",size:"sm",className:"gap-2 shrink-0",children:c.jsxs(ax,{to:"/admin/boden/bilder",children:["Zur Bildverwaltung Boden",c.jsx(_d,{className:"h-4 w-4"})]})})]}),e?c.jsx("div",{className:"text-sm text-muted-foreground",children:"Lade Produkteâ¦"}):r.length===0?c.jsx("div",{className:"border border-dashed border-border rounded-lg p-12 text-center text-sm text-muted-foreground",children:'Keine Cover-Motive im Katalog gefunden. Bitte zuerst unter âProduktdaten" einen Channable-Import durchführen.'}):c.jsxs("section",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-base font-semibold text-foreground",children:["Cover (",r.length,")"]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Vorschau der gespiegelten Cover-M
4946otive aus dem Boden-Konfigurator."})]}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:r.map(i=>{const s=i.bild_url?`${i.bild_url}${n}`:null;return c.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card flex flex-col",children:[c.jsx("div",{className:"aspect-square bg-muted/40 flex items-center justify-center relative",children:s?c.jsx("img",{src:s,alt:i.variable,loading:"lazy",className:"w-full h-full object-cover",onError:a=>{a.currentTarget.style.display="none"}}):c.jsx(v1,{className:"h-6 w-6 text-muted-foreground/60"})}),c.jsx("div",{className:"px-2 py-1.5 border-t border-border",children:c.jsx("span",{className:"text-xs font-medium text-foreground truncate block",title:i.variable,children:i.variable})})]},i.variable)})})]})]})}const pC={desktop:{label:"Desktop",width:1280,icon:g5},tablet:{label:"Tablet",width:820,icon:b5},mobile:{label:"Mobil",width:390,icon:y5}};function zVe(){const[t,e]=E.useState("desktop"),[n,r]=E.useState(0),i=`${window.location.origin}/standonfloor-wuerfel`,s=pC[t].width;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Vorschau",description:"Live-Vorschau des Würfel-Konfigurators (StandOnFloor & EasyCubes).",actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center gap-1 border rounded-md p-1 bg-card",children:Object.keys(pC).map(a=>{const o=pC[a].icon,l=t===a;return c.jsxs(Pt,{variant:l?"default":"ghost",size:"sm",onClick:()=>e(a),className:"gap-1.5",children:[c.jsx(o,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:pC[a].label})]},a)})}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:()=>r(a=>a+1),className:"gap-1.5",children:[c.jsx(b1,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Reset"})]}),c.jsx(Pt,{variant:"outline",size:"sm",asChild:!0,className:"gap-1.5",children:c.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:[c.jsx(_d,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Neuer Tab"})]})})]})}),c.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted/30 flex justify-center p-4",children:c.jsx("div",{className:"bg-card shadow-lg transition-all duration-300 rounded-md overflow-hidden w-full",style:{maxWidth:s},children:c.jsx("iframe",{src:"/standonfloor-wuerfel?embed=true",className:"w-full border-0 block",style:{height:"80vh",minHeight:600},title:"Würfel-Konfigurator-Vorschau"},n)})})]})}function UVe(){return c.jsxs("div",{className:"space-y-8",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"Zwei Designs für unterschiedliche Shops: Messebau.de und Ladenbau.de. Engine, Schritte und Preise sind identisch â nur die Farbgebung unterscheidet sich."}),c.jsxs("section",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-lg font-semibold",children:["Messebau.de"," "]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktuelles Design des Würfel-Konfigurators. Verwenden Sie diesen Code im Messebau-Shop."})]}),c.jsx(Km,{configuratorPath:"/standonfloor-wuerfel",iframeTitle:"StandOnFloor Würfel-Konfigurator â Messebau",extraParams:{theme:"messebau"}})]}),c.jsxs("section",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"text-lg font-semibold",children:["Ladenbau.de"," "]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Grünes Theme passend zum Ladenbau-Shop. Verwenden Sie diesen Code im Ladenbau-Shop."})]}),c.jsx(Km,{configuratorPath:"/standonfloor-wuerfel",iframeTitle:"StandOnFloor Würfel-Konfigurator â Ladenbau",extraParams:{theme:"ladenbau"}})]})]})}const mC="easycubes",Sce={id:"easycubes",label:"EasyCubes",material:"Kunststoff",raster:40,unterboden:5,wuerfelHoehe:20,coverplatte:1},r3={easycubes:Sce};function RK(){return{grundflaecheRasterX:4,grundflaecheRasterZ:4,wuerfel:[]}}function x2(t,e){return`${t}\\${e}`}function xN(t,e){return`${t}_${e}`}function HVe(t){const e=t.toLowerCase().trim();return e.includes("big sale")||e==="sale"||e.includes("rot")?"#c92626":e.includes("schwarz")?"#1f2329":e.includes("weiÃ")||e.includes("weiss")?"#f3f3f3":e.includes("silber")||e.includes("alu")?"#c8ccd1":e.includes("anthrazit")?"#383c42":e.includes("lichtgrau")?"#cfd2d6":e.includes("juraweiÃ")||e.includes("juraweiss")?"#ece7d8":e.includes("holz dunkel")||e.includes("nussbaum")||e.includes("wenge")?"#5c3a21":e.includes("holz hell")||e.includes("eiche")||e.includes("buche")?"#d9b382":e.includes("carbon")?"#202428":e.includes("kieselstein")?"#9a958b"
4946:e.includes("pflasterstein")?"#7d7a76":e.includes("gras")||e.includes("grün")||e.includes("gruen")?"#5c8a3a":e.includes("druckvorlage")?e.includes("schwarz")?"#1f2329":e.includes("weiÃ")||e.includes("weiss")?"#f3f3f3":"#cccccc":"#bfc3c7"}function HP(t,e,n,r,i={}){const s=e.toLowerCase();let a,o;t==="Cube"||t==="Boden"?(a=.05,o=.55):(a=s.includes("hochglänzend")||s.includes("hochglanz")?.5:.3,o=s.includes("matt")?.85:s.includes("hochglänzend")||s.includes("hochglanz")?.2:.5),(s.includes("holz")||s.includes("stein")||s.includes("eiche")||s.includes("buche")||s.includes("nussbaum")||s.includes("kiesel")||s.includes("pflaster"))&&(a=0,o=.85);const l=HVe(e);let u=null;if(i.useTexture&&t==="Cover"){const d=x2(t,e),h=r.find(p=>p.schluessel===d);u=(h==null?void 0:h.bild_url)??null}return{color:l,metalness:a,roughness:o,textureUrl:u}}const jK=180;function nB(t,e,n){return t.wuerfel.filter(r=>r.spalte===e&&r.reihe===n&&r.stapelIndex>=0).length}function vy(t,e,n){return t.wuerfel.some(r=>r.spalte===e&&r.reihe===n)}function GVe(t,e,n,r){const i=r3[e];if(!vy(t,n,r))return 0;const s=nB(t,n,r);return i.unterboden+s*i.wuerfelHoehe+i.coverplatte}
4946function VVe({hersteller:t,konfig:e,onChange:n,gesamtKonfig:r,produkte:i,mode:s,offenerBlockId:a,onNeedBlock:o,onBlockClicked:l,removeMode:u=!1}){const d=r3[t],h=e.grundflaecheRasterX,p=e.grundflaecheRasterZ,f=h*d.raster,m=p*d.raster,[x,v]=E.useState(null),g=E.useRef(null),b=E.useRef(0);function y($){const U=g.current;if($===null){U!==null&&(g.current=null,v(null));return}(!U||U.spalte!==$.spalte||U.reihe!==$.reihe)&&(g.current=$,v($))}const S=Math.sqrt(f*f+m*m),A=S*1.2+60,k=Math.max(2e3,A*12+S),M=E.useMemo(()=>{let $=0;for(const V of e.wuerfel)V.stapelIndex>=0&&V.stapelIndex+1>$&&($=V.stapelIndex+1);const U=d.unterboden+$*d.wuerfelHoehe+d.coverplatte,Z=S/2;return Math.max(U,Z,d.raster)*1.4},[e.wuerfel,d,S]);function T($,U){if(s!=="einzeln")return null;const Z=e.wuerfel.find(V=>V.spalte===$&&V.reihe===U&&V.stapelIndex===-1)??e.wuerfel.find(V=>V.spalte===$&&V.reihe===U&&V.stapelIndex===0);if(Z)return Z.blockId??a??null;if(a)return a}function C($,U){const Z=T($,U);if(Z===void 0){o==null||o();return}const V=vy(e,$,U)?nB(e,$,U):-1;if(V>=0){const O=Math.max(0,Math.floor((jK-d.unterboden-d.coverplatte)/d.wuerfelHoehe));if(V>=O){const Y=Date.now();Y-b.current>1500&&(b.current=Y,zb.error(`Maximale Stapelhöhe von ${jK/100} m erreicht.`));return}}const W={spalte:$,reihe:U,stapelIndex:V,blockId:Z};n({...e,wuerfel:[...e.wuerfel,W]})}function R($,U){if(s==="einzeln"){const Z=e.wuerfel.find(W=>W.spalte===$&&W.reihe===U&&W.stapelIndex===-1)??e.wuerfel.find(W=>W.spalte===$&&W.reihe===U&&W.stapelIndex===0),V=Z==null?void 0:Z.blockId;if(V&&V!==a){l==null||l(V);return}}C($,U)}function P($,U){const Z=[...e.wuerfel];let V=-1,W=-2;Z.forEach((O,Y)=>{O.spalte===$&&O.reihe===U&&O.stapelIndex>W&&(W=O.stapelIndex,V=Y)}),V>=0&&(Z.splice(V,1),n({...e,wuerfel:Z}))}const j=E.useMemo(()=>{const $=[];for(let U=0;U<h;U++)for(let Z=0;Z<p;Z++)$.push({spalte:U,reihe:Z});return $},[h,p]),G=E.useMemo(()=>{const $=new Map;for(const[U,Z]of Object.entries(r.felder))$.set(U,{boden:HP("Boden",Z.bodenVariante,t,i,{useTexture:!0}),cube:HP("Cube",Z.cubeVariante,t,i,{useTexture:!0}),cover:HP("Cover",Z.coverVariante,t,i,{useTexture:!0})});return $},[r,t,i]);function B($,U){const Z=$+f/2,V=U+m/2;if(Z<0||V<0||Z>f||V>m)return null;const W=Math.min(h-1,Math.max(0,Math.floor(Z/d.raster))),O=Math.min(p-1,Math.max(0,Math.floor(V/d.raster)));return{spalte:W,reihe:O}}return c.jsxs(A6,{shadows:!0,frameloop:"demand",dpr:[1,1.5],camera:{position:[A,A*.8,A],fov:35,near:1,far:k},gl:{logarithmicDepthBuffer:!1,antialias:!1,powerPreference:"high-performance"},style:{width:"100%",height:"100%"},children:[c.jsx("color",{attach:"background",args:["#f4f5f7"]}),c.jsx("ambientLight",{intensity:.55}),c.jsx("directionalLight",{position:[200,400,200],intensity:1.1,castShadow:!0,"shadow-mapSize":[1024,1024],"shadow-bias":-5e-4}),c.jsx(vce,{preset:"apartment",resolution:64}),c.jsxs("group",{position:[-f/2,0,-m/2],children:[c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[f/2,-.5,m/2],receiveShadow:!0,raycast:()=>null,children:[c.jsx("planeGeometry",{args:[f,m]}),c.jsx("meshStandardMaterial",{color:"#eef0f2",polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1})]}),c.jsx(WVe,{cellsX:h,cellsZ:p,raster:d.raster}),c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[f/2,0,m/2],onPointerMove:$=>{$.stopPropagation();const U=B($.point.x,$.point.z);if(!U){y(null);return}if(vy(e,U.spalte,U.reihe)){y(null);return}y(U)},onPointerOut:()=>y(null),onClick:$=>{$.stopPropagation();const U=B($.point.x,$.point.z);U&&(vy(e,U.spalte,U.reihe)||($.shiftKey||u?P(U.spalte,U.reihe):C(U.spalte,U.reihe)))},children:[c.jsx("planeGeometry",{args:[f,m]}),c.jsx("meshBasicMaterial",{visible:!1})]}),j.map(({spalte:$,reihe:U})=>{if(!vy(e,$,U))return null;const Z=nB(e,$,U),V=$*d.raster+d.raster/2,W=U*d.raster+d.raster/2,O=xN($,U),Y=G.get(O);return c.jsx(KVe,{x:V,z:W,n:Z,hersteller:t,materialien:Y,onTopClick:z=>{z||u?P($,U):R($,U)},onHover:()=>y({spalte:$,reihe:U}),onHoverOut:()=>y(null)},`stapel-${$}-${U}`)}),x&&c.jsx(YVe,{x:x.spalte*d.raster+d.raster/2,z:x.reihe*d.raster+d.raster/2,yBasisCm:GVe(e,t,x.spalte,x.reihe),hersteller:t,variante:vy(e,x.spalte,x.reihe)?"cube":"boden-cover"})]}),c.jsx(yce,{position:[0,0,0],opacity:.35,scale:S*2,blur:2,far:50}),c.jsx(N6,{target:[0,30,0],enablePan:!0,enableDamping:!0,maxPolarAngle:Math.PI/2.05,minDistance:M,maxDistance:A*3,touches:{ONE:ud.ROTATE,TWO:ud.DOLLY_PAN}})]})}function WVe({cellsX:t,cellsZ:e,raster:n}){const r=E.useMemo(()=>{const i=t*n,s=e*n,a=[],o=.05;for(let h=0;h<=t;h++){const p=h*n;a.push(p,o,0,p,o,s)}for(let h=0;h<=e;h++){const p=h*n;a.push(0,o,p,i,o,p)}const l=new or;l.setAttribute("position",new _n(a,3));const u=new Pa({color:"#b9bdc4",polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1}),d=new Ql(l,u);return d.raycast=()=>null,d},[t,e,n]);return c.jsx("primitive",{object:r})}const $Ve={boden:{color:"#3a3f46",metalness:.3,roughness:.6,textureUrl:null},cube:{color:"#ffffff",metalness:.05,roughness:.5,textureUrl:null},cover:{color:"#2a2e34",metalness:.4,roughness:.5,textureUrl:null}};function KVe({x:t,z:e,n,hersteller:r,materialien:i,onTopClick:s,onHover:a,onHoverOut:o}){const l=r3[r],u=l.raster,d=i??$Ve;let h=0;const p=[];p.push(c.jsx(PK,{width:u,height:l.unterboden,depth:u,yCenter:h+l.unterboden/2,spec:d.boden,castShadow:!0,receiveShadow:!0}
4946,"unterboden")),h+=l.unterboden;for(let f=0;f<n;f++){const m=f===n-1,x=h+l.wuerfelHoehe/2;p.push(c.jsx(PK,{width:u,height:l.wuerfelHoehe,depth:u,yCenter:x,spec:d.cube,castShadow:!0,receiveShadow:!0,interactive:m?{onHover:a,onHoverOut:o,onClick:v=>s(v)}:void 0},`w-${f}`)),p.push(c.jsxs("lineSegments",{position:[0,x,0],raycast:()=>null,children:[c.jsx("edgesGeometry",{args:[new Nd(u,l.wuerfelHoehe,u)]}),c.jsx("lineBasicMaterial",{color:"#3a3f46",transparent:!0,opacity:.35})]},`edge-${f}`)),f<n-1&&p.push(c.jsxs("mesh",{position:[0,h+l.wuerfelHoehe-.25/2,0],raycast:()=>null,children:[c.jsx("boxGeometry",{args:[u+.05,.25,u+.05]}),c.jsx("meshStandardMaterial",{color:"#1f2329",metalness:.2,roughness:.8})]},`fuge-${f}`)),h+=l.wuerfelHoehe}return p.push(c.jsx(qVe,{r:u,thickness:l.coverplatte,yBase:h,spec:d.cover,onHover:a,onHoverOut:o,onClick:f=>s(f)},"cover")),c.jsx("group",{position:[t,0,e],children:p})}function qVe({r:t,thickness:e,yBase:n,spec:r,onHover:i,onHoverOut:s,onClick:a}){const o={onPointerOver:l=>{l.stopPropagation(),i()},onPointerOut:()=>s(),onClick:l=>{l.stopPropagation(),a(l.shiftKey)}};return r.textureUrl?c.jsx(E.Suspense,{fallback:c.jsxs("mesh",{position:[0,n+e/2,0],...o,children:[c.jsx("boxGeometry",{args:[t,e,t]}),c.jsx("meshStandardMaterial",{color:r.color})]}),children:c.jsx(XVe,{r:t,thickness:e,yBase:n,spec:r,handlers:o})}):c.jsxs("mesh",{position:[0,n+e/2,0],castShadow:!0,receiveShadow:!0,...o,children:[c.jsx("boxGeometry",{args:[t,e,t]}),c.jsx("meshStandardMaterial",{color:r.color,metalness:r.metalness,roughness:r.roughness})]})}function XVe({r:t,thickness:e,yBase:n,spec:r,handlers:i}){const s=ow(r.textureUrl),a=E.useMemo(()=>
4946{s.colorSpace=os,s.anisotropy=8;const o=new Lc({color:r.color,metalness:r.metalness,roughness:r.roughness}),l=new Lc({map:s,color:"#ffffff",metalness:r.metalness,roughness:r.roughness});return[o,o,l,o,o,o]},[s,r.color,r.metalness,r.roughness]);return c.jsx("mesh",{position:[0,n+e/2,0],castShadow:!0,receiveShadow:!0,material:a,...i,children:c.jsx("boxGeometry",{args:[t,e,t]})})}function YVe({x:t,z:e,yBasisCm:n,hersteller:r,variante:i}){const s=r3[r],a=i==="boden-cover"?s.unterboden+s.coverplatte:s.wuerfelHoehe,o=i==="boden-cover"?.1:(n===0?s.unterboden:n-s.coverplatte)+.1;return c.jsxs("mesh",{position:[t,o+a/2,e],raycast:()=>null,renderOrder:2,children:[c.jsx("boxGeometry",{args:[s.raster,a,s.raster]}),c.jsx("meshStandardMaterial",{color:"#78AD48",transparent:!0,opacity:.35,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2})]})}function PK({width:t,height:e,depth:n,yCenter:r,spec:i,castShadow:s,receiveShadow:a,interactive:o}){const l=o?{onPointerOver:d=>{d.stopPropagation(),o.onHover()},onPointerOut:()=>o.onHoverOut(),onClick:d=>{d.stopPropagation(),o.onClick(d.shiftKey)}}:{},u=o?void 0:()=>null;return i.textureUrl?c.jsx(E.Suspense,{fallback:c.jsxs("mesh",{position:[0,r,0],raycast:u,...l,children:[c.jsx("boxGeometry",{args:[t,e,n]}),c.jsx("meshStandardMaterial",{color:i.color,metalness:i.metalness,roughness:i.roughness})]}),children:c.jsx(JVe,{width:t,height:e,depth:n,yCenter:r,spec:i,castShadow:s,receiveShadow:a,handlers:l,raycast:u})}):c.jsxs("mesh",{position:[0,r,0],castShadow:s,receiveShadow:a,raycast:u,...l,children:[c.jsx("boxGeometry",{args:[t,e,n]}),c.jsx("meshStandardMaterial",{color:i.color,metalness:i.metalness,roughness:i.roughness})]})}function JVe({width:t,height:e,depth:n,yCenter:r,spec:i,castShadow:s,receiveShadow:a,handlers:o,raycast:l}){const u=ow(i.textureUrl),d=E.useMemo(()=>(u.colorSpace=os,u.anisotropy=8,new Lc({map:u,color:"#ffffff",metalness:i.metalness,roughness:i.roughness})),[u,i.metalness,i.roughness]);return c.jsx("mesh",{position:[0,r,0],castShadow:s,receiveShadow:a,raycast:l,material:d,...o,children:c.jsx("boxGeometry",{args:[t,e,n]})})}const ZVe="easycubes_produkte";function QVe(t){const e=t.toLowerCase();return e.includes(" floor")||e.includes(" boden")?"Boden":e.includes(" cube")||e.includes(" würfel")||e.includes(" wuerfel")?"Cube":e.includes(" cover")||e.includes(" abdeckung")?"Cover":null}function Ace(){const[t,e]=E.useState({produkte:[],loading:!0,error:null});return E.useEffect(()=>{let n=!1;return e({produkte:[],loading:!0,error:null}),(async()=>{const{data:r,error:i}=await Ot.from(ZVe).select("artikelname, schluessel, sku, preis, bild_url").order("artikelname",{ascending:!0});if(n)return;if(i){e({produkte:[],loading:!1,error:i.message});return}const s=[];for(const a of r??[]){const o=String(a.schluessel??""),[l,...u]=o.split("|"),d=u.join("|").trim(),p=(l==="Boden"||l==="Cube"||l==="Cover"?l:null)??QVe(String(a.artikelname??""));if(!p)continue;const f=d||o;s.push({name:String(a.artikelname??""),variable:f,schluessel:x2(p,f),bestandteil:p,sku:String(a.sku??""),preis:Number(a.preis??0),bild_url:a.bild_url?String(a.bild_url):null,produkt_url:null})}e({produkte:s,loading:!1,error:null})})(),()=>{n=!0}},[]),t}function GP(t,e){return t.filter(n=>n.bestandteil===e)}function LK(t){if(!t)return"";const e=t.indexOf("|");return e>=0?t.slice(e+1):t}function eWe({produkte:t,loading:e,global:n,setGlobal:r,mode:i,onModeChange:s,bloecke:a,offenerBlockId:o,setOffenerBlockId:l,addBlock:u,updateBlock:d,closeBlock:h,removeBlock:p,wuerfelProBlock:f,onConfirmDeleteBlock:m}){var A;const x=GP(t,"Boden"),v=GP(t,"Cube"),g=GP(t,"Cover"),[b,y]=E.useState(null);if(e)return c.jsx("div",{className:"text-xs text-muted-foreground border-t border-border pt-3",children:"Farben werden geladenâ¦"});if(!t.length)return c.jsx("div",{className:"text-xs text-muted-foreground border-t border-border pt-3",children:"Noch keine Produkte importiert. Bitte im Admin CSV hochladen."});const S=i==="einzeln";return c.jsxs("div",{className:"border-t border-border pt-3 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-1 p-1 bg-muted rounded-md text-[11px]",children:[c.jsx("button",{type:"button",onClick:()=>s("alle-gleich"),className:`py-1.5 rounded transition ${i==="alle-gleich"?"bg-card text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:"Alle gleich"}),c.jsx("button",{type:"button",onClick:()=>s("einzeln"),className:`py-1.5 rounded transition ${i==="einzeln"?"bg-card text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:"Einzeln (Blöcke)"})]}),!S&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Auswahl gilt für alle Würfel."}),c.jsx(Qv,{title:"Boden",produkte:x,aktiv:n.bodenVariante,onWaehle:k=>r(M=>({...M,bodenVariante:k}))}),c.jsx(Qv,{title:"Würfel-Farbe",produkte:v,aktiv:n.cubeVariante,onWaehle:k=>r(M=>({...M,cubeVariante:k}))}),c.jsx(Qv,{title:"Cover",produkte:g,aktiv:n.coverVariante,onWaehle:k=>r(M=>({...M,coverVariante:k}))})]}),S&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"text-[11px] text-muted-foreground leading-snug",children:"Würfel werden Blöcken zugeordnet. Jeder Block hat eigene Farben. Neue Würfel landen im offenen Block."}
4946),a.length===0&&c.jsx("div",{className:"text-[11px] text-muted-foreground bg-muted/60 rounded p-2 leading-snug",children:'Noch kein Block. Klicken Sie unten auf âBlock hinzufügen", um zu starten.'}),a.map(k=>{const M=k.id===o,T=f[k.id]??0;return c.jsxs("div",{className:`border rounded-md ${M?"border-primary/60 bg-primary/5":"border-border bg-card"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1.5 text-[11px]",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 order-1",children:[c.jsxs("span",{className:"font-medium text-foreground truncate",children:["Block ",k.index]}),c.jsxs("span",{className:"text-muted-foreground whitespace-nowrap shrink-0",children:["(",T," Würfel)"]})]}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 order-2",children:[!k.abgeschlossen&&M&&c.jsx("button",{type:"button",onClick:()=>h(k.id),className:"text-[10px] text-primary hover:underline",children:"abschlieÃen"}),k.abgeschlossen&&!o&&c.jsx("button",{type:"button",onClick:()=>{d(k.id,{abgeschlossen:!1}),l(k.id)},className:"text-[10px] text-muted-foreground hover:text-foreground hover:underline",children:"bearbeiten"}),c.jsx("button",{type:"button",onClick:()=>y(k.id),className:"text-[10px] text-destructive hover:underline",children:"löschen"})]}),k.abgeschlossen?c.jsx("span",{className:"order-3 basis-full text-[10px] text-muted-foreground",children:"â abgeschlossen"}):M?c.jsx("span",{className:"order-3 basis-full text-[10px] text-primary font-medium",children:"â offen"}):null]}),M&&!k.abgeschlossen&&c.jsxs("div",{className:"border-t border-border/60 px-2 py-2 space-y-3",children:[c.jsx(Qv,{title:"Boden",produkte:x,aktiv:k.bodenVariante,onWaehle:C=>d(k.id,{bodenVariante:C}),compact:!0}),c.jsx(Qv,{title:"Würfel-Farbe",produkte:v,aktiv:k.cubeVariante,onWaehle:C=>d(k.id,{cubeVariante:C}),compact:!0}),c.jsx(Qv,{title:"Cover",produkte:g,aktiv:k.coverVariante,onWaehle:C=>d(k.id,{coverVariante:C}),compact:!0})]})]},k.id)}),c.jsx("button",{type:"button",onClick:()=>u(),disabled:!!o,className:`w-full text-[11px] py-1.5 rounded border transition ${o?"border-border text-muted-foreground bg-muted/40 cursor-not-allowed":"border-primary text-primary hover:bg-primary/10"}`,title:o?"Bitte aktuellen Block zuerst abschlieÃen":"Neuen Block hinzufügen",children:"+ Block hinzufügen"})]}),c.jsx(vx,{open:!!b,onOpenChange:k=>!k&&y(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:"Block löschen?"}),c.jsx(Vm,{children:b&&`Block ${(A=a.find(k=>k.id===b))==null?void 0:A.index} wird gelöscht. Die ${f[b]??0} zugehörigen Würfel werden mitgelöscht. Möchten Sie fortfahren?`})]}),c.jsxs(Hm,{children:[c.jsx($m,{children:"Abbrechen"}),c.jsx(Wm,{onClick:()=>{b&&(m(b),p(b),y(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Löschen"})]})]})})]})}function Qv({title:t,produkte:e,aktiv:n,onWaehle:r,compact:i}){const s=LK(n);return c.jsxs("section",{className:"space-y-1.5",children:[c.jsx("h3",{className:`font-semibold text-foreground ${i?"text-[11px]":"text-xs"}`,children:t}),c.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:e.map(a=>{const o=a.variable===n,l=LK(a.variable);return c.jsxs("button",{type:"button",onClick:()=>r(a.variable),title:l,className:"flex flex-col items-center gap-1 group",children:[c.jsx("div",{className:`aspect-square w-full rounded border overflow-hidden flex items-center justify-center bg-muted/40 transition ${o?"border-primary ring-2 ring-primary/40":"border-border group-hover:border-foreground
4946/40"}`,children:a.bild_url?c.jsx("img",{src:a.bild_url,alt:l,className:"w-full h-full object-cover",loading:"lazy"}):c.jsx("span",{className:"text-[9px] text-center text-muted-foreground p-0.5 leading-tight break-words",children:l})}),c.jsx("span",{className:`text-[10px] leading-tight text-center w-full truncate ${o?"text-foreground font-medium":"text-muted-foreground"}`,children:l})]},a.variable)})}),s&&c.jsxs("div",{className:"text-[11px] text-muted-foreground truncate",children:["Aktuell: ",c.jsx("span",{className:"text-foreground",children:s})]})]})}function tWe(t){const e=t.variante.indexOf("|"),n=e>=0?t.variante.slice(e+1):t.variante;return{artikelnummer:t.sku,bezeichnung:`${t.bestandteil}: ${n}`,menge:t.anzahl,einzelpreis:t.einzelpreis,gesamtpreis:t.gesamtpreis,bild_url:t.bild_url,gruppe:t.bestandteil,staffel:XO(t)}}function IK({lieferumfang:t,loading:e,onAnfrage:n,extraActions:r,variant:i="desktop"}){const{positionen:s,anzahlFelder:a,fehlendeSchluessel:o}=t,l=i==="mobile",u=E.useMemo(()=>{const p=s.map(tWe);return yA(p,q1)},[s]),d=ZO(u)??u,h=d.positionen;return c.jsxs("aside",{className:l?"bg-card flex flex-col":"bg-card border border-border rounded-lg flex flex-col h-fit lg:sticky lg:top-4 max-h-[calc(100vh-2rem)]",children:[!l&&c.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[c.jsx("h2",{className:"text-sm font-semibold",children:"Lieferumfang"}),c.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:a===0?"Noch keine Felder belegt":`${a} Feld${a===1?"":"er"} · ${s.length} Position${s.length===1?"":"en"}`})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3 min-h-0",children:[e&&c.jsx("div",{className:"text-xs text-muted-foreground",children:"Produkte werden geladenâ¦"}),!e&&a===0&&c.jsx("div",{className:"text-xs text-muted-foreground py-8 text-center",children:"Klicken Sie auf die Grundfläche oder einen vorhandenen Würfel, um Würfel hinzuzufügen."}),!e&&h.length>0&&c.jsx(YO,{positionen:h,gruppiert:!0,zeigeBild:!0}),o.length>0&&c.jsxs("div",{className:"mt-3 p-2 rounded border border-destructive/40 bg-destructive/5 text-[11px] text-destructive",children:[c.jsxs("div",{className:"font-medium mb-1",children:["Für ",o.length," Variante",o.length===1?"":"n"," kein Produkt im Katalog:"]}),c.jsxs("ul",{className:"space-y-0.5",children:[o.slice(0,5).map(p=>c.jsxs("li",{className:"truncate",children:["⢠",p]},p)),o.length>5&&c.jsxs("li",{children:["⦠und ",o.length-5," weitere"]})]})]})]}),c.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2",children:[c.jsx(pM,{ergebnis:d}),!l&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",disabled:a===0,onClick:n,className:"w-full px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90 transition",children:"Angebot anfordern"}),c.jsx("div",{className:"text-[10px] text-muted-foreground text-center",children:"Unverbindliches Angebot"}),r]})]})]})}function nWe(){return{bodenVariante:"",bodenAlleGleich:!0,cubeVariante:"",coverVariante:""}}function rWe(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`b_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function iWe(t,e,n,r,i){const s=new Map;for(const l of t.wuerfel){const u=xN(l.spalte,l.reihe);let d=s.get(u);d||(d={spalte:l.spalte,reihe:l.reihe,cubes:0,blockId:null},s.set(u,d)),l.stapelIndex>=0&&(d.cubes+=1)}for(const l of t.wuerfel){if(l.stapelIndex!==-1)continue;const u=s.get(xN(l.spalte,l.reihe));u&&(u.blockId=l.blockId??null)}for(const l of t.wuerfel){if(l.stapelIndex!==0)continue;const u=s.get(xN(l.spalte,l.reihe));u&&u.blockId==null&&(u.blockId=l.blockId??null)}const a=new Map;for(const l of i)a.set(l.id,l);const o={};for(const[l,u]of s.entries()){let d=n.bodenVariante,h=n.cubeVariante,p=n.coverVariante;if(r==="einzeln"&&u.blockId){const f=a.get(u.blockId);f&&(d=f.bodenVariante,h=f.cubeVariante,p=f.coverVariante)}o[l]={spalte:u.spalte,reihe:u.reihe,cubes:u.cubes,bodenVariante:d,cubeVariante:h,coverVariante:p,blockId:u.blockId}}return{hersteller:e,grundflaecheRasterX:t.grundflaecheRasterX,grundflaecheRasterZ:t.grundflaecheRasterZ,felder:o,global:n,mode:r,bloecke:i}}function sWe(t){const[e,n]=E.useState(nWe),[r,i]=E.useState("alle-gleich"),[s,a]=E.useState([]),[o,l]=E.useState(null),u=E.useRef(!1);return E.useEffect(()=>{if(u.current||!t.length)return;const d=(h,...p)=>{var f;for(const m of p){const x=t.find(v=>v.bestandteil===h&&v.variable===m);if(x)return x.variable}return((f=t.find(m=>m.bestandteil===h))==null?void 0:f.variable)??""};n(h=>({bodenVariante:h.bodenVariante||d("Boden","weiss","weiÃ"),bodenAlleGleich:h.bodenAlleGleich,cubeVariante:h.cubeVariante||d("Cube","weiss","weiÃ"),coverVariante:h.coverVariante||d("Cover","schwarz matt","schwarz","black")})),u.current=!0},[t]),E.useMemo(()=>({global:e,mode:r,bloecke:s,offenerBlockId:o,setGlobal:n,setMode:i,setBloecke:a,setOffenerBlockId:l,addBlock:d=>{const h=rWe(),p=s.reduce((x,v)=>Math.max(x,v.index),0)+1,f=(x,...v)=>{var g;for(const b of v){const y=t.find(S=>S.bestandteil===x&&S.variable===b);if(y)return y.variable}return((g=t.find(b=>b.bestandteil===x))==null?void 0:g.variable)??""},m={id:h,index:p,bodenVariante:(d==null?void 0:d.bodenVariante)??(e.bodenVariante||f("Boden","weiss","weiÃ")),cubeVariante:(d==null?void 0:d.cubeVariante)??(e.cubeVariante||f("Cube","weiss","weiÃ")),coverVariante:(d==null?void 0:d.coverVariante)??(e.coverVariante||f("Cover","schwarz matt","schwarz","black")),abgeschlossen:!1};return a(x=>[...x,m]),l(h),h},updateBlock:(d,h)=>{a(p=>p.map(f=>f.id===d?{...f,...h}:f))},closeBlock:d=>{a(h=>h.map(p=>p.id===d?{...p,abgeschlossen:!0}:p)),l(h=>h===d?null:h)},removeBlock:d=>{a(h=>h.filter(p=>
4946p.id!==d)),l(h=>h===d?null:h)},reset:()=>{a([]),l(null),i("alle-gleich")}}),[e,r,s,o,t])}function VP(t,e,n){n<=0||t.set(e,(t.get(e)??0)+n)}function aWe(t){const e=new Map;for(const n of Object.values(t.felder))VP(e,x2("Boden",n.bodenVariante),1),n.cubes>0&&VP(e,x2("Cube",n.cubeVariante),n.cubes),VP(e,x2("Cover",n.coverVariante),1);return e}function oWe(t,e){const n=new Map;for(const h of e)n.set(h.schluessel,h);const r=aWe(t),i=[],s=[],a=["Boden","Cube","Cover"],o=[...r.entries()].sort((h,p)=>{const f=h[0].split("\\")[0],m=p[0].split("\\")[0],x=a.indexOf(f),v=a.indexOf(m);return x!==v?x-v:h[0].localeCompare(p[0],"de")});for(const[h,p]of o){const f=n.get(h);if(!f){s.push(h);continue}const m=f.preis*p;i.push({schluessel:h,sku:f.sku,name:f.name,bestandteil:f.bestandteil,variante:f.variable,anzahl:p,einzelpreis:f.preis,gesamtpreis:m,bild_url:f.bild_url})}const l=i.reduce((h,p)=>h+p.gesamtpreis,0),u=Object.keys(t.felder).length,d=Object.values(t.felder).reduce((h,p)=>h+p.cubes,0);return{positionen:i,gesamtpreis:l,anzahlFelder:u,anzahlCubesGesamt:d,fehlendeSchluessel:s}}const lWe=new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"});function cWe(){var Ge,He,_e;const[t,e]=E.useState(RK()),[n,r]=E.useState(null),[i,s]=E.useState(null),[a,o]=E.useState(!1),[l,u]=E.useState(!0),[d,h]=E.useState("grundflaeche"),{produkte:p,loading:f}=Ace(),[m]=Al(),[x]=E.useState(()=>!!m.get("code"));Ix({expectedKonfigurator:"easycubes",applyKonfiguration:Ne=>Ne&&e(Ne)});const{global:v,mode:g,bloecke:b,offenerBlockId:y,setGlobal:S,setMode:A,setBloecke:k,setOffenerBlockId:M,addBlock:T,updateBlock:C,closeBlock:R,removeBlock:P,reset:j}=sWe(p),{toast:G}=HS(),B=E.useMemo(()=>iWe(t,mC,v,g,b),[t,v,g,b]),[$,U]=E.useState(new Map);E.useEffect(()=>{gO().then(U).catch(()=>{})},[]);const Z=E.useMemo(()=>{const Ne=oWe(B,p);if($.size===0)return Ne;const{groups:ue,totalsPerGroup:Ce}=hte([Ne.positionen],$,{totalField:"gesamtpreis"});return{...Ne,positionen:ue[0],gesamtpreis:Ce[0]}},[B,p,$]),V=E.useMemo(()=>{const Ne={};for(const ue of t.wuerfel){if(ue.stapelIndex<0)continue;const Ce=ue.blockId;Ce&&(Ne[Ce]=(Ne[Ce]??0)+1)}return Ne},[t.wuerfel]),W=Sce,O=t.wuerfel.filter(Ne=>Ne.stapelIndex>=0).length,Y=t.wuerfel.length>0,z=t.wuerfel.reduce((Ne,ue)=>ue.stapelIndex>=0?Math.max(Ne,ue.stapelIndex+1):Ne,0),I=Y?W.unterboden+z*W.wuerfelHoehe+W.coverplatte:0,q=()=>{e(RK()),j(),o(!1)},te=Ne=>{if(Ne!==g){if(Ne==="einzeln"){if(t.wuerfel.length>0&&b.length===0){const ue=T({bodenVariante:v.bodenVariante,cubeVariante:v.cubeVariante,coverVariante:v.coverVariante});e({...t,wuerfel:t.wuerfel.map(Ce=>({...Ce,blockId:ue}))})}A("einzeln");return}if(b.length>0&&t.wuerfel.length>0){r("alle-gleich");return}A("alle-gleich"),k([]),M(null),e({...t,wuerfel:t.wuerfel.map(ue=>({...ue,blockId:null}))})}},se=()=>{const Ne=b[0];Ne&&S(ue=>({...ue,bodenVariante:Ne.bodenVariante,cubeVariante:Ne.cubeVariante,coverVariante:Ne.coverVariante})),k([]),M(null),A("alle-gleich"),e({...t,wuerfel:t.wuerfel.map(ue=>({...ue,blockId:null}))}),r(null)},ie=Ne=>{e({...t,wuerfel:t.wuerfel.filter(ue=>ue.blockId!==Ne)})},[le,xe]=E.useState(!1),Ee=()=>{Z.positionen.length!==0&&xe(!0)},ae=Ne=>{s(Ne)},Q=()=>{i&&(y&&y!==i&&R(y),C(i,{abgeschlossen:!1}),M(i),s(null))},we=()=>{y&&R(y),T(),s(null)},Ae=((Ge=b.find(Ne=>Ne.id===y))==null?void 0:Ge.index)??null,K=((He=b.find(Ne=>Ne.id===i))==null?void 0:He.index)??null,pe=y&&y!==i?((_e=b.find(Ne=>Ne.id===y))==null?void 0:_e.index)??null:null,ye=c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3",children:[c.jsx("div",{className:"font-medium text-foreground",children:"Grundfläche"}),c.jsx("div",{className:"grid grid-cols-2 gap-3",children:[["Spalten","grundflaecheRasterX",t.grundflaecheRasterX],["Reihen","grundflaecheRasterZ",t.grundflaecheRasterZ]].map(([Ne,ue,Ce])=>c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("span",{children:Ne}),c.jsxs("div",{className:"flex items-stretch border border-border rounded overflow-hidden bg-background",children:[c.jsx("button",{type:"button","aria-label":`${Ne} verringern`,onClick:()=>{const Ke=Math.max(1,Ce-1);e({...t,[ue]:Ke,wuerfel:t.wuerfel.filter(Qe=>ue==="grundflaecheRasterX"?Qe.spalte<Ke:Qe.reihe<Ke)})},className:"h-11 w-11 lg:h-9 lg:w-9 flex items-center justify-center hover:bg-muted transition shrink-0",children:c.jsx(y1,{className:"w-4 h-4"})}),c.jsx("input",{type:"text",readOnly:!0,tabIndex:-1,"aria-label":Ne,value:Ce,className:"flex-1 min-w-0 text-center bg-transparent border-x border-border text-sm font-medium text-foreground tabular-nums focus:outline-none cursor-default select-none"}),c.jsx("button",{type:"button","aria-label":`${Ne} erhöhen`,onClick:()=>{const Ke=Math.min(30,Ce+1);e({...t,[ue]:Ke})},className:"h-11 w-11 lg:h-9 lg:w-9 flex items-center justify-center hover:bg-muted transition shrink-0",children:c.jsx(ph,{className:"w-4 h-4"})})]})]},ue))}),c.jsxs("div",{className:"text-[11px] opacity-80",children:["â ",(t.grundflaecheRasterX*W.raster).toLocaleStr
4946ing("de-DE")," à ",(t.grundflaecheRasterZ*W.raster).toLocaleString("de-DE")," cm"]}),c.jsxs("div",{className:"border-t border-border pt-3 space-y-1",children:[c.jsxs("div",{className:"font-medium text-foreground",children:["Geometrie ",W.label]}),c.jsxs("div",{children:["Raster: ",W.raster," cm"]}),c.jsxs("div",{children:["Unterboden: ",W.unterboden," cm"]}),c.jsxs("div",{children:["Würfelhöhe: ",W.wuerfelHoehe," cm"]}),c.jsxs("div",{children:["Coverplatte: ",W.coverplatte," cm"]})]})]}),Se=c.jsx(eWe,{produkte:p,loading:f,global:v,setGlobal:S,mode:g,onModeChange:te,bloecke:b,offenerBlockId:y,setOffenerBlockId:M,addBlock:T,updateBlock:C,closeBlock:R,removeBlock:P,gesamtKonfig:B,wuerfelProBlock:V,onConfirmDeleteBlock:ie}),ee=c.jsx("button",{type:"button",onClick:q,className:"w-full text-xs px-3 py-2 min-h-[44px] rounded-md border border-border hover:bg-muted transition",children:"Zurücksetzen"}),re=c.jsxs("div",{className:"relative h-full w-full bg-muted/30",children:[c.jsx(E.Suspense,{fallback:c.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground",children:"3D-Szene wird geladenâ¦"}),children:c.jsx(VVe,{hersteller:mC,konfig:t,onChange:e,gesamtKonfig:B,produkte:p,mode:g,offenerBlockId:y,removeMode:a,onBlockClicked:ae,onNeedBlock:()=>G({title:"Kein Block geöffnet",description:"Bitte fügen Sie zuerst einen Block hinzu, oder bearbeiten Sie einen bestehenden Block und arbeiten Sie diesen fortlaufend ab."})})}),c.jsxs("div",{className:"absolute top-3 left-3 z-20 max-w-[280px]",children:[c.jsx("button",{type:"button",onClick:()=>u(Ne=>!Ne),"aria-expanded":l,"aria-label":"Bedienungshinweise anzeigen",className:"bg-card/90 backdrop-blur border border-border rounded-full h-9 w-9 flex items-center justify-center hover:bg-card transition shadow-sm",children:c.jsx(aF,{className:"w-4 h-4 text-muted-foreground"})}),l&&c.jsxs("div",{className:"mt-2 bg-card/95 backdrop-blur border border-border rounded-md px-3 py-2 text-xs text-muted-foreground shadow-md space-y-0.5",children:[c.jsx("div",{className:"font-medium text-foreground mb-1",children:"Bedienung"}),c.jsxs("div",{className:"lg:hidden space-y-0.5",children:[c.jsx("div",{children:"1. Tap â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Taps â Würfel stapeln"}),c.jsx("div",{children:'Modus âEntfernen" â Tap geht eine Stufe zurück'}),c.jsx("div",{children:"1 Finger ziehen â drehen"}),c.jsx("div",{children:"2 Finger ziehen â zoomen / verschieben"})]}),c.jsxs("div",{className:"hidden lg:block space-y-0.5",children:[g==="alle-gleich"?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:"1. Klick â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Klicks â Würfel stapeln"}),c.jsx("div",{children:"Shift + Klick â eine Stufe zurück"})]}):c.jsxs(c.Fragment,{children:[Ae?c.jsxs("div",{children:["Neue Felder â Block"," ",c.jsx("span",{className:"text-primary font-medium",children:Ae})]}):c.jsx("div",{className:"text-amber-700",children:"Bitte links Block hinzufügen"}),c.jsx("div",{children:"1. Klick â Bodenplatte mit Cover"}),c.jsx("div",{children:"Weitere Klicks â Würfel stapeln"}),c.jsx("div",{children:"Shift + Klick â eine Stufe zurück"})]}),c.jsxs("div",{className:"pt-1 mt-1 border-t border-border/60",children:[c.jsx("div",{children:"Linke Maustaste halten â drehen"}),c.jsx("div",{children:"Rechte Maustaste halten â verschieben"}),c.jsx("div",{children:"Mausrad â zoomen"})]})]})]})]}),I>0&&c.jsxs("div",{className:"absolute top-3 right-3 z-20 bg-card/90 backdrop-blur border border-border rounded-md px-3 py-1.5 text-xs",children:["Höhe: ",I.toLocaleString("de-DE")," cm"]}),c.jsx("div",{className:"lg:hidden absolute bottom-3 left-1/2 -translate-x-1/2 z-20",children:c.jsxs("div",{role:"group","aria-label":"Klick-Modus",className:"flex bg-card/95 backdrop-blur border border-border rounded-full shadow-md overflow-hidden text-xs",children:[c.jsxs("button",{type:"button",onClick:()=>o(!1),"aria-pressed":!a,className:`flex items-center gap-1.5 px-3 h-10 transition ${a?"text-muted-foreground hover:bg-muted":"bg-primary text-primary-foreground"}`,children:[c.jsx(x5,{className:"w-3.5 h-3.5"}),"Hinzufügen"]}),c.jsxs("button",{type:"button",onClick:()=>o(!0),"aria-pressed":a,className:`flex items-center gap-1.5 px-3 h-10 transition ${a?"bg-destructive text-destructive-foreground":"text-muted-foreground hover:bg-muted"}`,children:[c.jsx(pJ,{className:"w-3.5 h-3.5"}),"Entfernen"]})]})})]}),me=c.jsxs("div",{className:"border-t border-border px-4 py-3 text-sm text-muted-foreground",children:[O," Würfel",z>0&&` · höchster Stapel ${z}`,g==="einzeln"&&b.length>0&&c.jsxs(c.Fragment,{children:[" · ",b.length," Block",b.length===1?"":"öcke"]})]});return c.jsxs("div",{className:"min-h-screen lg:h-screen lg:overflow-hidden bg-background flex flex-col",children:[c.jsx(B1,{konfigurator:"easycubes",disabled:x,onGeladen:Ne=>Ne&&e(Ne)}),c.jsx("header",{className:"border-b border-border bg-card",children:c.jsxs("div",{className:"max-w-screen-2xl mx-auto px-4 py-3 flex flex-col sm:flex-row sm:flex-wrap sm:items-center gap-1 sm:gap-4",children:[c.jsx("h1",{className:"text-base sm:text-lg font-semibold leading-tight",children:"EasyCubes Würfelsystem-Konfigurator"}),c.jsxs("span",{className:"text-[11px] sm:text-xs font-normal text-muted-foreground",children:["(",W.material,", ",W.raster," cm Raster)"]})]})}),c.jsxs("div",{className:"hidden lg:grid flex-1 lg:min-h-0 max-w-screen-2xl w-full mx-auto px-4 py-4 grid-cols-[260px_1fr_320px] gap-4",children:[c.jsxs("aside",{className:"bg-card border border-border rounded-lg p-4 space-y-4 h-full overflow-y-auto",children:[ye,Se,c.jsx("div",{className:"sticky bottom-0 bg-card pt-2 -mx-4 px-4 -mb-4 pb-4 border-t border-border",children:ee})]}),c.jsxs("main",{className:"bg-card border border-border rounded-lg flex flex-col overflow-hidden h-full",children:[c.jsx("div",{className:"flex-1 min-h-0 relative",children:re}),me]}),c.jsx(IK,{lieferumfang:Z,loading:f,onAnfrage:Ee,extraActions:c.jsx(Bf,{konfigurator:"easycubes",getKonfiguration:()=>t,size:"sm",className:"w-full mt-2"})})]}),c.jsxs("div",{className:"lg:hidden flex-1 flex flex-col pb-20",children:[c.jsxs("div",{className:"sticky top-0 z-30 bg-card border-b border-border",children:[c.jsx("div",{className:"h-[55vh] min-h-[340px] max-h-[480px] relative",children:re}),c.jsxs("div",{className:"px-4 py-2 text-xs text-muted-foreground flex items-center justify-between gap-2",children:[c.jsxs("span",{children:[O," Würfel",z>0&&` · Stapel ${z}`]}),c.jsx("button",{type:"button",onClick:q,className:"text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted transition",children:"Zurücksetzen"})]})]}),c.jsxs($b,{value:d,onValueChange:Ne=>h(Ne),className:"flex-1 flex flex-col",children:[c.jsxs(dx,{className:"w-full justify-start overflow-x-auto rounded-none border-b border-border bg-card h-12 px-2 gap-1",children:[c.jsx(Xl,{value:"grundflaeche",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:"Grundfläche"}),c.jsx(Xl,{value:"farben",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:"Farben & Blöcke"}),c.jsxs(Xl,{value:"uebersicht",className:"h-10 px-4 text-sm data-[state=active]:bg-muted",children:["Ãbersicht",Z.positionen.length>0&&c.jsx("span",{className:"ml-1.5 text-[10px] bg-primary text-primary-foreground rounded-full px-1.5 py-0.5",children:Z.positionen.length})]})]}),c.jsx(vu,{value:"grundflaeche",className:"p-4 m-0",children:ye}),c.jsx(vu,{value:"farben",className:"p-4 m-0",children:Se}),c.jsx(vu,{value:"uebersicht",className:"p-0 m-0",children:c.jsx(IK,{lieferumfang:Z,loading:f,onAnfrage:Ee,variant:"mobile",extraActions:c.jsx(Bf,{konfigurator:"easycubes",getKonfiguration:()=>t,size:"sm",className:"w-full mt-2"})})})]})]}),c.jsxs("div",{className:"lg:hidden fixed bottom-0 left-0 right-0 z-40 bg-card border-t border-border px-4 py-3 flex items-center gap-3",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 0.75rem)"},children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Gesamtpreis"}),c.jsx("div",{className:"text-base font-semibold text-foreground truncate",children:lWe.format(Z.gesamtpreis)})]}),c.jsx("button",{type:"button",onClick:Ee,disabled:Z.positionen.length===0,className:"h-11 px-4 roun
4946ded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90 transition",children:"Angebot anfordern"})]}),c.jsx(Px,{open:le,onOpenChange:xe,konfiguratorName:"EasyCubes Würfelsystem",tabelle:"easycubes_anfragen",konfiguratorTyp:"easycubes",konfigurationSnapshot:()=>t,buildInsertPayload:()=>({konfiguration:B,lieferumfang:Z,gesamtpreis:Z.gesamtpreis}),buildPdfInput:(Ne,ue)=>({konfiguratorName:"EasyCubes Würfelsystem",anfrageId:ue,identifier:mC,konfiguration:[{label:"Hersteller",value:mC},{label:"Anzahl Felder",value:String(Z.anzahlFelder)},{label:"Anzahl Würfel",value:String(Z.anzahlCubesGesamt)},{label:"Höhe",value:`${I} cm`}],positionen:Z.positionen.map(Ce=>({sku:Ce.sku,artikelname:Ce.name,menge:Ce.anzahl,einzelpreis:Ce.einzelpreis,gesamtpreis:Ce.gesamtpreis})),gesamtNetto:Z.gesamtpreis,mwstSatz:.19})}),c.jsx(vx,{open:!!n,onOpenChange:Ne=>!Ne&&r(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:'Auf âAlle gleich" wechseln?'}),c.jsx(Vm,{children:"Alle Blöcke werden zusammengeführt. Sämtliche Würfel übernehmen die Farben von Block 1 (Boden, Würfel-Farbe, Cover). Die übrigen Blockeinstellungen gehen verloren. Möchten Sie fortfahren?"})]}),c.jsxs(Hm,{className:"flex-col-reverse sm:flex-row gap-2",children:[c.jsx($m,{className:"h-11 sm:h-10 mt-0",children:"Abbrechen"}),c.jsx(Wm,{onClick:se,className:"h-11 sm:h-10",children:"Fortfahren"})]})]})}),c.jsx(qf,{open:!!i,onOpenChange:Ne=>{Ne||s(null)},children:c.jsxs(jh,{children:[c.jsxs(Xf,{children:[c.jsxs(Yf,{children:["Block ",K," bearbeiten?"]}),c.jsx(D1,{children:pe?`Möchten Sie Block ${K} bearbeiten oder einen neuen Block anlegen? Hinweis: Block ${pe} wird in beiden Fällen zuvor abgeschlossen.`:`Möchten Sie Block ${K} zur Bearbeitung öffnen oder lieber einen neuen Block anlegen?`})]}),c.jsxs(X5,{className:"gap-2 flex-col-reverse sm:flex-row",children:[c.jsx("button",{type:"button",onClick:()=>s(null),className:"h-11 sm:h-10 text-sm px-4 rounded border border-border hover:bg-muted transition",children:"Abbrechen"}),c.jsx("button",{type:"button",onClick:we,className:"h-11 sm:h-10 text-sm px-4 rounded border border-border hover:bg-muted transition",children:"Neuen Block hinzufügen"}),c.jsx("button",{type:"button",onClick:Q,className:"h-11 sm:h-10 text-sm px-4 rounded bg-primary text-primary-foreground hover:bg-primary/90 transition",children:"Bearbeiten"})]})]})})]})}function uWe(){return c.jsx(Ed,{slug:"easycubes",children:c.jsx(cWe,{})})}function dWe(){return c.jsx(Q1,{title:"Produktdaten â EasyCubes (Kunststoff)",description:"Würfelsystem aus Kunststoff, 40 à 40 cm Raster, 20 cm Stapelschritt.",tableName:"easycubes_produkte",exportPrefix:"easycubes-produkte",channableLabel:"EasyCubes",channableRpc:"enrich_easycubes_produkte_from_produkte"})}const D6="wuerfel-images",hWe="https://ntxxmvyoiatxvggtjtfg.supabase.co",Ece="easycubes_produkte",fWe="easycubes";function pWe(t){return t.toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/Ã/g,"ss").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function kce(t,e){return`${fWe}/${t}/${pWe(e)}.webp`}function mWe(t){return`${hWe}/storage/v1/object/public/${D6}/${t}`}async function gWe(t,e,n){const r=await sA(n),i=kce(t,e),{error:s}=await Ot.storage.from(D6).upload(i,r,{contentType:"image/webp",upsert:!0});if(s)throw s;const a=mWe(i),o=`${t}|${e}`,{data:l,error:u}=await Ot.from(Ece).update({bild_url:a}).eq("schluessel",o).select("id");if(u)throw u;if(!l||l.length===0)throw new Error(`Kein Produkt mit schluessel="${o}" gefunden.`);return nA(),{url:`${a}?t=${Date.now()}`}}async function xWe(t,e){const n=kce(t,e),{error:r}=await Ot.storage.from(D6).remove([n]);if(r)throw r;const i=`${t}|${e}`,{data:s,error:a}=await Ot.from(Ece).update({bild_url:null}).eq("schluessel",i).select("id");if(a)throw a;if(!s||s.length===0)throw new Error(`Kein Produkt mit schluessel="${i}" gefunden.`);nA()}function vWe(){const{produkte:t,loading:e}=Ace(),[n,r]=E.useState(Date.now()),[i,s]=E.useState(0),a=E.useMemo(()=>t.filter(d=>d.bestandteil==="Cover"),[t]),o=E.useMemo(()=>t.filter(d=>d.bestandteil==="Boden"),[t]),l=E.useMemo(()=>t.filter(d=>d.bestandteil==="Cube"),[t]),u=E.useCallback(()=>{r(Date.now()),s(d=>d+1)},[]);return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:xc,title:"Bilder â EasyCubes Würfel",description:"Bilder für Boden, Würfel-Farbe und Cover. Erscheinen in der Auswahlleiste sowie im Lieferumfang."}),e?c.jsx("div",{className:"text-sm text-muted-foreground",children:"Lade Produkteâ¦"}):t.length===0?c.jsx("div",{className:"border border-dashed border-border rounded-lg p-12 text-center text-sm text-muted-foreground",children:'Noch keine Produkte importiert. Bitte zuerst unter âProduktdaten" CSV hochladen.'}):c.jsxs(c.Fragment,{children:[c.jsx(WP,{titel:"Boden",beschreibung:"Bild für die Boden-Variante. Wird ausschlieÃlich in der Auswahlleiste eingeblendet â die 3D-Ansicht bleibt unverändert.",produkte:o,bestandteil:"Boden",ver
4946sion:n,onChange:u}),c.jsx(WP,{titel:"Würfel-Farbe",beschreibung:"Bild für die Würfel-Variante. Wird ausschlieÃlich in der Auswahlleiste eingeblendet â die 3D-Ansicht bleibt unverändert.",produkte:l,bestandteil:"Cube",version:n,onChange:u}),c.jsx(WP,{titel:"Cover",beschreibung:"Cover-Motive für die Auswahlleiste und die 3D-Ansicht (Oberseite des Würfels).",produkte:a,bestandteil:"Cover",version:n,onChange:u})]})]},i)}function WP({titel:t,beschreibung:e,produkte:n,bestandteil:r,version:i,onChange:s}){return c.jsxs("section",{className:"space-y-2",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-semibold text-foreground",children:t}),c.jsx("p",{className:"text-xs text-muted-foreground",children:e})]}),n.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border rounded p-4",children:"Keine passenden Varianten gefunden."}):c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:n.map(a=>c.jsx(yWe,{produkt:a,bestandteil:r,version:i,onChange:s},a.variable))})]})}function yWe({produkt:t,bestandteil:e,version:n,onChange:r}){const i=E.useRef(null),[s,a]=E.useState(!1),o=t.bild_url?`${t.bild_url}${t.bild_url.includes("?")?"&":"?"}t=${n}`:null;async function l(d){a(!0);try{await gWe(e,t.variable,d),dn({title:"Bild hochgeladen",description:t.variable}),r()}catch(h){dn({title:"Upload fehlgeschlagen",description:(h==null?void 0:h.message)??"Unbekannter Fehler",variant:"destructive"})}finally{a(!1)}}async function u(){if(confirm(`Bild für â${t.variable}" entfernen?`)){a(!0);try{await xWe(e,t.variable),dn({title:"Bild entfernt",description:t.variable}),r()}catch(d){dn({title:"Löschen fehlgeschlagen",description:(d==null?void 0:d.message)??"Unbekannter Fehler",variant:"destructive"})}finally{a(!1)}}}return c.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card flex flex-col",onDragOver:d=>d.preventDefault(),onDrop:d=>{var p;d.preventDefault();const h=(p=d.dataTransfer.files)==null?void 0:p[0];h&&l(h)},children:[c.jsxs("button",{type:"button",onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"aspect-square bg-muted/40 flex items-center justify-center relative group",title:"Klicken oder Datei hierhin ziehen, um Bild zu setzen",children:[o?c.jsx("img",{src:o,alt:t.variable,className:"w-full h-full object-cover"}):c.jsxs("div",{className:"text-center text-xs text-muted-foreground p-2",children:[c.jsx(pu,{className:"h-5 w-5 mx-auto mb-1 opacity-60"}),"Bild hochladen"]}),s&&c.jsx("div",{className:"absolute inset-0 bg-background/70 flex items-center justify-center text-xs",children:"â¦"})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:d=>{var p;const h=(p=d.target.files)==null?void 0:p[0];h&&l(h),d.target.value=""}}),c.jsxs("div",{className:"px-2 py-1.5 flex items-center justify-between gap-1 border-t border-border",children:[c.jsx("span",{className:"text-xs font-medium text-foreground truncate",title:t.variable,children:t.variable}),o&&c.jsx(Pt,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-destructive",onClick:u,disabled:s,title:"Bild entfernen",children:c.jsx(yo,{className:"h-3.5 w-3.5"})})]})]})}const gC={desktop:{label:"Desktop",width:1280,icon:g5},tablet:{label:"Tablet",width:820,icon:b5},mobile:{label:"Mobil",width:390,icon:y5}};function bWe(){const[t,e]=E.useState("desktop"),[n,r]=E.useState(0),i=`${window.location.origin}/easycubes`,s=gC[t].width;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Vorschau",description:"Live-Vorschau des Würfel-Konfigurators (StandOnFloor & EasyCubes).",actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center gap-1 border rounded-md p-1 bg-card",children:Object.keys(gC).map(a=>{const o=gC[a].icon,l=t===a;return c.jsxs(Pt,{variant:l?"default":"ghost",size:"sm",onClick:()=>e(a),className:"gap-1.5",children:[c.jsx(o,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:gC[a].label})]},a)})}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:()=>r(a=>a+1),className:"gap-1.5",children:[c.jsx(b1,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Reset"})]}),c.jsx(Pt,{variant:"outline",size:"sm",asChild:!0,className:"gap-1.5",children:c.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:[c.jsx(_d,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Neuer Tab"})]})})]})}),c.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted/30 flex justify-center p-4",children:c.jsx("div",{className:"bg-card shadow-lg transition-all duration-300 rounded-md overflow-hidden w-full",style:{maxWidth:s},children:c.jsx("iframe",{src:"/easycubes?embed=true",className:"w-full border-0 block",style:{height:"80vh",minHeight:600},title:"Würfel-Konfigurator-Vorschau"},n)})})]})}function wWe(){return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"Kopieren Sie den Code, um den EasyCubes-Konfigurator auf einer beliebigen Webseite einzubinden."}),c.jsx(Km,{configuratorPath:"/easycubes",iframeTitle:"EasyCubes-Konfigurator"})]})}const DK=t=>{let e;const n=new Set,r=(u,d)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const p=e;e=d??(typeof h!="object"||h===null)?h:Object.assign({}
4946,e,h),n.forEach(f=>f(e,p))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=e=t(r,i,o);return o},_We=t=>t?DK(t):DK,SWe=t=>t;function AWe(t,e=SWe){const n=Bt.useSyncExternalStore(t.subscribe,Bt.useCallback(()=>e(t.getState()),[t,e]),Bt.useCallback(()=>e(t.getInitialState()),[t,e]));return Bt.useDebugValue(n),n}const BK=t=>{const e=_We(t),n=r=>AWe(e,r);return Object.assign(n,e),n},EWe=t=>t?BK(t):BK;let kWe=0;const CWe=()=>`p_${Date.now().toString(36)}_${(kWe++).toString(36)}`,zs=EWe(t=>({standflaeche:{laenge:6,breite:4},platzierungen:[],selectedId:null,setStandflaeche:e=>t({standflaeche:e}),add:e=>{const n=CWe();return t(r=>({platzierungen:[...r.platzierungen,{...e,id:n}],selectedId:n})),n},update:(e,n)=>t(r=>({platzierungen:r.platzierungen.map(i=>i.id===e?{...i,...n}:i)})),remove:e=>t(n=>({platzierungen:n.platzierungen.filter(r=>r.id!==e),selectedId:n.selectedId===e?null:n.selectedId})),select:e=>t({selectedId:e}),rotate90:e=>t(n=>({platzierungen:n.platzierungen.map(r=>r.id===e?{...r,rotationY:r.rotationY+Math.PI/2}:r)})),clear:()=>t({platzierungen:[],selectedId:null})})),FK=[2,2.3,2.48,2.98],NWe=.12;function TWe(){const t=[.88,1,1.4];for(let e=1;e<10;e++)t.push(e+.5),t.push(e+.75),t.push(e+.85),t.push(e+1);return t}const MWe=TWe(),OK=(()=>{const t=[];for(let e=1;e<=20;e+=.5)t.push(Number(e.toFixed(1)));return t})(),YT=.1;function RWe({size:t}){const{laenge:e,breite:n}=t,r=zs(l=>l.update),i=zs(l=>l.select);zs(l=>l.selectedId),zs(l=>l.platzierungen);const s=E.useRef(null);E.useState(!1);const a=l=>Math.round(l/YT)*YT,o={x:e/2,z:n/2};return c.jsxs(c.Fragment,{children:[c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],receiveShadow:!0,position:[0,0,0],children:[c.jsx("planeGeometry",{args:[e,n]}),c.jsx("meshStandardMaterial",{color:"#EAEAEA",roughness:.95})]}),c.jsx("gridHelper",{args:[Math.max(e,n),Math.max(e,n)*2,"#B5B5B5","#D5D5D5"],position:[0,.001,0]}),c.jsxs("lineSegments",{position:[0,.002,0],children:[c.jsx("edgesGeometry",{args:[new Nd(e,.001,n)]}),c.jsx("lineBasicMaterial",{color:"#78AD48"})]}),c.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.005,0],onPointerMove:l=>{if(!s.current)return;l.stopPropagation();const u=s.current,d=KT.clamp(a(l.point.x),-o.x,o.x),h=KT.clamp(a(l.point.z),-o.z,o.z);r(u,{x:d,z:h})},onPointerUp:()=>{s.current=null},onPointerDown:l=>{l.button===0&&!s.current&&i(null)},children:[c.jsx("planeGeometry",{args:[e+4,n+4]}),c.jsx("meshBasicMaterial",{visible:!1})]}),c.jsx(jWe,{onStart:l=>{s.current=l}})]})}function jWe({onStart:t}){return bs(),typeof window<"u"&&(window.__messestand_startDrag=t),null}const zK=.03;function PWe({breite:t,hoehe:e,position:n,rotationY:r,selected:i,onPointerDown:s}){const a=NWe,o=E.useMemo(()=>new Lc({color:"#F4F4F2",roughness:.85,metalness:.05}),[]),l=E.useMemo(()=>new Lc({color:"#B8BCC2",roughness:.35,metalness:.7}),[]);return c.jsxs("group",{position:[n[0],e/2,n[2]],rotation:[0,r,0],onPointerDown:s,children:[c.jsx("mesh",{material:o,castShadow:!0,receiveShadow:!0,children:c.jsx("boxGeometry",{args:[t,e,a]})}),[-t/2,0,t/2].map((u,d)=>c.jsx("mesh",{material:l,position:[u,0,0],children:c.jsx("boxGeometry",{args:[zK,e+.001,a+.005]})},`v${d}`)),[e/2,-e/2].map((u,d)=>c.jsx("mesh",{material:l,position:[0,u,0],children:c.jsx("boxGeometry",{args:[t+.001,zK,a+.005]})},`h${d}`)),i&&c.jsxs("lineSegments",{children:[c.jsx("edgesGeometry",{args:[new Nd(t+.02,e+.02,a+.02)]}),c.jsx("lineBasicMaterial",{color:"#78AD48",linewidth:2})]})]})}function LWe({url:t,modell:e,selected:n}){const r=t3(t),i=E.useMemo(()=>r.scene.clone(!0),[r]),s=E.useMemo(()=>{const o=new ma().setFromObject(i),l=new Ie;o.getSize(l);let u=1;return e.default_breite&&l.x>0?u=e.default_breite/l.x:e.default_hoehe&&l.y>0?u=e.default_hoehe/l.y:e.default_tiefe&&l.z>0&&(u=e.default_tiefe/l.z),u},[i,e]),a=E.useMemo(()=>{const o=new ma().setFromObject(i),l=new Ie;return o.getCenter(l),{y:-o.min.y*s,x:-l.x*s,z:-l.z*s}},[i,s]);return c.jsxs("group",{scale:s,children:[c.jsx("primitive",{object:i,position:[a.x/s,a.y/s,a.z/s]}),n&&c.jsxs("lineSegments",{scale:1/s,children:[c.jsx("edgesGeometry",{args:[new Nd(Math.max(.5,(e.default_breite??1)+.05),Math.max(.5,(e.default_hoehe??1)+.05),Math.max(.3,(e.default_tiefe??.5)+.05))]}),c.jsx("lineBasicMaterial",{color:"#78AD48"})]})]})}function IWe({modell:t,position:e,rotationY:n,selected:r,onPointerDown:i}){return c.jsx("group",{position:e,rotation:[0,n,0],onPointerDown:i,children:c.jsx(E.Suspense,{fallback:null,children:c.jsx(LWe,{url:t.glb_url,modell:t,selected:r})})})}function DWe({modelle:t,onCanvasDrop:e}){const n=E.useRef(null),r=E.useRef(null),i=E.useRef(null),s=zs(f=>f.standflaeche),a=zs(f=>f.platzierungen),o=zs(f=>f.selectedId),l=zs(f=>f.select),u=zs(f=>f.remove),d=zs(f=>f.rotate90),[h,p]=E.useState("iso");return E.useEffect(()=>{const f=m=>{o&&(m.key==="Delete"||m.key==="Backspace"?u(o):m.key.toLowerCase()==="r"&&d(o))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[o,u,d]),E.useEffect(()=>{if(!i.current||!r.current)return;
4946const f=Math.max(s.laenge,s.breite)*1.3+4;h==="top"?i.current.position.set(0,f*1.2,.001):i.current.position.set(f*.7,f*.6,f*.7),r.current.target.set(0,0,0),r.current.update()},[h,s.laenge,s.breite]),c.jsxs("div",{ref:n,className:"relative w-full h-full bg-gradient-to-b from-[#FAFAFA] to-[#ECECEC]",onDragOver:f=>{f.preventDefault(),f.dataTransfer.dropEffect="copy"},onDrop:f=>{f.preventDefault();const m=f.dataTransfer.getData("application/x-messestand");m&&e(f.clientX,f.clientY,m)},children:[c.jsxs(A6,{shadows:!0,dpr:[1,2],children:[c.jsx(zGe,{ref:i,makeDefault:!0,fov:45,position:[8,6,8],near:.1,far:200}),c.jsx("ambientLight",{intensity:.55}),c.jsx("directionalLight",{castShadow:!0,position:[6,10,4],intensity:1.1,"shadow-mapSize-width":2048,"shadow-mapSize-height":2048,"shadow-camera-left":-15,"shadow-camera-right":15,"shadow-camera-top":15,"shadow-camera-bottom":-15}),c.jsx("hemisphereLight",{args:["#ffffff","#cccccc",.4]}),c.jsx(RWe,{size:s}),a.map(f=>{if(f.typ==="wall")return c.jsx(PWe,{breite:f.breite??1,hoehe:f.hoehe??2,position:[f.x,0,f.z],rotationY:f.rotationY,selected:o===f.id,onPointerDown:x=>{x.stopPropagation(),l(f.id),window.__messestand_startDrag&&window.__messestand_startDrag(f.id)}},f.id);const m=t.find(x=>x.id===f.refId);return m?c.jsx(IWe,{modell:m,position:[f.x,0,f.z],rotationY:f.rotationY,selected:o===f.id,onPointerDown:x=>{x.stopPropagation(),l(f.id),window.__messestand_startDrag&&window.__messestand_startDrag(f.id)}},f.id):null}),c.jsx(N6,{ref:r,makeDefault:!0,enableDamping:!0,maxPolarAngle:Math.PI/2-.05,minDistance:2,maxDistance:80})]}),c.jsxs("div",{className:"absolute top-3 right-3 flex flex-col gap-2",children:[c.jsxs(Pt,{size:"sm",variant:h==="iso"?"default":"outline",onClick:()=>p("iso"),className:"gap-2",children:[c.jsx($fe,{className:"w-4 h-4"})," Iso"]}),c.jsxs(Pt,{size:"sm",variant:h==="top"?"default":"outline",onClick:()=>p("top"),className:"gap-2",children:[c.jsx(xJ,{className:"w-4 h-4"})," Top"]})]}),o&&c.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex gap-2 bg-white/95 backdrop-blur border border-border rounded-lg shadow-md px-3 py-2",children:[c.jsxs(Pt,{size:"sm",variant:"outline",onClick:()=>d(o),className:"gap-2",children:[c.jsx(cpe,{className:"w-4 h-4"})," 90° drehen"]}),c.jsxs(Pt,{size:"sm",variant:"destructive",onClick:()=>u(o),className:"gap-2",children:[c.jsx(yo,{className:"w-4 h-4"})," Entfernen"]})]}),c.jsx("div",{className:"absolute bottom-3 right-3 text-xs text-muted-foreground bg-white/80 px-2 py-1 rounded",children:"Drag aus Palette · R = Drehen · Entf = Löschen"})]})}const UK=t=>t.toFixed(2).replace(".",",")+" m";function HK({modelle:t}){const[e,n]=E.useState(FK[0]),r=(i,s)=>{i.dataTransfer.setData("application/x-messestand",JSON.stringify(s)),i.dataTransfer.effectAllowed="copy"};return c.jsxs("div",{className:"flex flex-col gap-5 p-4 overflow-y-auto h-full",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-2 flex items-center gap-2",children:[c.jsx(dJ,{className:"w-4 h-4"})," Messewände"]}),c.jsx("div",{className:"grid grid-cols-4 gap-1 mb-3",children:FK.map(i=>c.jsx("button",{onClick:()=>n(i),className:`text-xs px-2 py-1.5 rounded border transition-colors ${e===i?"bg-primary text-primary-foreground border-primary":"bg-card border-border hover:border-primary/50"}`,children:UK(i)},i))}),c.jsx("p",{className:"text-[11px] text-muted-foreground mb-2",children:"Höhe wählen, dann Breite ziehen â Standfläche"}),c.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:MWe.map(i=>c.jsxs("div",{draggable:!0,onDragStart:s=>r(s,{kind:"wall",hoehe:e,breite:i}),className:"cursor-grab active:cursor-grabbing rounded border border-border bg-card hover:border-primary hover:bg-primary/5 px-2 py-2 text-xs flex items-center justify-between transition-colors",children:[c.jsx("span",{className:"font-medium",children:UK(i)}),c.jsx("span",{className:"text-muted-foreground text-[10px]",children:"B"})]},i))})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-2 flex items-center gap-2",children:[c.jsx(Mf,{className:"w-4 h-4"})," Eigene Modelle"]}),t.length===0?c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Noch keine Modelle hochgeladen."}):c.jsx("div",{className:"space-y-1.5",children:t.map(i=>c.jsxs("div",{draggable:!0,onDragStart:s=>r(s,{kind:"model",id:i.id}),className:"cursor-grab active:cursor-grabbing rounded border border-border bg-card hover:border-primary hover:bg-primary/5 px-2 py-2 flex items-center gap-2 transition-colors",children:[i.thumbnail_url?c.jsx("img",{src:i.thumbnail_url,alt:"",className:"w-10 h-10 object-cover rounded"}):c.jsx("div",{className:"w-10 h-10 rounded bg-muted flex items-center justify-center",children:c.jsx(Mf,{className:"w-5 h-5 text-muted-foreground"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-xs font-medium truncate",children:i.name}),i.beschreibung&&c.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:i.beschreibung})]})]},i.id))})]})]})}function BWe(){const t=zs(r=>r.standflaeche),e=zs(r=>r.setStandflaeche),n=r=>r.toFixed(1).replace(".",",")+" m";return c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-card border border-border rounded-lg",children:[c.jsx("span",{className:"text-sm font-medium text-foreground",children:"Standfläche:"}),c.jsxs("label",{className:"flex items-center gap-1.5 text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"L"}),c.jsx("select",{value:t.laenge,onChange:r=>e({...t,laenge:Number(r.target.value)}),className:"border border-border rounded px-2 py-1 bg-background text-sm",children:OK.map(r=>c.jsx("option",{value:r,children:n(r)},r))})]}),c.jsx("span",{className:"text-muted-foreground",children:"Ã"}),c.jsxs("label",{className:"flex items-center gap-1.5 text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"B"}),c.jsx("select",{value:t.breite,onChange:r=>e({...t,breite:Number(r.target.value)}),className:"border border-border rounded px-2 py-1 bg-background text-sm",children:OK.map(r=>c.jsx("option",{value:r,children:n(r)},r))})]}),c.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["= ",(t.laenge*t.breite).toFixed(1).replace(".",",")," m²"]})]})}const xC=t=>t.toFixed(2).replace(".",",")+" m";function GK({modelle:t,onAnfrage:e}){const n=zs(u=>u.platzierungen),r=zs(u=>u.standflaeche),i=zs(u=>u.remove),s=zs(u=>u.select),a=zs(u=>u.selectedId),o=new Map,l=new Map;for(const u of n)if(u.typ==="wall"&&u.breite&&u.hoehe){const d=`${u.hoehe}|${u.breite}`,h=o.get(d);h?h.count++:o.set(d,{breite:u.breite,hoehe:u.hoehe,count:1})}else if(u.typ==="model"){const d=t.find(p=>p.id===u.refId);if(!d)continue;const h=l.get(u.refId);h?h.count++:l.set(u.refId,{name:d.name,count:1})}return c.jsxs("div",{className:"flex flex-col h-full p-4 overflow-y-auto",children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-3",children:"Stückliste"}),n.length===0?c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Noch keine Objekte platziert. Ziehen Sie Wände aus der Palette auf die Standfläche."}):c.jsxs("div",{className:"space-y-4 flex-1",children:[o.size>
49460&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-foreground mb-1.5",children:"Messewände"}),c.jsx("ul",{className:"space-y-1",children:Array.from(o.values()).sort((u,d)=>d.hoehe-u.hoehe||d.breite-u.breite).map(u=>c.jsxs("li",{className:"flex items-center justify-between text-sm border-b border-border/60 pb-1",children:[c.jsxs("span",{children:["H ",xC(u.hoehe)," à B ",xC(u.breite)]}),c.jsxs("span",{className:"font-semibold tabular-nums",children:[u.count,"Ã"]})]},`${u.hoehe}|${u.breite}`))})]}),l.size>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-foreground mb-1.5",children:"Eigene Modelle"}),c.jsx("ul",{className:"space-y-1",children:Array.from(l.values()).map(u=>c.jsxs("li",{className:"flex items-center justify-between text-sm border-b border-border/60 pb-1",children:[c.jsx("span",{className:"truncate",children:u.name}),c.jsxs("span",{className:"font-semibold tabular-nums",children:[u.count,"Ã"]})]},u.name))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-foreground mb-1.5",children:"Alle Platzierungen"}),c.jsx("ul",{className:"space-y-1",children:n.map(u=>{var p;const d=u.typ==="wall"?`Wand H ${xC(u.hoehe??0)} à B ${xC(u.breite??0)}`:((p=t.find(f=>f.id===u.refId))==null?void 0:p.name)??"Modell",h=a===u.id;return c.jsxs("li",{onClick:()=>s(u.id),className:`flex items-center justify-between text-xs px-2 py-1.5 rounded cursor-pointer ${h?"bg-primary/10 text-primary":"hover:bg-muted"}`,children:[c.jsx("span",{className:"truncate",children:d}),c.jsx("button",{onClick:f=>{f.stopPropagation(),i(u.id)},className:"text-muted-foreground hover:text-destructive",children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]},u.id)})})]})]}),c.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[c.jsx(JO,{}),c.jsx(Pt,{onClick:e,disabled:n.length===0,className:"w-full",children:"Angebot anfordern"}),c.jsx(Bf,{konfigurator:"messestand",getKonfiguration:()=>({standflaeche:r,platzierungen:n}),disabled:n.length===0,className:"w-full"})]})]})}const VK="Messestand";function FWe({open:t,onClose:e,modelle:n}){const r=zs(o=>o.standflaeche),i=zs(o=>o.platzierungen),s=new Map,a=new Map;for(const o of i)if(o.typ==="wall"&&o.breite&&o.hoehe){const l=`${o.hoehe}|${o.breite}`,u=s.get(l);u?u.count++:s.set(l,{breite:o.breite,hoehe:o.hoehe,count:1})}else if(o.typ==="model"){const l=n.find(d=>d.id===o.refId);if(!l)continue;const u=a.get(o.refId);u?u.count++:a.set(o.refId,{name:l.name,count:1})}return c.jsx(Px,{open:t,onOpenChange:o=>{o||e()},konfiguratorName:VK,tabelle:"messestand_anfragen",konfiguratorTyp:"messestand",konfigurationSnapshot:()=>({standflaeche:r,platzierungen:i}),buildInsertPayload:()=>({konfiguration:{standflaeche:r,platzierungen:i},lieferumfang:{items:i,modelle:n.map(o=>({id:o.id,name:o.name}))}}),buildPdfInput:(o,l)=>({konfiguratorName:VK,anfrageId:l,identifier:r?`${r.breite}Ã${r.laenge} m`:void 0,konfiguration:[{label:"Standfläche",value:r?`${r.breite} à ${r.laenge} m`:"â"},{label:"Anzahl Platzierungen",value:String(i.length)},{label:"Messewände",value:String(Array.from(s.values()).reduce((u,d)=>u+d.count,0))},{label:"Eigene Modelle",value:String(Array.from(a.values()).reduce((u,d)=>u+d.count,0))}],positionen:[...Array.from(s.values()).map((u,d)=>({sku:`WAND-${u.hoehe}x${u.breite}`,artikelname:`Messewand H ${u.hoehe.toFixed(2)} m à B ${u.breite.toFixed(2)} m`,menge:u.count,einzelpreis:0,gesamtpreis:0})),...Array.from(a.values()).map(u=>({sku:"MODELL",artikelname:u.name,menge:u.count,einzelpreis:0,gesamtpreis:0}))],gesamtNetto:0,mwstSatz:0})})}async function OWe(){const{data:t,error:e}=await Ot.from("messestand_modelle").select("*").order("created_at",{ascending:!1});return e?(console.error("loadModelle",e),[]):t??[]}function zWe(){const[t]=Al(),e=t.get("embed")==="true",[n,r]=E.useState([]),[i,s]=E.useState(!1),a=zs(d=>d.add);zs(d=>d.standflaeche);const o=d=>{d!=null&&d.standflaeche&&Array.isArray(d.platzierungen)&&zs.setState({standflaeche:d.standflaeche,platzierungen:d.platzierungen,selectedId:null})};Ix({expectedKonfigurator:"messestand",applyKonfiguration:o}),E.useEffect(()=>{OWe().then(r)},[]);const l=(d,h,p)=>{try{const f=JSON.parse(p),m=x=>Math.round(x/YT)*YT;f.kind==="wall"?a({typ:"wall",refId:`${f.hoehe}_${f.breite}`,breite:f.breite,hoehe:f.hoehe,x:0,z:0,rotationY:0}):f.kind==="model"&&a({typ:"model",refId:f.id,x:0,z:0,rotationY:0})}catch(f){console.error("drop parse",f)}},u=!!t.get("code");return c.jsxs("div",{className:"min-h-screen flex flex-col bg-secondary/40",children:[c.jsx(B1,{konfigurator:"messestand",disabled:u,onGeladen:d=>o(d)}),!e&&c.jsx("header",{className:"border-b border-border bg-background",children:c.jsxs("div",{className:"container mx-auto px-4 py-3 flex items-center gap-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-9 w-auto"}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold leading-tight tracking-tight",children:"Messestand-Konfigurator"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Standfläche definieren · Wände platzieren · Anfrage senden"})]})]})}),c.jsx("div",{className:"px-4 py-3 border-b border-border bg-background",children:c.jsx("div",{className:"container mx-auto",children:c.jsx(BWe,{})})}),c.jsxs("main",{className:"flex-1 grid grid-cols-1 lg:grid-cols-[260px_1fr_300px] min-h-[70vh]",children:[c.jsx("aside",{className:"border-r border-border bg-card hidden lg:block",children:c.jsx(HK,{modelle:n})}),c.jsx("section",{className:"relative min-h-[60vh]",children:c.jsx(DWe,{modelle:n,onCanvasDrop:l})}),c.jsx("aside",{className:"border-l border-border bg-card hidden lg:block",children:c.jsx(GK,{modelle:n,onAnfrage:()=>s(!0)})})]}),c.jsxs("div",{className:"lg:hidden grid grid-cols-1 gap-3 p-3",children:[c.jsx("div",{className:"rounded-lg border border-border bg-card max-h-80 overflow-hidden",children:c.jsx(HK,{modelle:n})}),c.jsx("div",{className:"rounded-lg border border-border bg-card max-h-80 overflow-hidden",children:c.jsx(GK,{modelle:n,onAnfrage:()=>s(!0)})})]}),c.jsx(FWe,{open:i,onClose:()=>s(!1),modelle:n}),!e&&c.jsx(Kf,{isEmbed:!1})]})}function UWe(){return c.jsx(Ed,{slug:"messestand",children:c.jsx(zWe,{})})}function HWe(){const[t,e]=E.useState([]),[n,r]=E.useState(""),[i,s]=E.useState(""),[a,o]=E.useState(""),[l,u]=E.useState(""),[d,h]=E.useState(""),[p,f]=E.useState(null),[m,x]=E.useState(null),[v,g]=E.useState(!1),b=E.useRef(null),y=E.useRef(null),S=async()=>{const{data:T}=await Ot.from("messestand_modelle").select("*").order("created_at",{ascending:!1});e(T??[])};E.useEffect(()=>{S()},[]);const A=async(T,C)=>{const R=T.name.split(".").pop(),P=`${C}/${Date.now()}_${Math.random().toString(36).slice(2)}.${R}`,{error:j}=await Ot.storage.from("messestand-models").upload(P,T,{cacheControl:"3600",upsert:!1});if(j)throw j;const{data:G}=Ot.storage.from("messestand-models").getPublicUrl(P);return G.publicUrl},k=async()=>
4946{if(!n||!p){dn({title:"Name und GLB-Datei sind Pflicht",variant:"destructive"});return}if(!/\.(glb|gltf)$/i.test(p.name)){dn({title:"Nur .glb / .gltf erlaubt",variant:"destructive"});return}if(p.size>25*1024*1024){dn({title:"Datei zu groà (max. 25 MB)",variant:"destructive"});return}g(!0);try{const T=await A(p,"glb"),C=m?await A(m,"thumb"):null,{error:R}=await Ot.from("messestand_modelle").insert({name:n,beschreibung:i||null,glb_url:T,thumbnail_url:C,default_breite:a?Number(a.replace(",",".")):null,default_hoehe:l?Number(l.replace(",",".")):null,default_tiefe:d?Number(d.replace(",",".")):null});if(R)throw R;dn({title:"Modell hochgeladen"}),r(""),s(""),o(""),u(""),h(""),f(null),x(null),b.current&&(b.current.value=""),y.current&&(y.current.value=""),S()}catch(T){dn({title:"Fehler",description:T.message,variant:"destructive"})}finally{g(!1)}},M=async T=>{if(!confirm("Modell wirklich löschen?"))return;const{error:C}=await Ot.from("messestand_modelle").delete().eq("id",T);if(C){dn({title:"Fehler",description:C.message,variant:"destructive"});return}S()};return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:Mf,title:"3D-Modelle",description:"GLB-Dateien hochladen, die Kunden per Drag & Drop in den Messestand ziehen können"}),c.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card space-y-4",children:[c.jsx("h3",{className:"font-semibold text-sm",children:"Neues Modell hochladen"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"Name *"}),c.jsx(yr,{value:n,onChange:T=>r(T.target.value),placeholder:"z. B. Theke Curve"})]}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"Beschreibung"}),c.jsx(yr,{value:i,onChange:T=>s(T.target.value)})]}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"Standard-Breite (m)"}),c.jsx(yr,{value:a,onChange:T=>o(T.target.value),placeholder:"1,20"})]}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"Standard-Höhe (m)"}),c.jsx(yr,{value:l,onChange:T=>u(T.target.value),placeholder:"2,00"})]}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"Standard-Tiefe (m)"}),c.jsx(yr,{value:d,onChange:T=>h(T.target.value),placeholder:"0,60"})]}),c.jsxs("div",{children:[c.jsx(Vn,{className:"text-xs",children:"GLB-Datei *"}),c.jsx(yr,{ref:b,type:"file",accept:".glb,.gltf",onChange:T=>{var C;return f(((C=T.target.files)==null?void 0:C[0])??null)}})]}),c.jsxs("div",{className:"md:col-span-2",children:[c.jsx(Vn,{className:"text-xs",children:"Thumbnail (PNG/JPG, optional)"}),c.jsx(yr,{ref:y,type:"file",accept:"image/*",onChange:T=>{var C;return x(((C=T.target.files)==null?void 0:C[0])??null)}})]})]}),c.jsxs(Pt,{onClick:k,disabled:v,className:"gap-2",children:[c.jsx(pu,{className:"w-4 h-4"})," ",v?"Wird hochgeladenâ¦":"Hochladen"]})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"font-semibold text-sm mb-2",children:["Hochgeladene Modelle (",t.length,")"]}),t.length===0?c.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Noch keine Modelle."}):c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map(T=>c.jsxs("div",{className:"border border-border rounded-lg p-3 bg-card space-y-2",children:[T.thumbnail_url?c.jsx("img",{src:T.thumbnail_url,alt:T.name,className:"w-full aspect-video object-cover rounded bg-muted"}):c.jsx("div",{className:"w-full aspect-video rounded bg-muted flex items-center justify-center",children:c.jsx(Mf,{className:"w-8 h-8 text-muted-foreground"})}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-sm",children:T.name}),T.beschreibung&&c.jsx("div",{className:"text-xs text-muted-foreground",children:T.beschreibung}),c.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:[T.default_breite&&`B ${T.default_breite}m`,T.default_hoehe&&`H ${T.default_hoehe}m`,T.default_tiefe&&`T ${T.default_tiefe}
4946m`].filter(Boolean).join(" · ")||"Keine StandardmaÃe"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("a",{href:T.glb_url,target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline",children:"GLB öffnen"}),c.jsx(Pt,{size:"sm",variant:"ghost",className:"ml-auto text-destructive",onClick:()=>M(T.id),children:c.jsx(yo,{className:"w-4 h-4"})})]})]},T.id))})]})]})}function GWe(){return c.jsx(Q1,{title:"Produktdaten â Messestand",tableName:"messestand_produkte",exportPrefix:"messestand-produkte",channableLabel:"Messestand",channableRpc:"enrich_messestand_produkte_from_produkte"})}function VWe(){return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Vorschau",description:"Live-Vorschau des Messestand-Konfigurators"}),c.jsx("div",{className:"border border-border rounded-lg overflow-hidden bg-card",style:{height:"80vh"},children:c.jsx("iframe",{src:"/messestand?embed=true",className:"w-full h-full border-0",title:"Messestand Vorschau"})})]})}function WWe(){return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"iFrame-Snippet zum Einbinden des Messestand-Konfigurators."}),c.jsx(Km,{configuratorPath:"/messestand",iframeTitle:"Messestand-Konfigurator",defaultHeight:"800"})]})}var B6="Radio",[$We,Cce]=ja(B6),[KWe,qWe]=$We(B6),Nce=E.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:l,form:u,...d}=t,[h,p]=E.useState(null),f=ur(e,v=>p(v)),m=E.useRef(!1),x=h?u||!!h.closest("form"):!0;return c.jsxs(KWe,{scope:n,checked:i,disabled:a,children:[c.jsx(vn.button,{type:"button",role:"radio","aria-checked":i,"data-state":jce(i),"data-disabled":a?"":void 0,disabled:a,value:o,...d,ref:f,onClick:cn(t.onClick,v=>{i||l==null||l(),x&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),x&&c.jsx(Rce,{control:h,bubbles:!m.current,name:r,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Nce.displayName=B6;var Tce="RadioIndicator",Mce=E.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,s=qWe(Tce,n);return c.jsx(Cu,{present:r||s.checked,children:c.jsx(vn.span,{"data-state":jce(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});Mce.displayName=Tce;var XWe="RadioBubbleInput",Rce=E.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:r=!0,...i},s)=>{const a=E.useRef(null),o=ur(a,s),l=hA(n),u=qS(e);return E.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&f){const m=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(m)}},[l,n,r]),c.jsx(vn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Rce.displayName=XWe;function jce(t){return t?"checked":"unchecked"}var YWe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],i3="RadioGroup",[JWe,Eqe]=ja(i3,[V1,Cce]),Pce=V1(),Lce=Cce(),[ZWe,QWe]=JWe(i3),Ice=E.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:l,dir:u,loop:d=!0,onValueChange:h,...p}=t,f=Pce(n),m=Mx(u),[x,v]=Ja({prop:s,defaultProp:i??null,onChange:h,caller:i3});return c.jsx(ZWe,{scope:n,name:r,required:a,disabled:o,value:x,onValueChange:v,children:c.jsx(TO,{asChild:!0,...f,orientation:l,dir:m,loop:d,children:c.jsx(vn.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":o?"":void 0,dir:m,...p,ref:e})})})});Ice.displayName=i3;var Dce="RadioGroupItem",Bce=E.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,s=QWe(Dce,n),a=s.disabled||r,o=Pce(n),l=Lce(n),u=E.useRef(null),d=ur(e,u),h=s.value===i.value,p=E.useRef(!1);return E.useEffect(()=>{const f=x=>{YWe.includes(x.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),c.jsx(MO,{asChild:!0,...o,focusable:!a,active:h,children:c.jsx(Nce,{disabled:a,required:s.required,
vendor: 6,149 bytes, line 4946
4946checked:h,...l,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:cn(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:cn(i.onFocus,()=>{var f;p.current&&((f=u.current)==null||f.click())})})})});Bce.displayName=Dce;var e$e="RadioGroupIndicator",Fce=E.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=Lce(n);return c.jsx(Mce,{...i,...r,ref:e})});Fce.displayName=e$e;var Oce=Ice,zce=Bce,t$e=Fce;const rB=E.forwardRef(({className:t,...e},n)=>c.jsx(Oce,{className:rn("grid gap-2",t),...e,ref:n}));rB.displayName=Oce.displayName;const L_=E.forwardRef(({className:t,...e},n)=>c.jsx(zce,{ref:n,className:rn("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(t$e,{className:"flex items-center justify-center",children:c.jsx(Xfe,{className:"h-2.5 w-2.5 fill-current text-current"})})}));L_.displayName=zce.displayName;var s3="Popover",[Uce,kqe]=ja(s3,[A1]),$A=A1(),[n$e,pg]=Uce(s3),Hce=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=t,o=$A(e),l=E.useRef(null),[u,d]=E.useState(!1),[h,p]=Ja({prop:r,defaultProp:i??!1,onChange:s,caller:s3});return c.jsx(bF,{...o,children:c.jsx(n$e,{scope:e,contentId:mu(),triggerRef:l,open:h,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(f=>!f),[p]),hasCustomAnchor:u,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:a,children:n})})};Hce.displayName=s3;var Gce="PopoverAnchor",r$e=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=pg(Gce,n),s=$A(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return E.useEffect(()=>(a(),()=>o()),[a,o]),c.jsx(A5,{...s,...r,ref:e})});r$e.displayName=Gce;var Vce="PopoverTrigger",Wce=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=pg(Vce,n),s=$A(n),a=ur(e,i.triggerRef),o=c.jsx(vn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Yce(i.open),...r,ref:a,onClick:cn(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:c.jsx(A5,{asChild:!0,...s,children:o})});Wce.displayName=Vce;var F6="PopoverPortal",[i$e,s$e]=Uce(F6,{forceMount:void 0}),$ce=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=pg(F6,e);return c.jsx(i$e,{scope:e,forceMount:n,children:c.jsx(Cu,{present:n||s.open,children:c.jsx(VS,{asChild:!0,container:i,children:r})})})};$ce.displayName=F6;var u1="PopoverContent",Kce=E.forwardRef((t,e)=>{const n=s$e(u1,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=pg(u1,t.__scopePopover);return c.jsx(Cu,{present:r||s.open,children:s.modal?c.jsx(o$e,{...i,ref:e}):c.jsx(l$e,{...i,ref:e})})});Kce.displayName=u1;var a$e=tx("PopoverContent.RemoveScroll"),o$e=E.forwardRef((t,e)=>{const n=pg(u1,t.__scopePopover),r=E.useRef(null),i=ur(e,r),s=E.useRef(!1);return E.useEffect(()=>{const a=r.current;if(a)return hO(a)},[]),c.jsx(V5,{as:a$e,allowPinchZoom:!0,children:c.jsx(qce,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cn(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:cn(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0,u=o.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:cn(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),l$e=E.forwardRef((t,e)=>{const n=pg(u1,t.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return c.jsx(qce,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),qce=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=t,p=pg(u1,n),f=$A(n);return dO(),c.jsx(H5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:c.jsx(p1,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:c.jsx(wF,{"data-state":Yce(p.open),role:"dialog",id:p.contentId,...f,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Xce="PopoverClose",c$e=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=pg(Xce,n);return c.jsx(vn.button,{type:"button",...r,ref:e,onClick:cn(t.onClick,()=>i.onOpenChange(!1))})});c$e.displayName=Xce;var u$e="PopoverArrow",d$e=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=$A(n);return c.jsx(_F,{...i,...r,ref:e})});d$e.displayName=u$e;function Yce(t){return t?"open":"closed"}var h$e=Hce,f$e=Wce,p$e=$ce,Jce=Kce;const WK=h$e,$K=f$e,iB=E.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>c.jsx(p$e,{children:c.jsx(Jce,{ref:i,align:e,sideOffset:n,className:rn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
4946de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));iB.displayName=Jce.displayName;const Zce=$5,m$e=ote,g$e=K5,Qce=E.forwardRef(({className:t,...e},n)=>c.jsx(j1,{className:rn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Qce.displayName=j1.displayName;const x$e=m1("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),O6=E.forwardRef(({side:t="right",className:e,children:n,...r},i)=>c.jsxs(g$e,{children:[c.jsx(Qce,{}),c.jsxs(P1,{ref:i,className:rn(x$e({side:t}),e),...r,children:[n,c.jsxs(q5,{className:"absolute right-4 top-4 roun
4946ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(Bc,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));O6.displayName=P1.displayName;const z6=({className:t,...e})=>c.jsx("div",{className:rn("flex flex-col space-y-2 text-center sm:text-left",t),...e});z6.displayName="SheetHeader";const U6=E.forwardRef(({className:t,...e},n)=>c.jsx(L1,{ref:n,className:rn("text-lg font-semibold text-foreground",t),...e}));U6.displayName=L1.displayName;const v$e=E.forwardRef(({className:t,...e},n)=>c.jsx(I1,{ref:n,className:rn("text-sm text-muted-foreground",t),...e}));v$e.displayName=I1.displayName;class tg extends Error{constructor(n,r){super(n);$n(this,"field");this.field=r}}const yu=11,sB=76.3,um=65.3,y$e=101.8,Fp=76.3,I_=14.9,eue=2400,b$e=100,w$e=10,_$e=250,S$e=15,A$e=50,E$e=["Premium WeiÃ","WeiÃ","Anthrazit","Premium Schwarz","Eiche","Nussbaum","grau","Premium Schwarz (inkl. Schienen)","dunkelgrau"],Ex=[{id:1,breite_cm:121,hoehe_cm:121,zuschneidbar:!1},{id:2,breite_cm:121,hoehe_cm:243,zuschneidbar:!0},{id:3,breite_cm:102,hoehe_cm:244,zuschneidbar:!0},{id:4,breite_cm:243,hoehe_cm:101.8,zuschneidbar:!0},{id:5,breite_cm:203.6,hoehe_cm:122,zuschneidbar:!0},{id:6,breite_cm:243,hoehe_cm:121,zuschneidbar:!0}],D_={WeiÃ:"#FFFFFF","Premium WeiÃ":"#F5F5F5","Premium SW WeiÃ":"#F2F2F2","Hochglanz WeiÃ":"#FAFAFA","Acryl WeiÃ":"#F5F5F5",Beige:"#E8D9B4",Almheu:"#C9B071",Eiche:"#B5813B","Andersen Pinie":"#C8A982",Birnbaum:"#A9794E",Nussbaum:"#5C3B1E",rot:"#B22222",grau:"#9A9C9E",dunkelgrau:"#5A5C5E",Anthrazit:"#3F4347","Premium Schwarz":"#111111","Premium Schwarz (inkl. Schienen)":"#1A1A1A","Hochglanz schwarz":"#0A0A0A","Acryl Schwarz":"#0F0F0F",Lava:"#2E2A28",Moos:"#5E7A4A","Alu Silber":"#C0C2C4","Alu gebürstet":"#B8BABC",Acrylspiegel:"#D9DDE0"};function k$e(t,e,n,r){const i=Ex.map(h=>{const p=Math.ceil(t/h.breite_cm),f=Math.ceil(e/h.hoehe_cm),m=p*f,x=r.get(`${h.id}|${n}`),v=!!x,g=(x==null?void 0:x.preis)??0,b=v?m*g+m*I_:Number.POSITIVE_INFINITY;return{format_id:h.id,spalten:p,zeilen:f,anzahl:m,gesamt:b,verfuegbar:v,preis:g,f:h}}),s=i.filter(h=>h.verfuegbar);if(!s.length)throw new tg("Diese Farbe ist in keinem Format für Ihre WandgröÃe verfügbar.","farbe");const a=s.find(h=>h.f.breite_cm===t&&h.f.hoehe_cm===e),o=s.filter(h=>h.f.zuschneidbar),u=(a?[a]:o.length?o:s).reduce((h,p)=>h.gesamt<=p.gesamt?h:p),d=Math.round(t/u.spalten*1e3)/100;return{format_id:u.format_id,spalten:u.spalten,zeilen:u.zeilen,anzahl_paneele:u.anzahl,preis_paneel:u.preis,finale_breite_mm:d,paneele_zuschnitt_noetig:!a,alle_kandidaten:i.map(h=>({format_id:h.format_id,spalten:h.spalten,zeilen:h.zeilen,anzahl:h.anzahl,gesamt:h.verfuegbar?h.gesamt:0,verfuegbar:h.verfuegbar}))}}function C$e(t,e,n){if(n<um)throw new tg(`Sockelabstand zu klein (min. ${um.toString().replace(".",",")} mm).`,"sockel");if(t<n+sB)throw new tg("Die Wand ist zu niedrig. Mindest-Kopfabstand von 76,3 mm kann nicht eingehalten werden.","hoehe");const r=Math.floor((t-n-sB)/e)+1,i=t-n-(r-1)*e;return{N:r,K:i}}function N$e(t,e){let n=0,r=0;for(let s=1;s<1e3;s++){const o=(t-(s-1)*e-yu)/2;if(o<um)break;n=s,r=o}if(n===0)throw new tg("Wand zu niedrig für die Mindest-Abstände (Sockel ⥠65,3 mm, Kopf ⥠76,3 mm).","hoehe");const i=r+yu;return{N:n,K:i,S:r}}function T$e(t,e,n,r,i,s,a){const o=e.zeilen;if(o<=1)return{walls:[t],transitions:[],transition_pos_mm:[]};const l=n,u=yu/2,d=Math.floor(l/i),h=r-1-(o-2)*d,p=Math.round(h/2+(a-s-yu)/(2*i)+1),f=Math.floor((l-s-u)/i)+1,m=Math.max(1,r-(o-2)*d-Math.floor((l-a+u)/i));if(m>f)throw new tg("Diese Kombination aus Wandhöhe und Format ist nicht umsetzbar, da die halben Nuten an den Zeilen-Ãbergängen nicht exakt gebildet werden können. Bitte wenden Sie sich an unseren Kundenservice.","hoehe");const x=Math.max(m,Math.min(f,p)),v=[];for(let S=1;S<=o-1;S++)v.push(x+(S-1)*d);const g=S=>Math.round(S*100)/100,b=v.map(S=>g(s+(S-1)*i+u)),y=new Array(o);y[0]=b[0];for(let S=1;S<=o-2;S++)y[S]=g(b[S]-b[S-1]);return y[o-1]=g(t-b[o-2]),{walls:y,transitions:v,transition_pos_mm:b,hinweis:`Wand wird in ${o} horizontale Zeilen geteilt.`}}
4946const KK={stueck_2500:0,stueck_3000:0,kosten:0,seiten_details:[]};function M$e(t,e,n,r,i,s,a){if(!n)return KK;const o=a.get(`2500|${s}|${i}`),l=a.get(`3000|${s}|${i}`);if(!o||!l)return KK;const u=[{key:"oben",laenge:t*10},{key:"unten",laenge:t*10},{key:"links",laenge:e*10},{key:"rechts",laenge:e*10}],d=[];let h=0,p=0;for(const m of u){if(!r[m.key])continue;const x=m.laenge;if(x<=0)continue;let v,g;x<=2500?(v=2500,g=1):x<=3e3?(v=3e3,g=1):(v=3e3,g=Math.ceil(x/3e3));const b=x/g;d.push({seite:m.key,laenge_mm:x,rohling_mm:v,anzahl_teile:g,zuschnitt_mm:Math.round(b*100)/100}),v===2500?h+=g:p+=g}const f=h*o.preis+p*l.preis;return{stueck_2500:h,stueck_3000:p,kosten:f,sku_2500:o.sku,sku_3000:l.sku,seiten_details:d}}function R$e(t,e,n,r,i){if(t==="Direktmontage")return{stueck:0,kosten:0,reihen_horizontal:0,segmente_pro_reihe:0,segment_laenge_mm:0};const s=i.get("Einhängeprofil");if(!s)return{stueck:0,kosten:0,reihen_horizontal:0,segmente_pro_reihe:0,segment_laenge_mm:0};const a=e*10,o=n*10,l=Math.floor(a/400),u=Math.max(0,o-b$e),d=u>0?Math.max(1,Math.ceil(u/eue)):0,h=d>0?u/d:0,p=d*l;return{stueck:p,kosten:p*s.preis,reihen_horizontal:l,segmente_pro_reihe:d,segment_laenge_mm:h}}function tue(t,e,n={}){if(!t.breite_cm||!t.hoehe_cm||!t.farbe)throw new tg("Vorschau wird generiert, sobald Sie die Farbe gewählt haben und Breite/Höhe in Schritt 2.");const r=t.hoehe_cm*10,i=t.lamellenabstand_inklusive_nut?t.lamellenabstand_mm:t.lamellenabstand_mm+yu;if(i<Fp)throw new tg(`Lamellenabstand zu klein (min. ${Fp.toString().replace(".",",")} mm inkl. Nut).`,"lamellenabstand");const s=k$e(t.breite_cm,t.hoehe_cm,t.farbe,e),a=t.sockelabstand_auto?N$e(r,i):C$e(r,i,t.sockelabstand_mm),o=Ex.find(P=>P.id===s.format_id),l=a.S??t.sockelabstand_mm,u=T$e(r,s,o.hoehe_cm*10,a.N,i,l,a.K),d=M$e(t.breite_cm,t.hoehe_cm,t.kantenschutz_aktiv,t.kantenschutz_seiten,t.kantenschutz_typ,t.kantenschutz_oberflaeche,e),h=R$e(t.montage,t.hoehe_cm,t.breite_cm,s,e),p=[],f=e.get(`${s.format_id}|${t.farbe}`);let m=1;if(f){const P=Math.round(o.breite_cm*10),j=Math.round(o.hoehe_cm*10),G=Math.round(t.breite_cm*10),B=Math.round(s.finale_breite_mm*100)/100;if(!s.paneele_zuschnitt_noetig||G===s.spalten*P&&u.walls.every(U=>U===j))p.push({pos:m++,sku:f.sku,bezeichnung:f.name,menge:s.anzahl_paneele,einzelpreis:f.preis,gesamt:f.preis*s.anzahl_paneele,bild_url:f.bild_url??null,produkt_url:f.produkt_url??null});else{const U=u.walls.length,Z=Y=>U===1?"":Y===0?"Unten":Y===U-1?"Oben":U===3?"Mitte":`Mitte ${Y}`,V=Y=>(Math.round(Y*100)/100).toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}),W=new Map;u.walls.forEach((Y,z)=>{const I=Math.round(Y*100),q=W.get(I)??{hoeheRaw:Y,indizes:[]};q.indizes.push(z),W.set(I,q)});const O=[...W.values()].sort((Y,z)=>Math.max(...z.indizes)-Math.max(...Y.indizes));for(const Y of O){const z=Y.indizes.length*s.spalten,I=Math.round(Y.hoeheRaw*100)/100,q=Y.indizes.map(Z).filter(Boolean);let te="";q.length>0&&(q.length===1?te=q[0]:q.every(le=>le.startsWith("Mitte"))&&q.length===U-2&&U>3?te=`Mitte 1â${U-2}`:te=q.join(", "));const se=te?` (Zeile: ${te})`:"";p.push({pos:m++,sku:f.sku,bezeichnung:`${f.name} â Zuschnitt ${V(B)} à ${V(I)} mm${se}`,menge:z,einzelpreis:f.preis,gesamt:f.preis*z,bild_url:f.bild_url??null,produkt_url:f.produkt_url??null,zuschnitt:{breite_mm:B,hoehe_mm:I}})}}}const x=s.paneele_zuschnitt_noetig?s.anzahl_paneele*I_:0;if(s.paneele_zuschnitt_noetig&&p.push({pos:m++,sku:"VERSCHNITT",bezeichnung:"Zuschnitt Pauschale Lamellenwände",menge:s.anzahl_paneele,einzelpreis:I_,gesamt:x}),d.kosten>0){if(d.stueck_2500>0&&d.sku_2500){const P=e.get(`2500|${t.kantenschutz_oberflaeche}|${t.kantenschutz_typ}`);p.push({pos:m++,sku:d.sku_2500,bezeichnung:(P==null?void 0:P.name)??`${t.kantenschutz_typ} 2500mm`,menge:d.stueck_2500,einzelpreis:(P==null?void 0:P.preis)??0,gesamt:((P==null?void 0:P.preis)??0)*d.stueck_2500,bild_url:(P==null?void 0:P.bild_url)??null,produkt_url:(P==null?void 0:P.produkt_url)??null})}if(d.stueck_3000>0&&d.sku_3000){const P=e.get(`3000|${t.kantenschutz_oberflaeche}|${t.kantenschutz_typ}`);p.push({pos:m++,sku:d.sku_3000,bezeichnung:(P==null?void 0:P.name)??`${t.kantenschutz_typ} 3000mm`,menge:d.stueck_3000,einzelpreis:(P==null?void 0:P.preis)??0,gesamt:((P==null?void 0:P.preis)??0)*d.stueck_3000,bild_url:(P==null?void 0:P.bild_url)??null,produkt_url:(P==null?void 0:P.produkt_url)??null})}}if(h.kosten>0){const P=e.get("Einhängeprofil");p.push({pos:m++,sku:(P==null?void 0:P.sku)??"KP-305",bezeichnung:(P==null?void 0:P.name)??"Einhängeprofil",menge:h.stueck,einzelpreis:(P==null?void 0:P.preis)??0,gesamt:h.kosten,bild_url:(P==null?void 0:P.bild_url)??null,produkt_url:(P==null?void 0:P.produkt_url)??null})}const v=t.montage!=="Direktmontage"&&t.breite_cm===_$e,g=d.stueck_2500+d.stueck_3000+(v?0:h.stueck);if(g>0){const P=Math.ceil(g/w$e);p.push({pos:m++,sku:"ZUSCHNITT-PROFILE",bezeichnung:"Zuschnitt Pauschale Profile",menge:P,einzelpreis:I_,gesamt:P*I_})}const b=Math.max(1,Math.floor(t.anzahl_waende??1));if(b>1)for(const P of p)P.menge=P.menge*b,P.gesamt=Math.round(P.einzelpreis*P.menge*100)/100;const y=(f?f.preis*s.anzahl_paneele:0)*b,S=x*b,A=p.reduce((P,j)=>P+j.gesamt,0),k=[];let M=0;if(n.warentraeger&&n.warentraeger.length>0){const P=new Map(n.warentraeger.map($=>[$.sku,$])),j=n.warentraeger.filter($=>$.kategorie==="holzfachbodentraeger"&&$.available).sort(($,U)=>$.sortierung-U.sortierung)[0],G=Object.entries(t.warentraeger??{}).filter(([$,U])=>U>0&&P.has($)).filter(([$])=>P.get($).kategorie!=="holzfachbodentraeger");let B=0;for(const[$,U]of G)P.get($).kategorie==="holzfachboden"&&(B+=U);for(const[$,U]of G){const Z=P.get($);if(!Z.available)continue;const V=Z.preis*U;M+=V,k.push({pos:m++,sku:Z.sku,bezeichnung:Z.name,menge:U,einzelpreis:Z.preis,gesamt:V,bild_url:Z.bild_url,produkt_url:Z.produkt_url})}if(j){const $=t.holzfachbodentraeger_override,U=$==null?B:Math.max(0,Math.floor($));if(U>0){const Z=j.preis*U;M+=Z,k.push({pos:m++,sku:j.sku,bezeichnung:j.name,menge:U,einzelpreis:j.preis,gesamt:Z,bild_url:j.bild_url,produkt_url:j.produkt_url})}}}const T=A+M,C=[];u.hinweis&&C.push(u.hinweis);let R;if(!n.skipSparCheck&&b===1){const P=s.zeilen;let j=null;for(const G of Ex){const B=G.hoehe_cm,$=t.hoehe_cm-B;if(!($<=0||$>S$e)&&e.has(`${G.id}|${t.farbe}`))try{const U=tue({...t,hoehe_cm:B},e,{skipSparCheck:!0,warentraeger:n.warentraeger});if(U.format.zeilen>=P||U.gesamt_netto>=T)continue;(!j||U.gesamt_netto<j.gesamt)&&(j={hoehe_cm:B,gesamt:U.gesamt_netto,reihen:U.format.zeilen})}catch{}}j&&T-j.gesamt>=A$e&&(R={neue_hoehe_cm:j.hoehe_cm,differenz_cm:Number((t.hoehe_cm-j.hoehe_cm).toFixed(1)),ersparnis_eur:Number((T-j.gesamt).toFixed(2)),gesamt_netto_neu:j.gesamt,reihen_aktuell:P,reihen_neu:j.reihen})}return{config:t,format:s,geometry:a,distribution:u,kantenschutz:d,montage:h,positionen:p,verschnitt_kosten:S,paneel_
4946kosten:y,warentraeger_positionen:k,warentraeger_kosten:M,gesamt_netto:T,hinweise:C,sparempfehlung:R}}const j$e=[{name:"Lamellenpaneel Birnbaum Format 2",sku:"72701_2",schluessel:"2|Birnbaum",variable:"paneel",preis:250.11},{name:"Lamellenpaneel Birnbaum Format 3",sku:"72701_3",schluessel:"3|Birnbaum",variable:"paneel",preis:214.5},{name:"Lamellenpaneel Birnbaum Format 4",sku:"72701_4",schluessel:"4|Birnbaum",variable:"paneel",preis:230.28},{name:"Lamellenpaneel Birnbaum Format 5",sku:"72701_5",schluessel:"5|Birnbaum",variable:"paneel",preis:208.9},{name:"Lamellenpaneel Birnbaum Format 6",sku:"72701_6",schluessel:"6|Birnbaum",variable:"paneel",preis:220.05},{name:"Lamellenpaneel Premium Weià Format 2",sku:"48489_2",schluessel:"2|Premium WeiÃ",variable:"paneel",preis:250.11},{name:"Lamellenpaneel Premium Weià Format 3",sku:"48489_3",schluessel:"3|Premium WeiÃ",variable:"paneel",preis:214.5},{name:"Lamellenpaneel Premium Weià Format 4",sku:"48489_4",schluessel:"4|Premium WeiÃ",variable:"paneel",preis:230.28},{name:"Lamellenpaneel Premium Weià Format 5",sku:"48489_5",schluessel:"5|Premium WeiÃ",variable:"paneel",preis:208.9},{name:"Lamellenpaneel Premium Weià Format 6",sku:"48489_6",schluessel:"6|Premium WeiÃ",variable:"paneel",preis:220.05},{name:"Alu Kantenschutz blank 2500mm",sku:"KP-302",schluessel:"2500|blank|Alu Kantenschutz",variable:"kantenschutz",preis:9.95},{name:"Alu Kantenschutz blank 3000mm",sku:"KP-302-0",schluessel:"3000|blank|Alu Kantenschutz",variable:"kantenschutz",preis:11.95},{name:"Alu Kantenschutz eloxiert 2500mm",sku:"KP-302-1",schluessel:"2500|eloxiert|Alu Kantenschutz",variable:"kantenschutz",preis:15.95},{name:"Alu Kantenschutz eloxiert 3000mm",sku:"KP-302-2",schluessel:"3000|eloxiert|Alu Kantenschutz",variable:"kantenschutz",preis:18.95},{name:"Alu Abdeckprofil blank 2500mm",sku:"KP-320",schluessel:"2500|blank|Alu Abdeckprofil",variable:"kantenschutz",preis:9.95},{name:"Alu Abdeckprofil blank 3000mm",sku:"KP-320-0",schluessel:"3000|blank|Alu Abdeckprofil",variable:"kantenschutz",preis:12.95},{name:"Alu Abdeckprofil eloxiert 2500mm",sku:"KP-320-1",schluessel:"2500|eloxiert|Alu Abdeckprofil",variable:"kantenschutz",preis:15.95},{name:"Alu Abdeckprofil eloxiert 3000mm",sku:"KP-320-2",schluessel:"3000|eloxiert|Alu Abdeckprofil",variable:"kantenschutz",preis:18.95},{name:"Alu Abschlussprofil blank 2500mm",sku:"KP-314",schluessel:"2500|blank|Alu Abschlussprofil",variable:"kantenschutz",preis:25.95},{name:"Alu Abschlussprofil blank 3000mm",sku:"KP-314-0",schluessel:"3000|blank|Alu Abschlussprofil",variable:"kantenschutz",preis:30.95},{name:"Alu Abschlussprofil eloxiert 2500mm",sku:"KP-314-1",schluessel:"2500|eloxiert|Alu Abschlussprofil",variable:"kantenschutz",preis:32.95},{name:"Alu Abschlussprofil eloxiert 3000mm",sku:"KP-314-2",schluessel:"3000|eloxiert|Alu Abschlussprofil",variable:"kantenschutz",preis:38.95},{name:"Einhängeprofil",sku:"KP-305",schluessel:"Einhängeprofil",variable:"montage",preis:31.95}];function P$e(t){const e=new Map;for(const n of t)e.set(n.schluessel,n);return e}async function L$e(){const{data:t,error:e}=await Ot.from("spacewall_produkte").select("artikelname, sku, schluessel, preis").limit(2e3);let n;e||!t||t.length===0?n=j$e:n=t.map(a=>({name:a.artikelname,sku:a.sku,schluessel:a.schluessel,preis:a.preis,bild_url:null,produkt_url:null}));const r=Array.from(new Set(n.map(a=>a.sku).filter(a=>!!a))),i=await H6(r),s=n.map(a=>{const o=i.get(a.sku);return{...a,bild_url:(o==null?void 0:o.bild_url)??a.bild_url??null,produkt_url:(o==null?void 0:o.shop_url)??a.produkt_url??null}});return P$e(s)}async function I$e(){const{data:t,error:e}=await Ot.from("spacewall_farben").select("id, name, hex_swatch, sortierung, vorschau_url, vorschau_storage_path, produktbild_url, produktbild_storage_path, profil_farbe").order("sortierung",{ascending:!0});return e||!t?[]:t}async function D$e(){const{data:t,error:e}=await Ot.from("spacewall_kantenschutz_info").select("typ, beschreibung, bild_url");if(e||!t)return{};const n={};return t.forEach(r=>{n[r.typ]=r}),n}async function B$e(){const{data:t,error:e}=await Ot.from("spacewall_warentraeger").select("id, sku, kategorie, sortierung, beschreibung").order("kategorie",{ascending:!0}).order("sortierung",{ascending:!0});return e||!t?[]:t}async function H6(t){const e=new Map;if(t.length===0)return e;const{data:n,error:r}=await Ot.from("produkte").select("artikelnummer, bezeichnung, netto_preis, shop_url, bild_url, beschreibung").in("artikelnummer",t);if(r||!n)return e;for(const i of n)e.set(i.artikelnummer,i);return e}async function F$e(){const t=await B$e();if(t.length===0)return[];const e=t.map(r=>r.sku),n=await H6(e);return t.map(r=>{var a;const i=n.get(r.sku),s=((a=r.beschreibung)==null?void 0:a.trim())||null;return{sku:r.sku,kategorie:r.kategorie,sortierung:r.sortierung,beschreibung:s??(i==null?void 0:i.beschreibung)??null,beschreibung_override:s,beschreibung_channable:(i==null?void 0:i.beschreibung)??null,name:(i==null?void 0:i.bezeichnung)??r.sku,preis:(i==null?void 0:i.netto_preis)??0,bild_url:(i==null?void 0:i.bild_url)??null,produkt_url:(i==null?void 0:i.shop_url)??null,available:!!i}})}const O$e={breite_cm:null,hoehe_cm:null,farbe:null,lamellenabstand_mm:101.8,lamellenabstand_inklusive_nut:!0,sockelabstand_mm:100,sockelabstand_auto:!0,kantenschutz_aktiv:!1,kantenschutz_typ:"Alu Kantenschutz",kantenschutz_oberflaeche:"blank",kantenschutz_seiten:{oben:!0,unten:!0,links:!0,rechts:!0}
4946,montage:"Direktmontage",warentraeger:{},holzfachbodentraeger_override:null,anzahl_waende:1};function z$e(){const[t,e]=E.useState(O$e),[n,r]=E.useState(null),[i,s]=E.useState([]),[a,o]=E.useState({}),[l,u]=E.useState([]),[d,h]=E.useState(new Map),[p,f]=E.useState(!0);E.useEffect(()=>{Promise.all([L$e(),I$e(),D$e(),F$e(),gO().catch(()=>new Map)]).then(([x,v,g,b,y])=>{r(x),s(v),o(g),u(b),h(y),f(!1)})},[]);const m=E.useMemo(()=>{if(!n)return{data:null,error:null};try{const x=tue(t,n,{warentraeger:l});if(d.size===0)return{data:x,error:null};const{groups:v,totalsPerGroup:g}=hte([x.positionen,x.warentraeger_positionen],d,{totalField:"gesamt"}),[b,y]=v,S=g[0],A=g[1];return{data:{...x,positionen:b,warentraeger_positionen:y,warentraeger_kosten:A,gesamt_netto:Math.round((S+A)*100)/100},error:null}}catch(x){return x instanceof tg?{data:null,error:x.message}:{data:null,error:x instanceof Error?x.message:"Fehler"}}},[t,n,l,d]);return{config:t,setConfig:e,update:x=>e(v=>{const g={...v,...x};if(x.breite_cm!==void 0||x.hoehe_cm!==void 0||x.anzahl_waende!==void 0){const y=Ex.find(S=>S.breite_cm===g.breite_cm&&S.hoehe_cm===g.hoehe_cm);if(!y)g.anzahl_waende=1;else if(y.zuschneidbar)g.anzahl_waende=Math.max(1,Math.floor(g.anzahl_waende||1));else{const S=Math.max(2,Math.floor(g.anzahl_waende||2));g.anzahl_waende=S%2===0?S:S+1}}return g}),ergebnis:m,farben:i,kantenschutzInfos:a,produkte:n,warentraeger:l,loading:p}}function $P({ergebnis:t,error:e,config:n,farbe:r}){if(e)return c.jsx("div",{className:"w-full aspect-[4/5] bg-muted/40 rounded-lg border border-destructive/40 flex items-center justify-center p-6 text-center",children:c.jsx("p",{className:"text-sm text-destructive",children:e})});if(!t||!n.breite_cm||!n.hoehe_cm)return c.jsx("div",{className:"w-full aspect-[4/5] bg-muted/40 rounded-lg border border-border flex items-center justify-center p-6 text-center",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"Geben Sie Breite, Höhe und Farbe ein, um die Visualisierung zu sehen."})});const o=n.breite_cm*10,l=n.hoehe_cm*10,u=Math.min((400-2*40)/o,(500-2*40)/l),d=o*u,h=l*u,p=(400-d)/2,f=(500-h)/2,m=Ex.find(C=>C.id===t.format.format_id),x=t.config.lamellenabstand_inklusive_nut?t.config.lamellenabstand_mm:t.config.lamellenabstand_mm+yu,v=t.geometry.S??t.config.sockelabstand_mm,g=[],b=v*u,y=x*u;for(let C=0;C<t.geometry.N;C++)g.push(f+h-b-C*y);const S=(r==null?void 0:r.profil_farbe)==="schwarz"?"#0E0E0E":"#9DA1A6",A=(r==null?void 0:r.profil_farbe)==="schwarz"?"#2A2A2A":"#D8DBDF",k=(r==null?void 0:r.hex_swatch)||"#E5E5E5",M=Math.max(1,Math.floor(t.config.anzahl_waende??1)),T=c.jsxs("svg",{viewBox:"0 0 400 500",className:"w-full h-auto",children:[c.jsx("rect",{x:p,y:f,width:d,height:h,fill:k,stroke:"#3A3A3A",strokeWidth:1}),g.map((C,R)=>c.jsxs("g",{children:[c.jsx("line",{x1:p,y1:C,x2:p+d,y2:C,stroke:S,strokeWidth:1.4}),c.jsx("line",{x1:p,y1:C+.6,x2:p+d,y2:C+.6,stroke:A,strokeWidth:.4})]},R)),Array.from({length:t.format.spalten-1},(C,R)=>{const P=p+(R+1)/t.format.spalten*d;return c.jsx("line",{x1:P,y1:f,x2:P,y2:f+h,stroke:"#666",strokeDasharray:"3 2",strokeWidth:.6},`s${R}`)}),t.distribution.transitions.map((C,R)=>{const P=f+h-b-(C-1)*y;return c.jsx("line",{x1:p,y1:P,x2:p+d,y2:P,stroke:"#0066CC",strokeWidth:1.5},`t${R}`)}),t.config.kantenschutz_aktiv&&c.jsxs(c.Fragment,{children:[t.config.kantenschutz_seiten.oben&&c.jsx("line",{x1:p,y1:f,x2:p+d,y2:f,stroke:"#E8520A",strokeWidth:3}),t.config.kantenschutz_seiten.unten&&c.jsx("line",{x1:p,y1:f+h,x2:p+d,y2:f+h,stroke:"#E8520A",strokeWidth:3}),t.config.kantenschutz_seiten.links&&c.jsx("line",{x1:p,y1:f,x2:p,y2:f+h,stroke:"#E8520A",strokeWidth:3}),t.config.kantenschutz_seiten.rechts&&c.jsx("line",{x1:p+d,y1:f,x2:p+d,y2:f+h,stroke:"#E8520A",strokeWidth:3})]}),c.jsxs("text",{x:400/2,y:492,textAnchor:"middle",fontSize:11,fill:"#666",children:[n.breite_cm," cm"]}),c.jsxs("text",{x:12,y:500/2,textAnchor:"middle",fontSize:11,fill:"#666",transform:`rotate(-90 12 ${500/2})`,children:[n.hoehe_cm," cm"]})]});return c.jsxs("div",{className:"w-full bg-card rounded-lg border border-border p-3",children:[M>1?c.jsx("div",{className:"overflow-x-auto -mx-1 px-1",children:c.jsx("div",{className:"grid gap-2 items-end",style:{gridTemplateColumns:`repeat(${M}, minmax(110px, 1fr))`},children:Array.from({length:M},(C,R)=>c.jsxs("div",{className:"flex flex-col items-center min-w-0",children:[c.jsxs("div",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:["Wand ",R+1]}),c.jsx("div",{className:"w-full",children:T})]},R))})}):T,c.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs",children:[c.jsxs("span",{className:"bg-primary/10 text-primary px-2 py-1 rounded font-medium",children:[t.format.spalten," à ",t.format.zeilen," = ",t.format.anzahl_paneele," Paneele",M>1?` à ${M} Wände`:""]}),c.jsxs("span",{className:"bg-muted px-2 py-1 rounded",title:`Hersteller-Format: ${m==null?void 0:m.breite_cm} à ${m==null?void 0:m.hoehe_cm} cm`,children:["Format ",t.format.format_id]}),c.jsxs("span",{className:"bg-muted px-2 py-1 rounded",children:["N = ",t.geometry.N," Nuten"]}),c.jsxs("span",{className:"bg-muted px-2 py-1 rounded",children:["K = ",t.geometry.K.toFixed(1)," mm"]})]})]})}const qK="Spacewall",Xg=t=>
4946`${t.toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} mm`;function U$e(t,e){const n=[];n.push({label:"MaÃe (B à H)",value:`${t.breite_cm} à ${t.hoehe_cm} cm`}),n.push({label:"Farbe",value:String(t.farbe??"â")}),n.push({label:"Format",value:String(e.format.format_id)}),n.push({label:"Paneele",value:String(e.format.anzahl_paneele)});const r=t.lamellenabstand_inklusive_nut?t.lamellenabstand_mm:t.lamellenabstand_mm+yu,i=r-yu;n.push({label:"Lamellenabstand (inkl. Nut)",value:Xg(r)}),n.push({label:"Lamellenabstand (exkl. Nut)",value:Xg(i)}),n.push({label:"Kopfabstand (inkl. Nut)",value:Xg(e.geometry.K)});const s=e.geometry.S??t.sockelabstand_mm,a=t.sockelabstand_auto?" (automatisch ausgemittelt)":"";if(n.push({label:"Sockelabstand (exkl. Nut)",value:`${Xg(s)}${a}`}),n.push({label:"Anzahl Nuten",value:String(e.geometry.N)}),t.kantenschutz_aktiv){n.push({label:"Kantenschutz-Typ",value:`${t.kantenschutz_typ} (${t.kantenschutz_oberflaeche})`});const o={oben:"oben",unten:"unten",links:"links",rechts:"rechts"};for(const u of e.kantenschutz.seiten_details)n.push({label:`Kantenschutz ${o[u.seite]} â Soll-Länge`,value:Xg(u.laenge_mm)}),n.push({label:`Kantenschutz ${o[u.seite]} â Zuschnitt`,value:`${u.anzahl_teile} à ${u.rohling_mm} mm Rohling, Zuschnitt je ${Xg(u.zuschnitt_mm)}`});const l=[];e.kantenschutz.stueck_2500>0&&l.push(`${e.kantenschutz.stueck_2500} à 2500 mm`),e.kantenschutz.stueck_3000>0&&l.push(`${e.kantenschutz.stueck_3000} à 3000 mm`),l.length>0&&n.push({label:"Kantenschutz-Rohstangen (Summe)",value:l.join(" + ")})}return t.montage==="Einhängeprofil"?(n.push({label:"Montage",value:"Einhängeprofil"}),n.push({label:"Einhängeprofile â horizontale Reihen",value:String(e.montage.reihen_horizontal)}),n.push({label:"Einhängeprofile â Segmente pro Reihe",value:`${e.montage.segmente_pro_reihe} à ${Xg(e.montage.segment_laenge_mm)}`}),n.push({label:"Einhängeprofile â Rohprofile",value:`${e.montage.stueck} à ${eue} mm`})):n.push({label:"Montage",value:"Direktmontage"}),n}function H$e({open:t,onOpenChange:e,config:n,ergebnis:r}){return c.jsx(Px,{open:t,onOpenChange:e,konfiguratorName:qK,tabelle:"spacewall_anfragen",konfiguratorTyp:"spacewall",konfigurationSnapshot:()=>({config:n}),buildInsertPayload:()=>({konfiguration:n,lieferumfang:r,gesamtpreis:r.gesamt_netto}),buildPdfInput:(i,s)=>{const a=[...r.positionen,...r.warentraeger_positionen];return{konfiguratorName:qK,anfrageId:s,identifier:`${String(r.format.format_id)} · ${r.format.anzahl_paneele} Paneele`,konfiguration:U$e(n,r),positionen:a.map(o=>({sku:o.sku,artikelname:o.bezeichnung,menge:o.menge,einzelpreis:o.einzelpreis,gesamtpreis:o.gesamt})),gesamtNetto:r.gesamt_netto,mwstSatz:.19}}})}function nue({value:t,onChange:e,min:n=0,max:r=999,step:i=1,size:s="md"}){const a=s==="sm"?"h-7 w-7":"h-9 w-9",o=s==="sm"?"h-7 w-12 text-xs":"h-9 w-16",l=f=>f<=0?0:i<=1?f:Math.ceil(f/i)*i,u=()=>{if(t<=n)return;if(i<=1){e(Math.max(n,t-1));return}const f=Math.floor((t-1)/i)*i;e(Math.max(n,f))},d=()=>{const f=i<=1?t+1:Math.floor(t/i)*i+i;e(Math.min(r,f))},h=f=>{const m=Math.max(n,Number(f)||0);e(Math.min(r,m))},p=()=>{if(i<=1)return;const f=l(t);f!==t&&e(Math.min(r,f))};return c.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[c.jsx(Pt,{type:"button",size:"icon",variant:"outline",className:a,onClick:u,disabled:t<=n,"aria-label":"Menge verringern",children:c.jsx(y1,{className:s==="sm"?"w-3 h-3":"w-4 h-4"})}),c.jsx(yr,{type:"number",min:n,max:r,step:i,value:t,onChange:f=>h(f.target.value),onBlur:p,className:`${o} text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0`}),c.jsx(Pt,{type:"button",size:"icon",variant:"outline",className:a,onClick:d,disabled:t>=r,"aria-label":"Menge erhöhen",children:c.jsx(ph,{className:s==="sm"?"w-3 h-3":"w-4 h-4"})})]})}const G$e=["andersen pinie","eiche","birnbaum","nussbaum"];function V$e(t){const e=t.toLowerCase();return G$e.some(n=>e.includes(n))}function W$e(t){const e=t.toLowerCase().replace(/\s+/g,"");return e.includes("121x30")?"121x30":e.includes("102x30")?"102x30":e.includes("60x30")?"60x30":null}function $$e(t,e){return e?t==="60x30"?16:8:t==="60x30"?16:t==="102x30"?9:8}function rue(t){const e=W$e(t);return e?{step:$$e(e,V$e(t)),min:0}:null}const K$e=[{id:"chrom",label:"Chrom"},{id:"holzfachboden",label:"Holzfachboden"},{id:"kunststoff",label:"Kunststoff"},{id:"schwarz",label:"Schwarz"},{id:"gewaehlt",label:"Meine Auswahl"}],XK=t=>
4946t.toLocaleString("de-DE",{style:"currency",currency:"EUR"});function q$e(t,e){const n=t.split(/\s+-\s+/),r=/^(Länge|Breite|Tiefe|Höhe|Durchmesser|Drahtstärke|MaÃe?|Format)\b/i,i=[],s=[];for(const l of n)r.test(l.trim())?i.push(l.trim()):s.push(l.trim());if(i.length===0)return{groupKey:`solo:${e}`,variantLabel:""};const a=`name:${s.join(" - ").toLowerCase()}`,o=i.map(l=>{const u=l.indexOf(":");return u>=0?l.slice(u+1).trim():l}).join(" · ");return{groupKey:a,variantLabel:o}}function X$e(t,e){const n=new Map;for(const i of t){const{groupKey:s,variantLabel:a}=q$e(i.name,i.sku);let o=n.get(s);if(!o){const l=i.name.split(/\s+-\s+(Länge|Breite|Tiefe|Höhe|Durchmesser|Drahtstärke|MaÃe?|Format)\b/i)[0];o={key:s,head:i,baseName:l,variants:[],totalMenge:0,sortierung:i.sortierung},n.set(s,o)}o.variants.push({item:i,variantLabel:a}),o.totalMenge+=e[i.sku]??0,i.sortierung<o.sortierung&&(o.sortierung=i.sortierung,o.head=i)}const r=i=>{const s=i.replace(/\./g,"").replace(",",".").match(/-?\d+(?:\.\d+)?/);return s?parseFloat(s[0]):Number.POSITIVE_INFINITY};for(const i of n.values())i.variants.sort((s,a)=>{if(s.item.sortierung!==a.item.sortierung&&(s.item.sortierung||a.item.sortierung))return s.item.sortierung-a.item.sortierung;const o=r(s.variantLabel),l=r(a.variantLabel);return o!==l?o-l:s.variantLabel.localeCompare(a.variantLabel,"de",{numeric:!0,sensitivity:"base"})}),i.head=i.variants[0].item;return Array.from(n.values()).sort((i,s)=>i.sortierung-s.sortierung)}function Y$e({warentraeger:t,selection:e,onChange:n}){const r=E.useMemo(()=>t.filter(U=>U.available),[t]),[i,s]=E.useState("chrom"),[a,o]=E.useState(null),[l,u]=E.useState(!1),[d,h]=E.useState(null),[p,f]=E.useState(""),[m,x]=E.useState(1),v=24,g=E.useMemo(()=>i==="gewaehlt"?r.filter(U=>U.kategorie!=="holzfachbodentraeger").filter(U=>(e[U.sku]??0)>0).sort((U,Z)=>U.sortierung-Z.sortierung):r.filter(U=>U.kategorie===i).sort((U,Z)=>U.sortierung-Z.sortierung),[i,r,e]),b=E.useMemo(()=>r.filter(U=>U.kategorie==="holzfachbodentraeger").sort((U,Z)=>U.sortierung-Z.sortierung)[0]??null,[r]),y=E.useMemo(()=>X$e(g,e),[g,e]),S=E.useMemo(()=>{const U=p.trim().toLowerCase();return U?y.filter(Z=>Z.baseName.toLowerCase().includes(U)||Z.variants.some(V=>V.item.sku.toLowerCase().includes(U)||V.item.name.toLowerCase().includes(U))):y},[y,p]),A=Math.max(1,Math.ceil(S.length/v)),k=Math.min(m,A),M=E.useMemo(()=>S.slice((k-1)*v,k*v),[S,k]);E.useEffect(()=>{x(1)},[i,p]);const T=E.useMemo(()=>{if(a){const U=M.find(Z=>Z.key===a);if(U)return U}return M[0]??null},[a,M]),C=E.useMemo(()=>{if(!T)return null;if(d){const Z=T.variants.find(V=>V.item.sku===d);if(Z)return Z}return T.variants.find(Z=>(e[Z.item.sku]??0)>0)??T.variants[0]},[T,d,e]),R=(C==null?void 0:C.item)??null,P=E.useMemo(()=>{const U={chrom:0,holzfachboden:0,kunststoff:0,schwarz:0,gewaehlt:0};for(const Z of r){if(Z.kategorie==="holzfachbodentraeger")continue;const V=e[Z.sku]??0;V>0&&(U[Z.kategorie]=(U[Z.kategorie]??0)+V,U.gewaehlt+=V)}return U},[r,e]),j=P.gewaehlt,G=E.useMemo(()=>r.reduce((U,Z)=>U+(e[Z.sku]??0)*Z.preis,0),[r,e]);if(r.length===0)return c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 6: Warenträger (optional)"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktuell sind keine Warenträger hinterlegt. Sie können diesen Schritt überspringen."})]});function B(U,Z){const V=Math.max(0,Math.min(999,Math.floor(Z)));n(U,V),V>0&&h(U)}const $=T&&R?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid sm:grid-cols-[1fr_240px] gap-4",children:[c.jsx("div",{className:"aspect-square sm:aspect-auto sm:h-64 bg-muted rounded-md overflow-hidden flex items-center justify-center",children:R.bild_url?c.jsx("img",{src:R.bild_url,alt:
4946R.name,className:"max-w-full max-h-full object-contain"}):c.jsx("div",{className:"text-xs text-muted-foreground",children:"Kein Bild verfügbar"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Spacewall Warenträger"}),c.jsx("div",{className:"font-medium leading-snug mt-0.5",children:T.baseName}),c.jsxs("div",{className:"text-xs font-mono text-muted-foreground mt-1",children:["SKU: ",R.sku]})]}),T.variants.length>1&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Variante wählen"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.variants.map(U=>{const Z=R.sku===U.item.sku,V=e[U.item.sku]??0;return c.jsxs("button",{type:"button",onClick:()=>h(U.item.sku),className:`relative px-3 py-1.5 rounded border text-xs font-medium transition-colors min-h-9 ${Z?"border-primary bg-primary/10 text-primary":V>0?"border-primary/40 bg-primary/5 text-foreground":"border-border bg-background text-foreground hover:border-primary/40"}`,children:[U.variantLabel||U.item.sku,V>0&&c.jsx("span",{className:"ml-1.5 inline-flex min-w-4 h-4 px-1 rounded-full bg-primary text-primary-foreground text-[9px] font-bold items-center justify-center",children:V})]},U.item.sku)})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Netto-Preis"}),c.jsx("div",{className:"text-xl font-bold text-primary",children:XK(R.preis)})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Stückzahl"}),(()=>{const U=R.kategorie==="holzfachboden"?rue(R.name):null;return c.jsxs(c.Fragment,{children:[c.jsx(nue,{value:e[R.sku]??0,onChange:Z=>B(R.sku,Z),step:(U==null?void 0:U.step)??1,min:(U==null?void 0:U.min)??0}),U&&c.jsxs("div",{className:"mt-1.5 text-[11px] text-muted-foreground",children:["Mindestabnahme: ",U.step," Stk., weitere Schritte je ",U.step," Stk."]})]})})()]})]})]}),c.jsxs("div",{className:"border-t border-border pt-3",children:[c.jsx("div",{className:"text-sm font-medium text-foreground mb-2",children:"Details"}),R.produkt_url&&c.jsxs("a",{href:R.produkt_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline",children:[c.jsx(_d,{className:"w-3.5 h-3.5"}),"Auf ladenbau.de ansehen (öffnet in neuem Tab)"]})]})]}):null;return c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 6: Warenträger (optional)"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Wählen Sie passende Warenträger. Varianten (z. B. Längen) wählen Sie nach dem Anklicken im Detail."})]})}),c.jsx("div",{className:"flex flex-wrap gap-2",children:K$e.map(U=>{const Z=i===U.id,V=P[U.id]??0;return U.id==="gewaehlt"&&V===0?null:c.jsxs("button",{type:"button",onClick:()=>{s(U.id),o(null),h(null)},className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-colors ${Z?"bg-primary text-primary-foreground":"bg-muted text-foreground hover:bg-primary/10"}`,children:[U.label,V>0&&c.jsx("span",{className:`inline-flex min-w-5 h-5 px-1.5 rounded-full items-center justify-center text-[10px] font-bold ${Z?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/15 text-primary"}`,children:V})]},U.id)})}),i==="holzfachboden"&&c.jsxs("div",{className:"flex items-start gap-3 rounded-md border-l-4 border-primary bg-primary/5 p-3",children:[b!=null&&b.bild_url?c.jsx("img",{src:b.bild_url,alt:b.name,className:"w-16 h-16 object-contain rounded border border-border bg-background flex-shrink-0",loading:"lazy"}):c.jsx("div",{className:"w-16 h-16 rounded bg-muted border border-border flex-shrink-0","aria-hidden":!0}),c.jsxs("div",{className:"text-xs text-foreground leading-relaxed",children:["Für jeden gewählten Holzfachboden wird automatisch"," ",c.jsxs("strong",{children:["1à ",(b==null?void 0:b.name)??"Holzfachbodenträger"]})," ","ins Angebot aufgenommen. Fachböden lassen sich nur mit diesem Träger an der Lamellenwand montieren. Falls Sie bereits eigene Träger besitzen, können Sie die Position in der Zusammenfassung anpassen oder entfernen."]})]}),c.jsxs("div",{className:"grid lg:grid-cols-[340px_1fr] gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(lF,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground pointer-events-none"}),c.jsx(yr,{type:"text",value:p,onChange:U=>f(U.target.value),placeholder:"Warenträger suchen (Name oder SKU)â¦",className:"h-9 text-xs pl-8 pr-8"}),p&&c.jsx("button",{type:"button",onClick:()=>f(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Suche löschen",children:c.jsx(Bc,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"text-[11px] text-muted-foreground flex items-center justify-between px-0.5",children:[c.jsxs("span",{children:[S.length," ",(S.length===1,"Treffer"),p&&y.length!==S.length&&c.jsxs("span",{className:"text-muted-foreground
4946/70",children:[" von ",y.length]})]}),A>1&&c.jsxs("span",{children:["Seite ",k," / ",A]})]}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 content-start md:max-h-[520px] md:overflow-y-auto md:pr-1",children:[M.length===0&&c.jsx("div",{className:"col-span-full text-xs text-muted-foreground italic py-8 text-center",children:p?"Keine Treffer für Ihre Suche.":"Keine Einträge in dieser Kategorie."}),c.jsx(KN,{delayDuration:150,children:M.map(U=>{const Z=(T==null?void 0:T.key)===U.key,V=U.variants.length>1;return c.jsxs(qN,{children:[c.jsx(XN,{asChild:!0,children:c.jsxs("button",{type:"button",onClick:()=>{o(U.key),h(null),typeof window<"u"&&window.matchMedia("(max-width: 1023px)").matches&&u(!0)},className:`group relative rounded-md overflow-hidden border-2 bg-card transition-all text-left flex flex-col ${Z?"border-primary ring-2 ring-primary/30":U.totalMenge>0?"border-primary/60":"border-border hover:border-primary/40"}`,"aria-label":U.baseName,children:[c.jsxs("div",{className:"aspect-square bg-muted relative",children:[U.head.bild_url?c.jsx("img",{src:U.head.bild_url,alt:U.baseName,loading:"lazy",className:"w-full h-full object-contain"}):c.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground",children:"Kein Bild"}),V&&c.jsxs("div",{className:"absolute bottom-1 left-1 px-1.5 py-0.5 rounded bg-background/90 text-[9px] font-medium text-muted-foreground border border-border",children:[U.variants.length," Var."]}),U.totalMenge>0&&c.jsx("div",{className:"absolute top-1 right-1 min-w-6 h-6 px-1.5 rounded-full bg-primary text-primary-foreground text-xs font-bold flex items-center justify-center shadow",children:U.totalMenge})]}),c.jsx("div",{className:"px-1.5 py-1 text-[10px] leading-tight text-foreground line-clamp-4 min-h-[56px]",children:U.baseName.replace(/^spacewall\s+/i,"")})]})}),c.jsx(O2,{side:"top",className:"max-w-xs text-xs",children:U.baseName})]},U.key)})})]}),A>1&&c.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[c.jsxs(Pt,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",onClick:()=>x(U=>Math.max(1,U-1)),disabled:k<=1,children:[c.jsx(Ob,{className:"w-3.5 h-3.5 mr-0.5"}),"Zurück"]}),c.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[k," / ",A]}),c.jsxs(Pt,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",onClick:()=>x(U=>Math.min(A,U+1)),disabled:k>=A,children:["Weiter",c.jsx(nx,{className:"w-3.5 h-3.5 ml-0.5"})]})]})]}),c.jsx("div",{className:"hidden lg:block",children:$?c.jsx("div",{className:"rounded-lg border border-border bg-background p-4",children:$}):c.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/30 p-6 text-sm text-muted-foreground italic flex items-center justify-center",children:"Wählen Sie links einen Warenträger."})})]}),c.jsx(Zce,{open:l&&!!$,onOpenChange:u,children:c.jsxs(O6,{side:"bottom",className:"max-h-[90vh] overflow-y-auto lg:hidden",children:[c.jsx(z6,{className:"mb-3",children:c.jsx(U6,{className:"text-left",children:(T==null?void 0:T.baseName)??"Warenträger"})}),$]})}),c.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 px-4 py-3 flex items-center justify-between gap-3",children:[c.jsx("div",{className:"text-sm",children:j>0?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:j})," Warenträger gewählt"]}):c.jsx("span",{className:"text-muted-foreground",children:"Noch keine Warenträger gewählt"})}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Zwischensumme"}),c.jsx("div",{className:"font-bold text-primary",children:XK(G)})]})]})]})}function YK(t){return{artikelnummer:t.sku,bezeichnung:t.bezeichnung,menge:t.menge,einzelpreis:t.einzelpreis,gesamtpreis:t.gesamt,bild_url:t.bild_url??null,produkt_url:t.produkt_url??null,staffel:XO(t)}}function J$e(t,e=q1){if(!t)return null;const n=[...t.positionen.map(YK),...t.warentraeger_positionen.map(YK)].filter(r=>r.menge>0);return yA(n,e)}const ey=["Dekor","MaÃe","Abstände","Kantenschutz","Montage","Warenträger","Zusammenfassung"],hc=t=>
4946t.toLocaleString("de-DE",{style:"currency",currency:"EUR"}),ty=t=>Number.isInteger(t)?`${t}`:t.toLocaleString("de-DE",{maximumFractionDigits:1}),th=t=>t.toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1});function Z$e(){var P;const{config:t,setConfig:e,update:n,ergebnis:r,farben:i,kantenschutzInfos:s,produkte:a,warentraeger:o,loading:l}=z$e(),[u,d]=E.useState(0),[h,p]=E.useState(!1),[f,m]=E.useState(!1),[x,v]=E.useState(!1),[g,b]=E.useState(!1),[y,S]=E.useState(!1),[A]=Al(),k=!!A.get("code");A.get("embed"),Ix({expectedKonfigurator:"spacewall",applyKonfiguration:j=>{j!=null&&j.config&&(e(j.config),d(6))}});const M=j=>{("hoehe_cm"in j||"breite_cm"in j||"farbe"in j)&&m(!1),n(j)};if(l)return c.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:c.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"})});const T=t.lamellenabstand_inklusive_nut?t.lamellenabstand_mm:t.lamellenabstand_mm+yu,C=u===0?!!t.farbe:u===1?!!(t.breite_cm&&t.hoehe_cm):u===2?!(T<Fp||!t.sockelabstand_auto&&t.sockelabstand_mm<um):!0,R=i.find(j=>j.name===t.farbe)??null;return c.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-6 lg:py-10 pb-32 md:pb-10",children:[c.jsx(B1,{konfigurator:"spacewall",disabled:k,onGeladen:j=>{const G=j==null?void 0:j.config;G&&(e(G),d(6))}}),c.jsxs("div",{className:"sticky top-0 z-30 bg-background/95 backdrop-blur border-b border-border -mx-4 px-4 py-3 mb-6",children:[c.jsxs("header",{className:"flex items-center gap-3 mb-3",children:[c.jsx("img",{src:Fc,alt:"Ladenbau.de",className:"h-8"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"text-base sm:text-lg lg:text-xl font-bold leading-tight truncate",children:"Spacewall Lamellenwand-Konfigurator"}),c.jsx("p",{className:"text-[11px] sm:text-xs text-muted-foreground hidden sm:block",children:"Konfigurieren Sie Ihre individuelle Lamellenwand"})]})]}),c.jsxs("div",{className:"md:hidden mb-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs",children:[c.jsxs("span",{className:"font-medium text-foreground",children:["Schritt ",u+1," / ",ey.length]}),c.jsx("span",{className:"text-muted-foreground truncate ml-2",children:ey[u]})]}),c.jsx("div",{className:"h-1.5 bg-muted rounded-full mt-1.5 overflow-hidden",children:c.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${(u+1)/ey.length*100}%`}})})]}),c.jsx("div",{className:"flex items-center gap-2 overflow-x-auto -mx-1 px-1",children:ey.map((j,G)=>{const B=G===u+1&&C,$=G>u&&!B;return c.jsxs("button",{type:"button",disabled:$,onClick:()=>{(G<u||B)&&d(G)},className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium whitespace-nowrap transition-colors ${G===u?"bg-primary text-primary-foreground":G<u?"bg-primary/15 text-primary hover:bg-primary/25":B?"bg-muted text-foreground hover:bg-primary/10 ring-1 ring-primary/40":"bg-muted text-muted-foreground opacity-60 cursor-not-allowed"}`,children:[c.jsx("span",{className:"w-5 h-5 rounded-full bg-background/30 flex items-center justify-center text-[10px]",children:G+1}),j]},j)})})]}),t.farbe&&t.breite_cm&&t.hoehe_cm&&c.jsxs("div",{className:"lg:hidden mb-4 rounded-lg border border-border bg-card overflow-hidden",children:[c.jsxs("button",{type:"button",onClick:()=>b(j=>!j),className:"w-full flex items-center justify-between gap-2 px-4 py-3 text-sm font-medium hover:bg-muted/40","aria-expanded":g,children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Vo,{className:"w-4 h-4 text-primary"}),"Live-Vorschau ",g?"ausblenden":"anzeigen"]}),c.jsx(Su,{className:`w-4 h-4 transition-transform ${g?"rotate-180":""}`})]}),g&&c.jsx("div",{className:"p-3 border-t border-border",children:c.jsx($P,{ergebnis:r.data,error:r.error,config:{breite_cm:t.breite_cm,hoehe_cm:t.hoehe_cm},farbe:i.find(j=>j.name===t.farbe)??null})})]}),c.jsxs("div",{className:"grid lg:grid-cols-[1fr_400px] gap-6",children:[c.jsxs("div",{className:"bg-card rounded-lg border border-border p-5 lg:p-6 space-y-5",children:[u===0&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 1: Dekor wählen"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Wählen Sie das Dekor Ihrer Lamellenwand. Die Bilder zeigen die fertig montierte Wand in der jeweiligen Oberfläche."}),(()=>{const j=E$e.map(V=>i.find(W=>W.name===V)).filter(V=>!!V),G=new Set(j.map(V=>V.name)),B=i.filter(V=>!G.has(V.name)),U=!!t.farbe&&!G.has(t.farbe)?B.find(V=>V.name===t.farbe)??null:null,Z=U?[...j,U]:j;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:Z.map(V=>{const W=t.farbe===V.name,O=!G.has(V.name);return c.jsxs("button",{type:"button",onClick:()=>M({farbe:V.name}),className:`group relative text-left rounded-lg overflow-hidden border-2 transition-all ${W?"border-primary ring-2 ring-primary/30":"border-border hover:border-primary/50"}`,children:[c.jsxs("div",{className:"aspect-square bg-muted relative",children:[V.produktbild_url?c.jsx("img",{src:V.produktbild_url,alt:V.name,className:"absolute inset-0 w-full h-full object-contain",loading:"lazy"}):c.jsx("div",{className:"absolute inset-0",style:{background:V.hex_swatch||D_[V.name]||"#CCC"}}),W&&c.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center shadow",children:c.jsx(ti,{className:"w-4 h-4"})}),O&&c.jsx("div",{className:"absolute top-2 left-2 px-1.5 py-0.5 rounded bg-background/85 text-[10px] font-medium text-muted-foreground border border-border",children:"weiteres Dekor"})]}),c.jsxs("div",{className:"px-3 py-2 flex items-center gap-2 bg-card",children:[c.jsx("span",{className:"inline-block w-3.5 h-3.5 rounded-full border border-border flex-shrink-0",style:{background:V.hex_swatch||D_[V.name]||"#CCC"}}),c.jsx("span",{className:"text-sm font-medium truncate",children:V.name})]})]},V.name)})}),B.length>0&&c.jsxs("div",{className:"pt-2",children:[c.jsxs("button",{type:"button",onClick:()=>v(V=>!V),className:"w-full flex items-center justify-between gap-2 px-4 py-3 rounded-md border border-border bg-muted/40 hover:bg-muted transition-colors text-sm font-medium","aria-expanded":x,children:[c.jsx("span",{children:x?"Weitere Dekore ausblenden":`Weitere Dekore anzeigen (${B.length})`}),c.jsx(Su,{className:`w-4 h-4 transition-transform ${x?"rotate-180":""}`})]}),x&&c.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4 mt-4",children:B.map(V=>{const W=t.farbe===V.name;return c.jsxs("button",{type:"button",onClick:()=>M({farbe:V.name}),className:`group relative text-left rounded-lg overflow-hidden border-2 transition-all ${W?"border-primary ring-2 ring-primary/30":"border-border hover:border-primary/50"}`,children:[c.jsxs("div",{className:"aspect-square bg-muted relative",children:[V.produktbild_url?c.jsx("img",{src:V.produktbild_url,alt:V.name,className:"absolute inset-0 w-full h-full object-contain",loading:"lazy"}):c.jsx("div",{className:"absolute inset-0",style:{background:V.hex_swatch||D_[V.name]||"#CCC"}}),W&&c.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center shadow",children:c.jsx(ti,{className:"w-4 h-4"})})]}),c.jsxs("div",{className:"px-3 py-2 flex items-center gap-2 bg-card",children:[c.jsx("span",{className:"inline-block w-3.5 h-3.5 rounded-full border border-border flex-shrink-0",style:{background:V.hex_swatch||D_[V.name]||"#CCC"}}),c.jsx("span",{className:"text-sm font-medium truncate",children:V.name})]})]},V.name)})})]})]})})(),c.jsxs("div",{className:"bg-muted/50 border border-border rounded-md p-3 text-xs text-muted-foreground",children:[c.jsx("strong",{children:"Hinweis:"})," In den folgenden Schritten zeigt die Vorschau nur die reine Farbe ohne Dekor-Struktur (z. B. keine Holzmaserung oder Oberflächentextur). Das echte Produkt entspricht dem oben gewählten Bild."]})]}),u===1&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 2: MaÃe"}),R&&c.jsxs("div",{className:"flex items-center gap-3 p-2.5 bg-muted/40 border border-border rounded-md",children:[c.jsx("div",{className:"w-16 h-10 rounded overflow-hidden border border-border flex-shrink-0 bg-muted flex items-center justify-center",children:R.produktbild_url?c.jsx("img",{src:R.produktbild_url,alt:"",className:"max-w-full max-h-full object-contain"}):c.jsx("div",{className:"w-full h-full",style:{background:R.hex_swatch}})}),c.jsxs("div",{className:"flex-1 text-sm",children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Gewähltes Dekor"}),c.jsx("div",{className:"font-medium",children:R.name})]}),c.jsx(Pt,{variant:"ghost",size:"sm",onClick:()=>d(0),children:"Ãndern"})]}),(()=>{const j=t.farbe&&a?Ex.filter(G=>a.has(`${G.id}|${t.farbe}`)):[];return j.length?c.jsxs("div",{className:"space-y-2",children:[c.jsx(Vn,{children:"Standardformat wählen"}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:j.map(G=>{const B=t.breite_cm===G.breite_cm&&t.hoehe_cm===G.hoehe_cm;return c.jsxs("button",{type:"button",onClick:()=>M({breite_cm:G.breite_cm,hoehe_cm:G.hoehe_cm}),className:`relative text-left p-3 rounded-md border transition ${B?"border-primary bg-primary/5 ring-1 ring-primary":"border-border hover:border-primary/50 hover:bg-muted/40"}`,children:[B&&c.jsx(ti,{className:"absolute top-2 right-2 w-4 h-4 text-primary"}),c.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:["Format ",G.id]}
4946),c.jsxs("div",{className:"text-sm font-medium mt-0.5",children:[ty(G.breite_cm)," à ",ty(G.hoehe_cm)," cm"]}),!G.zuschneidbar&&c.jsx("div",{className:"text-[10px] text-muted-foreground mt-1",children:"nur als Ganzes"})]},G.id)})}),c.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[c.jsx("div",{className:"h-px flex-1 bg-border"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"oder individuelle MaÃe eingeben"}),c.jsx("div",{className:"h-px flex-1 bg-border"})]})]}):null})(),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Vn,{children:"Breite (cm) *"}),c.jsx(yr,{type:"number",min:50,max:1e3,value:t.breite_cm??"",onChange:j=>M({breite_cm:j.target.value?Number(j.target.value):null}),placeholder:"z. B. 240"})]}),c.jsxs("div",{children:[c.jsx(Vn,{children:"Höhe (cm) *"}),c.jsx(yr,{type:"number",min:50,max:400,value:t.hoehe_cm??"",onChange:j=>M({hoehe_cm:j.target.value?Number(j.target.value):null}),placeholder:"z. B. 240"})]})]}),(()=>{const j=Ex.find(W=>W.breite_cm===t.breite_cm&&W.hoehe_cm===t.hoehe_cm);if(!j)return null;const G=!j.zuschneidbar,B=G?2:1,$=G?2:1,U=t.anzahl_waende??$,Z=()=>M({anzahl_waende:Math.max($,U-B)}),V=()=>M({anzahl_waende:U+B});return c.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx(Vn,{className:"text-sm font-medium",children:"Anzahl Wände"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Wie viele Wände im Format ",j.breite_cm," à ",j.hoehe_cm," cm wünschen Sie?"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Pt,{type:"button",size:"sm",variant:"outline",className:"h-9 w-9 p-0",onClick:Z,disabled:U<=$,"aria-label":"Anzahl verringern",children:"â"}),c.jsx("span",{className:"min-w-[2.5rem] text-center text-base font-semibold tabular-nums",children:U}),c.jsx(Pt,{type:"button",size:"sm",variant:"outline",className:"h-9 w-9 p-0",onClick:V,"aria-label":"Anzahl erhöhen",children:"+"})]})]}),G&&c.jsx("p",{className:"text-xs text-muted-foreground",children:"Format 1 (121 à 121 cm) ist nicht zuschneidbar und nur paarweise lieferbar (Schrittweite 2, mindestens 2 Wände)."})]})})(),((P=r.data)==null?void 0:P.sparempfehlung)&&!f&&(()=>{const j=r.data.sparempfehlung;return c.jsxs("div",{className:"rounded-lg border-2 border-primary/50 bg-primary/5 p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"text-2xl leading-none",children:"ð¡"}),c.jsxs("div",{className:"flex-1 text-sm",children:[c.jsxs("div",{className:"font-semibold text-foreground mb-1",children:["Spar-Tipp: ",ty(j.differenz_cm)," cm weniger Höhe spart ",hc(j.ersparnis_eur)]}),c.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Mit einer Höhe von ",c.jsxs("strong",{className:"text-foreground",children:[ty(j.neue_hoehe_cm)," cm"]})," statt ",ty(t.hoehe_cm)," cm benötigen Sie nur ",j.reihen_neu," Reihe",j.reihen_neu===1?"":"n"," Paneele (statt ",j.reihen_aktuell,"). Neuer Gesamtpreis: ",c.jsx("strong",{className:"text-foreground",children:hc(j.gesamt_netto_neu)}),"."]})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs(Pt,{size:"sm",onClick:()=>M({hoehe_cm:j.neue_hoehe_cm}),children:["Auf ",ty(j.neue_hoehe_cm)," cm reduzieren"]}),c.jsx(Pt,{size:"sm",variant:"ghost",onClick:()=>m(!0),children:"Nein danke"})]})]})})()]}),u===2&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 3: Abstände"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Stellen Sie den Lamellenabstand und â falls gewünscht â den Sockelabstand individuell ein. Die Vorschau rechts aktualisiert sich live."}),c.jsxs("div",{className:"rounded-lg border border-border bg-background p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Lamellenabstand"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Standard: ",c.jsxs("strong",{children:[th(y$e)," mm"]})," (Hersteller-Vorgabe). Individuell wählbar, mindestens jedoch ",th(Fp)," mm (inkl. Nut)."]})]}),c.jsxs(WK,{children:[c.jsx($K,{asChild:!0,children:c.jsxs(Pt,{variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-foreground",children:[c.jsx(pa,{className:"w-4 h-4 mr-1"})," Was bedeutet inkl./exkl. Nut?"]})}),c.jsx(iB,{side:"bottom",align:"end",sideOffset:8,collisionPadding:16,className:"w-[min(360px,calc(100vw-2rem))] max-h-[70vh] overflow-y-auto p-4",children:c.jsx(Q$e,{})})]})]}),c.jsxs("div",{className:"space-y-2",children:[(()=>{const j=t.lamellenabstand_inklusive_nut?Fp:Fp-yu,G=t.lamellenabstand_inklusive_nut?400:400-yu;return c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[c.jsx(wz,{value:[t.lamellenabstand_mm],min:j,max:G,step:.1,onValueChange:([B])=>M({lamellenabstand_mm:Number(B.toFixed(1))}),className:"flex-1 w-full"}),c.jsxs("div",{className:"flex items-center gap-1 self-end sm:self-auto",children:[c.jsx(yr,{type:"number",inputMode:"decimal",step:.1,min:j,max:G,value:t.lamellenabstand_mm,onChange:B=>M({lamellenabstand_mm:Number(B.target.value)}),className:"w-24 h-10"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"mm"})]})]})})(),c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-3 pt-1",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx($o,{id:"nut-toggle",checked:!t.lamellenabstand_inklusive_nut,onCheckedChange:j=>M({lamellenabstand_inklusive_nut:!j})}),c.jsxs(Vn,{htmlFor:"nut-toggle",className:"cursor-pointer",children:["Eingabe als ",c.jsx("strong",{children:t.lamellenabstand_inklusive_nut?"inkl. Nut":"exkl. Nut"})]})]}),!t.lamellenabstand_inklusive_nut&&c.jsxs("div",{className:"text-xs text-muted-foreground",children:["Tatsächlich inkl. Nut: ",c.jsxs("strong",{children:[th(T)," mm"]})]})]}),T<Fp&&c.jsxs("p",{className:"text-xs text-destructive",children:["Lamellenabstand zu klein (min. ",th(Fp)," mm inkl. Nut)."]})]})]}),c.jsxs("div",{className:"rounded-lg border border-border bg-background p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Sockel- & Kopfabstand"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Sockelabstand = Wand-Unterkante bis Unterkante der ersten Nut (exkl. Nut). Kopfabstand = Unterkante der letzten Nut bis Wand-Oberkante (inkl. Nut)."})]}),c.jsxs(WK,{children:[c.jsx($K,{asChild:!0,children:c.jsxs(Pt,{variant:"ghost",size:"sm",className:"h-8 px-2 shrink-0 text-muted-foreground hover:text-foreground",children:[c.jsx(pa,{className:"w-4 h-4 mr-1"})," Was bedeuten Sockel & Kopf?"]})}),c.jsx(iB,{side:"bottom",align:"end",sideOffset:8,collisionPadding:16,className:"w-[min(360px,calc(100vw-2rem))] max-h-[70vh] overflow-y-auto p-4",children:c.jsx(eKe,{})})]})]}),c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(G0,{checked:t.sockelabstand_auto,onCheckedChange:j=>M({sockelabstand_auto:!!j})}),c.jsxs("span",{className:"text-sm",children:["Sockel- und Kopfabstand automatisch ausmitteln ",c.jsx("span",{className:"text-muted-foreground",children:"(empfohlen)"})]})]}),!t.sockelabstand_auto&&c.jsxs("div",{className:"space-y-1 pl-6",children:[c.jsx(Vn,{children:"Sockelabstand (mm, exkl. Nut)"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(yr,{type:"number",step:.1,min:um,value:t.sockelabstand_mm,onChange:j=>M({sockelabstand_mm:Number(j.target.value)}),className:"w-32"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"mm"})]}),t.sockelabstand_mm<um&&c.jsxs("p",{className:"text-xs text-destructive",children:["Minimaler Sockelabstand: ",th(um)," mm."]})]})]}),r.data&&c.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4",children:[c.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Ergebnis bei Ihren Eingaben"}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 text-sm divide-y sm:divide-y-0 divide-border",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Nuten"}),c.jsx("div",{className:"font-semibold text-base",children:r.data.geometry.N})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Sockel (exkl. Nut)"}),c.jsx("div",{className:"font-semibold text-base",children:r.data.geometry.S!=null?`${th(r.data.geometry.S)} mm`:`${th(t.sockelabstand_mm)} mm`})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Kopf (inkl. Nut)"}),c.jsxs("div",{className:"font-semibold text-base",children:[th(r.data.geometry.K)," mm"]})]})]}),t.sockelabstand_auto&&c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Sockel und Kopf sind exakt symmetrisch ausgemittelt (Differenz = 11 mm Nut)."})]}),r.error&&c.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:r.error})]}),u===3&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 4: Kantenschutz"}),c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(G0,{checked:t.kantenschutz_aktiv,onCheckedChange:j=>M({kantenschutz_aktiv:!!j})}),c.jsx("span",{children:"Kantenschutz hinzufügen"})]}),t.kantenschutz_aktiv&&c.jsxs("div",{className:"space-y-4 pl-1",children:[c.jsxs("div",{children:[c.jsx(Vn,{children:"Typ"}),c.jsxs(vl,{value:t.kantenschutz_typ,onValueChange:j=>M({kantenschutz_typ:j}),children:[c.jsx(qo,{children:c.jsx(yl,{})}),c.jsxs(Xo,{children:[c.jsx(Us,{value:"Alu Kantenschutz",children:"Alu Kantenschutz"}),c.jsx(Us,{value:"Alu Abdeckprofil",children:"Alu Abdeckprofil"}),c.jsx(Us,{value:"Alu Abschlussprofil",children:"Alu Abschlussprofil"})]})]}),(()=>{const j=s[t.kantenschutz_typ];return!j||!j.bild_url&&!j.beschreibung?null:c.jsxs("div",{className:"mt-3 flex gap-3 p-3 bg-muted/40 border border-border rounded-md",children:[j.bild_url&&c.jsx("img",{src:j.bild_url,alt:t.kantenschutz_typ,className:"w-28 h-28 object-contain rounded border border-border bg-background flex-shrink-0",loading:"lazy"}),j.beschreibung&&c.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:j.beschreibung})]})})()]}),c.jsxs("div",{children:[c.jsx(Vn,{children:"Oberfläche"}),c.jsxs(rB,{value:t.kantenschutz_oberflaeche,onValueChange:j=>M({kantenschutz_oberflaeche:j}),className:"flex gap-4",children:[c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(L_,{value:"blank"})," blank"]}),c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(L_,{value:"eloxiert"})," eloxiert"]})]}),c.jsxs("div",{className:"mt-2 flex items-start gap-2 p-2.5 bg-muted/40 border border-border rounded text-xs text-muted-foreground",children:[c.jsx(pa,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),c.jsxs("span",{children:["Minimaler optischer Unterschied. ",c.jsx("strong",{children:"Eloxiert"})," bietet eine bessere, kratzfestere Oberfläche."]})]})]}),c.jsxs("div",{children:[c.jsx(Vn,{children:"Seiten"}),c.jsx("div",{className:"grid grid-cols-2 gap-2 mt-1",children:["oben","unten","links","rechts"].map(j=>c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(G0,{checked:t.kantenschutz_seiten[j],onCheckedChange:G=>M({kantenschutz_seiten:{...t.kantenschutz_seiten,[j]:!!G}})}),c.jsx("span",{className:"capitalize",children:j})]},j))})]})]})]}),u===4&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Schritt 5: Montage"}),c.jsxs(rB,{value:t.montage,onValueChange:j=>M({montage:j}),className:"space-y-2",children:[c.jsxs("label",{className:"flex items-start gap-3 p-3 border border-border rounded cursor-pointer hover:bg-muted/50",children:[c.jsx(L_,{value:"Direktmontage",className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Direktmontage"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"Paneele werden direkt an die Wand geschraubt. Kein Zusatzmaterial."})]})]}),c.jsxs("label",{className:"flex items-start gap-3 p-3 border border-border rounded cursor-pointer hover:bg-muted/50",children:[c.jsx(L_,{value:"Einhängeprofil",className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Einhängeprofil"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"Aluminium-Schienen werden montiert, Paneele werden eingehängt."})]})]})]})]}),u===5&&c.jsx(Y$e,{warentraeger:o,selection:t.warentraeger,onChange:(j,G)=>{const B={...t.warentraeger};G<=0?delete B[j]:B[j]=G,M({warentraeger:B})}}),u===6&&r.data&&c.jsxs(c.Fragment,{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Zusammenfassung & Lieferumfang"}),r.data.warentraeger_positionen.length>0&&c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:["Inklusive ",r.data.warentraeger_positionen.reduce((j,G)=>j+G.menge,0)," Warenträger (",hc(r.data.warentraeger_kosten),"). Mengen lassen sich unten direkt anpassen oder per Mülleimer-Symbol entfernen â ohne Rückkehr zu Schritt 6."]}),c.jsx("div",{className:"border border-border rounded overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left p-2",children:"Pos"}),c.jsx("th",{className:"text-left p-2",children:"Artikel"}),c.jsx("th",{className:"text-right p-2",children:"Menge"}),c.jsx("th",{className:"text-right p-2",children:"Einzelpreis"}),c.jsx("th",{className:"text-right p-2",children:"Gesamt"})]})}),c.jsxs("tbody",{children:[r.data.positionen.map(j=>c.jsxs("tr",{className:"border-t border-border",children:[c.jsx("td",{className:"p-2 align-top",children:j.pos}),c.jsx("td",{className:"p-2",children:c.jsxs("div",{className:"flex items-start gap-3",children:[j.bild_url?c.jsx("img",{src:j.bild_url,alt:"",loading:"lazy",className:"w-12 h-12 object-contain rounded border border-border flex-shrink-0 bg-muted p-0.5"}):c.jsx("div",{className:"w-12 h-12 flex-shrink-0","aria-hidden":!0}),c.jsxs("div",{className:"min-w-0",children:[j.produkt_url?c.jsx("a",{href:j.produkt_url,target:"_blank",rel:"noopener noreferrer",className:"text-foreground hover:text-primary hover:underline",children:j.bezeichnung}):c.jsx("div",{children:j.bezeichnung}),c.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:j.sku})]})]})}
4946),c.jsx("td",{className:"p-2 text-right align-top",children:j.menge}),c.jsx("td",{className:"p-2 text-right align-top",children:j.basis_einzelpreis!=null&&j.basis_einzelpreis!==j.einzelpreis?c.jsxs("div",{className:"flex flex-col items-end leading-tight",children:[c.jsx("span",{className:"text-xs text-muted-foreground line-through",children:hc(j.basis_einzelpreis)}),c.jsx("span",{children:hc(j.einzelpreis)}),j.staffel_menge_ab!=null&&c.jsxs("span",{className:"text-[10px] text-primary",children:["Staffel ab ",j.staffel_menge_ab," Stk."]})]}):hc(j.einzelpreis)}),c.jsx("td",{className:"p-2 text-right font-medium align-top",children:hc(j.gesamt)})]},j.pos)),r.data.warentraeger_positionen.length>0&&c.jsx("tr",{className:"border-t border-border bg-primary/5",children:c.jsx("td",{colSpan:5,className:"p-2 text-xs font-semibold uppercase tracking-wide text-primary",children:"Warenträger"})}),r.data.warentraeger_positionen.map(j=>{const G=o.find(V=>V.sku===j.sku),B=(G==null?void 0:G.kategorie)==="holzfachbodentraeger",$=B&&t.holzfachbodentraeger_override===null,U=V=>{const W=Math.max(0,Math.min(999,Math.floor(V)));if(B)M({holzfachbodentraeger_override:W});else{const O={...t.warentraeger};W<=0?delete O[j.sku]:O[j.sku]=W,M({warentraeger:O})}},Z=()=>{if(B)M({holzfachbodentraeger_override:0});else{const V={...t.warentraeger};delete V[j.sku],M({warentraeger:V})}};return c.jsxs("tr",{className:"border-t border-border",children:[c.jsx("td",{className:"p-2 align-top",children:j.pos}),c.jsx("td",{className:"p-2",children:c.jsxs("div",{className:"flex items-start gap-3",children:[j.bild_url?c.jsx("img",{src:j.bild_url,alt:"",loading:"lazy",className:"w-12 h-12 object-contain rounded border border-border flex-shrink-0 bg-muted p-0.5"}):c.jsx("div",{className:"w-12 h-12 flex-shrink-0","aria-hidden":!0}),c.jsxs("div",{className:"min-w-0",children:[j.produkt_url?c.jsx("a",{href:j.produkt_url,target:"_blank",rel:"noopener noreferrer",className:"text-foreground hover:text-primary hover:underline",children:j.bezeichnung}):c.jsx("div",{children:j.bezeichnung}),c.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:j.sku}),$&&c.jsxs("div",{className:"mt-1 inline-flex items-center gap-1 text-[10px] font-medium text-primary bg-primary/10 px-1.5 py-0.5 rounded",children:[c.jsx(bJ,{className:"w-3 h-3"}),"automatisch ergänzt"]}),B&&!$&&c.jsx("button",{type:"button",onClick:()=>M({holzfachbodentraeger_override:null}),className:"mt-1 block text-[10px] text-primary hover:underline",children:"Wieder automatisch berechnen lassen"})]})]})}),c.jsx("td",{className:"p-2 align-top",children:c.jsx("div",{className:"flex justify-end",children:(()=>{const V=(G==null?void 0:G.kategorie)==="holzfachboden"?rue(G.name):null;return c.jsx(nue,{value:j.menge,onChange:U,size:"sm",step:(V==null?void 0:V.step)??1,min:(V==null?void 0:V.min)??0})})()})}),c.jsx("td",{className:"p-2 text-right align-top",children:j.basis_einzelpreis!=null&&j.basis_einzelpreis!==j.einzelpreis?c.jsxs("div",{className:"flex flex-col items-end leading-tight",children:[c.jsx("span",{className:"text-xs text-muted-foreground line-through",children:hc(j.basis_einzelpreis)}),c.jsx("span",{children:hc(j.einzelpreis)}),j.staffel_menge_ab!=null&&c.jsxs("span",{className:"text-[10px] text-primary",children:["Staffel ab ",j.staffel_menge_ab," Stk."]})]}):hc(j.einzelpreis)}),c.jsx("td",{className:"p-2 text-right font-medium align-top",children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx("span",{children:hc(j.gesamt)}),c.jsx(Pt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:Z,title:"Position entfernen","aria-label":"Position entfernen",children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]})})]},`wt-${j.pos}`)})]})]})}),(()=>{const j=J$e(r.data);return j?c.jsxs("div",{className:"border-t pt-3",children:[c.jsx(pM,{ergebnis:j}),c.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Preise für gewerbliche Kunden."})]}):null})(),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[c.jsx(Pt,{onClick:()=>p(!0),size:"lg",className:"w-full sm:w-auto",children:"Angebot anfordern"}),c.jsx(Bf,{konfigurator:"spacewall",getKonfiguration:()=>({config:t}),size:"lg",className:"w-full sm:w-auto"})]})]}),c.jsxs("div",{className:"hidden md:flex justify-between pt-4 border-t border-border",children:[c.jsxs(Pt,{variant:"outline",onClick:()=>d(j=>Math.max(0,j-1)),disabled:u===0,children:[c.jsx(Ob,{className:"w-4 h-4 mr-1"})," Zurück"]}
4946),u<ey.length-1&&c.jsxs(Pt,{onClick:()=>d(j=>j+1),disabled:!C,children:["Weiter ",c.jsx(nx,{className:"w-4 h-4 ml-1"})]})]})]}),c.jsxs("div",{className:"hidden lg:block lg:sticky lg:top-6 self-start space-y-3",children:[c.jsx($P,{ergebnis:r.data,error:r.error,config:{breite_cm:t.breite_cm,hoehe_cm:t.hoehe_cm},farbe:i.find(j=>j.name===t.farbe)??null}),r.data&&c.jsxs("div",{className:"bg-card rounded-lg border border-border p-4",children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Gesamtpreis netto"}),c.jsx("div",{className:"text-2xl font-bold text-primary",children:hc(r.data.gesamt_netto)}),c.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[r.data.format.anzahl_paneele," Paneele · Format ",r.data.format.format_id]})]})]})]}),c.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-40 bg-background/95 backdrop-blur border-t border-border px-3 py-2.5 shadow-[0_-4px_12px_-4px_rgba(0,0,0,0.1)]",children:c.jsxs("div",{className:"flex items-center gap-2 max-w-7xl mx-auto",children:[c.jsx("div",{className:"flex-1 min-w-0",children:r.data?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground leading-none",children:"Netto"}),c.jsx("div",{className:"text-base font-bold text-primary leading-tight truncate",children:hc(r.data.gesamt_netto)})]}):c.jsx("div",{className:"text-xs text-muted-foreground",children:"Konfiguration läuftâ¦"})}),t.farbe&&t.breite_cm&&t.hoehe_cm&&c.jsxs(Zce,{open:y,onOpenChange:S,children:[c.jsx(m$e,{asChild:!0,children:c.jsx(Pt,{variant:"outline",size:"sm",className:"h-10 px-3","aria-label":"Vorschau",children:c.jsx(Vo,{className:"w-4 h-4"})})}),c.jsxs(O6,{side:"bottom",className:"max-h-[90vh] overflow-y-auto",children:[c.jsx(z6,{className:"mb-3",children:c.jsx(U6,{children:"Live-Vorschau"})}),c.jsx($P,{ergebnis:r.data,error:r.error,config:{breite_cm:t.breite_cm,hoehe_cm:t.hoehe_cm},farbe:i.find(j=>j.name===t.farbe)??null})]})]}),u>0&&c.jsx(Pt,{variant:"outline",size:"sm",className:"h-10 px-2",onClick:()=>d(j=>Math.max(0,j-1)),"aria-label":"Zurück",children:c.jsx(Ob,{className:"w-4 h-4"})}),u<ey.length-1?c.jsxs(Pt,{size:"sm",className:"h-10 px-4",onClick:()=>d(j=>j+1),disabled:!C,children:["Weiter ",c.jsx(nx,{className:"w-4 h-4 ml-1"})]}):c.jsx(Pt,{size:"sm",className:"h-10 px-4",onClick:()=>p(!0),disabled:!r.data,children:"Anfragen"})]})}),r.data&&c.jsx(H$e,{open:h,onOpenChange:p,config:t,ergebnis:r.data})]})}function Q$e(){const u="hsl(var(--muted))",d="hsl(var(--background))",h="hsl(var(--border))",p="hsl(var(--primary))";return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"font-medium text-sm",children:"Inkl. Nut vs. exkl. Nut"}),c.jsxs("svg",{viewBox:"0 0 280 170",className:"w-full h-auto","aria-hidden":"true",children:[c.jsx("defs",{children:c.jsx("marker",{id:"nut-arrow-up",viewBox:"0 0 10 10",refX:"5",refY:"0",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:c.jsx("path",{d:"M0,10 L5,0 L10,10 z",fill:p})})}),c.jsx("rect",{x:20,y:16,width:240,height:38,fill:u,stroke:h}),c.jsx("rect",{x:20,y:65,width:240,height:38,fill:u,stroke:h}),c.jsx("rect",{x:20,y:114,width:240,height:38,fill:u,stroke:h}),c.jsx("rect",{x:20,y:54,width:240,height:11,fill:d,stroke:h,strokeDasharray:"2 2"}),c.jsx("rect",{x:20,y:103,width:240,height:11,fill:d,stroke:h,strokeDasharray:"2 2"}),c.jsx("text",{x:20+240/2,y:16+38/2+4,textAnchor:"middle",fontSize:"11",fill:"hsl(var(--foreground))",children:"Lamelle"}),c.jsx("text",{x:20+240/2,y:65+38/2+4,textAnchor:"middle",fontSize:"11",fill:"hsl(var(--foreground))",children:"Lamelle"}),c.jsx("text",{x:20+240/2,y:114+38/2+4,textAnchor:"middle",fontSize:"11",fill:"hsl(var(--foreground))",children:"Lamelle"}),c.jsx("text",{x:20+240/2,y:54+11/2+3,textAnchor:"middle",fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"Nut (11 mm)"}),c.jsx("text",{x:20+240/2,y:103+11/2+3,textAnchor:"middle",fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"Nut (11 mm)"}),c.jsx("line",{x1:48,y1:65,x2:48,y2:103,stroke:p,strokeWidth:"2",markerStart:"url(#nut-arrow-up)",markerEnd:"url(#nut-arrow-up)"}),c.jsx("rect",{x:52,y:168/2-7,width:"68",height:"14",rx:"2",fill:"hsl(var(--background))",opacity:"0.9"}),c.jsx("text",{x:56,y:168/2+4,textAnchor:"start",fontSize:"10",fill:p,fontWeight:"700",children:"exkl. 90,8 mm"}),c.jsx("line",{x1:232,y1:65,x2:232,y2:114,stroke:p,strokeWidth:"2",markerStart:"url(#nut-arrow-up)",markerEnd:"url(#nut-arrow-up)"}),c.jsx("rect",{x:160,y:179/2-7,width:"68",height:"14",rx:"2",fill:"hsl(var(--background))",opacity:"0.9"}),c.jsx("text",{x:224,y:179/2+4,textAnchor:"end",fontSize:"10",fill:p,fontWeight:"700",children:"inkl. 101,8 mm"})]}),c.jsx("p",{className:"text-[11px] italic text-muted-foreground",children:"In der Darstellung ist ein Lamellenabstand repräsentativ zur Erläuterung der Unterschiede anhand des Standardlamellenabstands (101,8 mm inkl. Nut = 90,8 mm exkl. Nut)."}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1.5",children:[c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Inkl. Nut"})," = vollständiges Lamellenraster (eine Lamelle plus eine Nut). Standard: ",c.jsx("strong",{className:"text-foreground",children:"101,8 mm"}),". Dies ist das technische MaÃ, mit dem intern gerechnet wird."]}),c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Exkl. Nut"})," = reine Höhe einer Lamelle (von Oberkante einer Nut bis Unterkante der nächsten Nut). Standard: ",c.jsx("strong",{className:"text-foreground",children:"90,8 mm"}),". Wenn Sie diesen Wert angeben, rechnen wir intern automatisch +11 mm (Nuthöhe) hinzu."]})]})]})}function eKe(){const m="hsl(var(--muted))",x="hsl(var(--background))",v="hsl(var(--border))",g="hsl(var(--foreground))",b="hsl(0 75% 50%)",y="hsl(45 90% 45%)";return c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"font-medium text-sm",children:"Sockel- & Kopfabstand"}),c.jsxs("svg",{viewBox:"0 0 300 170",className:"w-full h-auto max-h-[180px]","aria-hidden":"true",children:[c.jsxs("defs",{children:[c.jsx("marker",{id:"sk-arrow-red",viewBox:"0 0 10 10",refX:"5",refY:"0",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:c.jsx("path",{d:"M0,10 L5,0 L10,10 z",fill:b})}),c.jsx("marker",{id:"sk-arrow-yellow",viewBox:"0 0 10 10",refX:"5",refY:"0",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:c.jsx("path",{d:"M0,10 L5,0 L10,10 z",fill:y})})]}),c.jsx("rect",{x:60,y:12,width:180,height:144,fill:m,stroke:v}),c.jsx("rect",{x:60,y:44,width:180,height:10,fill:x,stroke:v,strokeDasharray:"2 2"}),c.jsx("rect",{x:60,y:76,width:180,height:10,fill:x,stroke:v,strokeDasharray:"2 2"}),c.jsx("rect",{x:60,y:108,width:180,height:10,fill:x,stroke:v,strokeDasharray:"2 2"}),c.jsx("line",{x1:56,y1:12,x2:244,y2:12,stroke:g,strokeWidth:"2"}),c.jsx("line",{x1:56,y1:156,x2:244,y2:156,stroke:g,strokeWidth:"2"}),c.jsx("text",{x:248,y:16,fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"Wand-Oberkante"}),c.jsx("text",{x:248,y:160,fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"Wand-Unterkante"}),c.jsx("text",{x:52,y:44+10/2+3,textAnchor:"end",fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"oberste Nut"}),c.jsx("text",{x:52,y:76+10/2+3,textAnchor:"end",fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"1. Nut"}),c.jsx("text",{x:52,y:108+10/2+3,textAnchor:"end",fontSize:"9",fill:"hsl(var(--muted-foreground))",children:"unterste Nut"}),c.jsx("line",{x1:216,y1:12,x2:216,y2:54,stroke:b,strokeWidth:"2",markerStart:"url(#sk-arrow-red)",markerEnd:"url(#sk-arrow-red)"}),c.jsx("rect",{x:170,y:66/2-7,width:"42",height:"14",rx:"2",fill:"hsl(var(--background))",opacity:"0.9"}),c.jsx("text",{x:212,y:66/2+4,textAnchor:"end",fontSize:"10",fill:b,fontWeight:"700",children:"K (inkl.)"}),c.jsx("line",{x1:84,y1:118,x2:84,y2:156,stroke:b,strokeWidth:"2",markerStart:"url(#sk-arrow-red)",markerEnd:"url(#sk-arrow-red)"}),c.jsx("rect",{x:88,y:274/2-7,width:"44",height:"14",rx:"2",fill:"hsl(var(--background))",opacity:"0.9"}),c.jsx("text",{x:92,y:274/2+4,textAnchor:"start",fontSize:"10",fill:b,fontWeight:"700",children:"S (exkl.)"}),c.jsx("line",{x1:60+180/2,y1:54,x2:60+180/2,y2:86,stroke:y,strokeWidth:"2",markerStart:"url(#sk-arrow-yellow)",markerEnd:"url(#sk-arrow-yellow)"}),c.jsx("line",{x1:60+180/2,y1:86,x2:60+180/2,y2:118,stroke:y,strokeWidth:"2",markerStart:"url(#sk-arrow-yellow)",markerEnd:"url(#sk-arrow-yellow)"}),c.jsx("rect",{x:60+180/2+4,y:140/2-7,width:"58",height:"14",rx:"2",fill:"hsl(var(--background))",opacity:"0.9"}),c.jsx("text",{x:60+180/2+8,y:140/2+4,textAnchor:"start",fontSize:"10",fill:y,fontWeight:"700",children:"L (inkl. Nut)"})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-1.5",children:[c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Sockelabstand S"})," = Abstand von der Wand-Unterkante bis zur Unterkante der ",c.jsx("strong",{children:"untersten"})," Nut â ",c.jsx("strong",{children:"exkl. Nut"}),". Mindestens"," ",c.jsxs("strong",{className:"text-foreground",children:[th(um)," mm"]}),"."]}),c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Kopfabstand K"})," = Abstand von der Unterkante der"," ",c.jsx("strong",{children:"obersten"})," Nut bis zur Wand-Oberkante â ",c.jsx("strong",{children:"inkl. Nut"}),". Mindestens"," ",c.jsxs("strong",{className:"text-foreground",children:[th(sB)," mm"]}),"."]}),c.jsxs("p",{children:["Im Automatik-Modus werden Sockel und Kopf symmetrisch ausgemittelt (Differenz = ",yu," mm Nuthöhe)."]})]})]})}function tKe(){const[t]=Al(),e=t.get("embed")==="true";return c.jsx(Ed,{slug:"spacewall",children:c.jsx("div",{className:e?"":"min-h-screen bg-[#F5F5F5]",children:c.jsx(Z$e,{})})})}const KP={chrom:"Chrom",holzfachboden:"Holzfachboden",holzfachbodentraeger:"Holzfachbodenträger",kunststoff:"Kunststoff",schwarz:"Schwarz"};function nKe(t){const e=t.split(/[\s,;]+/).map(a=>
4946a.trim()).filter(Boolean),n=[],r=[],i=new Set,s=new Set;for(const a of e){if(!/^[A-Za-z0-9_\-\.]+$/.test(a)){r.push(a);continue}const o=a.toLowerCase();i.has(o)?s.add(a):(i.add(o),n.push(a))}return{valid:n,invalid:r,duplicatesInInput:Array.from(s)}}function rKe({open:t,onOpenChange:e,onImported:n}){const[r,i]=E.useState(""),[s,a]=E.useState("chrom"),[o,l]=E.useState(0),[u,d]=E.useState(null),[h,p]=E.useState(!1);function f(){i(""),d(null),l(0)}async function m(){const{valid:v,invalid:g,duplicatesInInput:b}=nKe(r);if(!v.length&&!g.length){dn({title:"Keine SKUs eingegeben",variant:"destructive"});return}p(!0);try{const y=[];let A=0;for(;;){const{data:C,error:R}=await Ot.from("spacewall_warentraeger").select("sku, kategorie").range(A,A+1e3-1);if(R)throw R;const P=C??[];if(y.push(...P),P.length<1e3)break;A+=1e3}const k=new Map(y.map(C=>[C.sku.toLowerCase(),C.kategorie])),M=[],T=[];for(const C of v){const R=k.get(C.toLowerCase());R?T.push({sku:C,kategorie:R}):M.push(C)}d({neu:M,vorhanden:T,doppelt_in_eingabe:b,ungueltig:g})}catch(y){dn({title:"Prüfung fehlgeschlagen",description:y.message,variant:"destructive"})}finally{p(!1)}}async function x(){if(!(!u||!u.neu.length)){p(!0);try{const v=u.neu.map(b=>({sku:b,kategorie:s,sortierung:o,beschreibung:null}));for(let b=0;b<v.length;b+=200){const y=v.slice(b,b+200),{error:S}=await Ot.from("spacewall_warentraeger").insert(y);if(S)throw S}const g=[`${u.neu.length} importiert`,u.vorhanden.length?`${u.vorhanden.length} übersprungen (bereits vorhanden)`:null,u.ungueltig.length?`${u.ungueltig.length} ungültig`:null].filter(Boolean);dn({title:"Massen-Import abgeschlossen",description:g.join(" · ")}),n(),d({...u,neu:[]})}catch(v){dn({title:"Import fehlgeschlagen",description:v.message,variant:"destructive"})}finally{p(!1)}}}return c.jsx(qf,{open:t,onOpenChange:v=>{v||f(),e(v)},children:c.jsxs(jh,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[c.jsx(Xf,{children:c.jsx(Yf,{children:"Massen-Import Warenträger"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-xs font-medium mb-1 block",children:"Kategorie"}),c.jsxs(vl,{value:s,onValueChange:v=>a(v),children:[c.jsx(qo,{children:c.jsx(yl,{})}),c.jsx(Xo,{children:Object.keys(KP).map(v=>c.jsx(Us,{value:v,children:KP[v]},v))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs font-medium mb-1 block",children:"Sortierung (Standard 0)"}),c.jsx(yr,{type:"number",value:o,onChange:v=>l(Number(v.target.value)||0)})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs font-medium mb-1 block",children:"SKUs (eine pro Zeile, oder durch Komma/Leerzeichen getrennt)"}),c.jsx(pA,{value:r,onChange:v=>{i(v.target.value),d(null)},placeholder:`TW-401-50-OM 4947TW-402-30-OM 4948â¦`,rows:10,className:"font-mono text-xs"})]}),u&&c.jsxs("div",{className:"space-y-2 border border-border rounded p-3 bg-muted/30",children:[c.jsx("div",{className:"text-sm font-medium",children:"Prüf-Ergebnis"}),c.jsxs("div",{className:"text-sm",children:[c.jsxs("span",{className:"text-primary",children:["â Neu: ",u.neu.length]})," · ",c.jsxs("span",{className:"text-amber-600",children:["â ï¸ Bereits vorhanden: ",u.vorhanden.length]})," · ",c.jsxs("span",{className:"text-destructive",children:["â Ungültig: ",u.ungueltig.length]}),u.doppelt_in_eingabe.length>0&&c.jsxs(c.Fragment,{children:[" "," · ",c.jsxs("span",{className:"text-muted-foreground",children:["Doppelt in Eingabe: ",u.doppelt_in_eingabe.length]})]})]}),u.vorhanden.length>0&&c.jsxs("details",{className:"text-xs",children:[c.jsx("summary",{className:"cursor-pointer text-amber-700 font-medium",children:"Bereits vorhanden (werden übersprungen)"}),c.jsx("div",{className:"mt-2 max-h-40 overflow-y-auto font-mono",children:u.vorhanden.map(v=>c.jsxs("div",{children:[v.sku," ",c.jsxs("span",{className:"text-muted-foreground",children:["â ",KP[v.kategorie]??v.kategorie]})]},v.sku))})]}),u.ungueltig.length>0&&c.jsxs("details",{className:"text-xs",children:[c.jsx("summary",{className:"cursor-pointer text-destructive font-medium",children:"Ungültige Einträge"}),c.jsx("div",{className:"mt-2 max-h-32 overflow-y-auto font-mono",children:u.ungueltig.map((v,g)=>c.jsx("div",{children:v},g))})]}),u.doppelt_in_eingabe.length>0&&c.jsxs("details",{className:"text-xs",children:[c.jsx("summary",{className:"cursor-pointer text-muted-foreground font-medium",children:"Doppelt in Eingabe"}),c.jsx("div",{className:"mt-2 max-h-32 overflow-y-auto font-mono",children:u.doppelt_in_eingabe.map(v=>c.jsx("div",{children:v},v))})]})]})]}),c.jsxs(X5,{className:"gap-2",children:[c.jsx(Pt,{variant:"outline",onClick:()=>{f(),e(!1)},children:"SchlieÃen"}),!u||u.neu.length===0?c.jsx(Pt,{onClick:m,disabled:h||!r.trim(),children:h?"Prüfeâ¦":"Prüfen"}):c.jsxs(c.Fragment,{children:[c.jsx(Pt,{variant:"outline",onClick:m,disabled:h,children:"Erneut prüfen"}),c.jsx(Pt,{onClick:x,disabled:h,children:h?"Importiereâ¦":`${u.neu.length} neue SKUs importieren`})]})]})]})})}/*! @license DOMPurify 3.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.7/LICENSE */function JK(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function iKe(t){if(Array.isArray(t))return t}function sKe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==e);l=!0);}catch(d){u=!0,i=d}
vendor: 6,705 bytes, lines 4948-4949
4948finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function aKe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4949In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oKe(t,e){return iKe(t)||sKe(t,e)||lKe(t,e)||aKe()}function lKe(t,e){if(t){if(typeof t=="string")return JK(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JK(t,e):void 0}}const iue=Object.entries,ZK=Object.setPrototypeOf,cKe=Object.isFrozen,uKe=Object.getPrototypeOf,dKe=Object.getOwnPropertyDescriptor;let wl=Object.freeze,ku=Object.seal,yy=Object.create,sue=typeof Reflect<"u"&&Reflect,aB=sue.apply,oB=sue.construct;wl||(wl=function(e){return e});ku||(ku=function(e){return e});aB||(aB=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)});oB||(oB=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const ny=ga(Array.prototype.forEach),hKe=ga(Array.prototype.lastIndexOf),QK=ga(Array.prototype.pop),ry=ga(Array.prototype.push),fKe=ga(Array.prototype.splice),ol=Array.isArray,B_=ga(String.prototype.toLowerCase),qP=ga(String.prototype.toString),eq=ga(String.prototype.match),iy=ga(String.prototype.replace),tq=ga(String.prototype.indexOf),pKe=ga(String.prototype.trim),mKe=ga(Number.prototype.toString),gKe=ga(Boolean.prototype.toString),nq=typeof BigInt>"u"?null:ga(BigInt.prototype.toString),rq=typeof Symbol>"u"?null:ga(Symbol.prototype.toString),Rs=ga(Object.prototype.hasOwnProperty),x_=ga(Object.prototype.toString),co=ga(RegExp.prototype.test),v_=xKe(TypeError);function ga(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return aB(t,e,r)}}function xKe(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oB(t,n)}}function kr(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B_;if(ZK&&ZK(t,null),!ol(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=n(i);s!==i&&(cKe(e)||(e[r]=s),i=s)}t[i]=!0}return t}function vKe(t){for(let e=0;e<t.length;e++)Rs(t,e)||(t[e]=null);return t}function zo(t){const e=yy(null);for(const r of iue(t)){var n=oKe(r,2);const i=n[0],s=n[1];Rs(t,i)&&(ol(s)?e[i]=vKe(s):s&&typeof s=="object"&&s.constructor===Object?e[i]=zo(s):e[i]=s)}return e}function yKe(t){switch(typeof t){case"string":return t;case"number":return mKe(t);case"boolean":return gKe(t);case"bigint":return nq?nq(t):"0";case"symbol":return rq?rq(t):"Symbol()";case"undefined":return x_(t);case"function":case"object":{if(t===null)return x_(t);const e=t,n=Yd(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:x_(r)}return x_(t)}default:return x_(t)}}function Yd(t,e){for(;t!==null;){const r=dKe(t,e);if(r){if(r.get)return ga(r.get);if(typeof r.value=="function")return ga(r.value)}t=uKe(t)}function n(){return null}return n}function bKe(t){try{return co(t,""),!0}catch{return!1}}const iq=wl(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),XP=wl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),YP=wl(["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"]),wKe=wl(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),JP=wl(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_Ke=wl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sq=wl(["#text"]),aq=wl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
4949spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ZP=wl(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),oq=wl(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vC=wl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),SKe=ku(/{{[\w\W]*|^[\w\W]*}}/g),AKe=ku(/<%[\w\W]*|^[\w\W]*%>/g),EKe=ku(/\${[\w\W]*/g),kKe=ku(/^data-[\-\w.\u00B7-\uFFFF]+$/),CKe=ku(/^aria-[\-\w]+$/),lq=ku(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NKe=ku(/^(?:\w+script|data):/i),TKe=ku(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),MKe=ku(/^html$/i),RKe=ku(/^[a-z][.\w]*(-[.\w]+)+$/i),qd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},jKe=function(){return typeof window>"u"?null:window},PKe=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;
vendor: 4,830 bytes, line 4949
4949const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},cq=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function aue(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:jKe();const e=ft=>aue(ft);if(e.version="3.4.7",e.removed=[],!t||!t.document||t.document.nodeType!==qd.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,i=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,a=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const d=t.DOMParser,h=t.trustedTypes,p=o.prototype,f=Yd(p,"cloneNode"),m=Yd(p,"remove"),x=Yd(p,"nextSibling"),v=Yd(p,"childNodes"),g=Yd(p,"parentNode"),b=Yd(p,"shadowRoot"),y=Yd(p,"attributes"),S=a&&a.prototype?Yd(a.prototype,"nodeType"):null,A=a&&a.prototype?Yd(a.prototype,"nodeName"):null;if(typeof s=="function"){const ft=n.createElement("template");ft.content&&ft.content.ownerDocument&&(n=ft.content.ownerDocument)}let k,M="";const T=n,C=T.implementation,R=T.createNodeIterator,P=T.createDocumentFragment,j=T.getElementsByTagName,G=r.importNode;let B=cq();e.isSupported=typeof iue=="function"&&typeof g=="function"&&C&&C.createHTMLDocument!==void 0;const $=SKe,U=AKe,Z=EKe,V=kKe,W=CKe,O=NKe,Y=TKe,z=RKe;let I=lq,q=null;const te=kr({},[...iq,...XP,...YP,...JP,...sq]);let se=null;const ie=kr({},[...aq,...ZP,...oq,...vC]);let le=Object.seal(yy(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,Ee=null;const ae=Object.seal(yy(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Q=!0,we=!0,Ae=!1,K=!0,pe=!1,ye=!0,Se=!1,ee=!1,re=!1,me=!1,Ge=!1,He=!1,_e=!0,Ne=!1;const ue="user-content-";let Ce=!0,Ke=!1,Qe={},je=null;const We=kr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let xt=null;const et=kr({},["audio","video","img","source","image","track"]);let Je=null;const Ze=kr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let lt=ut,Fe=!1,Le=null;const bt=kr({},[Me,Xe,ut],qP);let dt=kr({},["mi","mo","mn","ms","mtext"]),Nt=kr({},["annotation-xml"]);const _t=kr({},["title","style","font","a","script"]);let Lt=null;const Dt=["application/xhtml+xml","text/html"],en="text/html";let Mt=null,nn=null;const Tn=n.createElement("form"),Fn=function(ve){return ve instanceof RegExp||ve instanceof Function},lr=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nn&&nn===ve)return;(!ve||typeof ve!="object")&&(ve={}),ve=zo(ve),Lt=Dt.indexOf(ve.PARSER_MEDIA_TYPE)===-1?en:ve.PARSER_MEDIA_TYPE,Mt=Lt==="application/xhtml+xml"?qP:B_,q=Rs(ve,"ALLOWED_TAGS")&&ol(ve.ALLOWED_TAGS)?kr({},ve.ALLOWED_TAGS,Mt):te,se=Rs(ve,"ALLOWED_ATTR")&&ol(ve.ALLOWED_ATTR)?kr({},ve.ALLOWED_ATTR,Mt):ie,Le=Rs(ve,"ALLOWED_NAMESPACES")&&ol(ve.ALLOWED_NAMESPACES)?kr({},ve.ALLOWED_NAMESPACES,qP):bt,Je=Rs(ve,"ADD_URI_SAFE_ATTR")&&ol(ve.ADD_URI_SAFE_ATTR)?kr(zo(Ze),ve.ADD_URI_SAFE_ATTR,Mt):Ze,xt=Rs(ve,"ADD_DATA_URI_TAGS")&&ol(ve.ADD_DATA_URI_TAGS)?kr(zo(et),ve.ADD_DATA_URI_TAGS,Mt):et,je=Rs(ve,"FORBID_CONTENTS")&&ol(ve.FORBID_CONTENTS)?kr({},ve.FORBID_CONTENTS,Mt):We,xe=Rs(ve,"FORBID_TAGS")&&ol(ve.FORBID_TAGS)?kr({},ve.FORBID_TAGS,Mt):zo({}),Ee=Rs(ve,"FORBID_ATTR")&&ol(ve.FORBID_ATTR)?kr({},ve.FORBID_ATTR,Mt):zo({}),Qe=Rs(ve,"USE_PROFILES")?ve.USE_PROFILES&&typeof ve.USE_PROFILES=="object"?zo(ve.USE_PROFILES):ve.USE_PROFILES:!1,Q=ve.ALLOW_ARIA_ATTR!==!1,we=ve.ALLOW_DATA_ATTR!==!1,Ae=ve.ALLOW_UNKNOWN_PROTOCOLS||!1,K=ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=ve.SAFE_FOR_TEMPLATES||!1,ye=ve.SAFE_FOR_XML!==!1,Se=ve.WHOLE_DOCUMENT||!1,me=ve.RETURN_DOM||!1,Ge=ve.RETURN_DOM_FRAGMENT||!1,He=ve.RETURN_TRUSTED_TYPE||!1,re=ve.FORCE_BODY||!1,_e=ve.SANITIZE_DOM!==!1,Ne=ve.SANITIZE_NAMED_PROPS||!1,Ce=ve.KEEP_CONTENT!==!1,Ke=ve.IN_PLACE||!1,I=bKe(ve.ALLOWED_URI_REGEXP)?ve.ALLOWED_URI_REGEXP:lq,lt=typeof ve.NAMESPACE=="str
4949ing"?ve.NAMESPACE:ut,dt=Rs(ve,"MATHML_TEXT_INTEGRATION_POINTS")&&ve.MATHML_TEXT_INTEGRATION_POINTS&&typeof ve.MATHML_TEXT_INTEGRATION_POINTS=="object"?zo(ve.MATHML_TEXT_INTEGRATION_POINTS):kr({},["mi","mo","mn","ms","mtext"]),Nt=Rs(ve,"HTML_INTEGRATION_POINTS")&&ve.HTML_INTEGRATION_POINTS&&typeof ve.HTML_INTEGRATION_POINTS=="object"?zo(ve.HTML_INTEGRATION_POINTS):kr({},["annotation-xml"]);const rt=Rs(ve,"CUSTOM_ELEMENT_HANDLING")&&ve.CUSTOM_ELEMENT_HANDLING&&typeof ve.CUSTOM_ELEMENT_HANDLING=="object"?zo(ve.CUSTOM_ELEMENT_HANDLING):yy(null);if(le=yy(null),Rs(rt,"tagNameCheck")&&Fn(rt.tagNameCheck)&&(le.tagNameCheck=rt.tagNameCheck),Rs(rt,"attributeNameCheck")&&Fn(rt.attributeNameCheck)&&(le.attributeNameCheck=rt.attributeNameCheck),Rs(rt,"allowCustomizedBuiltInElements")&&typeof rt.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=rt.allowCustomizedBuiltInElements),pe&&(we=!1),Ge&&(me=!0),Qe&&(q=kr({},sq),se=yy(null),Qe.html===!0&&(kr(q,iq),kr(se,aq)),Qe.svg===!0&&(kr(q,XP),kr(se,ZP),kr(se,vC)),Qe.svgFilters===!0&&(kr(q,YP),kr(se,ZP),kr(se,vC)),Qe.mathMl===!0&&(kr(q,JP),kr(se,oq),kr(se,vC))),ae.tagCheck=null,ae.attributeCheck=null,Rs(ve,"ADD_TAGS")&&(typeof ve.ADD_TAGS=="function"?ae.tagCheck=ve.ADD_TAGS:ol(ve.ADD_TAGS)&&(q===te&&(q=zo(q)),kr(q,ve.ADD_TAGS,Mt))),Rs(ve,"ADD_ATTR")&&(typeof ve.ADD_ATTR=="function"?ae.attributeCheck=ve.ADD_ATTR:ol(ve.ADD_ATTR)&&(se===ie&&(se=zo(se)),kr(se,ve.ADD_ATTR,Mt))),Rs(ve,"ADD_URI_SAFE_ATTR")&&ol(ve.ADD_URI_SAFE_ATTR)&&kr(Je,ve.ADD_URI_SAFE_ATTR,Mt),Rs(ve,"FORBID_CONTENTS")&&ol(ve.FORBID_CONTENTS)&&(je===We&&(je=zo(je)),kr(je,ve.FORBID_CONTENTS,Mt)),Rs(ve,"ADD_FORBID_CONTENTS")&&ol(ve.ADD_FORBID_CONTENTS)&&(je===We&&(je=zo(je)),kr(je,ve.ADD_FORBID_CONTENTS,Mt)),Ce&&(q["#text"]=!0),Se&&kr(q,["html","head","body"]),q.table&&(kr(q,["tbody"]),delete xe.tbody),ve.TRUSTED_TYPES_POLICY){if(typeof ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw v_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw v_('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=ve.TRUSTED_TYPES_POLICY,M=k.createHTML("")}else k===void 0&&(k=PKe(h,i)),k!==null&&typeof M=="string"&&(M=k.createHTML(""));(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&q===te&&(q=zo(q)),B.uponSanitizeAttribute.length>0&&se===ie&&(se=zo(se)),wl&&wl(ve),nn=ve},mr=kr({},[...XP,...YP,...wKe]),gr=kr({},[...JP,..._Ke]),br=function(ve){let rt=g(ve);(!rt||!rt.tagName)&&(rt={namespaceURI:lt,tagName:"template"});const At=B_(ve.tagName),Gt=B_(rt.tagName);return Le[ve.namespaceURI]?ve.namespaceURI===Xe?rt.namespaceURI===ut?At==="svg":rt.namespaceURI===Me?At==="svg"&&(Gt==="annotation-xml"||dt[Gt]):!!mr[At]:ve.namespaceURI===Me?rt.namespaceURI===ut?At==="math":rt.namespaceURI===Xe?At==="math"&&Nt[Gt]:!!gr[At]:ve.namespaceURI===ut?rt.namespaceURI===Xe&&!Nt[Gt]||rt.namespaceURI===Me&&!dt[Gt]?!1:!gr[At]&&(_t[At]||!mr[At]):!!(Lt==="application/xhtml+xml"&&Le[ve.namespaceURI]):!1},sn=function(ve){ry(e.removed,{element:ve});try{g(ve).removeChild(ve)}catch{m(ve)}},Mr=function(ve,rt){try{ry(e.removed,{attribute:rt.getAttributeNode(ve),from:rt})}catch{ry(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(ve),ve==="is")if(me||Ge)try{sn(rt)}catch{}else try{rt.setAttribute(ve,"")}catch{}},yi=function(ve){let rt=null,At=null;if(re)ve="<remove></remove>"+ve;else{const zt=eq(ve,/^[\r\n\t ]+/);At=zt&&zt[0]}Lt==="application/xhtml+xml"&<===ut&&(ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ve+"</body></html>");const Gt=k?k.createHTML(ve):ve;if(lt===ut)try{rt=new d().parseFromString(Gt,Lt)}catch{}if(!rt||!rt.documentElement){rt=C.createDocument(lt,"template",null);try{rt.documentElement.innerHTML=Fe?M:Gt}catch{}}const Wt=rt.body||rt.documentElement;return ve&&At&&Wt.insertBefore(n.createTextNode(At),Wt.childNodes[0]||null),lt===ut?j.call(rt,Se?"html":"body")[0]:Se?rt.documentElement:Wt},de=function(ve){return R.call(ve.ownerDocument||ve,ve,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ke=function(ve){ve.normalize();const rt=R.call(ve.ownerDocument||ve,ve,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let At=rt.nextNode();for(;At;){let Gt=At.data;ny([$,U,Z],Wt=>{Gt=iy(Gt,Wt," ")}),At.data=Gt,At=rt.nextNode()}},Ye=function(ve){const rt=A?A(ve):null;return typeof rt!="string"||Mt(rt)!=="form"?!1:typeof ve.nodeName!="string"||typeof ve.textContent!="string"||typeof ve.removeChild!="function"||ve.attributes!==y(ve)||typeof ve.removeAttribute!="function"||typeof ve.setAttribute!="function"||typeof ve.namespaceURI!="string"||typeof ve.insertBefore!="function"||typeof ve.hasChildNodes!="function"||ve.nodeType!==S(ve)||ve.childNodes!==v(ve)}
vendor: 3,411 bytes, line 4949
4949,ce=function(ve){if(!S||typeof ve!="object"||ve===null)return!1;try{return S(ve)===qd.documentFragment}catch{return!1}},Pe=function(ve){if(!S||typeof ve!="object"||ve===null)return!1;try{return typeof S(ve)=="number"}catch{return!1}};function De(ft,ve,rt){ny(ft,At=>{At.call(e,ve,rt,nn)})}const qe=function(ve){let rt=null;if(De(B.beforeSanitizeElements,ve,null),Ye(ve))return sn(ve),!0;const At=Mt(ve.nodeName);if(De(B.uponSanitizeElement,ve,{tagName:At,allowedTags:q}),ye&&ve.hasChildNodes()&&!Pe(ve.firstElementChild)&&co(/<[/\w!]/g,ve.innerHTML)&&co(/<[/\w!]/g,ve.textContent)||ye&&ve.namespaceURI===ut&&At==="style"&&Pe(ve.firstElementChild)||ve.nodeType===qd.progressingInstruction||ye&&ve.nodeType===qd.comment&&co(/<[/\w]/g,ve.data))return sn(ve),!0;if(xe[At]||!(ae.tagCheck instanceof Function&&ae.tagCheck(At))&&!q[At]){if(!xe[At]&&vt(At)&&(le.tagNameCheck instanceof RegExp&&co(le.tagNameCheck,At)||le.tagNameCheck instanceof Function&&le.tagNameCheck(At)))return!1;if(Ce&&!je[At]){const Wt=g(ve),zt=v(ve);if(zt&&Wt){const Ut=zt.length;for(let pn=Ut-1;pn>=0;--pn){const an=f(zt[pn],!0);Wt.insertBefore(an,x(ve))}}}return sn(ve),!0}return(S?S(ve):ve.nodeType)===qd.element&&!br(ve)||(At==="noscript"||At==="noembed"||At==="noframes")&&co(/<\/no(script|embed|frames)/i,ve.innerHTML)?(sn(ve),!0):(pe&&ve.nodeType===qd.text&&(rt=ve.textContent,ny([$,U,Z],Wt=>{rt=iy(rt,Wt," ")}),ve.textContent!==rt&&(ry(e.removed,{element:ve.cloneNode()}),ve.textContent=rt)),De(B.afterSanitizeElements,ve,null),!1)},$e=function(ve,rt,At){if(Ee[rt]||_e&&(rt==="id"||rt==="name")&&(At in n||At in Tn))return!1;const Gt=se[rt]||ae.attributeCheck instanceof Function&&ae.attributeCheck(rt,ve);if(!(we&&!Ee[rt]&&co(V,rt))){if(!(Q&&co(W,rt))){if(!Gt||Ee[rt]){if(!(vt(ve)&&(le.tagNameCheck instanceof RegExp&&co(le.tagNameCheck,ve)||le.tagNameCheck instanceof Function&&le.tagNameCheck(ve))&&(le.attributeNameCheck instanceof RegExp&&co(le.attributeNameCheck,rt)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(rt,ve))||rt==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&co(le.tagNameCheck,At)||le.tagNameCheck instanceof Function&&le.tagNameCheck(At))))return!1}else if(!Je[rt]){if(!co(I,iy(At,Y,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&ve!=="script"&&tq(At,"data:")===0&&xt[ve])){if(!(Ae&&!co(O,iy(At,Y,"")))){if(At)return!1}}}}}}return!0},mt=kr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vt=function(ve){return!mt[B_(ve)]&&co(z,ve)},wt=function(ve){De(B.beforeSanitizeAttributes,ve,null);const rt=ve.attributes;if(!rt||Ye(ve))return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se,forceKeepAttr:void 0};let Gt=rt.length;for(;Gt--;){const Wt=rt[Gt],zt=Wt.name,Ut=Wt.namespaceURI,pn=Wt.value,an=Mt(zt),Cn=pn;let on=zt==="value"?Cn:pKe(Cn);if(At.attrName=an,At.attrValue=on,At.keepAttr=!0,At.forceKeepAttr=void 0,De(B.uponSanitizeAttribute,ve,At),on=At.attrValue,Ne&&(an==="id"||an==="name")&&tq(on,ue)!==0&&(Mr(zt,ve),on=ue+on),ye&&co(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,on)){Mr(zt,ve);continue}if(an==="attributename"&&eq(on,"href")){Mr(zt,ve);continue}if(At.forceKeepAttr)continue;if(!At.keepAttr){Mr(zt,ve);continue}if(!K&&co(/\/>/i,on)){Mr(zt,ve);continue}pe&&ny([$,U,Z],wr=>{on=iy(on,wr," ")});
4949const Hr=Mt(ve.nodeName);if(!$e(Hr,an,on)){Mr(zt,ve);continue}if(k&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Ut)switch(h.getAttributeType(Hr,an)){case"TrustedHTML":{on=k.createHTML(on);break}case"TrustedScriptURL":{on=k.createScriptURL(on);break}}if(on!==Cn)try{Ut?ve.setAttributeNS(Ut,zt,on):ve.setAttribute(zt,on),Ye(ve)?sn(ve):QK(e.removed)}catch{Mr(zt,ve)}}De(B.afterSanitizeAttributes,ve,null)},nt=function(ve){let rt=null;const At=de(ve);for(De(B.beforeSanitizeShadowDOM,ve,null);rt=At.nextNode();)if(De(B.uponSanitizeShadowNode,rt,null),qe(rt),wt(rt),ce(rt.content)&&nt(rt.content),(S?S(rt):rt.nodeType)===qd.element){const Wt=b?b(rt):rt.shadowRoot;ce(Wt)&&(Xt(Wt),nt(Wt))}De(B.afterSanitizeShadowDOM,ve,null)},Xt=function(ve){const rt=S?S(ve):ve.nodeType;if(rt===qd.element){const Wt=b?b(ve):ve.shadowRoot;ce(Wt)&&(Xt(Wt),nt(Wt))}const At=v?v(ve):ve.childNodes;if(!At)return;const Gt=[];ny(At,Wt=>{ry(Gt,Wt)});for(const Wt of Gt)Xt(Wt);if(rt===qd.element){const Wt=A?A(ve):null;if(typeof Wt=="string"&&Mt(Wt)==="template"){const zt=ve.content;ce(zt)&&Xt(zt)}}};return e.sanitize=function(ft){let ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,At=null,Gt=null,Wt=null;if(Fe=!ft,Fe&&(ft="<!-->"),typeof ft!="string"&&!Pe(ft)&&(ft=yKe(ft),typeof ft!="string"))throw v_("dirty is not a string, aborting");if(!e.isSupported)return ft;if(ee||lr(ve),e.removed=[],typeof ft=="string"&&(Ke=!1),Ke){const pn=A?A(ft):ft.nodeName;if(typeof pn=="string"){const an=Mt(pn);if(!q[an]||xe[an])throw v_("root node is forbidden and cannot be sanitized in-place")}if(Ye(ft))throw v_("root node is clobbered and cannot be sanitized in-place");Xt(ft)}else if(Pe(ft))rt=yi("<!---->"),At=rt.ownerDocument.importNode(ft,!0),At.nodeType===qd.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?rt=At:rt.appendChild(At),Xt(At);else{if(!me&&!pe&&!Se&&ft.indexOf("<")===-1)return k&&He?k.createHTML(ft):ft;if(rt=yi(ft),!rt)return me?null:He?M:""}rt&&re&&sn(rt.firstChild);const zt=de(Ke?ft:rt);for(;Gt=zt.nextNode();)qe(Gt),wt(Gt),ce(Gt.content)&&nt(Gt.content);if(Ke)return pe&&ke(ft),ft;if(me){if(pe&&ke(rt),Ge)for(Wt=P.call(rt.ownerDocument);rt.firstChild;)Wt.appendChild(rt.firstChild);else Wt=rt;return(se.shadowroot||se.shadowrootmode)&&(Wt=G.call(r,Wt,!0)),Wt}let Ut=Se?rt.outerHTML:rt.innerHTML;return Se&&q["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&co(MKe,rt.ownerDocument.doctype.name)&&(Ut="<!DOCTYPE "+rt.ownerDocument.doctype.name+`> 4950`+Ut),pe&&ny([$,U,Z],pn=>{Ut=iy(Ut,pn," ")}),k&&He?k.createHTML(Ut):Ut},e.setConfig=function(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lr(ft),ee=!0},e.clearConfig=function(){nn=null,ee=!1},e.isValidAttribute=function(ft,ve,rt){nn||lr({});const At=Mt(ft),Gt=Mt(ve);return $e(At,Gt,rt)},e.addHook=function(ft,ve){typeof ve=="function"&&ry(B[ft],ve)},e.removeHook=function(ft,ve){if(ve!==void 0){const rt=hKe(B[ft],ve);return rt===-1?void 0:fKe(B[ft],rt,1)[0]}return QK(B[ft])},e.removeHooks=function(ft){B[ft]=[]},e.removeAllHooks=function(){B=cq()},e}var oue=aue();const LKe=Object.freeze(Object.defineProperty({__proto__:null,default:oue},Symbol.toStringTag,{value:"Module"}));function IKe({html:t,className:e,title:n}){const r=E.useMemo(()=>oue.sanitize(t,{ALLOWED_TAGS:["p","br","span","div","strong","b","em","i","u","s","ul","ol","li","h2","h3","h4","h5","h6","a","small","sub","sup","table","thead","tbody","tr","td","th"],ALLOWED_ATTR:["href","target","rel","title"],ALLOW_DATA_ATTR:!1}),[t]);return c.jsx("div",{className:e,title:n,dangerouslySetInnerHTML:{__html:r}})}const uq={chrom:"Chrom",holzfachboden:"Holzfachboden",holzfachbodentraeger:"Holzfachbodenträger",kunststoff:"Kunststoff",schwarz:"Schwarz"};function DKe(){const[t,e]=E.useState([]),[n,r]=E.useState(new Map),[i,s]=E.useState(""),[a,o]=E.useState(!1),[l,u]=E.useState(!1);async function d(){const{data:v}=await Ot.from("spacewall_warentraeger").select("id, sku, kategorie, sortierung, beschreibung").order("kategorie").order("sortierung"),g=(v??[]).map(A=>({...A,_key:A.id}));e(g);const b=g.map(A=>
4950A.sku).filter(Boolean),y=await H6(b),S=new Map;y.forEach((A,k)=>S.set(k,{bezeichnung:A.bezeichnung,netto_preis:A.netto_preis,bild_url:A.bild_url,beschreibung:A.beschreibung})),r(S)}E.useEffect(()=>{d()},[]);function h(v,g){e(b=>b.map(y=>y._key===v?{...y,...g}:y))}async function p(v){if(!v.sku||!v.kategorie){dn({title:"SKU und Kategorie sind Pflicht",variant:"destructive"});return}o(!0);const g={sku:v.sku,kategorie:v.kategorie,sortierung:v.sortierung??0,beschreibung:v.beschreibung||null},{error:b}=v.id?await Ot.from("spacewall_warentraeger").update(g).eq("id",v.id):await Ot.from("spacewall_warentraeger").insert(g);o(!1),b?dn({title:"Fehler",description:b.message,variant:"destructive"}):(dn({title:"Gespeichert"}),d())}async function f(v,g){if(!v){e(y=>y.filter(S=>S._key!==g));return}if(!confirm("Wirklich löschen?"))return;const{error:b}=await Ot.from("spacewall_warentraeger").delete().eq("id",v);b?dn({title:"Fehler",description:b.message,variant:"destructive"}):d()}const m=t.filter(v=>{var g;return!i||(v.sku??"").toLowerCase().includes(i.toLowerCase())||(((g=n.get(v.sku??""))==null?void 0:g.bezeichnung)??"").toLowerCase().includes(i.toLowerCase())}),x=t.filter(v=>v.sku&&n.has(v.sku)).length;return c.jsxs("section",{className:"space-y-4 border border-border rounded-lg bg-card p-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(dpe,{className:"w-5 h-5 mt-0.5 text-primary"}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-semibold",children:"Warenträger-Auswahl"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["SKUs, die im Konfigurator-Schritt 5 als Warenträger angezeigt werden. Bild, Name, Preis und Beschreibung kommen automatisch aus dem Produktkatalog (Channable).",c.jsx("br",{}),c.jsxs("span",{className:"text-xs",children:[t.length," Einträge · ",x," mit Channable-Daten gematcht."]})]})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(Pt,{variant:"outline",onClick:()=>u(!0),children:[c.jsx(pu,{className:"w-4 h-4 mr-1"})," Massen-Import"]}),c.jsxs(Pt,{onClick:()=>e([{_key:`new-${Date.now()}`,sku:"",kategorie:"chrom",sortierung:0,beschreibung:""},...t]),children:[c.jsx(ph,{className:"w-4 h-4 mr-1"})," Neuer Warenträger"]})]})]}),c.jsx(rKe,{open:l,onOpenChange:u,onImported:d}),c.jsx(yr,{placeholder:"Suchen (SKU oder Name)â¦",value:i,onChange:v=>s(v.target.value),className:"max-w-sm"}),c.jsx("div",{className:"border border-border rounded overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted text-xs uppercase tracking-wide",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left p-2 w-14",children:"Bild"}),c.jsx("th",{className:"text-left p-2",children:"SKU"}),c.jsx("th",{className:"text-left p-2",children:"Name (aus Channable)"}),c.jsx("th",{className:"text-left p-2 w-44",children:"Kategorie"}),c.jsx("th",{className:"text-right p-2 w-20",children:"Sort."}),c.jsx("th",{className:"text-right p-2 w-24",children:"Preis"}),c.jsx("th",{className:"text-left p-2",children:"Beschreibung (Channable)"}),c.jsx("th",{className:"text-left p-2",children:"Override (optional)"}),c.jsx("th",{className:"p-2 w-48"})]})}),c.jsxs("tbody",{children:[m.map(v=>{const g=v.sku?n.get(v.sku):void 0,b=!!g;return c.jsxs("tr",{className:"border-t border-border align-top",children:[c.jsx("td",{className:"p-2",children:g!=null&&g.bild_url?c.jsx("img",{src:g.bild_url,alt:"",className:"w-10 h-10 object-contain rounded border border-border bg-muted"}):c.jsx("div",{className:"w-10 h-10 rounded bg-muted border border-border"})}),c.jsx("td",{className:"p-2",children:c.jsx(yr,{value:v.sku??"",onChange:y=>h(v._key,{sku:y.target.value}),className:"h-8 text-xs font-mono",placeholder:"z. B. TW-401-50-OM"})}),c.jsx("td",{className:"p-2",children:b?c.jsx("span",{className:"text-foreground",children:g==null?void 0:g.bezeichnung}):c.jsx("span",{className:"text-xs text-destructive",children:"â Kein Channable-Match"})}),c.jsx("td",{className:"p-2",children:c.jsxs(vl,{value:v.kategorie??"chrom",onValueChange:y=>h(v._key,{kategorie:y}),children:[c.jsx(qo,{className:"h-8 text-xs",children:c.jsx(yl,{})}),c.jsx(Xo,{children:Object.keys(uq).map(y=>c.jsx(Us,{value:y,children:uq[y]},y))})]})}),c.jsx("td",{className:"p-2",children:c.jsx(yr,{type:"number",value:v.sortierung??0,onChange:y=>h(v._key,{sortierung:Number(y.target.value)}),className:"h-8 text-xs text-right"})}),c.jsx("td",{className:"p-2 text-right text-xs",children:g?g.netto_preis.toLocaleStr
4950ing("de-DE",{style:"currency",currency:"EUR"}):"â"}),c.jsx("td",{className:"p-2 max-w-xs",children:g!=null&&g.beschreibung?c.jsx(IKe,{html:g.beschreibung,className:"text-xs text-muted-foreground line-clamp-3 [&_p]:m-0 [&_ul]:m-0 [&_ul]:pl-4",title:g.beschreibung.replace(/<[^>]*>/g," ").slice(0,400)}):c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"â"})}),c.jsx("td",{className:"p-2",children:c.jsx(pA,{value:v.beschreibung??"",onChange:y=>h(v._key,{beschreibung:y.target.value}),placeholder:"Nur ausfüllen, um Channable-Text zu überschreiben",className:"min-h-[2.25rem] text-xs",rows:1})}),c.jsx("td",{className:"p-2",children:c.jsxs("div",{className:"flex gap-1 justify-end",children:[c.jsx(Pt,{size:"sm",disabled:a,onClick:()=>p(v),children:"Speichern"}),c.jsx(Pt,{size:"icon",variant:"ghost",onClick:()=>f(v.id,v._key),children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]})})]},v._key)}),m.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:9,className:"p-6 text-center text-muted-foreground text-sm",children:"Keine Warenträger angelegt."})})]})]})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Hinweis: Tragen Sie hier nur die SKU (Channable-Artikelnummer) ein. Bild, Name, Preis, Shop-Link und Beschreibung werden automatisch aus der Produktdatenbank geladen. Das Override-Feld nur ausfüllen, wenn der Channable-Text bewusst ersetzt werden soll. Einträge ohne Channable-Match werden im Konfigurator ausgeblendet."})]})}function BKe(){return c.jsxs("div",{className:"space-y-8",children:[c.jsx(Q1,{title:"Produktdaten â Spacewall",tableName:"spacewall_produkte",exportPrefix:"spacewall-produkte",channableLabel:"Spacewall",channableRpc:"enrich_spacewall_produkte_from_produkte"}),c.jsx(DKe,{})]})}function FKe(){const[t,e]=E.useState([]),[n,r]=E.useState(null),i=E.useRef({});async function s(){const{data:d}=await Ot.from("spacewall_farben").select("id, name, hex_swatch, sortierung, profil_farbe, produktbild_url, produktbild_storage_path").order("sortierung");e(d??[])}E.useEffect(()=>{s()},[]);async function a(d){const h={name:d.name,hex_swatch:d.hex_swatch,sortierung:d.sortierung,profil_farbe:d.profil_farbe??"alu"},{error:p}=d.id?await Ot.from("spacewall_farben").update(h).eq("id",d.id):await Ot.from("spacewall_farben").insert(h);p?dn({title:"Fehler",description:p.message,variant:"destructive"}):(dn({title:"Gespeichert"}),s())}async function o(d){if(!confirm("Farbe wirklich löschen? Zugehörige Bilder bleiben bestehen."))return;const{error:h}=await Ot.from("spacewall_farben").delete().eq("id",d);h?dn({title:"Fehler",description:h.message,variant:"destructive"}):s()}async function l(d,h){if(!d.id){dn({title:"Bitte zuerst die Farbe speichern.",variant:"destructive"});return}r(d.id);try{const p=await sA(h,1200,.82),f=`produktbild/${d.id}.webp`,{error:m}=await Ot.storage.from("spacewall-images").upload(f,p,{upsert:!0,contentType:"image/webp",cacheControl:"3600"});if(m)throw m;const{data:x}=Ot.storage.from("spacewall-images").getPublicUrl(f),v=`${x.publicUrl}?v=${Date.now()}`,{error:g}=await Ot.from("spacewall_farben").update({produktbild_url:v,produktbild_storage_path:f}).eq("id",d.id);if(g)throw g;dn({title:"Produktbild hochgeladen"}),s()}catch(p){dn({title:"Upload fehlgeschlagen",description:p.message,variant:"destructive"})}finally{r(null)}}async function u(d){d.id&&confirm("Produktbild entfernen?")&&(d.produktbild_storage_path&&await Ot.storage.from("spacewall-images").remove([d.produktbild_storage_path]),await Ot.from("spacewall_farben").update({produktbild_url:null,produktbild_storage_path:null}).eq("id",d.id),s())}return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Uf,title:"Spacewall Farben",description:`${t.length} Farben · Pro Dekor ein echtes Produktbild der fertig montierten Lamellenwand. Wird dem Kunden im ersten Konfigurator-Schritt zur Auswahl gezeigt.`,actions:c.jsxs(Pt,{onClick:()=>e([{name:"",hex_swatch:"#CCCCCC",sortierung:t.length,profil_farbe:"alu"},...t]),children:[c.jsx(ph,{className:"w-4 h-4 mr-1"})," Neu"]})}),c.jsx("div",{className:"border border-border rounded overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left p-2",children:"Swatch"}),c.jsx("th",{className:"text-left p-2",children:"Name"}),c.jsx("th",{className:"text-left p-2",children:"Hex"}),c.jsx("th",{className:"text-left p-2",children:"Profil"}),c.jsx("th",{className:"text-left p-2",children:"Produktbild (Lamellenwand-Optik)"}),c.jsx("th",{className:"text-right p-2",children:"Sort."}),c.jsx("th",{className:"p-2"})]})}),c.jsxs("tbody",{children:[t.map((d,h)=>c.jsxs("tr",{className:"border-t border-border",children:[c.jsx("td",{className:"p-2",children:c.jsx("span",{className:"inline-block w-6 h-6 rounded-full border border-border",style:{background:d.hex_swatch||D_[d.name]||"#CCC"}})}),c.jsx("td",{className:"p-1",children:c.jsx(yr,{value:d.name,onChange:p=>e(t.map(f=>f===d?{...f,name:p.target.value}:f)),className:"h-8"})}),c.jsx("td",{className:"p-1",children:c.jsx(yr,{value:d.hex_swatch,onChange:p=>e(t.map(f=>f===d?{...f,hex_swatch:p.target.value}:f)),className:"h-8 font-mono"})}),c.jsx("td",{className:"p-1",children:c.jsxs("select",{className:"h-8 border border-input rounded px-2 bg-background text-sm",value:d.profil_farbe??"alu",onChange:p=>e(t.map(f=>f===d?{...f,profil_farbe:p.target.value}:f)),children:[c.jsx("option",{value:"alu",children:"Alu"}),c.jsx("option",{value:"schwarz",children:"Schwarz"})]})}),c.jsx("td",{className:"p-1",children:c.jsxs("div",{className:"flex items-center gap-2",children:[d.produktbild_url?c.jsx("img",{src:d.produktbild_url,alt:"",className:"h-16 w-24 object-cover rounded border border-border"}):c.jsx("div",{className:"h-16 w-24 rounded border border-dashed border-border bg-muted/40"}),c.jsx("input",{ref:p=>{d.id&&(i.current[d.id]=p)},type:"file",accept:"image/*",className:"hidden",onChange:p=>{var m;const f=(m=p.target.files)==null?void 0:m[0];f&&l(d,f),p.currentTarget.value=""}}),c.jsxs(Pt,{size:"sm",variant:"outline",disabled:!d.id||n===d.id,onClick:()=>{var p;return d.id&&((p=i.current[d.id])==null?void 0:p.click())},children:[c.jsx(pu,{className:"w-3.5 h-3.5 mr-1"}),n===d.id?"â¦":d.produktbild_url?"Ersetzen":"Hochladen"]}),d.produktbild_url&&c.jsx(Pt,{size:"icon",variant:"ghost",onClick:()=>u(d),title:"Entfernen",children:c.jsx(yo,{className:"w-4 h-4"})})]})}),c.jsx("td",{className:"p-1",children:c.jsx(yr,{type:"number",value:d.sortierung,onChange:p=>e(t.map(f=>f===d?{...f,sortierung:Number(p.target.value)}:f)),className:"h-8 w-16 text-right"})}),c.jsxs("td",{className:"p-1 flex gap-1",children:[c.jsx(Pt,{size:"sm",onClick:()=>a(d),children:"Speichern"}),d.id&&c.jsx(Pt,{size:"icon",variant:"ghost",onClick:()=>o(d.id),children:c.jsx(yo,{className:"w-4 h-4"})})]})]},d.id??`new-${h}`)),!t.length&&c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"p-6 text-center text-muted-foreground",children:"Keine Farben."})})]})]})})]})}function OKe(){const[t,e]=E.useState([]),[n,r]=E.useState(null),[i,s]=E.useState([]),[a,o]=E.useState(!1);async function l(){const{data:f}=await Ot.from("spacewall_farben").select("*").order("sortierung"),m=f??[];e(m),!n&&m.length&&r(m[0].id)}async function u(f){const{data:m}=await Ot.from("spacewall_farb_bilder").select("*").eq("farbe_id",f).order("sortierung");s(m??[])}E.useEffect(()=>{l()},[]),E.useEffect(()=>{n&&u(n)},[n]);async function d(f){if(n){o(!0);try{const m=f.name.split(".").pop()||"jpg",x=`${n}/${Date.now()}.${m}`,{error:v}=await Ot.storage.from("spacewall-images").upload(x,f);if(v)throw v;const{data:g}=Ot.storage.from("spacewall-images").getPublicUrl(x),b=i.length,{error:y}=await Ot.from("spacewall_farb_bilder").insert({farbe_id:n,bild_url:g.publicUrl,storage_path:x,sortierung:b});if(y)throw y;dn({title:"Bild hochgeladen"}),u(n)}catch(m){dn({title:"Upload fehlgeschlagen",description:m.message,variant:"destructive"})}finally{o(!1)}}}async function h(f){confirm("Bild wirklich löschen?")&&(f.storage_path&&await Ot.storage.from("spacewall-images").remove([f.storage_path]),await Ot.from("spacewall_farb_bilder").delete().eq("id",f.id),n&&u(n))}const p=t.find(f=>f.id===n);return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:xc,title:"Spacewall Bilder",description:"Galerie pro Farbe. Mehrere Bilder pro Farbe möglich."}),c.jsxs("div",{className:"grid lg:grid-cols-[260px_1fr] gap-4",children:[c.jsxs("aside",{className:"border border-border rounded overflow-hidden",children:[c.jsx("div",{className:"text-xs font-semibold p-2 bg-muted",children:"Farben"}),c.jsxs("div",{className:"max-h-[60vh] overflow-y-auto",children:[t.map(f=>c.jsxs("button",{onClick:()=>r(f.id),className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left hover:bg-muted ${n===f.id?"bg-primary/10 text-primary":""}`,children:[c.jsx("span",{className:"w-4 h-4 rounded-full border border-border shrink-0",style:{background:f.hex_swatch}}),c.jsx("span",{className:"truncate",children:f.name})]},f.id)),!t.length&&c.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"Erst Farben anlegen."})]})]}),c.jsx("div",{className:"space-y-3",children:p&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-semibold",children:p.name}),c.jsxs("label",{className:"cursor-pointer",children:[c.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:f=>{var x;const m=(x=f.target.files)==null?void 0:x[0];m&&d(m)}}),c.jsx(Pt,{asChild:!0,disabled:a,children:c.jsxs("span",{children:[c.jsx(pu,{className:"w-4 h-4 mr-1"})," Bild hochladen"]})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:[i.map(f=>c.jsxs("div",{className:"relative border border-border rounded overflow-hidden group",children:[c.jsx("img",{src:f.bild_url,alt:"",className:"w-full aspect-square object-cover"}),c.jsx(Pt,{size:"icon",variant:"destructive",className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity h-7 w-7",onClick:()=>h(f),children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]},f.id)),!i.length&&c.jsx("div",{className:"col-span-full p-8 text-center text-sm text-muted-foreground border border-dashed border-border rounded",children:"Noch keine Bilder."})]})]})})]})]})}const yC={desktop:{label:"Desktop",width:1280,icon:g5},tablet:{label:"Tablet",width:820,icon:b5},mobile:{label:"Mobil",width:390,icon:y5}};function zKe(){const[t,e]=E.useState("desktop"),[n,r]=E.useState(0),i=`${window.location.origin}
4950/spacewall`,s=yC[t].width;return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Vo,title:"Vorschau",description:"Live-Vorschau des Spacewall Lamellenwand-Konfigurators.",actions:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center gap-1 border rounded-md p-1 bg-card",children:Object.keys(yC).map(a=>{const o=yC[a].icon,l=t===a;return c.jsxs(Pt,{variant:l?"default":"ghost",size:"sm",onClick:()=>e(a),className:"gap-1.5",children:[c.jsx(o,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:yC[a].label})]},a)})}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:()=>r(a=>a+1),className:"gap-1.5",children:[c.jsx(b1,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Reset"})]}),c.jsx(Pt,{variant:"outline",size:"sm",asChild:!0,className:"gap-1.5",children:c.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:[c.jsx(_d,{className:"w-4 h-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Neuer Tab"})]})})]})}),c.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted/30 flex justify-center p-4",children:c.jsx("div",{className:"bg-card shadow-lg transition-all duration-300 rounded-md overflow-hidden w-full",style:{maxWidth:s},children:c.jsx("iframe",{src:"/spacewall?embed=true",className:"w-full border-0 block",style:{height:"80vh",minHeight:600},title:"Spacewall-Vorschau"},n)})})]})}function UKe(){return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:ou,title:"Einbettung",description:"Kopieren Sie den Code, um den Spacewall-Konfigurator auf einer beliebigen Webseite einzubinden."}),c.jsx(Km,{configuratorPath:"/spacewall",iframeTitle:"Spacewall-Konfigurator"})]})}const HKe=["Alu Kantenschutz","Alu Abdeckprofil","Alu Abschlussprofil"];function GKe(){const[t,e]=E.useState({}),[n,r]=E.useState(null);async function i(){const{data:u}=await Ot.from("spacewall_kantenschutz_info").select("*"),d={};(u??[]).forEach(h=>{d[h.typ]=h}),e(d)}E.useEffect(()=>{i()},[]);async function s(u,d){const h=t[u];if(h){r(u);try{const p=d.name.split(".").pop()||"jpg",f=`kantenschutz/${h.id}-${Date.now()}.${p}`,{error:m}=await Ot.storage.from("spacewall-images").upload(f,d);if(m)throw m;const{data:x}=Ot.storage.from("spacewall-images").getPublicUrl(f);h.storage_path&&await Ot.storage.from("spacewall-images").remove([h.storage_path]);const{error:v}=await Ot.from("spacewall_kantenschutz_info").update({bild_url:x.publicUrl,storage_path:f}).eq("id",h.id);if(v)throw v;dn({title:"Bild hochgeladen"}),i()}catch(p){dn({title:"Upload fehlgeschlagen",description:p.message,variant:"destructive"})}finally{r(null)}}}async function a(u){const d=t[u];if(!(!d||!confirm("Bild entfernen?"))){r(u);try{d.storage_path&&await Ot.storage.from("spacewall-images").remove([d.storage_path]),await Ot.from("spacewall_kantenschutz_info").update({bild_url:null,storage_path:null}).eq("id",d.id),i()}finally{r(null)}}}async function o(u){const d=t[u];if(d){r(u);try{const{error:h}=await Ot.from("spacewall_kantenschutz_info").update({beschreibung:d.beschreibung}).eq("id",d.id);if(h)throw h;dn({title:"Beschreibung gespeichert"})}catch(h){dn({title:"Speichern fehlgeschlagen",description:h.message,variant:"destructive"})}finally{r(null)}}}function l(u,d){e(h=>({...h,[u]:{...h[u],beschreibung:d}}))}return c.jsxs("div",{className:"space-y-6",children:[c.jsx(es,{icon:cF,title:"Kantenschutz â Bilder & Erklärungen",description:"Pflegen Sie pro Kantenschutz-Typ ein Produktbild und einen Erklärtext. Diese werden im Konfigurator bei Schritt 4 angezeigt."}),c.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:HKe.map(u=>{const d=t[u];return d?c.jsx(VKe,{eintrag:d,busy:n===u,onUpload:h=>s(u,h),onDelete:()=>a(u),onChangeBeschreibung:h=>l(u,h),onSave:()=>o(u)},u):c.jsxs("div",{className:"border border-dashed rounded p-4 text-sm text-muted-foreground",children:[u," â wird geladenâ¦"]},u)})})]})}function VKe({eintrag:t,busy:e,onUpload:n,onDelete:r,onChangeBeschreibung:i,onSave:s}){const a=E.useRef(null);return c.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card flex flex-col",children:[c.jsx("div",{className:"p-3 border-b border-border",children:c.jsx("h3",{className:"font-semibold",children:t.typ})}),c.jsxs("div",{className:"aspect-video bg-muted/40 relative flex items-center justify-center cursor-pointer",onClick:()=>{var o;return(o=a.current)==null?void 0:o.click()},onDragOver:o=>o.preventDefault(),onDrop:o=>{var u;o.preventDefault();const l=(u=o.dataTransfer.files)==null?void 0:u[0];l&&n(l)},children:[t.bild_url?c.jsx("img",{src:t.bild_url,alt:t.typ,className:"w-full h-full object-contain"}):c.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[c.jsx(pu,{className:"h-5 w-5 mx-auto mb-1"}),"Bild hochladen"]}),e&&c.jsx("div",{className:"absolute inset-0 bg-background/70 flex items-center justify-center text-xs",children:"â¦"})]}),c.jsx("input",{ref:a,type:"file",accept:"image/*",className:"hidden",onChange:o=>{var u;const l=(u=o.target.files)==null?void 0:u[0];l&&n(l),o.target.value=""}}),c.jsxs("div",{className:"p-3 space-y-2",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("span",{className:"text-xs text-muted-foreground",children:"Beschreibung"}),t.bild_url&&c.jsxs(Pt,{variant:"ghost",size:"sm",onClick:r,disabled:e,className:"text-destructive h-7",children:[c.jsx(yo,{className:"w-3.5 h-3.5 mr-1"})," Bild"]})]}),c.jsx(pA,{rows:5,value:t.beschreibung,onChange:o=>i(o.target.value),placeholder:"Erklärung für den Kundenâ¦"}),c.jsx(Pt,{size:"sm",onClick:s,disabled:e,className:"w-full",children:"Speichern"})]})]})}const WKe=["wandregal","wandregal-anbau","gondelregal","gondelregal-anbau","paneelwandregal","paneelwandregal-anbau","eckregal"];
4950function zx({konfigurator:t,title:e,description:n}){const[r,i]=E.useState([]),[s,a]=E.useState(!1),[o,l]=E.useState(t??"all"),[u,d]=E.useState("all"),[h,p]=E.useState(null),f=t??(o==="all"?null:o),m=f==="regal",x=m&&u!=="all"?u:null;async function v(){a(!0);const{data:A,error:k}=await Ot.rpc("admin_list_saved_konfigurationen",{p_konfigurator:f,p_regal_typ:x});k?dn({title:"Fehler beim Laden",description:k.message,variant:"destructive"}):i(A??[]),a(!1)}E.useEffect(()=>{v()},[f,x]);async function g(A){const{data:k,error:M}=await Ot.rpc("admin_extend_saved_konfiguration",{p_code:A});if(M){dn({title:"Verlängern fehlgeschlagen",description:M.message,variant:"destructive"});return}dn({title:"Gültigkeit verlängert",description:"Um 90 Tage verlängert."}),i(T=>T.map(C=>C.kurz_code===A?{...C,expires_at:k}:C))}async function b(A){const{error:k}=await Ot.rpc("admin_delete_saved_konfiguration",{p_code:A});if(k){dn({title:"Löschen fehlgeschlagen",description:k.message,variant:"destructive"});return}i(M=>M.filter(T=>T.kurz_code!==A)),dn({title:"Gelöscht"})}const y=e??"Gespeicherte Konfigurationen",S=E.useMemo(()=>n??`${r.length} Konfiguration${r.length===1?"":"en"} mit aktivem Code (90 Tage gültig, verlängert sich bei jedem Aufruf).`,[n,r.length]);return c.jsxs("div",{className:"space-y-4",children:[c.jsx(es,{icon:Cp,title:y,description:S}),c.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[!t&&c.jsxs(vl,{value:o,onValueChange:A=>l(A),children:[c.jsx(qo,{className:"w-[220px]",children:c.jsx(yl,{placeholder:"Alle Konfiguratoren"})}),c.jsxs(Xo,{children:[c.jsx(Us,{value:"all",children:"Alle Konfiguratoren"}),Object.keys(WC).map(A=>c.jsx(Us,{value:A,children:WC[A]},A))]})]}),m&&c.jsxs(vl,{value:u,onValueChange:A=>d(A),children:[c.jsx(qo,{className:"w-[220px]",children:c.jsx(yl,{placeholder:"Alle Regalarten"})}),c.jsxs(Xo,{children:[c.jsx(Us,{value:"all",children:"Alle Regalarten"}),WKe.map(A=>c.jsx(Us,{value:A,children:W7[A]},A))]})]}),c.jsxs(Pt,{variant:"outline",size:"sm",onClick:v,disabled:s,children:[c.jsx(rx,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"Aktualisieren"]})]}),c.jsx("div",{className:"border border-border rounded-lg overflow-x-auto bg-card",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted text-xs uppercase tracking-wide",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left p-3",children:"Code"}),!t&&c.jsx("th",{className:"text-left p-3",children:"Konfigurator"}),c.jsx("th",{className:"text-left p-3",children:"Regalart"}),c.jsx("th",{className:"text-left p-3",children:"Erstellt"}),c.jsx("th",{className:"text-left p-3",children:"Ablauf"}),c.jsx("th",{className:"text-left p-3",children:"Letzter Aufruf"}),c.jsx("th",{className:"text-right p-3",children:"Aktionen"})]})}),c.jsxs("tbody",{children:[r.length===0&&!s&&c.jsx("tr",{children:c.jsx("td",{colSpan:t?6:7,className:"p-6 text-center text-muted-foreground",children:"Keine gespeicherten Konfigurationen."})}),r.map(A=>{const k=new Date(A.expires_at),M=k<new Date;return c.jsxs("tr",{className:"border-t border-border hover:bg-muted/40",children:[c.jsx("td",{className:"p-3 font-mono font-semibold tracking-wider",children:mT(A.kurz_code)}),!t&&c.jsx("td",{className:"p-3",children:WC[A.konfigurator]??A.konfigurator}),c.jsx("td",{className:"p-3",children:A.regal_typ?W7[A.regal_typ]??A.regal_typ:"â"}),c.jsx("td",{className:"p-3 whitespace-nowrap",children:new Date(A.created_at).toLocaleDateString("de-DE")}),c.jsx("td",{className:`p-3 whitespace-nowrap ${M?"text-destructive":""}`,children:k.toLocaleDateString("de-DE")}),c.jsx("td",{className:"p-3 whitespace-nowrap text-muted-foreground",children:new Date(A.last_loaded_at).toLocaleDateString("de-DE")}),c.jsx("td",{className:"p-3",children:c.jsxs("div",{className:"flex items-center justify-end gap-1",children:[c.jsxs(Pt,{size:"sm",variant:"outline",onClick:()=>{const T=nS(A.konfigurator,A.regal_typ,A.kurz_code);window.open(T,"_blank","noopener,noreferrer")},children:[c.jsx(_d,{className:"w-3.5 h-3.5 mr-1"})," Ãffnen"]}),c.jsxs(Pt,{size:"sm",variant:"ghost",onClick:()=>g(A.kurz_code),children:[c.jsx(rx,{className:"w-3.5 h-3.5 mr-1"})," +90 T"]}),c.jsx(Pt,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>p(A.kurz_code),children:c.jsx(yo,{className:"w-3.5 h-3.5"})})]})})]},A.kurz_code)})]})]})}),c.jsx(vx,{open:!!h,onOpenChange:A=>!A&&p(null),children:c.jsxs(zm,{children:[c.jsxs(Um,{children:[c.jsx(Gm,{children:"Konfiguration löschen?"}),c.jsxs(Vm,{children:["Code ",c.jsx("span",{className:"font-mono",children:h&&mT(h)})," wird unwiderruflich entfernt. Der Kunde kann seine Konfiguration danach nicht mehr laden."]})]}),c.jsxs(Hm,{children:[c.jsx($m,{children:"Abbrechen"}),c.jsx(Wm,{onClick:()=>{h&&b(h),p(null)},className:"bg-destructive hover:bg-destructive/90",children:"Löschen"})]})]})})]})}function $Ke(){return c.jsx(zx,{title:"Gespeicherte Konfigurationen (alle)"})}function KKe(){return c.jsx(zx,{konfigurator:"regal",title:"Gespeicherte Konfigurationen â Tegometall"})}function qKe(){return c.jsx(zx,{konfigurator:"boden",title:"Gespeicherte Konfigurationen â Boden"})}function XKe(){return c.jsx(zx,{konfigurator:"spacewall",title:"Gespeicherte Konfigurationen â Spacewall"})}function YKe(){return c.jsx(zx,{konfigurator:"easycubes",title:"Gespeicherte Konfigurationen â EasyCubes"})}function JKe(){return c.jsx(zx,{konfigurator:"standonfloor",title:"Gespeicherte Konfigurationen â StandOnFloor"})}function ZKe(){return c.jsx(zx,{konfigurator:"messestand",title:"Gespeicherte Konfigurationen â Messestand"})}const lue=[{slug:"wandregal",name:"Wandregal",gruppe:"regale",route:"/wandregal",farbe:"#78AD48"}
4950,{slug:"wandregal-anbau",name:"Wandregal-Anbau",gruppe:"regale",route:"/wandregal-anbau",farbe:"#4F8E2E"},{slug:"gondelregal",name:"Gondelregal",gruppe:"regale",route:"/gondelregal",farbe:"#2E7D32"},{slug:"gondelregal-anbau",name:"Gondelregal-Anbau",gruppe:"regale",route:"/gondelregal-anbau",farbe:"#1B5E20"},{slug:"paneelwandregal",name:"Paneelwandregal",gruppe:"regale",route:"/paneelwandregal",farbe:"#A4C76A"},{slug:"eckregal",name:"Eckregal",gruppe:"regale",route:"/eckregal",farbe:"#558B2F"},{slug:"boden",name:"Boden",gruppe:"boden",route:"/boden",farbe:"#8D6E63"},{slug:"standonfloor-wuerfel",name:"StandOnFloor-Würfel",gruppe:"wuerfel",route:"/standonfloor-wuerfel",farbe:"#6D4C41"},{slug:"easycubes",name:"EasyCubes",gruppe:"wuerfel",route:"/easycubes",farbe:"#A1887F"},{slug:"messestand",name:"Messestand",gruppe:"messestand",route:"/messestand",farbe:"#0288D1"},{slug:"spacewall",name:"Spacewall",gruppe:"spacewall",route:"/spacewall",farbe:"#7B1FA2"}];lue.filter(t=>t.gruppe==="regale").map(t=>t.slug);const cue=[{key:"heute",label:"Heute",days:0},{key:"7t",label:"7 Tage",days:7},{key:"30t",label:"30 Tage",days:30},{key:"90t",label:"90 Tage",days:90},{key:"alles",label:"Gesamt",days:null}];function QKe(t){const e=new Date,n=new Date(e),r=cue.find(i=>i.key===t);return r.days===null?n.setFullYear(2024,0,1):r.days===0?n.setHours(0,0,0,0):n.setDate(n.getDate()-r.days),{from:n.toISOString(),to:e.toISOString()}}const eqe=()=>{const[t,e]=E.useState("30t"),{from:n,to:r}=E.useMemo(()=>QKe(t),[t]),i=q0e({queryKey:["analytics_kpis",n,r],staleTime:3e4,queryFn:async()=>{const{data:l,error:u}=await Ot.rpc("analytics_kpis",{p_from:n,p_to:r});if(u)throw u;return(l??[]).map(d=>({slug:String(d.slug),regaltyp:d.regaltyp?String(d.regaltyp):null,
4950sitzungen:Number(d.sitzungen??0),speicherungen:Number(d.speicherungen??0),anfragen:Number(d.anfragen??0)}))}}),s=E.useMemo(()=>{const l=new Map;for(const u of i.data??[]){const d=l.get(u.slug)??{sitzungen:0,speicherungen:0,anfragen:0};d.sitzungen+=u.sitzungen,d.speicherungen+=u.speicherungen,d.anfragen+=u.anfragen,l.set(u.slug,d)}return lue.map(u=>{const d=l.get(u.slug)??{sitzungen:0,speicherungen:0,anfragen:0};return{slug:u.slug,name:u.name,gruppe:u.gruppe,sitzungen:d.sitzungen,speicherungen:d.speicherungen,anfragen:d.anfragen,quote:d.sitzungen>0?d.anfragen/d.sitzungen:0}})},[i.data]),a=E.useMemo(()=>s.reduce((l,u)=>({sitzungen:l.sitzungen+u.sitzungen,speicherungen:l.speicherungen+u.speicherungen,anfragen:l.anfragen+u.anfragen}),{sitzungen:0,speicherungen:0,anfragen:0}),[s]),o=a.sitzungen?a.anfragen/a.sitzungen:0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Nutzungsanalyse"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Pro Konfigurator: Sitzungen, davon mit gespeicherter Konfiguration, davon mit gesendeter Anfrage."})]}),c.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:[c.jsx(cF,{className:"h-3.5 w-3.5"}),"Keine IP, keine Cookies, keine Wiedererkennung"]})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:cue.map(l=>c.jsx(Pt,{size:"sm",variant:t===l.key?"default":"outline",onClick:()=>e(l.key),children:l.label},l.key))}),c.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-4",children:[c.jsx(bC,{label:"Sitzungen gesamt",value:i.isLoading?null:a.sitzungen.toLocaleString("de-DE")}),c.jsx(bC,{label:"Speicherungen gesamt",value:i.isLoading?null:a.speicherungen.toLocaleString("de-DE")}),c.jsx(bC,{label:"Anfragen gesamt",value:i.isLoading?null:a.anfragen.toLocaleString("de-DE")}),c.jsx(bC,{label:"Anfragequote",value:i.isLoading?null:a.sitzungen?`${(o*100).toFixed(1)} %`:"â"})]}),c.jsxs(Dn,{children:[c.jsx(li,{children:c.jsx(ci,{className:"text-base",children:"Pro Konfigurator"})}),c.jsxs(Bn,{children:[i.isLoading?c.jsx(jO,{className:"h-64 w-full"}):c.jsxs(AA,{children:[c.jsx(EA,{children:c.jsxs(kc,{children:[c.jsx(ws,{children:"Konfigurator"}),c.jsx(ws,{className:"text-right",children:"Sitzungen"}),c.jsx(ws,{className:"text-right",children:"Speicherungen"}),c.jsx(ws,{className:"text-right",children:"Anfragen"}),c.jsx(ws,{className:"text-right",children:"Anfragequote"})]})}),c.jsx(kA,{children:s.map(l=>c.jsxs(kc,{children:[c.jsx(Pi,{className:"font-medium",children:l.name}),c.jsx(Pi,{className:"text-right tabular-nums",children:l.sitzungen.toLocaleString("de-DE")}),c.jsx(Pi,{className:"text-right tabular-nums",children:l.speicherungen.toLocaleString("de-DE")}),c.jsx(Pi,{className:"text-right tabular-nums",children:l.anfragen.toLocaleString("de-DE")}),c.jsx(Pi,{className:"text-right tabular-nums",children:l.sitzungen?`${(l.quote*100).toFixed(1)} %`:"â"})]},l.slug))})]}),i.error&&c.jsxs("p",{className:"mt-3 text-xs text-destructive",children:["Daten konnten nicht geladen werden: ",i.error.message]}),c.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Sitzungen ⥠Speicherungen ⥠Anfragen. Eine gesendete Anfrage zählt automatisch als Speicherung â es wird nicht doppelt gezählt."})]})]})]})},bC=({label:t,value:e})=>c.jsx(Dn,{children:c.jsxs(Bn,{className:"pt-5",children:[c.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t}),e===null?c.jsx(jO,{className:"mt-1 h-7 w-20"}):c.jsx("p",{className:"mt-1 text-2xl font-semibold",children:e})]})}),tqe=new R0e,nqe=()=>c.jsx(D0e,{client:tqe,children:c.jsxs(KN,{children:[c.jsx(Ype,{}),c.jsx(Nme,{}),c.jsx(qxe,{children:c.jsxs(Oxe,{children:[c.jsx(jn,{path:"/",element:c.jsx(Obe,{})}),c.jsx(jn,{path:"/konfigurator",element:c.jsx(oEe,{})}),c.jsx(jn,{path:"/wandregal",element:c.jsx(_Ie,{})}),c.jsx(jn,{path:"/gondelregal",element:c.jsx(EIe,{})}),c.jsx(jn,{path:"/wandregal-anbau",element:c.jsx(TIe,{})}),c.jsx(jn,{path:"/gondelregal-anbau",element:c.jsx(RIe,{})}),c.jsx(jn,{path:"/paneelwandregal",element:c.jsx(LIe,{})}),c.jsx(jn,{path:"/eckregal",element:c.jsx(WIe,{})}),c.jsx(jn,{path:"/boden",element:c.jsx(NVe,{})}),c.jsx(jn,{path:"/standonfloor-wuerfel",element:c.jsx(BVe,{})}),c.jsx(jn,{path:"/easycubes",element:c.jsx(uWe,{})}),c.jsx(jn,{path:"/messestand",element:c.jsx(UWe,{})}),c.jsx(jn,{path:"/spacewall",element:c.jsx(tKe,{})}),c.jsx(jn,{path:"/impressum",element:c.jsx(zbe,{})}),c.jsx(jn,{path:"/datenschutz",element:c.jsx(Ube,{})}),c.jsxs(jn,{path:"/admin",element:c.jsx(KIe,{}),children:[c.jsx(jn,{index:!0,element:c.jsx(R5,{to:"/admin/global/produktkatalog",replace:!0})}),c.jsx(jn,{path:"global/produktkatalog",element:c.jsx(ZIe,{})}),c.jsx(jn,{path:"products",element:c.jsx(qIe,{})}),c.jsx(jn,{path:"tegometall/produkte",element:c.jsx(p4e,{})}),c.jsx(jn,{path:"modules",element:c.jsx(m4e,{})}),c.jsx(jn,{path:"preview",element:c.jsx(g4e,{})}),c.jsx(jn,{path:"embed",element:c.jsx(v4e,{})}),c.jsx(jn,{path:"images",element:c.jsx(P4e,{})}),c.jsx(jn,{path:"staffelpreise",element:c.jsx(L4e,{})}),c.jsx(jn,{path:"boden/produkte",element:c.jsx(TVe,{})}),c.jsx(jn,{path:"boden/vorschau",element:c.jsx(RVe,{})}),c.jsx(jn,{path:"boden/einbettung",element:c.jsx(MVe,{})}),c.jsx(jn,{path:"boden/bilder",element:c.jsx(jVe,{})}),c.jsx(jn,{path:"boden/videos",element:c.jsx(LVe,{})}),c.jsx(jn,{path:"standonfloor-wuerfel/produkte",element:c.jsx(FVe,{})}),c.jsx(jn,{path:"standonfloor-wuerfel/bilder",element:c.jsx(OVe,{})}),c.jsx(jn,{path:"standonfloor-wuerfel/vorschau",element:c.jsx(zVe,{})}),c.jsx(jn,{path:"standonfloor-wuerfel/einbettung",element:c.jsx(UVe,{})}),c.jsx(jn,{path:"easycubes/produkte",element:c.jsx(dWe,{})}),c.jsx(jn,{path:"easycubes/bilder",element:c.jsx(vWe,{})}),c.jsx(jn,{path:"easycubes/vorschau",element:c.jsx(bWe,{})}),c.jsx(jn,{path:"easycubes/einbettung",element:c.jsx(wWe,{})}),c.jsx(jn,{path:"messestand/modelle",element:c.jsx(HWe,{})}),c.jsx(jn,{path:"messestand/produkte",element:c.jsx(GWe,{})}),c.jsx(jn,{path:"messestand/vorschau",element:c.jsx(VWe,{})}),c.jsx(jn,{path:"messestand/einbettung",element:c.jsx(WWe,{})}),c.jsx(jn,{path:"spacewall/produkte",element:c.jsx(BKe,{})}),c.jsx(jn,{path:"spacewall/farben",element:c.jsx(FKe,{})}),c.jsx(jn,{path:"spacewall/bilder",element:c.jsx(OKe,{})}),c.jsx(jn,{path:"spacewall/vorschau",element:c.jsx(zKe,{})}),c.jsx(jn,{path:"spacewall/einbettung",element:c.jsx(UKe,{})}),c.jsx(jn,{path:"spacewall/kantenschutz",element:c.jsx(GKe,{})}),c.jsx(jn,{path:"gespeicherte-konfigurationen",element:c.jsx($Ke,{})}),c.jsx(jn,{path:"tegometall/gespeicherte-konfigurationen",element:c.jsx(KKe,{})}),c.jsx(jn,{path:"boden/gespeicherte-konfigurationen",element:c.jsx(qKe,{})}),c.jsx(jn,{path:"spacewall/gespeicherte-konfigurationen",element:c.jsx(XKe,{})}),c.jsx(jn,{path:"easycubes/gespeicherte-konfigurationen",element:c.jsx(YKe,{})}),c.jsx(jn,{path:"standonfloor-wuerfel/gespeicherte-konfigurationen",element:c.jsx(JKe,{})}),c.jsx(jn,{path:"messestand/gespeicherte-konfigurationen",element:c.jsx(ZKe,{})}),c.jsx(jn,{path:"analytics",element:c.jsx(eqe,{})})]}),c.jsx(jn,{path:"*",element:c.jsx(I4e,{})})]})})]})});PY(document.getElementById("root")).render(c.jsx(nqe,{}));export{Si as _,vN as c,DS as g};
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.