PageSourceSearch

https://www.xrguild.org/assets/index-Tjfrb6GK.js

js xrguild.org collected 2026-10-03 21:43:23 UTC 2,591,580 bytes, 4,536 lines download raw bytes

vendor: 4,112 bytes, line 1
1function qR(t,e){for(var n=0;n<e.length;n++){const a=e[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(a,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>a[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"]'))a(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).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 a(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Kg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yg(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function a(){var i=!1;try{i=this instanceof a}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,i.get?i:{enumerable:!0,get:function(){return t[a]}})}),n}var nv={exports:{}},Kh={},rv={exports:{}},er={};var J2;function JR(){if(J2)return er;J2=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function b(Q){return Q===null||typeof Q!="object"?null:(Q=p&&Q[p]||Q["@@iterator"],typeof Q=="function"?Q:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function F(Q,ve,pe){this.props=Q,this.context=ve,this.refs=S,this.updater=pe||v}F.prototype.isReactComponent={},F.prototype.setState=function(Q,ve){if(typeof Q!="object"&&typeof Q!="function"&&Q!=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,Q,ve,"setState")},F.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function w(){}w.prototype=F.prototype;function A(Q,ve,pe){this.props=Q,this.context=ve,this.refs=S,this.updater=pe||v}var N=A.prototype=new w;N.constructor=A,C(N,F.prototype),N.isPureReactComponent=!0;var P=Array.isArray,z=Object.prototype.hasOwnProperty,D={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function K(Q,ve,pe){var Me,We={},Ae=null,Ce=null;if(ve!=null)for(Me in ve.ref!==void 0&&(Ce=ve.ref),ve.key!==void 0&&(Ae=""+ve.key),ve)z.call(ve,Me)&&!T.hasOwnProperty(Me)&&(We[Me]=ve[Me]);var He=arguments.length-2;if(He===1)We.children=pe;else if(1<He){for(var Ct=Array(He),bt=0;bt<He;bt++)Ct[bt]=arguments[bt+2];We.children=Ct}if(Q&&Q.defaultProps)for(Me in He=Q.defaultProps,He)We[Me]===void 0&&(We[Me]=He[Me]);return{$$typeof:t,type:Q,key:Ae,ref:Ce,props:We,_owner:D.current}}function B(Q,ve){return{$$typeof:t,type:Q.type,key:ve,ref:Q.ref,props:Q.props,_owner:Q._owner}}function k(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function O(Q){var ve={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(pe){return ve[pe]})}var I=/\/+/g;function j(Q,ve){return typeof Q=="object"&&Q!==null&&Q.key!=null?O(""+Q.key):ve.toString(36)}function U(Q,ve,pe,Me,We){var Ae=typeof Q;(Ae==="undefined"||Ae==="boolean")&&(Q=null);var Ce=!1;
vendor: 9,111 bytes, line 1
1if(Q===null)Ce=!0;else switch(Ae){case"string":case"number":Ce=!0;break;case"object":switch(Q.$$typeof){case t:case e:Ce=!0}}if(Ce)return Ce=Q,We=We(Ce),Q=Me===""?"."+j(Ce,0):Me,P(We)?(pe="",Q!=null&&(pe=Q.replace(I,"$&/")+"/"),U(We,ve,pe,"",function(bt){return bt})):We!=null&&(k(We)&&(We=B(We,pe+(!We.key||Ce&&Ce.key===We.key?"":(""+We.key).replace(I,"$&/")+"/")+Q)),ve.push(We)),1;if(Ce=0,Me=Me===""?".":Me+":",P(Q))for(var He=0;He<Q.length;He++){Ae=Q[He];var Ct=Me+j(Ae,He);Ce+=U(Ae,ve,pe,Ct,We)}else if(Ct=b(Q),typeof Ct=="function")for(Q=Ct.call(Q),He=0;!(Ae=Q.next()).done;)Ae=Ae.value,Ct=Me+j(Ae,He++),Ce+=U(Ae,ve,pe,Ct,We);else if(Ae==="object")throw ve=String(Q),Error("Objects are not valid as a React child (found: "+(ve==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":ve)+"). If you meant to render a collection of children, use an array instead.");return Ce}function q(Q,ve,pe){if(Q==null)return Q;var Me=[],We=0;return U(Q,Me,"","",function(Ae){return ve.call(pe,Ae,We++)}),Me}function Y(Q){if(Q._status===-1){var ve=Q._result;ve=ve(),ve.then(function(pe){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=pe)},function(pe){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=pe)}),Q._status===-1&&(Q._status=0,Q._result=ve)}if(Q._status===1)return Q._result.default;throw Q._result}var W={current:null},H={transition:null},J={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:H,ReactCurrentOwner:D};function ie(){throw Error("act(...) is not supported in production builds of React.")}return er.Children={map:q,forEach:function(Q,ve,pe){q(Q,function(){ve.apply(this,arguments)},pe)},count:function(Q){var ve=0;return q(Q,function(){ve++}),ve},toArray:function(Q){return q(Q,function(ve){return ve})||[]},only:function(Q){if(!k(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},er.Component=F,er.Fragment=n,er.Profiler=i,er.PureComponent=A,er.StrictMode=a,er.Suspense=d,er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,er.act=ie,er.cloneElement=function(Q,ve,pe){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var Me=C({},Q.props),We=Q.key,Ae=Q.ref,Ce=Q._owner;if(ve!=null){if(ve.ref!==void 0&&(Ae=ve.ref,Ce=D.current),ve.key!==void 0&&(We=""+ve.key),Q.type&&Q.type.defaultProps)var He=Q.type.defaultProps;for(Ct in ve)z.call(ve,Ct)&&!T.hasOwnProperty(Ct)&&(Me[Ct]=ve[Ct]===void 0&&He!==void 0?He[Ct]:ve[Ct])}var Ct=arguments.length-2;if(Ct===1)Me.children=pe;else if(1<Ct){He=Array(Ct);for(var bt=0;bt<Ct;bt++)He[bt]=arguments[bt+2];Me.children=He}return{$$typeof:t,type:Q.type,key:We,ref:Ae,props:Me,_owner:Ce}},er.createContext=function(Q){return Q={$$typeof:o,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},er.createElement=K,er.createFactory=function(Q){var ve=K.bind(null,Q);return ve.type=Q,ve},er.createRef=function(){return{current:null}},er.forwardRef=function(Q){return{$$typeof:c,render:Q}},er.isValidElement=k,er.lazy=function(Q){return{$$typeof:f,_payload:{_status:-1,_result:Q},_init:Y}},er.memo=function(Q,ve){return{$$typeof:m,type:Q,compare:ve===void 0?null:ve}},er.startTransition=function(Q){var ve=H.transition;H.transition={};try{Q()}finally{H.transition=ve}},er.unstable_act=ie,er.useCallback=function(Q,ve){return W.current.useCallback(Q,ve)},er.useContext=function(Q){return W.current.useContext(Q)},er.useDebugValue=function(){},er.useDeferredValue=function(Q){return W.current.useDeferredValue(Q)},er.useEffect=function(Q,ve){return W.current.useEffect(Q,ve)},er.useId=function(){return W.current.useId()},er.useImperativeHandle=function(Q,ve,pe){return W.current.useImperativeHandle(Q,ve,pe)},er.useInsertionEffect=function(Q,ve){return W.current.useInsertionEffect(Q,ve)},er.useLayoutEffect=function(Q,ve){return W.current.useLayoutEffect(Q,ve)},er.useMemo=function(Q,ve){return W.current.useMemo(Q,ve)},er.useReducer=function(Q,ve,pe){return W.current.useReducer(Q,ve,pe)},er.useRef=function(Q){return W.current.useRef(Q)},er.useState=function(Q){return W.current.useState(Q)},er.useSyncExternalStore=function(Q,ve,pe){return W.current.useSyncExternalStore(Q,ve,pe)},er.useTransition=function(){return W.current.useTransition()},er.version="18.3.1",er}var X2;function x1(){return X2||(X2=1,rv.exports=JR()),rv.exports}var Z2;function XR(){if(Z2)return Kh;Z2=1;var t=x1(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,m){var f,p={},b=null,v=null;m!==void 0&&(b=""+m),d.key!==void 0&&(b=""+d.key),d.ref!==void 0&&(v=d.ref);for(f in d)a.call(d,f)&&!s.hasOwnProperty(f)&&(p[f]=d[f]);if(c&&c.defaultProps)for(f in d=c.defaultProps,d)p[f]===void 0&&(p[f]=d[f]);return{$$typeof:e,type:c,key:b,ref:v,props:p,_owner:i.current}}return Kh.Fragment=n,Kh.jsx=o,Kh.jsxs=o,Kh}var Q2;function ZR(){return Q2||(Q2=1,nv.exports=XR()),nv.exports}var r=ZR(),gp={},av={exports:{}},yi={},iv={exports:{}},sv={};var eF;function QR(){return eF||(eF=1,(function(t){function e(H,J){var ie=H.length;H.push(J);e:for(;0<ie;){var Q=ie-1>>>1,ve=H[Q];if(0<i(ve,J))H[Q]=J,H[ie]=ve,ie=Q;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var J=H[0],ie=H.pop();if(ie!==J){H[0]=ie;e:for(var Q=0,ve=H.length,pe=ve>>>1;Q<pe;){var Me=2*(Q+1)-1,We=H[Me],Ae=Me+1,Ce=H[Ae];if(0>i(We,ie))Ae<ve&&0>i(Ce,We)?(H[Q]=Ce,H[Ae]=ie,Q=Ae):(H[Q]=We,H[Me]=ie,Q=Me);else if(Ae<ve&&0>i(Ce,ie))H[Q]=Ce,H[Ae]=ie,Q=Ae;else break e}}return J}function i(H,J){var ie=H.sortIndex-J.sortIndex;return ie!==0?ie:H.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var d=[],m=[],f=1,p=null,b=3,v=!1,C=!1,S=!1,F=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(H){for(var J=n(m);J!==null;){if(J.callback===null)a(m);else if(J.startTime<=H)a(m),J.sortIndex=J.expirationTime,e(d,J);else break;J=n(m)}}function P(H){if(S=!1,N(H),!C)if(n(d)!==null)C=!0,Y(z);else{var J=n(m);J!==null&&W(P,J.startTime-H)}}function z(H,J){C=!1,S&&(S=!1,w(K),K=-1),v=!0;var ie=b;try{for(N(J),p=n(d);p!==null&&(!(p.expirationTime>J)||H&&!O());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,b=p.priorityLevel;var ve=Q(p.expirationTime<=J);J=t.unstable_now(),typeof ve=="function"?p.callback=ve:p===n(d)&&a(d),N(J)}else a(d);p=n(d)}if(p!==null)var pe=!0;else{var Me=n(m);Me!==null&&W(P,Me.startTime-J),pe=!1}return pe}finally{p=null,b=ie,v=!1}}var D=!1,T=null,K=-1,B=5,k=-1;function O(){return!(t.unstable_now()-k<B)}function I(){if(T!==null){var H=t.unstable_now();k=H;var J=!0;try{J=T(!0,H)}finally{J?j():(D=!1,T=null)}}else D=!1}var j;if(typeof A=="function")j=function(){A(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,q=U.port2;U.port1.onmessage=I,j=function(){q.postMessage(null)}}else j=function(){F(I,0)};function Y(H){T=H,D||(D=!0,j())}function W(H,J){K=F(function(){H(t.unstable_now())},J)}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(H){H.callback=null},t.unstable_continueExecution=function(){C||v||(C=!0,Y(z))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_getFirstCallbackNode=function(){return n(d)},t.unstable_next=function(H){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var ie=b;b=J;try{return H()}finally{b=ie}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ie=b;b=H;try{return J()}finally{b=ie}},t.unstable_scheduleCallback=function(H,J,ie){var Q=t.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?Q+ie:Q):ie=Q,H){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=ie+ve,H={id:f++,callback:J,priorityLevel:H,startTime:ie,expirationTime:ve,sortIndex:-1},ie>Q?(H.sortIndex=ie,e(m,H),n(d)===null&&H===n(m)&&(S?(w(K),K=-1):S=!0,W(P,ie-Q))):(H.sortIndex=ve,e(d,H),C||v||(C=!0,Y(z))),H},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(H){var J=b;return function(){var ie=b;b=J;try{return H.apply(this,arguments)}finally{b=ie}}}})(sv)),sv}var tF;
vendor: 37,546 bytes, lines 1-5
1function eD(){return tF||(tF=1,iv.exports=QR()),iv.exports}var nF;function tD(){if(nF)return yi;nF=1;var t=x1(),e=eD();function n(l){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+l,y=1;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+l+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,i={};function s(l,h){o(l,h),o(l+"Capture",h)}function o(l,h){for(i[l]=h,l=0;l<h.length;l++)a.add(h[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[: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]*$/,f={},p={};function b(l){return d.call(p,l)?!0:d.call(f,l)?!1:m.test(l)?p[l]=!0:(f[l]=!0,!1)}function v(l,h,y,E){if(y!==null&&y.type===0)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":return E?!1:y!==null?!y.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function C(l,h,y,E){if(h===null||typeof h>"u"||v(l,h,y,E))return!0;if(E)return!1;if(y!==null)switch(y.type){case 3:return!h;case 4:return h===!1;case 5:return isNaN(h);case 6:return isNaN(h)||1>h}return!1}function S(l,h,y,E,R,G,se){this.acceptsBooleans=h===2||h===3||h===4,this.attributeName=E,this.attributeNamespace=R,this.mustUseProperty=y,this.propertyName=l,this.type=h,this.sanitizeURL=G,this.removeEmptyString=se}var F={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){F[l]=new S(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var h=l[0];F[h]=new S(h,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){F[l]=new S(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){F[l]=new S(l,2,!1,l,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(l){F[l]=new S(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){F[l]=new S(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){F[l]=new S(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){F[l]=new S(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){F[l]=new S(l,5,!1,l.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function A(l){return l[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(l){var h=l.replace(w,A);F[h]=new S(h,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var h=l.replace(w,A);F[h]=new S(h,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var h=l.replace(w,A);F[h]=new S(h,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){F[l]=new S(l,1,!1,l.toLowerCase(),null,!1,!1)}),F.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){F[l]=new S(l,1,!1,l.toLowerCase(),null,!0,!0)});function N(l,h,y,E){var R=F.hasOwnProperty(h)?F[h]:null;(R!==null?R.type!==0:E||!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(C(h,y,R,E)&&(y=null),E||R===null?b(h)&&(y===null?l.removeAttribute(h):l.setAttribute(h,""+y)):R.mustUseProperty?l[R.propertyName]=y===null?R.type===3?!1:"":y:(h=R.attributeName,E=R.attributeNamespace,y===null?l.removeAttribute(h):(R=R.type,y=R===3||R===4&&y===!0?"":""+y,E?l.setAttributeNS(E,h,y):l.setAttribute(h,y))))}var P=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),D=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),O=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),H=Symbol.iterator;function J(l){return l===null||typeof l!="object"?null:(l=H&&l[H]||l["@@iterator"],typeof l=="function"?l:null)}var ie=Object.assign,Q;function ve(l){if(Q===void 0)try{throw Error()}catch(y){var h=y.stack.trim().match(/\n( *(at )?)/);Q=h&&h[1]||""}return`
2`+Q+l}var pe=!1;function Me(l,h){if(!l||pe)return"";pe=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(At){var E=At}Reflect.construct(l,[],h)}else{try{h.call()}catch(At){E=At}l.call(h.prototype)}else{try{throw Error()}catch(At){E=At}l()}}catch(At){if(At&&E&&typeof At.stack=="string"){for(var R=At.stack.split(`
3`),G=E.stack.split(`
4`),se=R.length-1,Pe=G.length-1;1<=se&&0<=Pe&&R[se]!==G[Pe];)Pe--;for(;1<=se&&0<=Pe;se--,Pe--)if(R[se]!==G[Pe]){if(se!==1||Pe!==1)do if(se--,Pe--,0>Pe||R[se]!==G[Pe]){var Ye=`
5`+R[se].replace(" at new "," at ");return l.displayName&&Ye.includes("<anonymous>")&&(Ye=Ye.replace("<anonymous>",l.displayName)),Ye}while(1<=se&&0<=Pe);break}}}finally{pe=!1,Error.prepareStackTrace=y}return(l=l?l.displayName||l.name:"")?ve(l):""}function We(l){switch(l.tag){case 5:return ve(l.type);case 16:return ve("Lazy");case 13:return ve("Suspense");case 19:return ve("SuspenseList");case 0:case 2:case 15:return l=Me(l.type,!1),l;case 11:return l=Me(l.type.render,!1),l;case 1:return l=Me(l.type,!0),l;default:return""}}function Ae(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case T:return"Fragment";case D:return"Portal";case B:return"Profiler";case K:return"StrictMode";case j:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case O:return(l.displayName||"Context")+".Consumer";case k:return(l._context.displayName||"Context")+".Provider";case I:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case q:return h=l.displayName||null,h!==null?h:Ae(l.type)||"Memo";case Y:h=l._payload,l=l._init;try{return Ae(l(h))}catch{}}return null}function Ce(l){var h=l.type;switch(l.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=h.render,l=l.displayName||l.name||"",h.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(h);case 8:return h===K?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function He(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Ct(l){var h=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function bt(l){var h=Ct(l)?"checked":"value",y=Object.getOwnPropertyDescriptor(l.constructor.prototype,h),E=""+l[h];if(!l.hasOwnProperty(h)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var R=y.get,G=y.set;return Object.defineProperty(l,h,{configurable:!0,get:function(){return R.call(this)},set:function(se){E=""+se,G.call(this,se)}}),Object.defineProperty(l,h,{enumerable:y.enumerable}),{getValue:function(){return E},setValue:function(se){E=""+se},stopTracking:function(){l._valueTracker=null,delete l[h]}}}}function Rt(l){l._valueTracker||(l._valueTracker=bt(l))}function zt(l){if(!l)return!1;var h=l._valueTracker;if(!h)return!0;var y=h.getValue(),E="";return l&&(E=Ct(l)?l.checked?"true":"false":l.value),l=E,l!==y?(h.setValue(l),!0):!1}function Ut(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Bt(l,h){var y=h.checked;return ie({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:y??l._wrapperState.initialChecked})}function re(l,h){var y=h.defaultValue==null?"":h.defaultValue,E=h.checked!=null?h.checked:h.defaultChecked;y=He(h.value!=null?h.value:y),l._wrapperState={initialChecked:E,initialValue:y,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function wt(l,h){h=h.checked,h!=null&&N(l,"checked",h,!1)}function Nt(l,h){wt(l,h);var y=He(h.value),E=h.type;if(y!=null)E==="number"?(y===0&&l.value===""||l.value!=y)&&(l.value=""+y):l.value!==""+y&&(l.value=""+y);else if(E==="submit"||E==="reset"){l.removeAttribute("value");return}h.hasOwnProperty("value")?Tt(l,h.type,y):h.hasOwnProperty("defaultValue")&&Tt(l,h.type,He(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(l.defaultChecked=!!h.defaultChecked)}function vt(l,h,y){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var E=h.type;if(!(E!=="submit"&&E!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+l._wrapperState.initialValue,y||h===l.value||(l.value=h),l.defaultValue=h}y=l.name,y!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,y!==""&&(l.name=y)}function Tt(l,h,y){(h!=="number"||Ut(l.ownerDocument)!==l)&&(y==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+y&&(l.defaultValue=""+y))}var Wt=Array.isArray;function Dt(l,h,y,E){if(l=l.options,h){h={};for(var R=0;R<y.length;R++)h["$"+y[R]]=!0;for(y=0;y<l.length;y++)R=h.hasOwnProperty("$"+l[y].value),l[y].selected!==R&&(l[y].selected=R),R&&E&&(l[y].defaultSelected=!0)}else{for(y=""+He(y),h=null,R=0;R<l.length;R++){if(l[R].value===y){l[R].selected=!0,E&&(l[R].defaultSelected=!0);return}h!==null||l[R].disabled||(h=l[R])}h!==null&&(h.selected=!0)}}function jt(l,h){if(h.dangerouslySetInnerHTML!=null)throw Error(n(91));return ie({},h,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function he(l,h){var y=h.value;if(y==null){if(y=h.children,h=h.defaultValue,y!=null){if(h!=null)throw Error(n(92));if(Wt(y)){if(1<y.length)throw Error(n(93));y=y[0]}h=y}h==null&&(h=""),y=h}l._wrapperState={initialValue:He(y)}}function ee(l,h){var y=He(h.value),E=He(h.defaultValue);y!=null&&(y=""+y,y!==l.value&&(l.value=y),h.defaultValue==null&&l.defaultValue!==y&&(l.defaultValue=y)),E!=null&&(l.defaultValue=""+E)}function ze(l){var h=l.textContent;h===l._wrapperState.initialValue&&h!==""&&h!==null&&(l.value=h)}function Ve(l){switch(l){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 lt(l,h){return l==null||l==="http://www.w3.org/1999/xhtml"?Ve(h):l==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var qe,It=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,y,E,R){MSApp.execUnsafeLocalFunction(function(){return l(h,y,E,R)})}:l})(function(l,h){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=h;else{for(qe=qe||document.createElement("div"),qe.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=qe.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;h.firstChild;)l.appendChild(h.firstChild)}});function gt(l,h){if(h){var y=l.firstChild;if(y&&y===l.lastChild&&y.nodeType===3){y.nodeValue=h;return}}l.textContent=h}var Ee={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},Je=["Webkit","ms","Moz","O"];Object.keys(Ee).forEach(function(l){Je.forEach(function(h){h=h+l.charAt(0).toUpperCase()+l.substring(1),Ee[h]=Ee[l]})});function $e(l,h,y){return h==null||typeof h=="boolean"||h===""?"":y||typeof h!="number"||h===0||Ee.hasOwnProperty(l)&&Ee[l]?(""+h).trim():h+"px"}function Xe(l,h){l=l.style;for(var y in h)if(h.hasOwnProperty(y)){var E=y.indexOf("--")===0,R=$e(y,h[y],E);y==="float"&&(y="cssFloat"),E?l.setProperty(y,R):l[y]=R}}var X=ie({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 ke(l,h){if(h){if(X[l]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(n(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(n(61))}if(h.style!=null&&typeof h.style!="object")throw Error(n(62))}}function De(l,h){if(l.indexOf("-")===-1)return typeof h.is=="string";switch(l){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 oe=null;function te(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ye=null,Re=null,Le=null;function fe(l){if(l=$o(l)){if(typeof ye!="function")throw Error(n(280));var h=l.stateNode;h&&(h=zu(h),ye(l.stateNode,l.type,h))}}function Se(l){Re?Le?Le.push(l):Le=[l]:Re=l}function Be(){if(Re){var l=Re,h=Le;if(Le=Re=null,fe(l),h)for(l=0;l<h.length;l++)fe(h[l])}}function Ze(l,h){return l(h)}function ue(){}var rt=!1;function je(l,h,y){if(rt)return l(h,y);rt=!0;try{return Ze(l,h,y)}finally{rt=!1,(Re!==null||Le!==null)&&(ue(),Be())}}function _t(l,h){var y=l.stateNode;if(y===null)return null;var E=zu(y);if(E===null)return null;y=E[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(E=!E.disabled)||(l=l.type,E=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!E;break e;default:l=!1}if(l)return null;if(y&&typeof y!="function")throw Error(n(231,h,typeof y));return y}var Kt=!1;if(c)try{var gn={};Object.defineProperty(gn,"passive",{get:function(){Kt=!0}}),window.addEventListener("test",gn,gn),window.removeEventListener("test",gn,gn)}catch{Kt=!1}function _e(l,h,y,E,R,G,se,Pe,Ye){var At=Array.prototype.slice.call(arguments,3);try{h.apply(y,At)}catch(qt){this.onError(qt)}}var et=!1,Ge=null,ht=!1,ft=null,Mt={onError:function(l){et=!0,Ge=l}};function be(l,h,y,E,R,G,se,Pe,Ye){et=!1,Ge=null,_e.apply(Mt,arguments)}function Z(l,h,y,E,R,G,se,Pe,Ye){if(be.apply(this,arguments),et){if(et){var At=Ge;et=!1,Ge=null}else throw Error(n(198));ht||(ht=!0,ft=At)}}function it(l){var h=l,y=l;if(l.alternate)for(;h.return;)h=h.return;else{l=h;do h=l,(h.flags&4098)!==0&&(y=h.return),l=h.return;while(l)}return h.tag===3?y:null}function we(l){if(l.tag===13){var h=l.memoizedState;if(h===null&&(l=l.alternate,l!==null&&(h=l.memoizedState)),h!==null)return h.dehydrated}return null}function st(l){if(it(l)!==l)throw Error(n(188))}function Lt(l){var h=l.alternate;if(!h){if(h=it(l),h===null)throw Error(n(188));return h!==l?null:l}for(var y=l,E=h;;){var R=y.return;if(R===null)break;var G=R.alternate;if(G===null){if(E=R.return,E!==null){y=E;continue}break}if(R.child===G.child){for(G=R.child;G;){if(G===y)return st(R),l;if(G===E)return st(R),h;G=G.sibling}throw Error(n(188))}if(y.return!==E.return)y=R,E=G;else{for(var se=!1,Pe=R.child;Pe;){if(Pe===y){se=!0,y=R,E=G;break}if(Pe===E){se=!0,E=R,y=G;break}Pe=Pe.sibling}if(!se){for(Pe=G.child;Pe;){if(Pe===y){se=!0,y=G,E=R;break}if(Pe===E){se=!0,E=G,y=R;break}Pe=Pe.sibling}if(!se)throw Error(n(189))}}if(y.alternate!==E)throw Error(n(190))}if(y.tag!==3)throw Error(n(188));return y.stateNode.current===y?l:h}function Ot(l){return l=Lt(l),l!==null?Et(l):null}function Et(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var h=Et(l);if(h!==null)return h;l=l.sibling}return null}var tt=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,$=e.unstable_shouldYield,xe=e.unstable_requestPaint,ne=e.unstable_now,me=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,Ie=e.unstable_UserBlockingPriority,Ke=e.unstable_NormalPriority,ut=e.unstable_LowPriority,ae=e.unstable_IdlePriority,Te=null,Qe=null;function ot(l){if(Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(Te,l,void 0,(l.current.flags&128)===128)}catch{}}var pt=Math.clz32?Math.clz32:sn,ct=Math.log,Vt=Math.LN2;function sn(l){return l>>>=0,l===0?32:31-(ct(l)/Vt|0)|0}var cn=64,St=4194304;function le(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ne(l,h){var y=l.pendingLanes;if(y===0)return 0;var E=0,R=l.suspendedLanes,G=l.pingedLanes,se=y&268435455;if(se!==0){var Pe=se&~R;Pe!==0?E=le(Pe):(G&=se,G!==0&&(E=le(G)))}else se=y&~R,se!==0?E=le(se):G!==0&&(E=le(G));if(E===0)return 0;if(h!==0&&h!==E&&(h&R)===0&&(R=E&-E,G=h&-h,R>=G||R===16&&(G&4194240)!==0))return h;if((E&4)!==0&&(E|=y&16),h=l.entangledLanes,h!==0)for(l=l.entanglements,h&=E;0<h;)y=31-pt(h),R=1<<y,E|=l[y],h&=~R;return E}function Oe(l,h){switch(l){case 1:case 2:case 4:return h+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(l,h){for(var y=l.suspendedLanes,E=l.pingedLanes,R=l.expirationTimes,G=l.pendingLanes;0<G;){var se=31-pt(G),Pe=1<<se,Ye=R[se];Ye===-1?((Pe&y)===0||(Pe&E)!==0)&&(R[se]=Oe(Pe,h)):Ye<=h&&(l.expiredLanes|=Pe),G&=~Pe}}function xt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Qt(){var l=cn;return cn<<=1,(cn&4194240)===0&&(cn=64),l}function Gt(l){for(var h=[],y=0;31>y;y++)h.push(l);return h}function Xt(l,h,y){l.pendingLanes|=h,h!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,h=31-pt(h),l[h]=y}function Zt(l,h){var y=l.pendingLanes&~h;l.pendingLanes=h,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=h,l.mutableReadLanes&=h,l.entangledLanes&=h,h=l.entanglements;var E=l.eventTimes;for(l=l.expirationTimes;0<y;){var R=31-pt(y),G=1<<R;h[R]=0,E[R]=-1,l[R]=-1,y&=~G}}function _n(l,h){var y=l.entangledLanes|=h;for(l=l.entanglements;y;){var E=31-pt(y),R=1<<E;R&h|l[E]&h&&(l[E]|=h),y&=~R}}var rn=0;function or(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Nr,Ca,qi,fs,_a,Pa=!1,qr=[],Jr=null,ui=null,Ea=null,ja=new Map,jn=new Map,Br=[],hr="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 Io(l,h){switch(l){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":ui=null;break;case"mouseover":case"mouseout":Ea=null;break;case"pointerover":case"pointerout":ja.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":jn.delete(h.pointerId)}}function Ai(l,h,y,E,R,G){return l===null||l.nativeEvent!==G?(l={blockedOn:h,domEventName:y,eventSystemFlags:E,nativeEvent:G,targetContainers:[R]},h!==null&&(h=$o(h),h!==null&&Ca(h)),l):(l.eventSystemFlags|=E,h=l.targetContainers,R!==null&&h.indexOf(R)===-1&&h.push(R),l)}function mn(l,h,y,E,R){switch(h){case"focusin":return Jr=Ai(Jr,l,h,y,E,R),!0;case"dragenter":return ui=Ai(ui,l,h,y,E,R),!0;case"mouseover":return Ea=Ai(Ea,l,h,y,E,R),!0;case"pointerover":var G=R.pointerId;return ja.set(G,Ai(ja.get(G)||null,l,h,y,E,R)),!0;case"gotpointercapture":return G=R.pointerId,jn.set(G,Ai(jn.get(G)||null,l,h,y,E,R)),!0}return!1}function En(l){var h=Vo(l.target);if(h!==null){var y=it(h);if(y!==null){if(h=y.tag,h===13){if(h=we(y),h!==null){l.blockedOn=h,_a(l.priority,function(){qi(y)});return}}else if(h===3&&y.stateNode.current.memoizedState.isDehydrated){l.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Sn(l){if(l.blockedOn!==null)return!1;for(var h=l.targetContainers;0<h.length;){var y=La(l.domEventName,l.eventSystemFlags,h[0],l.nativeEvent);if(y===null){y=l.nativeEvent;var E=new y.constructor(y.type,y);oe=E,y.target.dispatchEvent(E),oe=null}else return h=$o(y),h!==null&&Ca(h),l.blockedOn=y,!1;h.shift()}return!0}function Wn(l,h,y){Sn(l)&&y.delete(h)}function yn(){Pa=!1,Jr!==null&&Sn(Jr)&&(Jr=null),ui!==null&&Sn(ui)&&(ui=null),Ea!==null&&Sn(Ea)&&(Ea=null),ja.forEach(Wn),jn.forEach(Wn)}function xn(l,h){l.blockedOn===h&&(l.blockedOn=null,Pa||(Pa=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yn)))}function Mn(l){function h(R){return xn(R,l)}if(0<qr.length){xn(qr[0],l);for(var y=1;y<qr.length;y++){var E=qr[y];E.blockedOn===l&&(E.blockedOn=null)}}for(Jr!==null&&xn(Jr,l),ui!==null&&xn(ui,l),Ea!==null&&xn(Ea,l),ja.forEach(h),jn.forEach(h),y=0;y<Br.length;y++)E=Br[y],E.blockedOn===l&&(E.blockedOn=null);for(;0<Br.length&&(y=Br[0],y.blockedOn===null);)En(y),y.blockedOn===null&&Br.shift()}var mr=P.ReactCurrentBatchConfig,zn=!0;function lr(l,h,y,E){var R=rn,G=mr.transition;mr.transition=null;try{rn=1,ka(l,h,y,E)}finally{rn=R,mr.transition=G}}function qn(l,h,y,E){var R=rn,G=mr.transition;mr.transition=null;try{rn=4,ka(l,h,y,E)}finally{rn=R,mr.transition=G}}function ka(l,h,y,E){if(zn){var R=La(l,h,y,E);if(R===null)u(l,h,E,Ji,y),Io(l,E);else if(mn(R,l,h,y,E))E.stopPropagation();else if(Io(l,E),h&4&&-1<hr.indexOf(l)){for(;R!==null;){var G=$o(R);if(G!==null&&Nr(G),G=La(l,h,y,E),G===null&&u(l,h,E,Ji,y),G===R)break;R=G}R!==null&&E.stopPropagation()}else u(l,h,E,null,y)}}var Ji=null;function La(l,h,y,E){if(Ji=null,l=te(E),l=Vo(l),l!==null)if(h=it(l),h===null)l=null;else if(y=h.tag,y===13){if(l=we(h),l!==null)return l;l=null}else if(y===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;l=null}else h!==l&&(l=null);return Ji=l,null}function Vn(l){switch(l){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(me()){case de:return 1;case Ie:return 4;case Ke:case ut:return 16;case ae:return 536870912;default:return 16}default:return 16}}var Za=null,sa=null,di=null;function Bo(){if(di)return di;var l,h=sa,y=h.length,E,R="value"in Za?Za.value:Za.textContent,G=R.length;for(l=0;l<y&&h[l]===R[l];l++);var se=y-l;for(E=1;E<=se&&h[y-E]===R[G-E];E++);return di=R.slice(l,1<E?1-E:void 0)}function Xs(l){var h=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&h===13&&(l=13)):l=h,l===10&&(l=13),32<=l||l===13?l:0}function Ia(){return!0}function ps(){return!1}function Or(l){function h(y,E,R,G,se){this._reactName=y,this._targetInst=R,this.type=E,this.nativeEvent=G,this.target=se,this.currentTarget=null;for(var Pe in l)l.hasOwnProperty(Pe)&&(y=l[Pe],this[Pe]=y?y(G):G[Pe]);return this.isDefaultPrevented=(G.defaultPrevented!=null?G.defaultPrevented:G.returnValue===!1)?Ia:ps,this.isPropagationStopped=ps,this}return ie(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=Ia)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=Ia)},persist:function(){},isPersistent:Ia}),h}var Ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oo=Or(Ba),Oa=ie({},Ba,{view:0,detail:0}),gs=Or(Oa),Xr,Xi,hi,Tr=ie({},Oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zo,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==hi&&(hi&&l.type==="mousemove"?(Xr=l.screenX-hi.screenX,Xi=l.screenY-hi.screenY):Xi=Xr=0,hi=l),Xr)},movementY:function(l){return"movementY"in l?l.movementY:Xi}}),Ua=Or(Tr),xs=ie({},Tr,{dataTransfer:0}),Zs=Or(xs),Tu=ie({},Oa,{relatedTarget:0}),Sr=Or(Tu),$n=ie({},Ba,{animationName:0,elapsedTime:0,pseudoElement:0}),Dr=Or($n),xh=ie({},Ba,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Pc=Or(xh),vh=ie({},Ba,{data:0}),jc=Or(vh),Ni={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Al={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"},Uo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hx(l){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(l):(l=Uo[l])?!!h[l]:!1}function zo(){return Hx}var mi=ie({},Oa,{key:function(l){if(l.key){var h=Ni[l.key]||l.key;if(h!=="Unidentified")return h}return l.type==="keypress"?(l=Xs(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Al[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zo,charCode:function(l){return l.type==="keypress"?Xs(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Xs(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),pf=Or(mi),gf=ie({},Tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=Or(gf),yh=ie({},Oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zo}),bh=Or(yh),Wx=ie({},Ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vx=Or(Wx),vf=ie({},Tr,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),$x=Or(vf),Ti=[9,13,27,32],Qs=c&&"CompositionEvent"in window,Lc=null;c&&"documentMode"in document&&(Lc=document.documentMode);var vs=c&&"TextEvent"in window&&!Lc,yf=c&&(!Qs||Lc&&8<Lc&&11>=Lc),Go=" ",bf=!1;function Nl(l,h){switch(l){case"keyup":return Ti.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wh(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ys=!1;function Kx(l,h){switch(l){case"compositionend":return wh(h);case"keypress":return h.which!==32?null:(bf=!0,Go);case"textInput":return l=h.data,l===Go&&bf?null:l;default:return null}}function eo(l,h){if(ys)return l==="compositionend"||!Qs&&Nl(l,h)?(l=Bo(),di=sa=Za=null,ys=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return yf&&h.locale!=="ko"?null:h.data;default:return null}}var Mu={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 wf(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h==="input"?!!Mu[l.type]:h==="textarea"}function Ru(l,h,y,E){Se(E),h=_(h,"onChange"),0<h.length&&(y=new Oo("onChange","change",null,y,E),l.push({event:y,listeners:h}))}var Ic=null,Qa=null;function Yx(l){Th(l,0)}function bs(l){var h=Ko(l);if(zt(h))return l}function qx(l,h){if(l==="change")return h}var Zi=!1;if(c){var Tl;if(c){var Du="oninput"in document;if(!Du){var Pu=document.createElement("div");Pu.setAttribute("oninput","return;"),Du=typeof Pu.oninput=="function"}Tl=Du}else Tl=!1;Zi=Tl&&(!document.documentMode||9<document.documentMode)}function Bc(){Ic&&(Ic.detachEvent("onpropertychange",ju),Qa=Ic=null)}function ju(l){if(l.propertyName==="value"&&bs(Qa)){var h=[];Ru(h,Qa,l,te(l)),je(Yx,h)}}function Lu(l,h,y){l==="focusin"?(Bc(),Ic=h,Qa=y,Ic.attachEvent("onpropertychange",ju)):l==="focusout"&&Bc()}function Ml(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return bs(Qa)}function Iu(l,h){if(l==="click")return bs(h)}function Sh(l,h){if(l==="input"||l==="change")return bs(h)}function Sf(l,h){return l===h&&(l!==0||1/l===1/h)||l!==l&&h!==h}var Mi=typeof Object.is=="function"?Object.is:Sf;function to(l,h){if(Mi(l,h))return!0;if(typeof l!="object"||l===null||typeof h!="object"||h===null)return!1;var y=Object.keys(l),E=Object.keys(h);if(y.length!==E.length)return!1;for(E=0;E<y.length;E++){var R=y[E];if(!d.call(h,R)||!Mi(l[R],h[R]))return!1}return!0}function Ff(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Fh(l,h){var y=Ff(l);l=0;for(var E;y;){if(y.nodeType===3){if(E=l+y.textContent.length,l<=h&&E>=h)return{node:y,offset:h-l};l=E}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Ff(y)}}function Cf(l,h){return l&&h?l===h?!0:l&&l.nodeType===3?!1:h&&h.nodeType===3?Cf(l,h.parentNode):"contains"in l?l.contains(h):l.compareDocumentPosition?!!(l.compareDocumentPosition(h)&16):!1:!1}function Ch(){for(var l=window,h=Ut();h instanceof l.HTMLIFrameElement;){try{var y=typeof h.contentWindow.location.href=="string"}catch{y=!1}if(y)l=h.contentWindow;else break;h=Ut(l.document)}return h}function _h(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h&&(h==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||h==="textarea"||l.contentEditable==="true")}function Qi(l){var h=Ch(),y=l.focusedElem,E=l.selectionRange;if(h!==y&&y&&y.ownerDocument&&Cf(y.ownerDocument.documentElement,y)){if(E!==null&&_h(y)){if(h=E.start,l=E.end,l===void 0&&(l=h),"selectionStart"in y)y.selectionStart=h,y.selectionEnd=Math.min(l,y.value.length);else if(l=(h=y.ownerDocument||document)&&h.defaultView||window,l.getSelection){l=l.getSelection();var R=y.textContent.length,G=Math.min(E.start,R);E=E.end===void 0?G:Math.min(E.end,R),!l.extend&&G>E&&(R=E,E=G,G=R),R=Fh(y,G);var se=Fh(y,E);R&&se&&(l.rangeCount!==1||l.anchorNode!==R.node||l.anchorOffset!==R.offset||l.focusNode!==se.node||l.focusOffset!==se.offset)&&(h=h.createRange(),h.setStart(R.node,R.offset),l.removeAllRanges(),G>E?(l.addRange(h),l.extend(se.node,se.offset)):(h.setEnd(se.node,se.offset),l.addRange(h)))}}for(h=[],l=y;l=l.parentNode;)l.nodeType===1&&h.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<h.length;y++)l=h[y],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var Bu=c&&"documentMode"in document&&11>=document.documentMode,Rl=null,Dl=null,Oc=null,Ou=!1;function _f(l,h,y){var E=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;Ou||Rl==null||Rl!==Ut(E)||(E=Rl,"selectionStart"in E&&_h(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),Oc&&to(Oc,E)||(Oc=E,E=_(Dl,"onSelect"),0<E.length&&(h=new Oo("onSelect","select",null,h,y),l.push({event:h,listeners:E}),h.target=Rl)))}function no(l,h){var y={};return y[l.toLowerCase()]=h.toLowerCase(),y["Webkit"+l]="webkit"+h,y["Moz"+l]="moz"+h,y}var Pl={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionend:no("Transition","TransitionEnd")},ro={},Eh={};c&&(Eh=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function Uc(l){if(ro[l])return ro[l];if(!Pl[l])return l;var h=Pl[l],y;for(y in h)if(h.hasOwnProperty(y)&&y in Eh)return ro[l]=h[y];return l}var Ef=Uc("animationend"),es=Uc("animationiteration"),kh=Uc("animationstart"),Ah=Uc("transitionend"),jl=new Map,kf="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 Ri(l,h){jl.set(l,h),s(h,[l])}for(var Ho=0;Ho<kf.length;Ho++){var Uu=kf[Ho],Af=Uu.toLowerCase(),Jx=Uu[0].toUpperCase()+Uu.slice(1);Ri(Af,"on"+Jx)}Ri(Ef,"onAnimationEnd"),Ri(es,"onAnimationIteration"),Ri(kh,"onAnimationStart"),Ri("dblclick","onDoubleClick"),Ri("focusin","onFocus"),Ri("focusout","onBlur"),Ri(Ah,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focu
5sin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ll="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(" "),Nf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ll));function Nh(l,h,y){var E=l.type||"unknown-event";l.currentTarget=y,Z(E,h,void 0,l),l.currentTarget=null}function Th(l,h){h=(h&4)!==0;for(var y=0;y<l.length;y++){var E=l[y],R=E.event;E=E.listeners;e:{var G=void 0;if(h)for(var se=E.length-1;0<=se;se--){var Pe=E[se],Ye=Pe.instance,At=Pe.currentTarget;if(Pe=Pe.listener,Ye!==G&&R.isPropagationStopped())break e;Nh(R,Pe,At),G=Ye}else for(se=0;se<E.length;se++){if(Pe=E[se],Ye=Pe.instance,At=Pe.currentTarget,Pe=Pe.listener,Ye!==G&&R.isPropagationStopped())break e;Nh(R,Pe,At),G=Ye}}}if(ht)throw l=ft,ht=!1,ft=null,l}function yr(l,h){var y=h[Ul];y===void 0&&(y=h[Ul]=new Set);var E=l+"__bubble";y.has(E)||(Tf(h,l,2,!1),y.add(E))}function Mh(l,h,y){var E=0;h&&(E|=4),Tf(y,l,E,h)}var zc="_reactListening"+Math.random().toString(36).slice(2);function Il(l){if(!l[zc]){l[zc]=!0,a.forEach(function(y){y!=="selectionchange"&&(Nf.has(y)||Mh(y,!1,l),Mh(y,!0,l))});var h=l.nodeType===9?l:l.ownerDocument;h===null||h[zc]||(h[zc]=!0,Mh("selectionchange",!1,h))}}function Tf(l,h,y,E){switch(Vn(h)){case 1:var R=lr;break;case 4:R=qn;break;default:R=ka}y=R.bind(null,h,y,l),R=void 0,!Kt||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(R=!0),E?R!==void 0?l.addEventListener(h,y,{capture:!0,passive:R}):l.addEventListener(h,y,!0):R!==void 0?l.addEventListener(h,y,{passive:R}):l.addEventListener(h,y,!1)}function u(l,h,y,E,R){var G=E;if((h&1)===0&&(h&2)===0&&E!==null)e:for(;;){if(E===null)return;var se=E.tag;if(se===3||se===4){var Pe=E.stateNode.containerInfo;if(Pe===R||Pe.nodeType===8&&Pe.parentNode===R)break;if(se===4)for(se=E.return;se!==null;){var Ye=se.tag;if((Ye===3||Ye===4)&&(Ye=se.stateNode.containerInfo,Ye===R||Ye.nodeType===8&&Ye.parentNode===R))return;se=se.return}for(;Pe!==null;){if(se=Vo(Pe),se===null)return;if(Ye=se.tag,Ye===5||Ye===6){E=G=se;continue e}Pe=Pe.parentNode}}E=E.return}je(function(){var At=G,qt=te(y),en=[];e:{var Yt=jl.get(l);if(Yt!==void 0){var pn=Oo,Cn=l;switch(l){case"keypress":if(Xs(y)===0)break e;case"keydown":case"keyup":pn=pf;break;case"focusin":Cn="focus",pn=Sr;break;case"focusout":Cn="blur",pn=Sr;break;case"beforeblur":case"afterblur":pn=Sr;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pn=Ua;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pn=Zs;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pn=bh;break;case Ef:case es:case kh:pn=Dr;break;case Ah:pn=Vx;break;case"scroll":pn=gs;break;case"wheel":pn=$x;break;case"copy":case"cut":case"paste":pn=Pc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pn=xf}var kn=(h&4)!==0,Vr=!kn&&l==="scroll",mt=kn?Yt!==null?Yt+"Capture":null:Yt;kn=[];for(var nt=At,yt;nt!==null;){yt=nt;var nn=yt.stateNode;if(yt.tag===5&&nn!==null&&(yt=nn,mt!==null&&(nn=_t(nt,mt),nn!=null&&kn.push(g(nt,nn,yt)))),Vr)break;nt=nt.return}0<kn.length&&(Yt=new pn(Yt,Cn,null,y,qt),en.push({event:Yt,listeners:kn}))}}if((h&7)===0){e:{if(Yt=l==="mouseover"||l==="pointerover",pn=l==="mouseout"||l==="pointerout",Yt&&y!==oe&&(Cn=y.relatedTarget||y.fromElement)&&(Vo(Cn)||Cn[fr]))break e;if((pn||Yt)&&(Yt=qt.window===qt?qt:(Yt=qt.ownerDocument)?Yt.defaultView||Yt.parentWindow:window,pn?(Cn=y.relatedTarget||y.toElement,pn=At,Cn=Cn?Vo(Cn):null,Cn!==null&&(Vr=it(Cn),Cn!==Vr||Cn.tag!==5&&Cn.tag!==6)&&(Cn=null)):(pn=null,Cn=At),pn!==Cn)){if(kn=Ua,nn="onMouseLeave",mt="onMouseEnter",nt="mouse",(l==="pointerout"||l==="pointerover")&&(kn=xf,nn="onPointerLeave",mt="onPointerEnter",nt="pointer"),Vr=pn==null?Yt:Ko(pn),yt=Cn==null?Yt:Ko(Cn),Yt=new kn(nn,nt+"leave",pn,y,qt),Yt.target=Vr,Yt.relatedTarget=yt,nn=null,Vo(qt)===At&&(kn=new kn(mt,nt+"enter",Cn,y,qt),kn.target=yt,kn.relatedTarget=Vr,nn=kn),Vr=nn,pn&&Cn)t:{for(kn=pn,mt=Cn,nt=0,yt=kn;yt;yt=M(yt))nt++;for(yt=0,nn=mt;nn;nn=M(nn))yt++;for(;0<nt-yt;)kn=M(kn),nt--;for(;0<yt-nt;)mt=M(mt),yt--;for(;nt--;){if(kn===mt||mt!==null&&kn===mt.alternate)break t;kn=M(kn),mt=M(mt)}kn=null}else kn=null;pn!==null&&V(en,Yt,pn,kn,!1),Cn!==null&&Vr!==null&&V(en,Vr,Cn,kn,!0)}}
vendor: 5,875 bytes, lines 5-6
5e:{if(Yt=At?Ko(At):window,pn=Yt.nodeName&&Yt.nodeName.toLowerCase(),pn==="select"||pn==="input"&&Yt.type==="file")var An=qx;else if(wf(Yt))if(Zi)An=Sh;else{An=Ml;var Dn=Lu}else(pn=Yt.nodeName)&&pn.toLowerCase()==="input"&&(Yt.type==="checkbox"||Yt.type==="radio")&&(An=Iu);if(An&&(An=An(l,At))){Ru(en,An,y,qt);break e}Dn&&Dn(l,Yt,At),l==="focusout"&&(Dn=Yt._wrapperState)&&Dn.controlled&&Yt.type==="number"&&Tt(Yt,"number",Yt.value)}switch(Dn=At?Ko(At):window,l){case"focusin":(wf(Dn)||Dn.contentEditable==="true")&&(Rl=Dn,Dl=At,Oc=null);break;case"focusout":Oc=Dl=Rl=null;break;case"mousedown":Ou=!0;break;case"contextmenu":case"mouseup":case"dragend":Ou=!1,_f(en,y,qt);break;case"selectionchange":if(Bu)break;case"keydown":case"keyup":_f(en,y,qt)}var Pn;if(Qs)e:{switch(l){case"compositionstart":var Gn="onCompositionStart";break e;case"compositionend":Gn="onCompositionEnd";break e;case"compositionupdate":Gn="onCompositionUpdate";break e}Gn=void 0}else ys?Nl(l,y)&&(Gn="onCompositionEnd"):l==="keydown"&&y.keyCode===229&&(Gn="onCompositionStart");Gn&&(yf&&y.locale!=="ko"&&(ys||Gn!=="onCompositionStart"?Gn==="onCompositionEnd"&&ys&&(Pn=Bo()):(Za=qt,sa="value"in Za?Za.value:Za.textContent,ys=!0)),Dn=_(At,Gn),0<Dn.length&&(Gn=new jc(Gn,l,null,y,qt),en.push({event:Gn,listeners:Dn}),Pn?Gn.data=Pn:(Pn=wh(y),Pn!==null&&(Gn.data=Pn)))),(Pn=vs?Kx(l,y):eo(l,y))&&(At=_(At,"onBeforeInput"),0<At.length&&(qt=new jc("onBeforeInput","beforeinput",null,y,qt),en.push({event:qt,listeners:At}),qt.data=Pn))}Th(en,h)})}function g(l,h,y){return{instance:l,listener:h,currentTarget:y}}function _(l,h){for(var y=h+"Capture",E=[];l!==null;){var R=l,G=R.stateNode;R.tag===5&&G!==null&&(R=G,G=_t(l,y),G!=null&&E.unshift(g(l,G,R)),G=_t(l,h),G!=null&&E.push(g(l,G,R))),l=l.return}return E}function M(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function V(l,h,y,E,R){for(var G=h._reactName,se=[];y!==null&&y!==E;){var Pe=y,Ye=Pe.alternate,At=Pe.stateNode;if(Ye!==null&&Ye===E)break;Pe.tag===5&&At!==null&&(Pe=At,R?(Ye=_t(y,G),Ye!=null&&se.unshift(g(y,Ye,Pe))):R||(Ye=_t(y,G),Ye!=null&&se.push(g(y,Ye,Pe)))),y=y.return}se.length!==0&&l.push({event:h,listeners:se})}var ce=/\r\n?/g,Ue=/\u0000|\uFFFD/g;function dt(l){return(typeof l=="string"?l:""+l).replace(ce,`
6`).replace(Ue,"")}function kt(l,h,y){if(h=dt(h),dt(l)!==h&&y)throw Error(n(425))}function $t(){}var hn=null,Rn=null;function Kn(l,h){return l==="textarea"||l==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var oa=typeof setTimeout=="function"?setTimeout:void 0,Zr=typeof clearTimeout=="function"?clearTimeout:void 0,ei=typeof Promise=="function"?Promise:void 0,za=typeof queueMicrotask=="function"?queueMicrotask:typeof ei<"u"?function(l){return ei.resolve(null).then(l).catch(Bl)}:oa;function Bl(l){setTimeout(function(){throw l})}function Rh(l,h){var y=h,E=0;do{var R=y.nextSibling;if(l.removeChild(y),R&&R.nodeType===8)if(y=R.data,y==="/$"){if(E===0){l.removeChild(R),Mn(h);return}E--}else y!=="$"&&y!=="$?"&&y!=="$!"||E++;y=R}while(y);Mn(h)}function ao(l){for(;l!=null;l=l.nextSibling){var h=l.nodeType;if(h===1||h===3)break;if(h===8){if(h=l.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return l}function Mf(l){l=l.previousSibling;for(var h=0;l;){if(l.nodeType===8){var y=l.data;if(y==="$"||y==="$!"||y==="$?"){if(h===0)return l;h--}else y==="/$"&&h++}l=l.previousSibling}return null}var Wo=Math.random().toString(36).slice(2),ts="__reactFiber$"+Wo,Ol="__reactProps$"+Wo,fr="__reactContainer$"+Wo,Ul="__reactEvents$"+Wo,Xx="__reactListeners$"+Wo,Zx="__reactHandles$"+Wo;function Vo(l){var h=l[ts];if(h)return h;for(var y=l.parentNode;y;){if(h=y[fr]||y[ts]){if(y=h.alternate,h.child!==null||y!==null&&y.child!==null)for(l=Mf(l);l!==null;){if(y=l[ts])return y;l=Mf(l)}return h}l=y,y=l.parentNode}return null}function $o(l){return l=l[ts]||l[fr],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ko(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function zu(l){return l[Ol]||null}var Qx=[],Gu=-1;function zl(l){return{current:l}}function kr(l){0>Gu||(l.current=Qx[Gu],Qx[Gu]=null,Gu--)}function Fr(l,h){Gu++,Qx[Gu]=l.current,l.current=h}var Gl={},Ga=zl(Gl),fi=zl(!1),Gc=Gl;function Hu(l,h){var y=l.type.contextTypes;if(!y)return Gl;var E=l.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===h)return E.__reactInternalMemoizedMaskedChildContext;var R={},G;for(G in y)R[G]=h[G];return E&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=h,l.__reactInternalMemoizedMaskedChildContext=R),R}function pi(l){return l=l.childContextTypes,l!=null}function Rf(){kr(fi),kr(Ga)}function vS(l,h,y){if(Ga.current!==Gl)throw Error(n(168));Fr(Ga,h),Fr(fi,y)}function yS(l,h,y){var E=l.stateNode;if(h=h.childContextTypes,typeof E.getChildContext!="function")return y;E=E.getChildContext();for(var R in E)if(!(R in h))throw Error(n(108,Ce(l)||"Unknown",R));return ie({},y,E)}function Df(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Gl,Gc=Ga.current,Fr(Ga,l),Fr(fi,fi.current),!0}function bS(l,h,y){var E=l.stateNode;if(!E)throw Error(n(169));y?(l=yS(l,h,Gc),E.__reactInternalMemoizedMergedChildContext=l,kr(fi),kr(Ga),Fr(Ga,l)):kr(fi),Fr(fi,y)}var Yo=null,Pf=!1,e0=!1;function wS(l){Yo===null?Yo=[l]:Yo.push(l)}function fR(l){Pf=!0,wS(l)}function Hl(){if(!e0&&Yo!==null){e0=!0;var l=0,h=rn;try{var y=Yo;for(rn=1;l<y.length;l++){var E=y[l];do E=E(!0);while(E!==null)}Yo=null,Pf=!1}catch(R){throw Yo!==null&&(Yo=Yo.slice(l+1)),tt(de,Hl),R}finally{rn=h,e0=!1}}return null}var Wu=[],Vu=0,jf=null,Lf=0,ns=[],rs=0,Hc=null,qo=1,Jo="";function Wc(l,h){Wu[Vu++]=Lf,Wu[Vu++]=jf,jf=l,Lf=h}function SS(l,h,y){ns[rs++]=qo,ns[rs++]=Jo,ns[rs++]=Hc,Hc=l;var E=qo;l=Jo;var R=32-pt(E)-1;
vendor: 5,188 bytes, line 6
6E&=~(1<<R),y+=1;var G=32-pt(h)+R;if(30<G){var se=R-R%5;G=(E&(1<<se)-1).toString(32),E>>=se,R-=se,qo=1<<32-pt(h)+R|y<<R|E,Jo=G+l}else qo=1<<G|y<<R|E,Jo=l}function t0(l){l.return!==null&&(Wc(l,1),SS(l,1,0))}function n0(l){for(;l===jf;)jf=Wu[--Vu],Wu[Vu]=null,Lf=Wu[--Vu],Wu[Vu]=null;for(;l===Hc;)Hc=ns[--rs],ns[rs]=null,Jo=ns[--rs],ns[rs]=null,qo=ns[--rs],ns[rs]=null}var Di=null,Pi=null,Mr=!1,ws=null;function FS(l,h){var y=os(5,null,null,0);y.elementType="DELETED",y.stateNode=h,y.return=l,h=l.deletions,h===null?(l.deletions=[y],l.flags|=16):h.push(y)}function CS(l,h){switch(l.tag){case 5:var y=l.type;return h=h.nodeType!==1||y.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(l.stateNode=h,Di=l,Pi=ao(h.firstChild),!0):!1;case 6:return h=l.pendingProps===""||h.nodeType!==3?null:h,h!==null?(l.stateNode=h,Di=l,Pi=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(y=Hc!==null?{id:qo,overflow:Jo}:null,l.memoizedState={dehydrated:h,treeContext:y,retryLane:1073741824},y=os(18,null,null,0),y.stateNode=h,y.return=l,l.child=y,Di=l,Pi=null,!0):!1;default:return!1}}function r0(l){return(l.mode&1)!==0&&(l.flags&128)===0}function a0(l){if(Mr){var h=Pi;if(h){var y=h;if(!CS(l,h)){if(r0(l))throw Error(n(418));h=ao(y.nextSibling);var E=Di;h&&CS(l,h)?FS(E,y):(l.flags=l.flags&-4097|2,Mr=!1,Di=l)}}else{if(r0(l))throw Error(n(418));l.flags=l.flags&-4097|2,Mr=!1,Di=l}}}function _S(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Di=l}function If(l){if(l!==Di)return!1;if(!Mr)return _S(l),Mr=!0,!1;var h;if((h=l.tag!==3)&&!(h=l.tag!==5)&&(h=l.type,h=h!=="head"&&h!=="body"&&!Kn(l.type,l.memoizedProps)),h&&(h=Pi)){if(r0(l))throw ES(),Error(n(418));for(;h;)FS(l,h),h=ao(h.nextSibling)}if(_S(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,h=0;l;){if(l.nodeType===8){var y=l.data;if(y==="/$"){if(h===0){Pi=ao(l.nextSibling);break e}h--}else y!=="$"&&y!=="$!"&&y!=="$?"||h++}l=l.nextSibling}Pi=null}}else Pi=Di?ao(l.stateNode.nextSibling):null;return!0}function ES(){for(var l=Pi;l;)l=ao(l.nextSibling)}function $u(){Pi=Di=null,Mr=!1}function i0(l){ws===null?ws=[l]:ws.push(l)}var pR=P.ReactCurrentBatchConfig;function Dh(l,h,y){if(l=y.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(n(309));var E=y.stateNode}if(!E)throw Error(n(147,l));var R=E,G=""+l;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===G?h.ref:(h=function(se){var Pe=R.refs;se===null?delete Pe[G]:Pe[G]=se},h._stringRef=G,h)}if(typeof l!="string")throw Error(n(284));if(!y._owner)throw Error(n(290,l))}return l}function Bf(l,h){throw l=Object.prototype.toString.call(h),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":l))}function kS(l){var h=l._init;return h(l._payload)}function AS(l){function h(mt,nt){if(l){var yt=mt.deletions;yt===null?(mt.deletions=[nt],mt.flags|=16):yt.push(nt)}}function y(mt,nt){if(!l)return null;for(;nt!==null;)h(mt,nt),nt=nt.sibling;return null}function E(mt,nt){for(mt=new Map;nt!==null;)nt.key!==null?mt.set(nt.key,nt):mt.set(nt.index,nt),nt=nt.sibling;return mt}function R(mt,nt){return mt=Xl(mt,nt),mt.index=0,mt.sibling=null,mt}function G(mt,nt,yt){return mt.index=yt,l?(yt=mt.alternate,yt!==null?(yt=yt.index,yt<nt?(mt.flags|=2,nt):yt):(mt.flags|=2,nt)):(mt.flags|=1048576,nt)}function se(mt){return l&&mt.alternate===null&&(mt.flags|=2),mt}function Pe(mt,nt,yt,nn){return nt===null||nt.tag!==6?(nt=J0(yt,mt.mode,nn),nt.return=mt,nt):(nt=R(nt,yt),nt.return=mt,nt)}function Ye(mt,nt,yt,nn){var An=yt.type;return An===T?qt(mt,nt,yt.props.children,nn,yt.key):nt!==null&&(nt.elementType===An||typeof An=="object"&&An!==null&&An.$$typeof===Y&&kS(An)===nt.type)?(nn=R(nt,yt.props),nn.ref=Dh(mt,nt,yt),nn.return=mt,nn):(nn=lp(yt.type,yt.key,yt.props,null,mt.mode,nn),nn.ref=Dh(mt,nt,yt),nn.return=mt,nn)}function At(mt,nt,yt,nn){return nt===null||nt.tag!==4||nt.stateNode.containerInfo!==yt.containerInfo||nt.stateNode.implementation!==yt.implementation?(nt=X0(yt,mt.mode,nn),nt.return=mt,nt):(nt=R(nt,yt.children||[]),nt.return=mt,nt)}function qt(mt,nt,yt,nn,An){return nt===null||nt.tag!==7?(nt=Zc(yt,mt.mode,nn,An),nt.return=mt,nt):(nt=R(nt,yt),nt.return=mt,nt)}function en(mt,nt,yt){if(typeof nt=="string"&&nt!==""||typeof nt=="number")return nt=J0(""+nt,mt.mode,yt),nt.return=mt,nt;if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case z:return yt=lp(nt.type,nt.key,nt.props,null,mt.mode,yt),yt.ref=Dh(mt,null,nt),yt.return=mt,yt;case D:return nt=X0(nt,mt.mode,yt),nt.return=mt,nt;case Y:var nn=nt._init;return en(mt,nn(nt._payload),yt)}if(Wt(nt)||J(nt))return nt=Zc(nt,mt.mode,yt,null),nt.return=mt,nt;Bf(mt,nt)}return null}function Yt(mt,nt,yt,nn){var An=nt!==null?nt.key:null;if(typeof yt=="string"&&yt!==""||typeof yt=="number")return An!==null?null:Pe(mt,nt,""+yt,nn);if(typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case z:return yt.key===An?Ye(mt,nt,yt,nn):null;case D:return yt.key===An?At(mt,nt,yt,nn):null;case Y:return An=yt._init,Yt(mt,nt,An(yt._payload),nn)}if(Wt(yt)||J(yt))return An!==null?null:qt(mt,nt,yt,nn,null);Bf(mt,yt)}return null}
vendor: 20,499 bytes, lines 6-8
6function pn(mt,nt,yt,nn,An){if(typeof nn=="string"&&nn!==""||typeof nn=="number")return mt=mt.get(yt)||null,Pe(nt,mt,""+nn,An);if(typeof nn=="object"&&nn!==null){switch(nn.$$typeof){case z:return mt=mt.get(nn.key===null?yt:nn.key)||null,Ye(nt,mt,nn,An);case D:return mt=mt.get(nn.key===null?yt:nn.key)||null,At(nt,mt,nn,An);case Y:var Dn=nn._init;return pn(mt,nt,yt,Dn(nn._payload),An)}if(Wt(nn)||J(nn))return mt=mt.get(yt)||null,qt(nt,mt,nn,An,null);Bf(nt,nn)}return null}function Cn(mt,nt,yt,nn){for(var An=null,Dn=null,Pn=nt,Gn=nt=0,ya=null;Pn!==null&&Gn<yt.length;Gn++){Pn.index>Gn?(ya=Pn,Pn=null):ya=Pn.sibling;var cr=Yt(mt,Pn,yt[Gn],nn);if(cr===null){Pn===null&&(Pn=ya);break}l&&Pn&&cr.alternate===null&&h(mt,Pn),nt=G(cr,nt,Gn),Dn===null?An=cr:Dn.sibling=cr,Dn=cr,Pn=ya}if(Gn===yt.length)return y(mt,Pn),Mr&&Wc(mt,Gn),An;if(Pn===null){for(;Gn<yt.length;Gn++)Pn=en(mt,yt[Gn],nn),Pn!==null&&(nt=G(Pn,nt,Gn),Dn===null?An=Pn:Dn.sibling=Pn,Dn=Pn);return Mr&&Wc(mt,Gn),An}for(Pn=E(mt,Pn);Gn<yt.length;Gn++)ya=pn(Pn,mt,Gn,yt[Gn],nn),ya!==null&&(l&&ya.alternate!==null&&Pn.delete(ya.key===null?Gn:ya.key),nt=G(ya,nt,Gn),Dn===null?An=ya:Dn.sibling=ya,Dn=ya);return l&&Pn.forEach(function(Zl){return h(mt,Zl)}),Mr&&Wc(mt,Gn),An}function kn(mt,nt,yt,nn){var An=J(yt);if(typeof An!="function")throw Error(n(150));if(yt=An.call(yt),yt==null)throw Error(n(151));for(var Dn=An=null,Pn=nt,Gn=nt=0,ya=null,cr=yt.next();Pn!==null&&!cr.done;Gn++,cr=yt.next()){Pn.index>Gn?(ya=Pn,Pn=null):ya=Pn.sibling;var Zl=Yt(mt,Pn,cr.value,nn);if(Zl===null){Pn===null&&(Pn=ya);break}l&&Pn&&Zl.alternate===null&&h(mt,Pn),nt=G(Zl,nt,Gn),Dn===null?An=Zl:Dn.sibling=Zl,Dn=Zl,Pn=ya}if(cr.done)return y(mt,Pn),Mr&&Wc(mt,Gn),An;if(Pn===null){for(;!cr.done;Gn++,cr=yt.next())cr=en(mt,cr.value,nn),cr!==null&&(nt=G(cr,nt,Gn),Dn===null?An=cr:Dn.sibling=cr,Dn=cr);return Mr&&Wc(mt,Gn),An}for(Pn=E(mt,Pn);!cr.done;Gn++,cr=yt.next())cr=pn(Pn,mt,Gn,cr.value,nn),cr!==null&&(l&&cr.alternate!==null&&Pn.delete(cr.key===null?Gn:cr.key),nt=G(cr,nt,Gn),Dn===null?An=cr:Dn.sibling=cr,Dn=cr);return l&&Pn.forEach(function(YR){return h(mt,YR)}),Mr&&Wc(mt,Gn),An}function Vr(mt,nt,yt,nn){if(typeof yt=="object"&&yt!==null&&yt.type===T&&yt.key===null&&(yt=yt.props.children),typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case z:e:{for(var An=yt.key,Dn=nt;Dn!==null;){if(Dn.key===An){if(An=yt.type,An===T){if(Dn.tag===7){y(mt,Dn.sibling),nt=R(Dn,yt.props.children),nt.return=mt,mt=nt;break e}}else if(Dn.elementType===An||typeof An=="object"&&An!==null&&An.$$typeof===Y&&kS(An)===Dn.type){y(mt,Dn.sibling),nt=R(Dn,yt.props),nt.ref=Dh(mt,Dn,yt),nt.return=mt,mt=nt;break e}y(mt,Dn);break}else h(mt,Dn);Dn=Dn.sibling}yt.type===T?(nt=Zc(yt.props.children,mt.mode,nn,yt.key),nt.return=mt,mt=nt):(nn=lp(yt.type,yt.key,yt.props,null,mt.mode,nn),nn.ref=Dh(mt,nt,yt),nn.return=mt,mt=nn)}return se(mt);case D:e:{for(Dn=yt.key;nt!==null;){if(nt.key===Dn)if(nt.tag===4&&nt.stateNode.containerInfo===yt.containerInfo&&nt.stateNode.implementation===yt.implementation){y(mt,nt.sibling),nt=R(nt,yt.children||[]),nt.return=mt,mt=nt;break e}else{y(mt,nt);break}else h(mt,nt);nt=nt.sibling}nt=X0(yt,mt.mode,nn),nt.return=mt,mt=nt}return se(mt);case Y:return Dn=yt._init,Vr(mt,nt,Dn(yt._payload),nn)}if(Wt(yt))return Cn(mt,nt,yt,nn);if(J(yt))return kn(mt,nt,yt,nn);Bf(mt,yt)}return typeof yt=="string"&&yt!==""||typeof yt=="number"?(yt=""+yt,nt!==null&&nt.tag===6?(y(mt,nt.sibling),nt=R(nt,yt),nt.return=mt,mt=nt):(y(mt,nt),nt=J0(yt,mt.mode,nn),nt.return=mt,mt=nt),se(mt)):y(mt,nt)}return Vr}var Ku=AS(!0),NS=AS(!1),Of=zl(null),Uf=null,Yu=null,s0=null;function o0(){s0=Yu=Uf=null}function l0(l){var h=Of.current;kr(Of),l._currentValue=h}function c0(l,h,y){for(;l!==null;){var E=l.alternate;if((l.childLanes&h)!==h?(l.childLanes|=h,E!==null&&(E.childLanes|=h)):E!==null&&(E.childLanes&h)!==h&&(E.childLanes|=h),l===y)break;l=l.return}}function qu(l,h){Uf=l,s0=Yu=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&h)!==0&&(gi=!0),l.firstContext=null)}function as(l){var h=l._currentValue;if(s0!==l)if(l={context:l,memoizedValue:h,next:null},Yu===null){if(Uf===null)throw Error(n(308));Yu=l,Uf.dependencies={lanes:0,firstContext:l}}else Yu=Yu.next=l;return h}var Vc=null;function u0(l){Vc===null?Vc=[l]:Vc.push(l)}function TS(l,h,y,E){var R=h.interleaved;return R===null?(y.next=y,u0(h)):(y.next=R.next,R.next=y),h.interleaved=y,Xo(l,E)}function Xo(l,h){l.lanes|=h;var y=l.alternate;for(y!==null&&(y.lanes|=h),y=l,l=l.return;l!==null;)l.childLanes|=h,y=l.alternate,y!==null&&(y.childLanes|=h),y=l,l=l.return;return y.tag===3?y.stateNode:null}var Wl=!1;function d0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function MS(l,h){l=l.updateQueue,h.updateQueue===l&&(h.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Zo(l,h){return{eventTime:l,lane:h,tag:0,payload:null,callback:null,next:null}}function Vl(l,h,y){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(ir&2)!==0){var R=E.pending;return R===null?h.next=h:(h.next=R.next,R.next=h),E.pending=h,Xo(l,y)}return R=E.interleaved,R===null?(h.next=h,u0(E)):(h.next=R.next,R.next=h),E.interleaved=h,Xo(l,y)}function zf(l,h,y){if(h=h.updateQueue,h!==null&&(h=h.shared,(y&4194240)!==0)){var E=h.lanes;E&=l.pendingLanes,y|=E,h.lanes=y,_n(l,y)}}function RS(l,h){var y=l.updateQueue,E=l.alternate;if(E!==null&&(E=E.updateQueue,y===E)){var R=null,G=null;if(y=y.firstBaseUpdate,y!==null){do{var se={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};G===null?R=G=se:G=G.next=se,y=y.next}while(y!==null);G===null?R=G=h:G=G.next=h}else R=G=h;y={baseState:E.baseState,firstBaseUpdate:R,lastBaseUpdate:G,shared:E.shared,effects:E.effects},l.updateQueue=y;return}l=y.lastBaseUpdate,l===null?y.firstBaseUpdate=h:l.next=h,y.lastBaseUpdate=h}function Gf(l,h,y,E){var R=l.updateQueue;Wl=!1;var G=R.firstBaseUpdate,se=R.lastBaseUpdate,Pe=R.shared.pending;if(Pe!==null){R.shared.pending=null;var Ye=Pe,At=Ye.next;Ye.next=null,se===null?G=At:se.next=At,se=Ye;var qt=l.alternate;qt!==null&&(qt=qt.updateQueue,Pe=qt.lastBaseUpdate,Pe!==se&&(Pe===null?qt.firstBaseUpdate=At:Pe.next=At,qt.lastBaseUpdate=Ye))}if(G!==null){var en=R.baseState;se=0,qt=At=Ye=null,Pe=G;do{var Yt=Pe.lane,pn=Pe.eventTime;if((E&Yt)===Yt){qt!==null&&(qt=qt.next={eventTime:pn,lane:0,tag:Pe.tag,payload:Pe.payload,callback:Pe.callback,next:null});e:{var Cn=l,kn=Pe;switch(Yt=h,pn=y,kn.tag){case 1:if(Cn=kn.payload,typeof Cn=="function"){en=Cn.call(pn,en,Yt);break e}en=Cn;break e;case 3:Cn.flags=Cn.flags&-65537|128;case 0:if(Cn=kn.payload,Yt=typeof Cn=="function"?Cn.call(pn,en,Yt):Cn,Yt==null)break e;en=ie({},en,Yt);break e;case 2:Wl=!0}}Pe.callback!==null&&Pe.lane!==0&&(l.flags|=64,Yt=R.effects,Yt===null?R.effects=[Pe]:Yt.push(Pe))}else pn={eventTime:pn,lane:Yt,tag:Pe.tag,payload:Pe.payload,callback:Pe.callback,next:null},qt===null?(At=qt=pn,Ye=en):qt=qt.next=pn,se|=Yt;if(Pe=Pe.next,Pe===null){if(Pe=R.shared.pending,Pe===null)break;Yt=Pe,Pe=Yt.next,Yt.next=null,R.lastBaseUpdate=Yt,R.shared.pending=null}}while(!0);if(qt===null&&(Ye=en),R.baseState=Ye,R.firstBaseUpdate=At,R.lastBaseUpdate=qt,h=R.shared.interleaved,h!==null){R=h;do se|=R.lane,R=R.next;while(R!==h)}else G===null&&(R.shared.lanes=0);Yc|=se,l.lanes=se,l.memoizedState=en}}function DS(l,h,y){if(l=h.effects,h.effects=null,l!==null)for(h=0;h<l.length;h++){var E=l[h],R=E.callback;if(R!==null){if(E.callback=null,E=y,typeof R!="function")throw Error(n(191,R));R.call(E)}}}var Ph={},io=zl(Ph),jh=zl(Ph),Lh=zl(Ph);function $c(l){if(l===Ph)throw Error(n(174));return l}function h0(l,h){switch(Fr(Lh,h),Fr(jh,l),Fr(io,Ph),l=h.nodeType,l){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:lt(null,"");break;default:l=l===8?h.parentNode:h,h=l.namespaceURI||null,l=l.tagName,h=lt(h,l)}kr(io),Fr(io,h)}function Ju(){kr(io),kr(jh),kr(Lh)}function PS(l){$c(Lh.current);var h=$c(io.current),y=lt(h,l.type);h!==y&&(Fr(jh,l),Fr(io,y))}function m0(l){jh.current===l&&(kr(io),kr(jh))}var Pr=zl(0);function Hf(l){for(var h=l;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||y.data==="$?"||y.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var f0=[];function p0(){for(var l=0;l<f0.length;l++)f0[l]._workInProgressVersionPrimary=null;f0.length=0}var Wf=P.ReactCurrentDispatcher,g0=P.ReactCurrentBatchConfig,Kc=0,jr=null,la=null,xa=null,Vf=!1,Ih=!1,Bh=0,gR=0;function Ha(){throw Error(n(321))}function x0(l,h){if(h===null)return!1;for(var y=0;y<h.length&&y<l.length;y++)if(!Mi(l[y],h[y]))return!1;return!0}function v0(l,h,y,E,R,G){if(Kc=G,jr=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,Wf.current=l===null||l.memoizedState===null?bR:wR,l=y(E,R),Ih){G=0;do{if(Ih=!1,Bh=0,25<=G)throw Error(n(301));G+=1,xa=la=null,h.updateQueue=null,Wf.current=SR,l=y(E,R)}while(Ih)}if(Wf.current=Yf,h=la!==null&&la.next!==null,Kc=0,xa=la=jr=null,Vf=!1,h)throw Error(n(300));return l}function y0(){var l=Bh!==0;return Bh=0,l}function so(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xa===null?jr.memoizedState=xa=l:xa=xa.next=l,xa}function is(){if(la===null){var l=jr.alternate;l=l!==null?l.memoizedState:null}else l=la.next;var h=xa===null?jr.memoizedState:xa.next;if(h!==null)xa=h,la=l;else{if(l===null)throw Error(n(310));la=l,l={memoizedState:la.memoizedState,baseState:la.baseState,baseQueue:la.baseQueue,queue:la.queue,next:null},xa===null?jr.memoizedState=xa=l:xa=xa.next=l}return xa}function Oh(l,h){return typeof h=="function"?h(l):h}function b0(l){var h=is(),y=h.queue;if(y===null)throw Error(n(311));y.lastRenderedReducer=l;var E=la,R=E.baseQueue,G=y.pending;if(G!==null){if(R!==null){var se=R.next;R.next=G.next,G.next=se}E.baseQueue=R=G,y.pending=null}if(R!==null){G=R.next,E=E.baseState;var Pe=se=null,Ye=null,At=G;do{var qt=At.lane;if((Kc&qt)===qt)Ye!==null&&(Ye=Ye.next={lane:0,action:At.action,hasEagerState:At.hasEagerState,eagerState:At.eagerState,next:null}),E=At.hasEagerState?At.eagerState:l(E,At.action);else{var en={lane:qt,action:At.action,hasEagerState:At.hasEagerState,eagerState:At.eagerState,next:null};Ye===null?(Pe=Ye=en,se=E):Ye=Ye.next=en,jr.lanes|=qt,Yc|=qt}At=At.next}while(At!==null&&At!==G);Ye===null?se=E:Ye.next=Pe,Mi(E,h.memoizedState)||(gi=!0),h.memoizedState=E,h.baseState=se,h.baseQueue=Ye,y.lastRenderedState=E}if(l=y.interleaved,l!==null){R=l;do G=R.lane,jr.lanes|=G,Yc|=G,R=R.next;while(R!==l)}else R===null&&(y.lanes=0);return[h.memoizedState,y.dispatch]}function w0(l){var h=is(),y=h.queue;if(y===null)throw Error(n(311));y.lastRenderedReducer=l;var E=y.dispatch,R=y.pending,G=h.memoizedState;if(R!==null){y.pending=null;var se=R=R.next;do G=l(G,se.action),se=se.next;while(se!==R);Mi(G,h.memoizedState)||(gi=!0),h.memoizedState=G,h.baseQueue===null&&(h.baseState=G),y.lastRenderedState=G}return[G,E]}function jS(){}function LS(l,h){var y=jr,E=is(),R=h(),G=!Mi(E.memoizedState,R);if(G&&(E.memoizedState=R,gi=!0),E=E.queue,S0(OS.bind(null,y,E,l),[l]),E.getSnapshot!==h||G||xa!==null&&xa.memoizedState.tag&1){if(y.flags|=2048,Uh(9,BS.bind(null,y,E,R,h),void 0,null),va===null)throw Error(n(349));(Kc&30)!==0||IS(y,h,R)}return R}function IS(l,h,y){l.flags|=16384,l={getSnapshot:h,value:y},h=jr.updateQueue,h===null?(h={lastEffect:null,stores:null},jr.updateQueue=h,h.stores=[l]):(y=h.stores,y===null?h.stores=[l]:y.push(l))}function BS(l,h,y,E){h.value=y,h.getSnapshot=E,US(h)&&zS(l)}function OS(l,h,y){return y(function(){US(h)&&zS(l)})}function US(l){var h=l.getSnapshot;l=l.value;try{var y=h();return!Mi(l,y)}catch{return!0}}function zS(l){var h=Xo(l,1);h!==null&&_s(h,l,1,-1)}function GS(l){var h=so();return typeof l=="function"&&(l=l()),h.memoizedState=h.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oh,lastRenderedState:l},h.queue=l,l=l.dispatch=yR.bind(null,jr,l),[h.memoizedState,l]}function Uh(l,h,y,E){return l={tag:l,create:h,destroy:y,deps:E,next:null},h=jr.updateQueue,h===null?(h={lastEffect:null,stores:null},jr.updateQueue=h,h.lastEffect=l.next=l):(y=h.lastEffect,y===null?h.lastEffect=l.next=l:(E=y.next,y.next=l,l.next=E,h.lastEffect=l)),l}function HS(){return is().memoizedState}function $f(l,h,y,E){var R=so();jr.flags|=l,R.memoizedState=Uh(1|h,y,void 0,E===void 0?null:E)}function Kf(l,h,y,E){var R=is();E=E===void 0?null:E;var G=void 0;if(la!==null){var se=la.memoizedState;if(G=se.destroy,E!==null&&x0(E,se.deps)){R.memoizedState=Uh(h,y,G,E);return}}jr.flags|=l,R.memoizedState=Uh(1|h,y,G,E)}function WS(l,h){return $f(8390656,8,l,h)}function S0(l,h){return Kf(2048,8,l,h)}function VS(l,h){return Kf(4,2,l,h)}function $S(l,h){return Kf(4,4,l,h)}function KS(l,h){if(typeof h=="function")return l=l(),h(l),function(){h(null)};if(h!=null)return l=l(),h.current=l,function(){h.current=null}}function YS(l,h,y){return y=y!=null?y.concat([l]):null,Kf(4,4,KS.bind(null,h,l),y)}function F0(){}function qS(l,h){var y=is();h=h===void 0?null:h;var E=y.memoizedState;return E!==null&&h!==null&&x0(h,E[1])?E[0]:(y.memoizedState=[l,h],l)}function JS(l,h){var y=is();h=h===void 0?null:h;var E=y.memoizedState;return E!==null&&h!==null&&x0(h,E[1])?E[0]:(l=l(),y.memoizedState=[l,h],l)}function XS(l,h,y){return(Kc&21)===0?(l.baseState&&(l.baseState=!1,gi=!0),l.memoizedState=y):(Mi(y,h)||(y=Qt(),jr.lanes|=y,Yc|=y,l.baseState=!0),h)}function xR(l,h){var y=rn;rn=y!==0&&4>y?y:4,l(!0);var E=g0.transition;g0.transition={};try{l(!1),h()}finally{rn=y,g0.transition=E}}function ZS(){return is().memoizedState}function vR(l,h,y){var E=ql(l);if(y={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null},QS(l))e2(h,y);else if(y=TS(l,h,y,E),y!==null){var R=ni();_s(y,l,E,R),t2(y,h,E)}}function yR(l,h,y){var E=ql(l),R={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null};if(QS(l))e2(h,R);else{var G=l.alternate;if(l.lanes===0&&(G===null||G.lanes===0)&&(G=h.lastRenderedReducer,G!==null))try{var se=h.lastRenderedState,Pe=G(se,y);if(R.hasEagerState=!0,R.eagerState=Pe,Mi(Pe,se)){var Ye=h.interleaved;Ye===null?(R.next=R,u0(h)):(R.next=Ye.next,Ye.next=R),h.interleaved=R;return}}catch{}y=TS(l,h,R,E),y!==null&&(R=ni(),_s(y,l,E,R),t2(y,h,E))}}function QS(l){var h=l.alternate;return l===jr||h!==null&&h===jr}function e2(l,h){Ih=Vf=!0;var y=l.pending;y===null?h.next=h:(h.next=y.next,y.next=h),l.pending=h}function t2(l,h,y){if((y&4194240)!==0){var E=h.lanes;E&=l.pendingLanes,y|=E,h.lanes=y,_n(l,y)}}var Yf={readContext:as,useCallback:Ha,useContext:Ha,useEffect:Ha,useImperativeHandle:Ha,useInsertionEffect:Ha,useLayoutEffect:Ha,useMemo:Ha,useReducer:Ha,useRef:Ha,useState:Ha,useDebugValue:Ha,useDeferredValue:Ha,useTransition:Ha,useMutableSource:Ha,useSyncExternalStore:Ha,useId:Ha,unstable_isNewReconciler:!1},bR={readContext:as,useCallback:function(l,h){return so().memoizedState=[l,h===void 0?null:h],l},useContext:as,useEffect:WS,useImperativeHandle:function(l,h,y){return y=y!=null?y.concat([l]):null,$f(4194308,4,KS.bind(null,h,l),y)},useLayoutEffect:function(l,h){return $f(4194308,4,l,h)},useInsertionEffect:function(l,h){return $f(4,2,l,h)},useMemo:function(l,h){var y=so();return h=h===void 0?null:h,l=l(),y.memoizedState=[l,h],l},useReducer:function(l,h,y){var E=so();return h=y!==void 0?y(h):h,E.memoizedState=E.baseState=h,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:h},E.queue=l,l=l.dispatch=vR.bind(null,jr,l),[E.memoizedState,l]},useRef:function(l){var h=so();return l={current:l},h.memoizedState=l},useState:GS,useDebugValue:F0,useDeferredValue:function(l){return so().memoizedState=l},useTransition:function(){var l=GS(!1),h=l[0];return l=xR.bind(null,l[1]),so().memoizedState=l,[h,l]},useMutableSource:function(){},useSyncExternalStore:function(l,h,y){var E=jr,R=so();if(Mr){if(y===void 0)throw Error(n(407));y=y()}else{if(y=h(),va===null)throw Error(n(349));(Kc&30)!==0||IS(E,h,y)}R.memoizedState=y;var G={value:y,getSnapshot:h};return R.queue=G,WS(OS.bind(null,E,G,l),[l]),E.flags|=2048,Uh(9,BS.bind(null,E,G,y,h),void 0,null),y},useId:function(){var l=so(),h=va.identifierPrefix;if(Mr){var y=Jo,E=qo;y=(E&~(1<<32-pt(E)-1)).toString(32)+y,h=":"+h+"R"+y,y=Bh++,0<y&&(h+="H"+y.toString(32)),h+=":"}else y=gR++,h=":"+h+"r"+y.toString(32)+":";return l.memoizedState=h},unstable_isNewReconciler:!1},wR={readContext:as,useCallback:qS,useContext:as,useEffect:S0,useImperativeHandle:YS,useInsertionEffect:VS,useLayoutEffect:$S,useMemo:JS,useReducer:b0,useRef:HS,useState:function(){return b0(Oh)},useDebugValue:F0,useDeferredValue:function(l){var h=is();return XS(h,la.memoizedState,l)},useTransition:function(){var l=b0(Oh)[0],h=is().memoizedState;return[l,h]},useMutableSource:jS,useSyncExternalStore:LS,useId:ZS,unstable_isNewReconciler:!1},SR={readContext:as,useCallback:qS,useContext:as,useEffect:S0,useImperativeHandle:YS,useInsertionEffect:VS,useLayoutEffect:$S,useMemo:JS,useReducer:w0,useRef:HS,useState:function(){return w0(Oh)},useDebugValue:F0,useDeferredValue:function(l){var h=is();return la===null?h.memoizedState=l:XS(h,la.memoizedState,l)},useTransition:function(){var l=w0(Oh)[0],h=is().memoizedState;return[l,h]},useMutableSource:jS,useSyncExternalStore:LS,useId:ZS,unstable_isNewReconciler:!1};function Ss(l,h){if(l&&l.defaultProps){h=ie({},h),l=l.defaultProps;for(var y in l)h[y]===void 0&&(h[y]=l[y]);return h}return h}function C0(l,h,y,E){h=l.memoizedState,y=y(E,h),y=y==null?h:ie({},h,y),l.memoizedState=y,l.lanes===0&&(l.updateQueue.baseState=y)}var qf={isMounted:function(l){return(l=l._reactInternals)?it(l)===l:!1},enqueueSetState:function(l,h,y){l=l._reactInternals;var E=ni(),R=ql(l),G=Zo(E,R);G.payload=h,y!=null&&(G.callback=y),h=Vl(l,G,R),h!==null&&(_s(h,l,R,E),zf(h,l,R))},enqueueReplaceState:function(l,h,y){l=l._reactInternals;var E=ni(),R=ql(l),G=Zo(E,R);G.tag=1,G.payload=h,y!=null&&(G.callback=y),h=Vl(l,G,R),h!==null&&(_s(h,l,R,E),zf(h,l,R))},enqueueForceUpdate:function(l,h){l=l._reactInternals;var y=ni(),E=ql(l),R=Zo(y,E);R.tag=2,h!=null&&(R.callback=h),h=Vl(l,R,E),h!==null&&(_s(h,l,E,y),zf(h,l,E))}};function n2(l,h,y,E,R,G,se){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(E,G,se):h.prototype&&h.prototype.isPureReactComponent?!to(y,E)||!to(R,G):!0}function r2(l,h,y){var E=!1,R=Gl,G=h.contextType;return typeof G=="object"&&G!==null?G=as(G):(R=pi(h)?Gc:Ga.current,E=h.contextTypes,G=(E=E!=null)?Hu(l,R):Gl),h=new h(y,G),l.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=qf,l.stateNode=h,h._reactInternals=l,E&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=R,l.__reactInternalMemoizedMaskedChildContext=G),h}function a2(l,h,y,E){l=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(y,E),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(y,E),h.state!==l&&qf.enqueueReplaceState(h,h.state,null)}function _0(l,h,y,E){var R=l.stateNode;R.props=y,R.state=l.memoizedState,R.refs={},d0(l);var G=h.contextType;typeof G=="object"&&G!==null?R.context=as(G):(G=pi(h)?Gc:Ga.current,R.context=Hu(l,G)),R.state=l.memoizedState,G=h.getDerivedStateFromProps,typeof G=="function"&&(C0(l,h,G,y),R.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(h=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),h!==R.state&&qf.enqueueReplaceState(R,R.state,null),Gf(l,y,R,E),R.state=l.memoizedState),typeof R.componentDidMount=="function"&&(l.flags|=4194308)}function Xu(l,h){try{var y="",E=h;do y+=We(E),E=E.return;while(E);var R=y}catch(G){R=`
7Error generating stack: `+G.message+`
8`+G.stack}return{value:l,source:h,stack:R,digest:null}}function E0(l,h,y){return{value:l,source:null,stack:y??null,digest:h??null}}function k0(l,h){try{console.error(h.value)}catch(y){setTimeout(function(){throw y})}}var FR=typeof WeakMap=="function"?WeakMap:Map;function i2(l,h,y){y=Zo(-1,y),y.tag=3,y.payload={element:null};var E=h.value;
vendor: 11,167 bytes, line 8
8return y.callback=function(){np||(np=!0,G0=E),k0(l,h)},y}function s2(l,h,y){y=Zo(-1,y),y.tag=3;var E=l.type.getDerivedStateFromError;if(typeof E=="function"){var R=h.value;y.payload=function(){return E(R)},y.callback=function(){k0(l,h)}}var G=l.stateNode;return G!==null&&typeof G.componentDidCatch=="function"&&(y.callback=function(){k0(l,h),typeof E!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var se=h.stack;this.componentDidCatch(h.value,{componentStack:se!==null?se:""})}),y}function o2(l,h,y){var E=l.pingCache;if(E===null){E=l.pingCache=new FR;var R=new Set;E.set(h,R)}else R=E.get(h),R===void 0&&(R=new Set,E.set(h,R));R.has(y)||(R.add(y),l=IR.bind(null,l,h,y),h.then(l,l))}function l2(l){do{var h;if((h=l.tag===13)&&(h=l.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return l;l=l.return}while(l!==null);return null}function c2(l,h,y,E,R){return(l.mode&1)===0?(l===h?l.flags|=65536:(l.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(h=Zo(-1,1),h.tag=2,Vl(y,h,1))),y.lanes|=1),l):(l.flags|=65536,l.lanes=R,l)}var CR=P.ReactCurrentOwner,gi=!1;function ti(l,h,y,E){h.child=l===null?NS(h,null,y,E):Ku(h,l.child,y,E)}function u2(l,h,y,E,R){y=y.render;var G=h.ref;return qu(h,R),E=v0(l,h,y,E,G,R),y=y0(),l!==null&&!gi?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~R,Qo(l,h,R)):(Mr&&y&&t0(h),h.flags|=1,ti(l,h,E,R),h.child)}function d2(l,h,y,E,R){if(l===null){var G=y.type;return typeof G=="function"&&!q0(G)&&G.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(h.tag=15,h.type=G,h2(l,h,G,E,R)):(l=lp(y.type,null,E,h,h.mode,R),l.ref=h.ref,l.return=h,h.child=l)}if(G=l.child,(l.lanes&R)===0){var se=G.memoizedProps;if(y=y.compare,y=y!==null?y:to,y(se,E)&&l.ref===h.ref)return Qo(l,h,R)}return h.flags|=1,l=Xl(G,E),l.ref=h.ref,l.return=h,h.child=l}function h2(l,h,y,E,R){if(l!==null){var G=l.memoizedProps;if(to(G,E)&&l.ref===h.ref)if(gi=!1,h.pendingProps=E=G,(l.lanes&R)!==0)(l.flags&131072)!==0&&(gi=!0);else return h.lanes=l.lanes,Qo(l,h,R)}return A0(l,h,y,E,R)}function m2(l,h,y){var E=h.pendingProps,R=E.children,G=l!==null?l.memoizedState:null;if(E.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fr(Qu,ji),ji|=y;else{if((y&1073741824)===0)return l=G!==null?G.baseLanes|y:y,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:l,cachePool:null,transitions:null},h.updateQueue=null,Fr(Qu,ji),ji|=l,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},E=G!==null?G.baseLanes:y,Fr(Qu,ji),ji|=E}else G!==null?(E=G.baseLanes|y,h.memoizedState=null):E=y,Fr(Qu,ji),ji|=E;return ti(l,h,R,y),h.child}function f2(l,h){var y=h.ref;(l===null&&y!==null||l!==null&&l.ref!==y)&&(h.flags|=512,h.flags|=2097152)}function A0(l,h,y,E,R){var G=pi(y)?Gc:Ga.current;return G=Hu(h,G),qu(h,R),y=v0(l,h,y,E,G,R),E=y0(),l!==null&&!gi?(h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~R,Qo(l,h,R)):(Mr&&E&&t0(h),h.flags|=1,ti(l,h,y,R),h.child)}function p2(l,h,y,E,R){if(pi(y)){var G=!0;Df(h)}else G=!1;if(qu(h,R),h.stateNode===null)Xf(l,h),r2(h,y,E),_0(h,y,E,R),E=!0;else if(l===null){var se=h.stateNode,Pe=h.memoizedProps;se.props=Pe;var Ye=se.context,At=y.contextType;typeof At=="object"&&At!==null?At=as(At):(At=pi(y)?Gc:Ga.current,At=Hu(h,At));var qt=y.getDerivedStateFromProps,en=typeof qt=="function"||typeof se.getSnapshotBeforeUpdate=="function";en||typeof se.UNSAFE_componentWillReceiveProps!="function"&&typeof se.componentWillReceiveProps!="function"||(Pe!==E||Ye!==At)&&a2(h,se,E,At),Wl=!1;var Yt=h.memoizedState;se.state=Yt,Gf(h,E,se,R),Ye=h.memoizedState,Pe!==E||Yt!==Ye||fi.current||Wl?(typeof qt=="function"&&(C0(h,y,qt,E),Ye=h.memoizedState),(Pe=Wl||n2(h,y,Pe,E,Yt,Ye,At))?(en||typeof se.UNSAFE_componentWillMount!="function"&&typeof se.componentWillMount!="function"||(typeof se.componentWillMount=="function"&&se.componentWillMount(),typeof se.UNSAFE_componentWillMount=="function"&&se.UNSAFE_componentWillMount()),typeof se.componentDidMount=="function"&&(h.flags|=4194308)):(typeof se.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=E,h.memoizedState=Ye),se.props=E,se.state=Ye,se.context=At,E=Pe):(typeof se.componentDidMount=="function"&&(h.flags|=4194308),E=!1)}else{se=h.stateNode,MS(l,h),Pe=h.memoizedProps,At=h.type===h.elementType?Pe:Ss(h.type,Pe),se.props=At,en=h.pendingProps,Yt=se.context,Ye=y.contextType,typeof Ye=="object"&&Ye!==null?Ye=as(Ye):(Ye=pi(y)?Gc:Ga.current,Ye=Hu(h,Ye));var pn=y.getDerivedStateFromProps;(qt=typeof pn=="function"||typeof se.getSnapshotBeforeUpdate=="function")||typeof se.UNSAFE_componentWillReceiveProps!="function"&&typeof se.componentWillReceiveProps!="function"||(Pe!==en||Yt!==Ye)&&a2(h,se,E,Ye),Wl=!1,Yt=h.memoizedState,se.state=Yt,Gf(h,E,se,R);var Cn=h.memoizedState;Pe!==en||Yt!==Cn||fi.current||Wl?(typeof pn=="function"&&(C0(h,y,pn,E),Cn=h.memoizedState),(At=Wl||n2(h,y,At,E,Yt,Cn,Ye)||!1)?(qt||typeof se.UNSAFE_componentWillUpdate!="function"&&typeof se.componentWillUpdate!="function"||(typeof se.componentWillUpdate=="function"&&se.componentWillUpdate(E,Cn,Ye),typeof se.UNSAFE_componentWillUpdate=="function"&&se.UNSAFE_componentWillUpdate(E,Cn,Ye)),typeof se.componentDidUpdate=="function"&&(h.flags|=4),typeof se.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof se.componentDidUpdate!="function"||Pe===l.memoizedProps&&Yt===l.memoizedState||(h.flags|=4),typeof se.getSnapshotBeforeUpdate!="function"||Pe===l.memoizedProps&&Yt===l.memoizedState||(h.flags|=1024),h.memoizedProps=E,h.memoizedState=Cn),se.props=E,se.state=Cn,se.context=Ye,E=At):(typeof se.componentDidUpdate!="function"||Pe===l.memoizedProps&&Yt===l.memoizedState||(h.flags|=4),typeof se.getSnapshotBeforeUpdate!="function"||Pe===l.memoizedProps&&Yt===l.memoizedState||(h.flags|=1024),E=!1)}return N0(l,h,y,E,G,R)}function N0(l,h,y,E,R,G){f2(l,h);var se=(h.flags&128)!==0;if(!E&&!se)return R&&bS(h,y,!1),Qo(l,h,G);E=h.stateNode,CR.current=h;var Pe=se&&typeof y.getDerivedStateFromError!="function"?null:E.render();return h.flags|=1,l!==null&&se?(h.child=Ku(h,l.child,null,G),h.child=Ku(h,null,Pe,G)):ti(l,h,Pe,G),h.memoizedState=E.state,R&&bS(h,y,!0),h.child}function g2(l){var h=l.stateNode;h.pendingContext?vS(l,h.pendingContext,h.pendingContext!==h.context):h.context&&vS(l,h.context,!1),h0(l,h.containerInfo)}function x2(l,h,y,E,R){return $u(),i0(R),h.flags|=256,ti(l,h,y,E),h.child}var T0={dehydrated:null,treeContext:null,retryLane:0};function M0(l){return{baseLanes:l,cachePool:null,transitions:null}}function v2(l,h,y){var E=h.pendingProps,R=Pr.current,G=!1,se=(h.flags&128)!==0,Pe;if((Pe=se)||(Pe=l!==null&&l.memoizedState===null?!1:(R&2)!==0),Pe?(G=!0,h.flags&=-129):(l===null||l.memoizedState!==null)&&(R|=1),Fr(Pr,R&1),l===null)return a0(h),l=h.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((h.mode&1)===0?h.lanes=1:l.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(se=E.children,l=E.fallback,G?(E=h.mode,G=h.child,se={mode:"hidden",children:se},(E&1)===0&&G!==null?(G.childLanes=0,G.pendingProps=se):G=cp(se,E,0,null),l=Zc(l,E,y,null),G.return=h,l.return=h,G.sibling=l,h.child=G,h.child.memoizedState=M0(y),h.memoizedState=T0,l):R0(h,se));if(R=l.memoizedState,R!==null&&(Pe=R.dehydrated,Pe!==null))return _R(l,h,se,E,Pe,R,y);if(G){G=E.fallback,se=h.mode,R=l.child,Pe=R.sibling;var Ye={mode:"hidden",children:E.children};return(se&1)===0&&h.child!==R?(E=h.child,E.childLanes=0,E.pendingProps=Ye,h.deletions=null):(E=Xl(R,Ye),E.subtreeFlags=R.subtreeFlags&14680064),Pe!==null?G=Xl(Pe,G):(G=Zc(G,se,y,null),G.flags|=2),G.return=h,E.return=h,E.sibling=G,h.child=E,E=G,G=h.child,se=l.child.memoizedState,se=se===null?M0(y):{baseLanes:se.baseLanes|y,cachePool:null,transitions:se.transitions},G.memoizedState=se,G.childLanes=l.childLanes&~y,h.memoizedState=T0,E}return G=l.child,l=G.sibling,E=Xl(G,{mode:"visible",children:E.children}),(h.mode&1)===0&&(E.lanes=y),E.return=h,E.sibling=null,l!==null&&(y=h.deletions,y===null?(h.deletions=[l],h.flags|=16):y.push(l)),h.child=E,h.memoizedState=null,E}function R0(l,h){return h=cp({mode:"visible",children:h},l.mode,0,null),h.return=l,l.child=h}function Jf(l,h,y,E){return E!==null&&i0(E),Ku(h,l.child,null,y),l=R0(h,h.pendingProps.children),l.flags|=2,h.memoizedState=null,l}function _R(l,h,y,E,R,G,se){if(y)return h.flags&256?(h.flags&=-257,E=E0(Error(n(422))),Jf(l,h,se,E)):h.memoizedState!==null?(h.child=l.child,h.flags|=128,null):(G=E.fallback,R=h.mode,E=cp({mode:"visible",children:E.children},R,0,null),G=Zc(G,R,se,null),G.flags|=2,E.return=h,G.return=h,E.sibling=G,h.child=E,(h.mode&1)!==0&&Ku(h,l.child,null,se),h.child.memoizedState=M0(se),h.memoizedState=T0,G);if((h.mode&1)===0)return Jf(l,h,se,null);if(R.data==="$!"){if(E=R.nextSibling&&R.nextSibling.dataset,E)var Pe=E.dgst;return E=Pe,G=Error(n(419)),E=E0(G,E,void 0),Jf(l,h,se,E)}if(Pe=(se&l.childLanes)!==0,gi||Pe){if(E=va,E!==null){switch(se&-se){case 4:R=2;break;case 16:R=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:R=32;break;case 536870912:R=268435456;break;default:R=0}R=(R&(E.suspendedLanes|se))!==0?0:R,R!==0&&R!==G.retryLane&&(G.retryLane=R,Xo(l,R),_s(E,l,R,-1))}return Y0(),E=E0(Error(n(421))),Jf(l,h,se,E)}return R.data==="$?"?(h.flags|=128,h.child=l.child,h=BR.bind(null,l),R._reactRetry=h,null):(l=G.treeContext,Pi=ao(R.nextSibling),Di=h,Mr=!0,ws=null,l!==null&&(ns[rs++]=qo,ns[rs++]=Jo,ns[rs++]=Hc,qo=l.id,Jo=l.overflow,Hc=h),h=R0(h,E.children),h.flags|=4096,h)}function y2(l,h,y){l.lanes|=h;var E=l.alternate;E!==null&&(E.lanes|=h),c0(l.return,h,y)}function D0(l,h,y,E,R){var G=l.memoizedState;G===null?l.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:R}:(G.isBackwards=h,G.rendering=null,G.renderingStartTime=0,G.last=E,G.tail=y,G.tailMode=R)}function b2(l,h,y){var E=h.pendingProps,R=E.revealOrder,G=E.tail;if(ti(l,h,E.children,y),E=Pr.current,(E&2)!==0)E=E&1|2,h.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=h.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&y2(l,y,h);else if(l.tag===19)y2(l,y,h);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===h)break e;for(;l.sibling===null;){if(l.return===null||l.return===h)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}E&=1}if(Fr(Pr,E),(h.mode&1)===0)h.memoizedState=null;else switch(R){case"forwards":for(y=h.child,R=null;y!==null;)l=y.alternate,l!==null&&Hf(l)===null&&(R=y),y=y.sibling;y=R,y===null?(R=h.child,h.child=null):(R=y.sibling,y.sibling=null),D0(h,!1,R,y,G);break;case"backwards":for(y=null,R=h.child,h.child=null;R!==null;){if(l=R.alternate,l!==null&&Hf(l)===null){h.child=R;break}l=R.sibling,R.sibling=y,y=R,R=l}D0(h,!0,y,null,G);break;case"together":D0(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Xf(l,h){(h.mode&1)===0&&l!==null&&(l.alternate=null,h.alternate=null,h.flags|=2)}function Qo(l,h,y){if(l!==null&&(h.dependencies=l.dependencies),Yc|=h.lanes,(y&h.childLanes)===0)return null;if(l!==null&&h.child!==l.child)throw Error(n(153));
vendor: 4,469 bytes, line 8
8if(h.child!==null){for(l=h.child,y=Xl(l,l.pendingProps),h.child=y,y.return=h;l.sibling!==null;)l=l.sibling,y=y.sibling=Xl(l,l.pendingProps),y.return=h;y.sibling=null}return h.child}function ER(l,h,y){switch(h.tag){case 3:g2(h),$u();break;case 5:PS(h);break;case 1:pi(h.type)&&Df(h);break;case 4:h0(h,h.stateNode.containerInfo);break;case 10:var E=h.type._context,R=h.memoizedProps.value;Fr(Of,E._currentValue),E._currentValue=R;break;case 13:if(E=h.memoizedState,E!==null)return E.dehydrated!==null?(Fr(Pr,Pr.current&1),h.flags|=128,null):(y&h.child.childLanes)!==0?v2(l,h,y):(Fr(Pr,Pr.current&1),l=Qo(l,h,y),l!==null?l.sibling:null);Fr(Pr,Pr.current&1);break;case 19:if(E=(y&h.childLanes)!==0,(l.flags&128)!==0){if(E)return b2(l,h,y);h.flags|=128}if(R=h.memoizedState,R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),Fr(Pr,Pr.current),E)break;return null;case 22:case 23:return h.lanes=0,m2(l,h,y)}return Qo(l,h,y)}var w2,P0,S2,F2;w2=function(l,h){for(var y=h.child;y!==null;){if(y.tag===5||y.tag===6)l.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===h)break;for(;y.sibling===null;){if(y.return===null||y.return===h)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},P0=function(){},S2=function(l,h,y,E){var R=l.memoizedProps;if(R!==E){l=h.stateNode,$c(io.current);var G=null;switch(y){case"input":R=Bt(l,R),E=Bt(l,E),G=[];break;case"select":R=ie({},R,{value:void 0}),E=ie({},E,{value:void 0}),G=[];break;case"textarea":R=jt(l,R),E=jt(l,E),G=[];break;default:typeof R.onClick!="function"&&typeof E.onClick=="function"&&(l.onclick=$t)}ke(y,E);var se;y=null;for(At in R)if(!E.hasOwnProperty(At)&&R.hasOwnProperty(At)&&R[At]!=null)if(At==="style"){var Pe=R[At];for(se in Pe)Pe.hasOwnProperty(se)&&(y||(y={}),y[se]="")}else At!=="dangerouslySetInnerHTML"&&At!=="children"&&At!=="suppressContentEditableWarning"&&At!=="suppressHydrationWarning"&&At!=="autoFocus"&&(i.hasOwnProperty(At)?G||(G=[]):(G=G||[]).push(At,null));for(At in E){var Ye=E[At];if(Pe=R?.[At],E.hasOwnProperty(At)&&Ye!==Pe&&(Ye!=null||Pe!=null))if(At==="style")if(Pe){for(se in Pe)!Pe.hasOwnProperty(se)||Ye&&Ye.hasOwnProperty(se)||(y||(y={}),y[se]="");for(se in Ye)Ye.hasOwnProperty(se)&&Pe[se]!==Ye[se]&&(y||(y={}),y[se]=Ye[se])}else y||(G||(G=[]),G.push(At,y)),y=Ye;else At==="dangerouslySetInnerHTML"?(Ye=Ye?Ye.__html:void 0,Pe=Pe?Pe.__html:void 0,Ye!=null&&Pe!==Ye&&(G=G||[]).push(At,Ye)):At==="children"?typeof Ye!="string"&&typeof Ye!="number"||(G=G||[]).push(At,""+Ye):At!=="suppressContentEditableWarning"&&At!=="suppressHydrationWarning"&&(i.hasOwnProperty(At)?(Ye!=null&&At==="onScroll"&&yr("scroll",l),G||Pe===Ye||(G=[])):(G=G||[]).push(At,Ye))}y&&(G=G||[]).push("style",y);var At=G;(h.updateQueue=At)&&(h.flags|=4)}},F2=function(l,h,y,E){y!==E&&(h.flags|=4)};function zh(l,h){if(!Mr)switch(l.tailMode){case"hidden":h=l.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l.tail=null:y.sibling=null;break;case"collapsed":y=l.tail;for(var E=null;y!==null;)y.alternate!==null&&(E=y),y=y.sibling;E===null?h||l.tail===null?l.tail=null:l.tail.sibling=null:E.sibling=null}}function Wa(l){var h=l.alternate!==null&&l.alternate.child===l.child,y=0,E=0;if(h)for(var R=l.child;R!==null;)y|=R.lanes|R.childLanes,E|=R.subtreeFlags&14680064,E|=R.flags&14680064,R.return=l,R=R.sibling;else for(R=l.child;R!==null;)y|=R.lanes|R.childLanes,E|=R.subtreeFlags,E|=R.flags,R.return=l,R=R.sibling;return l.subtreeFlags|=E,l.childLanes=y,h}function kR(l,h,y){var E=h.pendingProps;switch(n0(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wa(h),null;case 1:return pi(h.type)&&Rf(),Wa(h),null;case 3:return E=h.stateNode,Ju(),kr(fi),kr(Ga),p0(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(l===null||l.child===null)&&(If(h)?h.flags|=4:l===null||l.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,ws!==null&&(V0(ws),ws=null))),P0(l,h),Wa(h),null;case 5:m0(h);var R=$c(Lh.current);if(y=h.type,l!==null&&h.stateNode!=null)S2(l,h,y,E,R),l.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!E){if(h.stateNode===null)throw Error(n(166));return Wa(h),null}if(l=$c(io.current),If(h)){E=h.stateNode,y=h.type;var G=h.memoizedProps;switch(E[ts]=h,E[Ol]=G,l=(h.mode&1)!==0,y){case"dialog":yr("cancel",E),yr("close",E);break;case"iframe":case"object":case"embed":yr("load",E);break;case"video":case"audio":for(R=0;R<Ll.length;R++)yr(Ll[R],E);break;
vendor: 5,101 bytes, line 8
8case"source":yr("error",E);break;case"img":case"image":case"link":yr("error",E),yr("load",E);break;case"details":yr("toggle",E);break;case"input":re(E,G),yr("invalid",E);break;case"select":E._wrapperState={wasMultiple:!!G.multiple},yr("invalid",E);break;case"textarea":he(E,G),yr("invalid",E)}ke(y,G),R=null;for(var se in G)if(G.hasOwnProperty(se)){var Pe=G[se];se==="children"?typeof Pe=="string"?E.textContent!==Pe&&(G.suppressHydrationWarning!==!0&&kt(E.textContent,Pe,l),R=["children",Pe]):typeof Pe=="number"&&E.textContent!==""+Pe&&(G.suppressHydrationWarning!==!0&&kt(E.textContent,Pe,l),R=["children",""+Pe]):i.hasOwnProperty(se)&&Pe!=null&&se==="onScroll"&&yr("scroll",E)}switch(y){case"input":Rt(E),vt(E,G,!0);break;case"textarea":Rt(E),ze(E);break;case"select":case"option":break;default:typeof G.onClick=="function"&&(E.onclick=$t)}E=R,h.updateQueue=E,E!==null&&(h.flags|=4)}else{se=R.nodeType===9?R:R.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Ve(y)),l==="http://www.w3.org/1999/xhtml"?y==="script"?(l=se.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof E.is=="string"?l=se.createElement(y,{is:E.is}):(l=se.createElement(y),y==="select"&&(se=l,E.multiple?se.multiple=!0:E.size&&(se.size=E.size))):l=se.createElementNS(l,y),l[ts]=h,l[Ol]=E,w2(l,h,!1,!1),h.stateNode=l;e:{switch(se=De(y,E),y){case"dialog":yr("cancel",l),yr("close",l),R=E;break;case"iframe":case"object":case"embed":yr("load",l),R=E;break;case"video":case"audio":for(R=0;R<Ll.length;R++)yr(Ll[R],l);R=E;break;case"source":yr("error",l),R=E;break;case"img":case"image":case"link":yr("error",l),yr("load",l),R=E;break;case"details":yr("toggle",l),R=E;break;case"input":re(l,E),R=Bt(l,E),yr("invalid",l);break;case"option":R=E;break;case"select":l._wrapperState={wasMultiple:!!E.multiple},R=ie({},E,{value:void 0}),yr("invalid",l);break;case"textarea":he(l,E),R=jt(l,E),yr("invalid",l);break;default:R=E}ke(y,R),Pe=R;for(G in Pe)if(Pe.hasOwnProperty(G)){var Ye=Pe[G];G==="style"?Xe(l,Ye):G==="dangerouslySetInnerHTML"?(Ye=Ye?Ye.__html:void 0,Ye!=null&&It(l,Ye)):G==="children"?typeof Ye=="string"?(y!=="textarea"||Ye!=="")&&gt(l,Ye):typeof Ye=="number"&&gt(l,""+Ye):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(i.hasOwnProperty(G)?Ye!=null&&G==="onScroll"&&yr("scroll",l):Ye!=null&&N(l,G,Ye,se))}switch(y){case"input":Rt(l),vt(l,E,!1);break;case"textarea":Rt(l),ze(l);break;case"option":E.value!=null&&l.setAttribute("value",""+He(E.value));break;case"select":l.multiple=!!E.multiple,G=E.value,G!=null?Dt(l,!!E.multiple,G,!1):E.defaultValue!=null&&Dt(l,!!E.multiple,E.defaultValue,!0);break;default:typeof R.onClick=="function"&&(l.onclick=$t)}switch(y){case"button":case"input":case"select":case"textarea":E=!!E.autoFocus;break e;case"img":E=!0;break e;default:E=!1}}E&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return Wa(h),null;case 6:if(l&&h.stateNode!=null)F2(l,h,l.memoizedProps,E);else{if(typeof E!="string"&&h.stateNode===null)throw Error(n(166));if(y=$c(Lh.current),$c(io.current),If(h)){if(E=h.stateNode,y=h.memoizedProps,E[ts]=h,(G=E.nodeValue!==y)&&(l=Di,l!==null))switch(l.tag){case 3:kt(E.nodeValue,y,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&kt(E.nodeValue,y,(l.mode&1)!==0)}G&&(h.flags|=4)}else E=(y.nodeType===9?y:y.ownerDocument).createTextNode(E),E[ts]=h,h.stateNode=E}return Wa(h),null;case 13:if(kr(Pr),E=h.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Mr&&Pi!==null&&(h.mode&1)!==0&&(h.flags&128)===0)ES(),$u(),h.flags|=98560,G=!1;else if(G=If(h),E!==null&&E.dehydrated!==null){if(l===null){if(!G)throw Error(n(318));if(G=h.memoizedState,G=G!==null?G.dehydrated:null,!G)throw Error(n(317));G[ts]=h}else $u(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Wa(h),G=!1}else ws!==null&&(V0(ws),ws=null),G=!0;if(!G)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=y,h):(E=E!==null,E!==(l!==null&&l.memoizedState!==null)&&E&&(h.child.flags|=8192,(h.mode&1)!==0&&(l===null||(Pr.current&1)!==0?ca===0&&(ca=3):Y0())),h.updateQueue!==null&&(h.flags|=4),Wa(h),null);case 4:return Ju(),P0(l,h),l===null&&Il(h.stateNode.containerInfo),Wa(h),null;case 10:return l0(h.type._context),Wa(h),null;case 17:return pi(h.type)&&Rf(),Wa(h),null;case 19:if(kr(Pr),G=h.memoizedState,G===null)return Wa(h),null;if(E=(h.flags&128)!==0,se=G.rendering,se===null)if(E)zh(G,!1);else{if(ca!==0||l!==null&&(l.flags&128)!==0)for(l=h.child;l!==null;){if(se=Hf(l),se!==null){for(h.flags|=128,zh(G,!1),E=se.updateQueue,E!==null&&(h.updateQueue=E,h.flags|=4),h.subtreeFlags=0,E=y,y=h.child;y!==null;)G=y,l=E,G.flags&=14680066,se=G.alternate,se===null?(G.childLanes=0,G.lanes=l,G.child=null,G.subtreeFlags=0,G.memoizedProps=null,G.memoizedState=null,G.updateQueue=null,G.dependencies=null,G.stateNode=null):(G.childLanes=se.childLanes,G.lanes=se.lanes,G.child=se.child,G.subtreeFlags=0,G.deletions=null,G.memoizedProps=se.memoizedProps,G.memoizedState=se.memoizedState,G.updateQueue=se.updateQueue,G.type=se.type,l=se.dependencies,G.depen
vendor: 5,629 bytes, line 8
8dencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),y=y.sibling;return Fr(Pr,Pr.current&1|2),h.child}l=l.sibling}G.tail!==null&&ne()>ed&&(h.flags|=128,E=!0,zh(G,!1),h.lanes=4194304)}else{if(!E)if(l=Hf(se),l!==null){if(h.flags|=128,E=!0,y=l.updateQueue,y!==null&&(h.updateQueue=y,h.flags|=4),zh(G,!0),G.tail===null&&G.tailMode==="hidden"&&!se.alternate&&!Mr)return Wa(h),null}else 2*ne()-G.renderingStartTime>ed&&y!==1073741824&&(h.flags|=128,E=!0,zh(G,!1),h.lanes=4194304);G.isBackwards?(se.sibling=h.child,h.child=se):(y=G.last,y!==null?y.sibling=se:h.child=se,G.last=se)}return G.tail!==null?(h=G.tail,G.rendering=h,G.tail=h.sibling,G.renderingStartTime=ne(),h.sibling=null,y=Pr.current,Fr(Pr,E?y&1|2:y&1),h):(Wa(h),null);case 22:case 23:return K0(),E=h.memoizedState!==null,l!==null&&l.memoizedState!==null!==E&&(h.flags|=8192),E&&(h.mode&1)!==0?(ji&1073741824)!==0&&(Wa(h),h.subtreeFlags&6&&(h.flags|=8192)):Wa(h),null;case 24:return null;case 25:return null}throw Error(n(156,h.tag))}function AR(l,h){switch(n0(h),h.tag){case 1:return pi(h.type)&&Rf(),l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 3:return Ju(),kr(fi),kr(Ga),p0(),l=h.flags,(l&65536)!==0&&(l&128)===0?(h.flags=l&-65537|128,h):null;case 5:return m0(h),null;case 13:if(kr(Pr),l=h.memoizedState,l!==null&&l.dehydrated!==null){if(h.alternate===null)throw Error(n(340));$u()}return l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 19:return kr(Pr),null;case 4:return Ju(),null;case 10:return l0(h.type._context),null;case 22:case 23:return K0(),null;case 24:return null;default:return null}}var Zf=!1,Va=!1,NR=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function Zu(l,h){var y=l.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(E){Ur(l,h,E)}else y.current=null}function j0(l,h,y){try{y()}catch(E){Ur(l,h,E)}}var C2=!1;function TR(l,h){if(hn=zn,l=Ch(),_h(l)){if("selectionStart"in l)var y={start:l.selectionStart,end:l.selectionEnd};else e:{y=(y=l.ownerDocument)&&y.defaultView||window;var E=y.getSelection&&y.getSelection();if(E&&E.rangeCount!==0){y=E.anchorNode;var R=E.anchorOffset,G=E.focusNode;E=E.focusOffset;try{y.nodeType,G.nodeType}catch{y=null;break e}var se=0,Pe=-1,Ye=-1,At=0,qt=0,en=l,Yt=null;t:for(;;){for(var pn;en!==y||R!==0&&en.nodeType!==3||(Pe=se+R),en!==G||E!==0&&en.nodeType!==3||(Ye=se+E),en.nodeType===3&&(se+=en.nodeValue.length),(pn=en.firstChild)!==null;)Yt=en,en=pn;for(;;){if(en===l)break t;if(Yt===y&&++At===R&&(Pe=se),Yt===G&&++qt===E&&(Ye=se),(pn=en.nextSibling)!==null)break;en=Yt,Yt=en.parentNode}en=pn}y=Pe===-1||Ye===-1?null:{start:Pe,end:Ye}}else y=null}y=y||{start:0,end:0}}else y=null;for(Rn={focusedElem:l,selectionRange:y},zn=!1,Fn=h;Fn!==null;)if(h=Fn,l=h.child,(h.subtreeFlags&1028)!==0&&l!==null)l.return=h,Fn=l;else for(;Fn!==null;){h=Fn;try{var Cn=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(Cn!==null){var kn=Cn.memoizedProps,Vr=Cn.memoizedState,mt=h.stateNode,nt=mt.getSnapshotBeforeUpdate(h.elementType===h.type?kn:Ss(h.type,kn),Vr);mt.__reactInternalSnapshotBeforeUpdate=nt}break;case 3:var yt=h.stateNode.containerInfo;yt.nodeType===1?yt.textContent="":yt.nodeType===9&&yt.documentElement&&yt.removeChild(yt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(nn){Ur(h,h.return,nn)}if(l=h.sibling,l!==null){l.return=h.return,Fn=l;break}Fn=h.return}return Cn=C2,C2=!1,Cn}function Gh(l,h,y){var E=h.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var R=E=E.next;do{if((R.tag&l)===l){var G=R.destroy;R.destroy=void 0,G!==void 0&&j0(h,y,G)}R=R.next}while(R!==E)}}function Qf(l,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var y=h=h.next;do{if((y.tag&l)===l){var E=y.create;y.destroy=E()}y=y.next}while(y!==h)}}function L0(l){var h=l.ref;if(h!==null){var y=l.stateNode;l.tag,l=y,typeof h=="function"?h(l):h.current=l}}function _2(l){var h=l.alternate;h!==null&&(l.alternate=null,_2(h)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(h=l.stateNode,h!==null&&(delete h[ts],delete h[Ol],delete h[Ul],delete h[Xx],delete h[Zx])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function E2(l){return l.tag===5||l.tag===3||l.tag===4}function k2(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||E2(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function I0(l,h,y){var E=l.tag;if(E===5||E===6)l=l.stateNode,h?y.nodeType===8?y.parentNode.insertBefore(l,h):y.insertBefore(l,h):(y.nodeType===8?(h=y.parentNode,h.insertBefore(l,y)):(h=y,h.appendChild(l)),y=y._reactRootContainer,y!=null||h.onclick!==null||(h.onclick=$t));else if(E!==4&&(l=l.child,l!==null))for(I0(l,h,y),l=l.sibling;l!==null;)I0(l,h,y),l=l.sibling}function B0(l,h,y){var E=l.tag;if(E===5||E===6)l=l.stateNode,h?y.insertBefore(l,h):y.appendChild(l);else if(E!==4&&(l=l.child,l!==null))for(B0(l,h,y),l=l.sibling;l!==null;)B0(l,h,y),l=l.sibling}var Aa=null,Fs=!1;function $l(l,h,y){for(y=y.child;y!==null;)A2(l,h,y),y=y.sibling}function A2(l,h,y){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(Te,y)}catch{}switch(y.tag){case 5:Va||Zu(y,h);case 6:var E=Aa,R=Fs;Aa=null,$l(l,h,y),Aa=E,Fs=R,Aa!==null&&(Fs?(l=Aa,y=y.stateNode,l.nodeType===8?l.parentNode.removeChild(y):l.removeChild(y)):Aa.removeChild(y.stateNode));break;case 18:Aa!==null&&(Fs?(l=Aa,y=y.stateNode,l.nodeType===8?Rh(l.parentNode,
vendor: 16,170 bytes, line 8
8y):l.nodeType===1&&Rh(l,y),Mn(l)):Rh(Aa,y.stateNode));break;case 4:E=Aa,R=Fs,Aa=y.stateNode.containerInfo,Fs=!0,$l(l,h,y),Aa=E,Fs=R;break;case 0:case 11:case 14:case 15:if(!Va&&(E=y.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){R=E=E.next;do{var G=R,se=G.destroy;G=G.tag,se!==void 0&&((G&2)!==0||(G&4)!==0)&&j0(y,h,se),R=R.next}while(R!==E)}$l(l,h,y);break;case 1:if(!Va&&(Zu(y,h),E=y.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=y.memoizedProps,E.state=y.memoizedState,E.componentWillUnmount()}catch(Pe){Ur(y,h,Pe)}$l(l,h,y);break;case 21:$l(l,h,y);break;case 22:y.mode&1?(Va=(E=Va)||y.memoizedState!==null,$l(l,h,y),Va=E):$l(l,h,y);break;default:$l(l,h,y)}}function N2(l){var h=l.updateQueue;if(h!==null){l.updateQueue=null;var y=l.stateNode;y===null&&(y=l.stateNode=new NR),h.forEach(function(E){var R=OR.bind(null,l,E);y.has(E)||(y.add(E),E.then(R,R))})}}function Cs(l,h){var y=h.deletions;if(y!==null)for(var E=0;E<y.length;E++){var R=y[E];try{var G=l,se=h,Pe=se;e:for(;Pe!==null;){switch(Pe.tag){case 5:Aa=Pe.stateNode,Fs=!1;break e;case 3:Aa=Pe.stateNode.containerInfo,Fs=!0;break e;case 4:Aa=Pe.stateNode.containerInfo,Fs=!0;break e}Pe=Pe.return}if(Aa===null)throw Error(n(160));A2(G,se,R),Aa=null,Fs=!1;var Ye=R.alternate;Ye!==null&&(Ye.return=null),R.return=null}catch(At){Ur(R,h,At)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)T2(h,l),h=h.sibling}function T2(l,h){var y=l.alternate,E=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Cs(h,l),oo(l),E&4){try{Gh(3,l,l.return),Qf(3,l)}catch(kn){Ur(l,l.return,kn)}try{Gh(5,l,l.return)}catch(kn){Ur(l,l.return,kn)}}break;case 1:Cs(h,l),oo(l),E&512&&y!==null&&Zu(y,y.return);break;case 5:if(Cs(h,l),oo(l),E&512&&y!==null&&Zu(y,y.return),l.flags&32){var R=l.stateNode;try{gt(R,"")}catch(kn){Ur(l,l.return,kn)}}if(E&4&&(R=l.stateNode,R!=null)){var G=l.memoizedProps,se=y!==null?y.memoizedProps:G,Pe=l.type,Ye=l.updateQueue;if(l.updateQueue=null,Ye!==null)try{Pe==="input"&&G.type==="radio"&&G.name!=null&&wt(R,G),De(Pe,se);var At=De(Pe,G);for(se=0;se<Ye.length;se+=2){var qt=Ye[se],en=Ye[se+1];qt==="style"?Xe(R,en):qt==="dangerouslySetInnerHTML"?It(R,en):qt==="children"?gt(R,en):N(R,qt,en,At)}switch(Pe){case"input":Nt(R,G);break;case"textarea":ee(R,G);break;case"select":var Yt=R._wrapperState.wasMultiple;R._wrapperState.wasMultiple=!!G.multiple;var pn=G.value;pn!=null?Dt(R,!!G.multiple,pn,!1):Yt!==!!G.multiple&&(G.defaultValue!=null?Dt(R,!!G.multiple,G.defaultValue,!0):Dt(R,!!G.multiple,G.multiple?[]:"",!1))}R[Ol]=G}catch(kn){Ur(l,l.return,kn)}}break;case 6:if(Cs(h,l),oo(l),E&4){if(l.stateNode===null)throw Error(n(162));R=l.stateNode,G=l.memoizedProps;try{R.nodeValue=G}catch(kn){Ur(l,l.return,kn)}}break;case 3:if(Cs(h,l),oo(l),E&4&&y!==null&&y.memoizedState.isDehydrated)try{Mn(h.containerInfo)}catch(kn){Ur(l,l.return,kn)}break;case 4:Cs(h,l),oo(l);break;case 13:Cs(h,l),oo(l),R=l.child,R.flags&8192&&(G=R.memoizedState!==null,R.stateNode.isHidden=G,!G||R.alternate!==null&&R.alternate.memoizedState!==null||(z0=ne())),E&4&&N2(l);break;case 22:if(qt=y!==null&&y.memoizedState!==null,l.mode&1?(Va=(At=Va)||qt,Cs(h,l),Va=At):Cs(h,l),oo(l),E&8192){if(At=l.memoizedState!==null,(l.stateNode.isHidden=At)&&!qt&&(l.mode&1)!==0)for(Fn=l,qt=l.child;qt!==null;){for(en=Fn=qt;Fn!==null;){switch(Yt=Fn,pn=Yt.child,Yt.tag){case 0:case 11:case 14:case 15:Gh(4,Yt,Yt.return);break;case 1:Zu(Yt,Yt.return);var Cn=Yt.stateNode;if(typeof Cn.componentWillUnmount=="function"){E=Yt,y=Yt.return;try{h=E,Cn.props=h.memoizedProps,Cn.state=h.memoizedState,Cn.componentWillUnmount()}catch(kn){Ur(E,y,kn)}}break;case 5:Zu(Yt,Yt.return);break;case 22:if(Yt.memoizedState!==null){D2(en);continue}}pn!==null?(pn.return=Yt,Fn=pn):D2(en)}qt=qt.sibling}e:for(qt=null,en=l;;){if(en.tag===5){if(qt===null){qt=en;try{R=en.stateNode,At?(G=R.style,typeof G.setProperty=="function"?G.setProperty("display","none","important"):G.display="none"):(Pe=en.stateNode,Ye=en.memoizedProps.style,se=Ye!=null&&Ye.hasOwnProperty("display")?Ye.display:null,Pe.style.display=$e("display",se))}catch(kn){Ur(l,l.return,kn)}}}else if(en.tag===6){if(qt===null)try{en.stateNode.nodeValue=At?"":en.memoizedProps}catch(kn){Ur(l,l.return,kn)}}else if((en.tag!==22&&en.tag!==23||en.memoizedState===null||en===l)&&en.child!==null){en.child.return=en,en=en.child;continue}if(en===l)break e;for(;en.sibling===null;){if(en.return===null||en.return===l)break e;qt===en&&(qt=null),en=en.return}qt===en&&(qt=null),en.sibling.return=en.return,en=en.sibling}}break;case 19:Cs(h,l),oo(l),E&4&&N2(l);break;case 21:break;default:Cs(h,l),oo(l)}}function oo(l){var h=l.flags;if(h&2){try{e:{for(var y=l.return;y!==null;){if(E2(y)){var E=y;break e}y=y.return}throw Error(n(160))}switch(E.tag){case 5:var R=E.stateNode;E.flags&32&&(gt(R,""),E.flags&=-33);var G=k2(l);B0(l,G,R);break;case 3:case 4:var se=E.stateNode.containerInfo,Pe=k2(l);I0(l,Pe,se);break;default:throw Error(n(161))}}catch(Ye){Ur(l,l.return,Ye)}l.flags&=-3}h&4096&&(l.flags&=-4097)}function MR(l,h,y){Fn=l,M2(l)}function M2(l,h,y){for(var E=(l.mode&1)!==0;Fn!==null;){var R=Fn,G=R.child;if(R.tag===22&&E){var se=R.memoizedState!==null||Zf;if(!se){var Pe=R.alternate,Ye=Pe!==null&&Pe.memoizedState!==null||Va;Pe=Zf;var At=Va;if(Zf=se,(Va=Ye)&&!At)for(Fn=R;Fn!==null;)se=Fn,Ye=se.child,se.tag===22&&se.memoizedState!==null?P2(R):Ye!==null?(Ye.return=se,Fn=Ye):P2(R);for(;G!==null;)Fn=G,M2(G),G=G.sibling;Fn=R,Zf=Pe,Va=At}R2(l)}else(R.subtreeFlags&8772)!==0&&G!==null?(G.return=R,Fn=G):R2(l)}}function R2(l){for(;Fn!==null;){var h=Fn;if((h.flags&8772)!==0){var y=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:Va||Qf(5,h);break;case 1:var E=h.stateNode;if(h.flags&4&&!Va)if(y===null)E.componentDidMount();else{var R=h.elementType===h.type?y.memoizedProps:Ss(h.type,y.memoizedProps);E.componentDidUpdate(R,y.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var G=h.updateQueue;G!==null&&DS(h,G,E);break;case 3:var se=h.updateQueue;if(se!==null){if(y=null,h.child!==null)switch(h.child.tag){case 5:y=h.child.stateNode;break;case 1:y=h.child.stateNode}DS(h,se,y)}break;case 5:var Pe=h.stateNode;if(y===null&&h.flags&4){y=Pe;var Ye=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":Ye.autoFocus&&y.focus();break;case"img":Ye.src&&(y.src=Ye.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var At=h.alternate;if(At!==null){var qt=At.memoizedState;if(qt!==null){var en=qt.dehydrated;en!==null&&Mn(en)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Va||h.flags&512&&L0(h)}catch(Yt){Ur(h,h.return,Yt)}}if(h===l){Fn=null;break}if(y=h.sibling,y!==null){y.return=h.return,Fn=y;break}Fn=h.return}}function D2(l){for(;Fn!==null;){var h=Fn;if(h===l){Fn=null;break}var y=h.sibling;if(y!==null){y.return=h.return,Fn=y;break}Fn=h.return}}function P2(l){for(;Fn!==null;){var h=Fn;try{switch(h.tag){case 0:case 11:case 15:var y=h.return;try{Qf(4,h)}catch(Ye){Ur(h,y,Ye)}break;case 1:var E=h.stateNode;if(typeof E.componentDidMount=="function"){var R=h.return;try{E.componentDidMount()}catch(Ye){Ur(h,R,Ye)}}var G=h.return;try{L0(h)}catch(Ye){Ur(h,G,Ye)}break;case 5:var se=h.return;try{L0(h)}catch(Ye){Ur(h,se,Ye)}}}catch(Ye){Ur(h,h.return,Ye)}if(h===l){Fn=null;break}var Pe=h.sibling;if(Pe!==null){Pe.return=h.return,Fn=Pe;break}Fn=h.return}}var RR=Math.ceil,ep=P.ReactCurrentDispatcher,O0=P.ReactCurrentOwner,ss=P.ReactCurrentBatchConfig,ir=0,va=null,Qr=null,Na=0,ji=0,Qu=zl(0),ca=0,Hh=null,Yc=0,tp=0,U0=0,Wh=null,xi=null,z0=0,ed=1/0,el=null,np=!1,G0=null,Kl=null,rp=!1,Yl=null,ap=0,Vh=0,H0=null,ip=-1,sp=0;function ni(){return(ir&6)!==0?ne():ip!==-1?ip:ip=ne()}function ql(l){return(l.mode&1)===0?1:(ir&2)!==0&&Na!==0?Na&-Na:pR.transition!==null?(sp===0&&(sp=Qt()),sp):(l=rn,l!==0||(l=window.event,l=l===void 0?16:Vn(l.type)),l)}function _s(l,h,y,E){if(50<Vh)throw Vh=0,H0=null,Error(n(185));Xt(l,y,E),((ir&2)===0||l!==va)&&(l===va&&((ir&2)===0&&(tp|=y),ca===4&&Jl(l,Na)),vi(l,E),y===1&&ir===0&&(h.mode&1)===0&&(ed=ne()+500,Pf&&Hl()))}function vi(l,h){var y=l.callbackNode;at(l,h);var E=Ne(l,l===va?Na:0);if(E===0)y!==null&&ge(y),l.callbackNode=null,l.callbackPriority=0;else if(h=E&-E,l.callbackPriority!==h){if(y!=null&&ge(y),h===1)l.tag===0?fR(L2.bind(null,l)):wS(L2.bind(null,l)),za(function(){(ir&6)===0&&Hl()}),y=null;else{switch(or(E)){case 1:y=de;break;case 4:y=Ie;break;case 16:y=Ke;break;case 536870912:y=ae;break;default:y=Ke}y=W2(y,j2.bind(null,l))}l.callbackPriority=h,l.callbackNode=y}}function j2(l,h){if(ip=-1,sp=0,(ir&6)!==0)throw Error(n(327));var y=l.callbackNode;if(td()&&l.callbackNode!==y)return null;var E=Ne(l,l===va?Na:0);if(E===0)return null;if((E&30)!==0||(E&l.expiredLanes)!==0||h)h=op(l,E);else{h=E;var R=ir;ir|=2;var G=B2();(va!==l||Na!==h)&&(el=null,ed=ne()+500,Jc(l,h));do try{jR();break}catch(Pe){I2(l,Pe)}while(!0);o0(),ep.current=G,ir=R,Qr!==null?h=0:(va=null,Na=0,h=ca)}if(h!==0){if(h===2&&(R=xt(l),R!==0&&(E=R,h=W0(l,R))),h===1)throw y=Hh,Jc(l,0),Jl(l,E),vi(l,ne()),y;if(h===6)Jl(l,E);else{if(R=l.current.alternate,(E&30)===0&&!DR(R)&&(h=op(l,E),h===2&&(G=xt(l),G!==0&&(E=G,h=W0(l,G))),h===1))throw y=Hh,Jc(l,0),Jl(l,E),vi(l,ne()),y;switch(l.finishedWork=R,l.finishedLanes=E,h){case 0:case 1:throw Error(n(345));case 2:Xc(l,xi,el);break;case 3:if(Jl(l,E),(E&130023424)===E&&(h=z0+500-ne(),10<h)){if(Ne(l,0)!==0)break;if(R=l.suspendedLanes,(R&E)!==E){ni(),l.pingedLanes|=l.suspendedLanes&R;break}l.timeoutHandle=oa(Xc.bind(null,l,xi,el),h);break}Xc(l,xi,el);break;case 4:if(Jl(l,E),(E&4194240)===E)break;for(h=l.eventTimes,R=-1;0<E;){var se=31-pt(E);G=1<<se,se=h[se],se>R&&(R=se),E&=~G}if(E=R,E=ne()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*RR(E/1960))-E,10<E){l.timeoutHandle=oa(Xc.bind(null,l,xi,el),E);break}Xc(l,xi,el);break;case 5:Xc(l,xi,el);break;default:throw Error(n(329))}}}return vi(l,ne()),l.callbackNode===y?j2.bind(null,l):null}function W0(l,h){var y=Wh;return l.current.memoizedState.isDehydrated&&(Jc(l,h).flags|=256),l=op(l,h),l!==2&&(h=xi,xi=y,h!==null&&V0(h)),l}function V0(l){xi===null?xi=l:xi.push.apply(xi,l)}function DR(l){for(var h=l;;){if(h.flags&16384){var y=h.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var E=0;E<y.length;E++){var R=y[E],G=R.getSnapshot;R=R.value;try{if(!Mi(G(),R))return!1}catch{return!1}}}if(y=h.child,h.subtreeFlags&16384&&y!==null)y.return=h,h=y;else{if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Jl(l,h){for(h&=~U0,h&=~tp,l.suspendedLanes|=h,l.pingedLanes&=~h,l=l.expirationTimes;0<h;){var y=31-pt(h),E=1<<y;l[y]=-1,h&=~E}}function L2(l){if((ir&6)!==0)throw Error(n(327));td();var h=Ne(l,0);if((h&1)===0)return vi(l,ne()),null;var y=op(l,h);if(l.tag!==0&&y===2){var E=xt(l);E!==0&&(h=E,y=W0(l,E))}if(y===1)throw y=Hh,Jc(l,0),Jl(l,h),vi(l,ne()),y;if(y===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=h,Xc(l,xi,el),vi(l,ne()),null}function $0(l,h){var y=ir;ir|=1;try{return l(h)}finally{ir=y,ir===0&&(ed=ne()+500,Pf&&Hl())}}function qc(l){Yl!==null&&Yl.tag===0&&(ir&6)===0&&td();var h=ir;ir|=1;var y=ss.transition,E=rn;try{if(ss.transition=null,rn=1,l)return l()}finally{rn=E,ss.transition=y,ir=h,(ir&6)===0&&Hl()}}function K0(){ji=Qu.current,kr(Qu)}function Jc(l,h){l.finishedWork=null,l.finishedLanes=0;var y=l.timeoutHandle;if(y!==-1&&(l.timeoutHandle=-1,Zr(y)),Qr!==null)for(y=Qr.return;y!==null;){var E=y;switch(n0(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&Rf();break;case 3:Ju(),kr(fi),kr(Ga),p0();break;case 5:m0(E);break;case 4:Ju();break;case 13:kr(Pr);break;case 19:kr(Pr);break;case 10:l0(E.type._context);break;case 22:case 23:K0()}y=y.return}if(va=l,Qr=l=Xl(l.current,null),Na=ji=h,ca=0,Hh=null,U0=tp=Yc=0,xi=Wh=null,Vc!==null){for(h=0;h<Vc.length;h++)if(y=Vc[h],E=y.interleaved,E!==null){y.interleaved=null;var R=E.next,G=y.pending;if(G!==null){var se=G.next;G.next=R,E.next=se}y.pending=E}Vc=null}return l}function I2(l,h){do{var y=Qr;try{if(o0(),Wf.current=Yf,Vf){for(var E=jr.memoizedState;E!==null;){var R=E.queue;R!==null&&(R.pending=null),E=E.next}Vf=!1}if(Kc=0,xa=la=jr=null,Ih=!1,Bh=0,O0.current=null,y===null||y.return===null){ca=1,Hh=h,Qr=null;break}e:{var G=l,se=y.return,Pe=y,Ye=h;if(h=Na,Pe.flags|=32768,Ye!==null&&typeof Ye=="object"&&typeof Ye.then=="function"){var At=Ye,qt=Pe,en=qt.tag;if((qt.mode&1)===0&&(en===0||en===11||en===15)){var Yt=qt.alternate;Yt?(qt.updateQueue=Yt.updateQueue,qt.memoizedState=Yt.memoizedState,qt.lanes=Yt.lanes):(qt.updateQueue=null,qt.memoizedState=null)}var pn=l2(se);if(pn!==null){pn.flags&=-257,c2(pn,se,Pe,G,h),pn.mode&1&&o2(G,At,h),h=pn,Ye=At;var Cn=h.updateQueue;if(Cn===null){var kn=new Set;kn.add(Ye),h.updateQueue=kn}else Cn.add(Ye);break e}else{if((h&1)===0){o2(G,At,h),Y0();break e}Ye=Error(n(426))}}else if(Mr&&Pe.mode&1){var Vr=l2(se);if(Vr!==null){(Vr.flags&65536)===0&&(Vr.flags|=256),c2(Vr,se,Pe,G,h),i0(Xu(Ye,Pe));break e}}G=Ye=Xu(Ye,Pe),ca!==4&&(ca=2),Wh===null?Wh=[G]:Wh.push(G),G=se;do{switch(G.tag){case 3:G.flags|=65536,h&=-h,G.lanes|=h;var mt=i2(G,Ye,h);RS(G,mt);break e;case 1:Pe=Ye;var nt=G.type,yt=G.stateNode;if((G.flags&128)===0&&(typeof nt.getDerivedStateFromError=="function"||yt!==null&&typeof yt.componentDidCatch=="function"&&(Kl===null||!Kl.has(yt)))){G.flags|=65536,h&=-h,G.lanes|=h;var nn=s2(G,Pe,h);RS(G,nn);break e}}G=G.return}while(G!==null)}U2(y)}catch(An){h=An,Qr===y&&y!==null&&(Qr=y=y.return);continue}break}while(!0)}function B2(){var l=ep.current;return ep.current=Yf,l===null?Yf:l}function Y0(){(ca===0||ca===3||ca===2)&&(ca=4),va===null||(Yc&268435455)===0&&(tp&268435455)===0||Jl(va,Na)}function op(l,h){var y=ir;ir|=2;var E=B2();(va!==l||Na!==h)&&(el=null,Jc(l,h));do try{PR();break}catch(R){I2(l,R)}while(!0);if(o0(),ir=y,ep.current=E,Qr!==null)throw Error(n(261));return va=null,Na=0,ca}function PR(){for(;Qr!==null;)O2(Qr)}function jR(){for(;Qr!==null&&!$();)O2(Qr)}function O2(l){var h=H2(l.alternate,l,ji);l.memoizedProps=l.pendingProps,h===null?U2(l):Qr=h,O0.current=null}function U2(l){var h=l;do{var y=h.alternate;if(l=h.return,(h.flags&32768)===0){if(y=kR(y,h,ji),y!==null){Qr=y;return}}else{if(y=AR(y,h),y!==null){y.flags&=32767,Qr=y;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ca=6,Qr=null;return}}if(h=h.sibling,h!==null){Qr=h;return}Qr=h=l}while(h!==null);ca===0&&(ca=5)}function Xc(l,h,y){var E=rn,R=ss.transition;try{ss.transition=null,rn=1,LR(l,h,y,E)}finally{ss.transition=R,rn=E}return null}function LR(l,h,y,E){do td();while(Yl!==null);if((ir&6)!==0)throw Error(n(327));y=l.finishedWork;var R=l.finishedLanes;if(y===null)return null;if(l.finishedWork=null,l.finishedLanes=0,y===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var G=y.lanes|y.childLanes;if(Zt(l,G),l===va&&(Qr=va=null,Na=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||rp||(rp=!0,W2(Ke,function(){return td(),null})),G=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||G){G=ss.transition,ss.transition=null;var se=rn;rn=1;var Pe=ir;ir|=4,O0.current=null,TR(l,y),T2(y,l),Qi(Rn),zn=!!hn,Rn=hn=null,l.current=y,MR(y),xe(),ir=Pe,rn=se,ss.transition=G}else l.current=y;if(rp&&(rp=!1,Yl=l,ap=R),G=l.pendingLanes,G===0&&(Kl=null),ot(y.stateNode),vi(l,ne()),h!==null)for(E=l.onRecoverableError,y=0;y<h.length;y++)R=h[y],E(R.value,{componentStack:R.stack,digest:R.digest});if(np)throw np=!1,l=G0,G0=null,l;return(ap&1)!==0&&l.tag!==0&&td(),G=l.pendingLanes,(G&1)!==0?l===H0?Vh++:(Vh=0,H0=l):Vh=0,Hl(),null}function td(){if(Yl!==null){var l=or(ap),h=ss.transition,y=rn;try{if(ss.transition=null,rn=16>l?16:l,Yl===null)var E=!1;else{if(l=Yl,Yl=null,ap=0,(ir&6)!==0)throw Error(n(331));var R=ir;for(ir|=4,Fn=l.current;Fn!==null;){var G=Fn,se=G.child;if((Fn.flags&16)!==0){var Pe=G.deletions;if(Pe!==null){for(var Ye=0;Ye<Pe.length;Ye++){var At=Pe[Ye];for(Fn=At;Fn!==null;){var qt=Fn;switch(qt.tag){case 0:case 11:case 15:Gh(8,qt,G)}var en=qt.child;if(en!==null)en.return=qt,Fn=en;else for(;Fn!==null;){qt=Fn;var Yt=qt.sibling,pn=qt.return;if(_2(qt),qt===At){Fn=null;break}if(Yt!==null){Yt.return=pn,Fn=Yt;break}Fn=pn}}}var Cn=G.alternate;
vendor: 10,405 bytes, line 8
8if(Cn!==null){var kn=Cn.child;if(kn!==null){Cn.child=null;do{var Vr=kn.sibling;kn.sibling=null,kn=Vr}while(kn!==null)}}Fn=G}}if((G.subtreeFlags&2064)!==0&&se!==null)se.return=G,Fn=se;else e:for(;Fn!==null;){if(G=Fn,(G.flags&2048)!==0)switch(G.tag){case 0:case 11:case 15:Gh(9,G,G.return)}var mt=G.sibling;if(mt!==null){mt.return=G.return,Fn=mt;break e}Fn=G.return}}var nt=l.current;for(Fn=nt;Fn!==null;){se=Fn;var yt=se.child;if((se.subtreeFlags&2064)!==0&&yt!==null)yt.return=se,Fn=yt;else e:for(se=nt;Fn!==null;){if(Pe=Fn,(Pe.flags&2048)!==0)try{switch(Pe.tag){case 0:case 11:case 15:Qf(9,Pe)}}catch(An){Ur(Pe,Pe.return,An)}if(Pe===se){Fn=null;break e}var nn=Pe.sibling;if(nn!==null){nn.return=Pe.return,Fn=nn;break e}Fn=Pe.return}}if(ir=R,Hl(),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(Te,l)}catch{}E=!0}return E}finally{rn=y,ss.transition=h}}return!1}function z2(l,h,y){h=Xu(y,h),h=i2(l,h,1),l=Vl(l,h,1),h=ni(),l!==null&&(Xt(l,1,h),vi(l,h))}function Ur(l,h,y){if(l.tag===3)z2(l,l,y);else for(;h!==null;){if(h.tag===3){z2(h,l,y);break}else if(h.tag===1){var E=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(Kl===null||!Kl.has(E))){l=Xu(y,l),l=s2(h,l,1),h=Vl(h,l,1),l=ni(),h!==null&&(Xt(h,1,l),vi(h,l));break}}h=h.return}}function IR(l,h,y){var E=l.pingCache;E!==null&&E.delete(h),h=ni(),l.pingedLanes|=l.suspendedLanes&y,va===l&&(Na&y)===y&&(ca===4||ca===3&&(Na&130023424)===Na&&500>ne()-z0?Jc(l,0):U0|=y),vi(l,h)}function G2(l,h){h===0&&((l.mode&1)===0?h=1:(h=St,St<<=1,(St&130023424)===0&&(St=4194304)));var y=ni();l=Xo(l,h),l!==null&&(Xt(l,h,y),vi(l,y))}function BR(l){var h=l.memoizedState,y=0;h!==null&&(y=h.retryLane),G2(l,y)}function OR(l,h){var y=0;switch(l.tag){case 13:var E=l.stateNode,R=l.memoizedState;R!==null&&(y=R.retryLane);break;case 19:E=l.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(h),G2(l,y)}var H2;H2=function(l,h,y){if(l!==null)if(l.memoizedProps!==h.pendingProps||fi.current)gi=!0;else{if((l.lanes&y)===0&&(h.flags&128)===0)return gi=!1,ER(l,h,y);gi=(l.flags&131072)!==0}else gi=!1,Mr&&(h.flags&1048576)!==0&&SS(h,Lf,h.index);switch(h.lanes=0,h.tag){case 2:var E=h.type;Xf(l,h),l=h.pendingProps;var R=Hu(h,Ga.current);qu(h,y),R=v0(null,h,E,l,R,y);var G=y0();return h.flags|=1,typeof R=="object"&&R!==null&&typeof R.render=="function"&&R.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,pi(E)?(G=!0,Df(h)):G=!1,h.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,d0(h),R.updater=qf,h.stateNode=R,R._reactInternals=h,_0(h,E,l,y),h=N0(null,h,E,!0,G,y)):(h.tag=0,Mr&&G&&t0(h),ti(null,h,R,y),h=h.child),h;case 16:E=h.elementType;e:{switch(Xf(l,h),l=h.pendingProps,R=E._init,E=R(E._payload),h.type=E,R=h.tag=zR(E),l=Ss(E,l),R){case 0:h=A0(null,h,E,l,y);break e;case 1:h=p2(null,h,E,l,y);break e;case 11:h=u2(null,h,E,l,y);break e;case 14:h=d2(null,h,E,Ss(E.type,l),y);break e}throw Error(n(306,E,""))}return h;case 0:return E=h.type,R=h.pendingProps,R=h.elementType===E?R:Ss(E,R),A0(l,h,E,R,y);case 1:return E=h.type,R=h.pendingProps,R=h.elementType===E?R:Ss(E,R),p2(l,h,E,R,y);case 3:e:{if(g2(h),l===null)throw Error(n(387));E=h.pendingProps,G=h.memoizedState,R=G.element,MS(l,h),Gf(h,E,null,y);var se=h.memoizedState;if(E=se.element,G.isDehydrated)if(G={element:E,isDehydrated:!1,cache:se.cache,pendingSuspenseBoundaries:se.pendingSuspenseBoundaries,transitions:se.transitions},h.updateQueue.baseState=G,h.memoizedState=G,h.flags&256){R=Xu(Error(n(423)),h),h=x2(l,h,E,y,R);break e}else if(E!==R){R=Xu(Error(n(424)),h),h=x2(l,h,E,y,R);break e}else for(Pi=ao(h.stateNode.containerInfo.firstChild),Di=h,Mr=!0,ws=null,y=NS(h,null,E,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if($u(),E===R){h=Qo(l,h,y);break e}ti(l,h,E,y)}h=h.child}return h;case 5:return PS(h),l===null&&a0(h),E=h.type,R=h.pendingProps,G=l!==null?l.memoizedProps:null,se=R.children,Kn(E,R)?se=null:G!==null&&Kn(E,G)&&(h.flags|=32),f2(l,h),ti(l,h,se,y),h.child;case 6:return l===null&&a0(h),null;case 13:return v2(l,h,y);case 4:return h0(h,h.stateNode.containerInfo),E=h.pendingProps,l===null?h.child=Ku(h,null,E,y):ti(l,h,E,y),h.child;case 11:return E=h.type,R=h.pendingProps,R=h.elementType===E?R:Ss(E,R),u2(l,h,E,R,y);case 7:return ti(l,h,h.pendingProps,y),h.child;case 8:return ti(l,h,h.pendingProps.children,y),h.child;case 12:return ti(l,h,h.pendingProps.children,y),h.child;case 10:e:{if(E=h.type._context,R=h.pendingProps,G=h.memoizedProps,se=R.value,Fr(Of,E._currentValue),E._currentValue=se,G!==null)if(Mi(G.value,se)){if(G.children===R.children&&!fi.current){h=Qo(l,h,y);break e}}else for(G=h.child,G!==null&&(G.return=h);G!==null;){var Pe=G.dependencies;if(Pe!==null){se=G.child;for(var Ye=Pe.firstContext;Ye!==null;){if(Ye.context===E){if(G.tag===1){Ye=Zo(-1,y&-y),Ye.tag=2;var At=G.updateQueue;if(At!==null){At=At.shared;var qt=At.pending;qt===null?Ye.next=Ye:(Ye.next=qt.next,qt.next=Ye),At.pending=Ye}}G.lanes|=y,Ye=G.alternate,Ye!==null&&(Ye.lanes|=y),c0(G.return,y,h),Pe.lanes|=y;break}Ye=Ye.next}}else if(G.tag===10)se=G.type===h.type?null:G.child;else if(G.tag===18){if(se=G.return,se===null)throw Error(n(341));se.lanes|=y,Pe=se.alternate,Pe!==null&&(Pe.lanes|=y),c0(se,y,h),se=G.sibling}else se=G.child;if(se!==null)se.return=G;else for(se=G;se!==null;){if(se===h){se=null;break}if(G=se.sibling,G!==null){G.return=se.return,se=G;break}se=se.return}G=se}ti(l,h,R.children,y),h=h.child}return h;case 9:return R=h.type,E=h.pendingProps.children,qu(h,y),R=as(R),E=E(R),h.flags|=1,ti(l,h,E,y),h.child;case 14:return E=h.type,R=Ss(E,h.pendingProps),R=Ss(E.type,R),d2(l,h,E,R,y);case 15:return h2(l,h,h.type,h.pendingProps,y);case 17:return E=h.type,R=h.pendingProps,R=h.elementType===E?R:Ss(E,R),Xf(l,h),h.tag=1,pi(E)?(l=!0,Df(h)):l=!1,qu(h,y),r2(h,E,R),_0(h,E,R,y),N0(null,h,E,!0,l,y);case 19:return b2(l,h,y);case 22:return m2(l,h,y)}throw Error(n(156,h.tag))};function W2(l,h){return tt(l,h)}function UR(l,h,y,E){this.tag=l,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function os(l,h,y,E){return new UR(l,h,y,E)}function q0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function zR(l){if(typeof l=="function")return q0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===I)return 11;if(l===q)return 14}return 2}function Xl(l,h){var y=l.alternate;return y===null?(y=os(l.tag,h,l.key,l.mode),y.elementType=l.elementType,y.type=l.type,y.stateNode=l.stateNode,y.alternate=l,l.alternate=y):(y.pendingProps=h,y.type=l.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=l.flags&14680064,y.childLanes=l.childLanes,y.lanes=l.lanes,y.child=l.child,y.memoizedProps=l.memoizedProps,y.memoizedState=l.memoizedState,y.updateQueue=l.updateQueue,h=l.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=l.sibling,y.index=l.index,y.ref=l.ref,y}function lp(l,h,y,E,R,G){var se=2;if(E=l,typeof l=="function")q0(l)&&(se=1);else if(typeof l=="string")se=5;else e:switch(l){case T:return Zc(y.children,R,G,h);case K:se=8,R|=8;break;case B:return l=os(12,y,h,R|2),l.elementType=B,l.lanes=G,l;case j:return l=os(13,y,h,R),l.elementType=j,l.lanes=G,l;case U:return l=os(19,y,h,R),l.elementType=U,l.lanes=G,l;case W:return cp(y,R,G,h);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case k:se=10;break e;case O:se=9;break e;case I:se=11;break e;case q:se=14;break e;case Y:se=16,E=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return h=os(se,y,h,R),h.elementType=l,h.type=E,h.lanes=G,h}function Zc(l,h,y,E){return l=os(7,l,E,h),l.lanes=y,l}function cp(l,h,y,E){return l=os(22,l,E,h),l.elementType=W,l.lanes=y,l.stateNode={isHidden:!1},l}function J0(l,h,y){return l=os(6,l,null,h),l.lanes=y,l}function X0(l,h,y){return h=os(4,l.children!==null?l.children:[],l.key,h),h.lanes=y,h.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},h}function GR(l,h,y,E,R){this.tag=h,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gt(0),this.expirationTimes=Gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.identifierPrefix=E,this.onRecoverableError=R,this.mutableSourceEagerHydrationData=null}function Z0(l,h,y,E,R,G,se,Pe,Ye){return l=new GR(l,h,y,Pe,Ye),h===1?(h=1,G===!0&&(h|=8)):h=0,G=os(3,null,null,h),l.current=G,G.stateNode=l,G.memoizedState={element:E,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},d0(G),l}function HR(l,h,y){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:E==null?null:""+E,children:l,containerInfo:h,implementation:y}}function V2(l){if(!l)return Gl;l=l._reactInternals;e:{if(it(l)!==l||l.tag!==1)throw Error(n(170));var h=l;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(pi(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(n(171))}if(l.tag===1){var y=l.type;if(pi(y))return yS(l,y,h)}return h}function $2(l,h,y,E,R,G,se,Pe,Ye){return l=Z0(y,E,!0,l,R,G,se,Pe,Ye),l.context=V2(null),y=l.current,E=ni(),R=ql(y),G=Zo(E,R),G.callback=h??null,Vl(y,G,R),l.current.lanes=R,Xt(l,R,E),vi(l,E),l}function up(l,h,y,E){var R=h.current,G=ni(),se=ql(R);return y=V2(y),h.context===null?h.context=y:h.pendingContext=y,h=Zo(G,se),h.payload={element:l},E=E===void 0?null:E,E!==null&&(h.callback=E),l=Vl(R,h,se),l!==null&&(_s(l,R,se,G),zf(l,R,se)),se}function dp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function K2(l,h){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var y=l.retryLane;l.retryLane=y!==0&&y<h?y:h}}function Q0(l,h){K2(l,h),(l=l.alternate)&&K2(l,h)}function WR(){return null}var Y2=typeof reportError=="function"?reportError:function(l){console.error(l)};function ev(l){this._internalRoot=l}hp.prototype.render=ev.prototype.render=function(l){var h=this._internalRoot;if(h===null)throw Error(n(409));
vendor: 6,257 bytes, line 8
8up(l,h,null,null)},hp.prototype.unmount=ev.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var h=l.containerInfo;qc(function(){up(null,l,null,null)}),h[fr]=null}};function hp(l){this._internalRoot=l}hp.prototype.unstable_scheduleHydration=function(l){if(l){var h=fs();l={blockedOn:null,target:l,priority:h};for(var y=0;y<Br.length&&h!==0&&h<Br[y].priority;y++);Br.splice(y,0,l),y===0&&En(l)}};function tv(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function mp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function q2(){}function VR(l,h,y,E,R){if(R){if(typeof E=="function"){var G=E;E=function(){var At=dp(se);G.call(At)}}var se=$2(h,E,l,0,null,!1,!1,"",q2);return l._reactRootContainer=se,l[fr]=se.current,Il(l.nodeType===8?l.parentNode:l),qc(),se}for(;R=l.lastChild;)l.removeChild(R);if(typeof E=="function"){var Pe=E;E=function(){var At=dp(Ye);Pe.call(At)}}var Ye=Z0(l,0,!1,null,null,!1,!1,"",q2);return l._reactRootContainer=Ye,l[fr]=Ye.current,Il(l.nodeType===8?l.parentNode:l),qc(function(){up(h,Ye,y,E)}),Ye}function fp(l,h,y,E,R){var G=y._reactRootContainer;if(G){var se=G;if(typeof R=="function"){var Pe=R;R=function(){var Ye=dp(se);Pe.call(Ye)}}up(h,se,l,R)}else se=VR(y,h,l,R,E);return dp(se)}Nr=function(l){switch(l.tag){case 3:var h=l.stateNode;if(h.current.memoizedState.isDehydrated){var y=le(h.pendingLanes);y!==0&&(_n(h,y|1),vi(h,ne()),(ir&6)===0&&(ed=ne()+500,Hl()))}break;case 13:qc(function(){var E=Xo(l,1);if(E!==null){var R=ni();_s(E,l,1,R)}}),Q0(l,1)}},Ca=function(l){if(l.tag===13){var h=Xo(l,134217728);if(h!==null){var y=ni();_s(h,l,134217728,y)}Q0(l,134217728)}},qi=function(l){if(l.tag===13){var h=ql(l),y=Xo(l,h);if(y!==null){var E=ni();_s(y,l,h,E)}Q0(l,h)}},fs=function(){return rn},_a=function(l,h){var y=rn;try{return rn=l,h()}finally{rn=y}},ye=function(l,h,y){switch(h){case"input":if(Nt(l,y),h=y.name,y.type==="radio"&&h!=null){for(y=l;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<y.length;h++){var E=y[h];if(E!==l&&E.form===l.form){var R=zu(E);if(!R)throw Error(n(90));zt(E),Nt(E,R)}}}break;case"textarea":ee(l,y);break;case"select":h=y.value,h!=null&&Dt(l,!!y.multiple,h,!1)}},Ze=$0,ue=qc;var $R={usingClientEntryPoint:!1,Events:[$o,Ko,zu,Se,Be,$0]},$h={findFiberByHostInstance:Vo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KR={bundleType:$h.bundleType,version:$h.version,rendererPackageName:$h.rendererPackageName,rendererConfig:$h.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Ot(l),l===null?null:l.stateNode},findFiberByHostInstance:$h.findFiberByHostInstance||WR,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 pp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pp.isDisabled&&pp.supportsFiber)try{Te=pp.inject(KR),Qe=pp}catch{}}return yi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$R,yi.createPortal=function(l,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tv(h))throw Error(n(200));return HR(l,h,null,y)},yi.createRoot=function(l,h){if(!tv(l))throw Error(n(299));var y=!1,E="",R=Y2;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onRecoverableError!==void 0&&(R=h.onRecoverableError)),h=Z0(l,1,!1,null,null,y,!1,E,R),l[fr]=h.current,Il(l.nodeType===8?l.parentNode:l),new ev(h)},yi.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var h=l._reactInternals;if(h===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Ot(h),l=l===null?null:l.stateNode,l},yi.flushSync=function(l){return qc(l)},yi.hydrate=function(l,h,y){if(!mp(h))throw Error(n(200));return fp(null,l,h,!0,y)},yi.hydrateRoot=function(l,h,y){if(!tv(l))throw Error(n(405));var E=y!=null&&y.hydratedSources||null,R=!1,G="",se=Y2;if(y!=null&&(y.unstable_strictMode===!0&&(R=!0),y.identifierPrefix!==void 0&&(G=y.identifierPrefix),y.onRecoverableError!==void 0&&(se=y.onRecoverableError)),h=$2(h,null,l,1,y??null,R,!1,G,se),l[fr]=h.current,Il(l),E)for(l=0;l<E.length;l++)y=E[l],R=y._getVersion,R=R(y._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[y,R]:h.mutableSourceEagerHydrationData.push(y,R);return new hp(h)},yi.render=function(l,h,y){if(!mp(h))throw Error(n(200));return fp(null,l,h,!1,y)},yi.unmountComponentAtNode=function(l){if(!mp(l))throw Error(n(40));return l._reactRootContainer?(qc(function(){fp(null,null,l,!1,function(){l._reactRootContainer=null,l[fr]=null})}),!0):!1},yi.unstable_batchedUpdates=$0,yi.unstable_renderSubtreeIntoContainer=function(l,h,y,E){if(!mp(y))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return fp(l,h,y,!1,E)},yi.version="18.3.1-next-f1338f8080-20240426",yi}var rF;function RE(){if(rF)return av.exports;rF=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),av.exports=tD(),av.exports}var aF;function nD(){if(aF)return gp;aF=1;var t=RE();return gp.createRoot=t.createRoot,gp.hydrateRoot=t.hydrateRoot,gp}var rD=nD(),x=x1();const Jt=Kg(x),v1=qR({__proto__:null,default:Jt},[x]),aD=1,iD=1e6;let ov=0;function sD(){return ov=(ov+1)%Number.MAX_SAFE_INTEGER,ov.toString()}const lv=new Map,iF=t=>{if(lv.has(t))return;const e=setTimeout(()=>{lv.delete(t),Sm({type:"REMOVE_TOAST",toastId:t})},iD);lv.set(t,e)},oD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,aD)};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;
8return n?iF(n):t.toasts.forEach(a=>{iF(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===n||n===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},og=[];let lg={toasts:[]};function Sm(t){lg=oD(lg,t),og.forEach(e=>{e(lg)})}function lD({...t}){const e=sD(),n=i=>Sm({type:"UPDATE_TOAST",toast:{...i,id:e}}),a=()=>Sm({type:"DISMISS_TOAST",toastId:e});return Sm({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||a()}}}),{id:e,dismiss:a,update:n}}function nr(){const[t,e]=x.useState(lg);return x.useEffect(()=>(og.push(e),()=>{const n=og.indexOf(e);n>-1&&og.splice(n,1)}),[t]),{...t,toast:lD,dismiss:n=>Sm({type:"DISMISS_TOAST",toastId:n})}}var _u=RE();const DE=Kg(_u);function vn(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function sF(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function PE(...t){return e=>{let n=!1;const a=t.map(i=>{const s=sF(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<a.length;i++){const s=a[i];typeof s=="function"?s():sF(t[i],null)}}}}function Hn(...t){return x.useCallback(PE(...t),t)}function cD(t,e){const n=x.createContext(e),a=s=>{const{children:o,...c}=s,d=x.useMemo(()=>c,Object.values(c));return r.jsx(n.Provider,{value:d,children:o})};a.displayName=t+"Provider";function i(s){const o=x.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[a,i]}function Xa(t,e=[]){let n=[];function a(s,o){const c=x.createContext(o),d=n.length;n=[...n,o];const m=p=>{const{scope:b,children:v,...C}=p,S=b?.[t]?.[d]||c,F=x.useMemo(()=>C,Object.values(C));return r.jsx(S.Provider,{value:F,children:v})};m.displayName=s+"Provider";function f(p,b){const v=b?.[t]?.[d]||c,C=x.useContext(v);if(C)return C;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[m,f]}const i=()=>{const s=n.map(o=>x.createContext(o));return function(c){const d=c?.[t]||s;return x.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return i.scopeName=t,[a,uD(i,...e)]}function uD(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const a=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=a.reduce((c,{useScope:d,scopeName:m})=>{const p=d(s)[`__scope${m}`];return{...c,...p}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Id(t){const e=hD(t),n=x.forwardRef((a,i)=>{const{children:s,...o}=a,c=x.Children.toArray(s),d=c.find(mD);if(d){const m=d.props.children,f=c.map(p=>p===d?x.Children.count(m)>1?x.Children.only(null):x.isValidElement(m)?m.props.children:null:p);return r.jsx(e,{...o,ref:i,children:x.isValidElement(m)?x.cloneElement(m,void 0,f):null})}return r.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var dD=Id("Slot");function hD(t){const e=x.forwardRef((n,a)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const o=pD(i),c=fD(s,i.props);return i.type!==x.Fragment&&(c.ref=a?PE(a,o):o),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var jE=Symbol("radix.slottable");function LE(t){const e=({children:n})=>r.jsx(r.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=jE,e}function mD(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===jE}function fD(t,e){const n={...e};for(const a in e){const i=t[a],s=e[a];/^on[A-Z]/.test(a)?i&&s?n[a]=(...c)=>{const d=s(...c);return i(...c),d}:i&&(n[a]=i):a==="style"?n[a]={...i,...s}:a==="className"&&(n[a]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function pD(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Vm(t){const e=t+"CollectionProvider",[n,a]=Xa(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=S=>{const{scope:F,children:w}=S,A=Jt.useRef(null),N=Jt.useRef(new Map).current;return r.jsx(i,{scope:F,itemMap:N,collectionRef:A,children:w})};o.displayName=e;const c=t+"CollectionSlot",d=Id(c),m=Jt.forwardRef((S,F)=>{const{scope:w,children:A}=S,N=s(c,w),P=Hn(F,N.collectionRef);return r.jsx(d,{ref:P,children:A})});m.displayName=c;const f=t+"CollectionItemSlot",p="data-radix-collection-item",b=Id(f),v=Jt.forwardRef((S,F)=>{const{scope:w,children:A,...N}=S,P=Jt.useRef(null),z=Hn(F,P),D=s(f,w);return Jt.useEffect(()=>(D.itemMap.set(P,{ref:P,...N}),()=>{D.itemMap.delete(P)})),r.jsx(b,{[p]:"",ref:z,children:A})});v.displayName=f;function C(S){const F=s(t+"CollectionConsumer",S);return Jt.useCallback(()=>
vendor: 5,489 bytes, line 8
8{const A=F.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(F.itemMap.values()).sort((D,T)=>N.indexOf(D.ref.current)-N.indexOf(T.ref.current))},[F.collectionRef,F.itemMap])}return[{Provider:o,Slot:m,ItemSlot:v},C,a]}var gD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tn=gD.reduce((t,e)=>{const n=Id(`Primitive.${e}`),a=x.forwardRef((i,s)=>{const{asChild:o,...c}=i,d=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(d,{...c,ref:s})});return a.displayName=`Primitive.${e}`,{...t,[e]:a}},{});function IE(t,e){t&&_u.flushSync(()=>t.dispatchEvent(e))}function ua(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>e.current?.(...n),[])}function xD(t,e=globalThis?.document){const n=ua(t);x.useEffect(()=>{const a=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",a,{capture:!0}),()=>e.removeEventListener("keydown",a,{capture:!0})},[n,e])}var vD="DismissableLayer",Ey="dismissableLayer.update",yD="dismissableLayer.pointerDownOutside",bD="dismissableLayer.focusOutside",oF,BE=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$m=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:c,...d}=t,m=x.useContext(BE),[f,p]=x.useState(null),b=f?.ownerDocument??globalThis?.document,[,v]=x.useState({}),C=Hn(e,T=>p(T)),S=Array.from(m.layers),[F]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),w=S.indexOf(F),A=f?S.indexOf(f):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,P=A>=w,z=SD(T=>{const K=T.target,B=[...m.branches].some(k=>k.contains(K));!P||B||(i?.(T),o?.(T),T.defaultPrevented||c?.())},b),D=FD(T=>{const K=T.target;[...m.branches].some(k=>k.contains(K))||(s?.(T),o?.(T),T.defaultPrevented||c?.())},b);return xD(T=>{A===m.layers.size-1&&(a?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},b),x.useEffect(()=>{if(f)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(oF=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(f)),m.layers.add(f),lF(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=oF)}},[f,b,n,m]),x.useEffect(()=>()=>{f&&(m.layers.delete(f),m.layersWithOutsidePointerEventsDisabled.delete(f),lF())},[f,m]),x.useEffect(()=>{const T=()=>v({});return document.addEventListener(Ey,T),()=>document.removeEventListener(Ey,T)},[]),r.jsx(Tn.div,{...d,ref:C,style:{pointerEvents:N?P?"auto":"none":void 0,...t.style},onFocusCapture:vn(t.onFocusCapture,D.onFocusCapture),onBlurCapture:vn(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:vn(t.onPointerDownCapture,z.onPointerDownCapture)})});$m.displayName=vD;var wD="DismissableLayerBranch",OE=x.forwardRef((t,e)=>{const n=x.useContext(BE),a=x.useRef(null),i=Hn(e,a);return x.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),r.jsx(Tn.div,{...t,ref:i})});OE.displayName=wD;function SD(t,e=globalThis?.document){const n=ua(t),a=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!a.current){let d=function(){UE(yD,n,m,{discrete:!0})};const m={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=d,e.addEventListener("click",i.current,{once:!0})):d()}else e.removeEventListener("click",i.current);a.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>a.current=!0}}function FD(t,e=globalThis?.document){const n=ua(t),a=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!a.current&&UE(bD,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function lF(){const t=new CustomEvent(Ey);document.dispatchEvent(t)}function UE(t,e,n,{discrete:a}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),a?IE(i,s):i.dispatchEvent(s)}var CD=$m,_D=OE,fa=globalThis?.document?x.useLayoutEffect:()=>{},ED="Portal",qg=x.forwardRef((t,e)=>{const{container:n,...a}=t,[i,s]=x.useState(!1);fa(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?DE.createPortal(r.jsx(Tn.div,{...a,ref:e}),o):null});qg.displayName=ED;function kD(t,e){return x.useReducer((n,a)=>e[n][a]??n,t)}var Yi=t=>{const{present:e,children:n}=t,a=AD(e),i=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),s=Hn(a.ref,ND(i));return typeof n=="function"||a.isPresent?x.cloneElement(i,{ref:s}):null};Yi.displayName="Presence";function AD(t){const[e,n]=x.useState(),a=x.useRef(null),i=x.useRef(t),s=x.useRef("none"),o=t?"mounted":"unmounted",[c,d]=kD(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const m=xp(a.current);s.current=c==="mounted"?m:"none"},[c]),fa(()=>{const m=a.current,f=i.current;if(f!==t){const b=s.current,v=xp(m);t?d("MOUNT"):v==="none"||m?.display==="none"?d("UNMOUNT"):d(f&&b!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,d]),fa(()=>
8{if(e){let m;const f=e.ownerDocument.defaultView??window,p=v=>{const S=xp(a.current).includes(CSS.escape(v.animationName));if(v.target===e&&S&&(d("ANIMATION_END"),!i.current)){const F=e.style.animationFillMode;e.style.animationFillMode="forwards",m=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=F)})}},b=v=>{v.target===e&&(s.current=xp(a.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",p),e.addEventListener("animationend",p),()=>{f.clearTimeout(m),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",p),e.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(m=>{a.current=m?getComputedStyle(m):null,n(m)},[])}}function xp(t){return t?.animationName||"none"}function ND(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var TD=v1[" useInsertionEffect ".trim().toString()]||fa;function ds({prop:t,defaultProp:e,onChange:n=()=>{},caller:a}){const[i,s,o]=MD({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:i;{const f=x.useRef(t!==void 0);x.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${a} is changing from ${p?"controlled":"uncontrolled"} to ${c?"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.`),f.current=c},[c,a])}const m=x.useCallback(f=>{if(c){const p=RD(f)?f(t):f;p!==t&&o.current?.(p)}else s(f)},[c,t,s,o]);return[d,m]}function MD({defaultProp:t,onChange:e}){const[n,a]=x.useState(t),i=x.useRef(n),s=x.useRef(e);return TD(()=>{s.current=e},[e]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,a,s]}function RD(t){return typeof t=="function"}var zE=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"}),DD="VisuallyHidden",Jg=x.forwardRef((t,e)=>r.jsx(Tn.span,{...t,ref:e,style:{...zE,...t.style}}));Jg.displayName=DD;var PD=Jg,y1="ToastProvider",[b1,jD,LD]=Vm("Toast"),[GE]=Xa("Toast",[LD]),[ID,Xg]=GE(y1),HE=t=>{const{__scopeToast:e,label:n="Notification",duration:a=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[c,d]=x.useState(null),[m,f]=x.useState(0),p=x.useRef(!1),b=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${y1}\`. Expected non-empty \`string\`.`),r.jsx(b1.Provider,{scope:e,children:r.jsx(ID,{scope:e,label:n,duration:a,swipeDirection:i,swipeThreshold:s,toastCount:m,viewport:c,onViewportChange:d,onToastAdd:x.useCallback(()=>f(v=>v+1),[]),onToastRemove:x.useCallback(()=>f(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:b,children:o})})};HE.displayName=y1;var WE="ToastViewport",BD=["F8"],ky="toast.viewportPause",Ay="toast.viewportResume",VE=x.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:a=BD,label:i="Notifications ({hotkey})",...s}=t,o=Xg(WE,n),c=jD(n),d=x.useRef(null),m=x.useRef(null),f=x.useRef(null),p=x.useRef(null),b=Hn(e,p,o.onViewportChange),v=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=o.toastCount>0;x.useEffect(()=>{const F=w=>{a.length!==0&&a.every(N=>w[N]||w.code===N)&&p.current?.focus()};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[a]),x.useEffect(()=>{const F=d.current,w=p.current;if(C&&F&&w){const A=()=>{if(!o.isClosePausedRef.current){const D=new CustomEvent(ky);w.dispatchEvent(D),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const D=new CustomEvent(Ay);w.dispatchEvent(D),o.isClosePausedRef.current=!1}},P=D=>{!F.contains(D.relatedTarget)&&N()},z=()=>{F.contains(document.activeElement)||N()};return F.addEventListener("focusin",A),F.addEventListener("focusout",P),F.addEventListener("pointermove",A),F.addEventListener("pointerleave",z),window.addEventListener("blur",A),window.addEventListener("focus",N),()=>{F.removeEventListener("focusin",A),F.removeEventListener("focusout",P),F.removeEventListener("pointermove",A),F.removeEventListener("pointerleave",z),window.removeEventListener("blur",A),window.removeEventListener("focus",N)}}},[C,o.isClosePausedRef]);const S=x.useCallback(({tabbingDirection:F})=>{const A=c().map(N=>{const P=N.ref.current,z=[P,...XD(P)];return F==="forwards"?z:z.reverse()});return(F==="forwards"?A.reverse():A).flat()},[c]);return x.useEffect(()=>{const F=p.current;if(F){const w=A=>{const N=A.altKey||A.ctrlKey||A.metaKey;if(A.key==="Tab"&&!N){const z=document.activeElement,D=A.shiftKey;if(A.target===F&&D){m.current?.focus();return}const B=S({tabbingDirection:D?"backwards":"forwards"}),k=B.findIndex(O=>O===z);cv(B.slice(k+1))?A.preventDefault():D?m.current?.focus():f.current?.focus()}};return F.addEventListener("keydown",w),()=>F.removeEventListener("keydown",w)}},[c,S]),r.jsxs(_D,{ref:d,role:"region","aria-label":i.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:C?void 0:"none"},children:[C&&r.jsx(Ny,{ref:m,onFocusFromOutsideViewport:()=>{const F=S({tabbingDirection:"forwards"});cv(F)}}),r.jsx(b1.Slot,{scope:n,children:r.jsx(Tn.ol,{tabIndex:-1,...s,ref:b})}),C&&r.jsx(Ny,{ref:f,onFocusFromOutsideViewport:()=>{const F=S({tabbingDirection:"backwards"});cv(F)}})]})});VE.displayName=WE;var $E="ToastFocusProxy",Ny=x.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:a,...i}=t,s=Xg($E,n);return r.jsx(Jg,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!s.viewport?.contains(c)&&a()}})});Ny.displayName=$E;var Km="Toast",OD="toast.swipeStart",UD="toast.swipeMove",zD="toast.swipeCancel",GD="toast.swipeEnd",KE=x.forwardRef((t,e)=>{const{forceMount:n,open:a,defaultOpen:i,onOpenChange:s,...o}=t,[c,d]=ds({prop:a,defaultProp:i??!0,onChange:s,caller:Km});return r.jsx(Yi,{present:n||c,children:r.jsx(VD,{open:c,...o,ref:e,onClose:()=>d(!1),onPause:ua(t.onPause),onResume:ua(t.onResume),onSwipeStart:vn(t.onSwipeStart,m=>{m.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:vn(t.onSwipeMove,m=>{const{x:f,y:p}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","move"),m.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:vn(t.onSwipeCancel,m=>{m.currentTarget.setAttribute("data-swipe","cancel"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:vn(t.onSwipeEnd,m=>{const{x:f,y:p}=m.detail.delta;m.currentTarget.setAttribute("data-swipe","end"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),m.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),m.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),m.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});KE.displayName=Km;var[HD,WD]=GE(Km,{onClose(){}}),VD=x.forwardRef((t,e)=>{const{__scopeToast:n,type:a="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:m,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:b,onSwipeEnd:v,...C}=t,S=Xg(Km,n),[F,w]=x.useState(null),A=Hn(e,U=>w(U)),N=x.useRef(null),P=x.useRef(null),z=i||S.duration,D=x.useRef(0),T=x.useRef(z),K=x.useRef(0),{onToastAdd:B,onToastRemove:k}=S,O=ua(()=>{F?.contains(document.activeElement)&&S.viewport?.focus(),o()}),I=x.useCallback(U=>
8{!U||U===1/0||(window.clearTimeout(K.current),D.current=new Date().getTime(),K.current=window.setTimeout(O,U))},[O]);x.useEffect(()=>{const U=S.viewport;if(U){const q=()=>{I(T.current),m?.()},Y=()=>{const W=new Date().getTime()-D.current;T.current=T.current-W,window.clearTimeout(K.current),d?.()};return U.addEventListener(ky,Y),U.addEventListener(Ay,q),()=>{U.removeEventListener(ky,Y),U.removeEventListener(Ay,q)}}},[S.viewport,z,d,m,I]),x.useEffect(()=>{s&&!S.isClosePausedRef.current&&I(z)},[s,z,S.isClosePausedRef,I]),x.useEffect(()=>(B(),()=>k()),[B,k]);const j=x.useMemo(()=>F?e3(F):null,[F]);return S.viewport?r.jsxs(r.Fragment,{children:[j&&r.jsx($D,{__scopeToast:n,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:j}),r.jsx(HD,{scope:n,onClose:O,children:_u.createPortal(r.jsx(b1.ItemSlot,{scope:n,children:r.jsx(CD,{asChild:!0,onEscapeKeyDown:vn(c,()=>{S.isFocusedToastEscapeKeyDownRef.current||O(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(Tn.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":S.swipeDirection,...C,ref:A,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:vn(t.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:vn(t.onPointerDown,U=>{U.button===0&&(N.current={x:U.clientX,y:U.clientY})}),onPointerMove:vn(t.onPointerMove,U=>{if(!N.current)return;const q=U.clientX-N.current.x,Y=U.clientY-N.current.y,W=!!P.current,H=["left","right"].includes(S.swipeDirection),J=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,ie=H?J(0,q):0,Q=H?0:J(0,Y),ve=U.pointerType==="touch"?10:2,pe={x:ie,y:Q},Me={originalEvent:U,delta:pe};W?(P.current=pe,vp(UD,p,Me,{discrete:!1})):cF(pe,S.swipeDirection,ve)?(P.current=pe,vp(OD,f,Me,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(q)>ve||Math.abs(Y)>ve)&&(N.current=null)}),onPointerUp:vn(t.onPointerUp,U=>{const q=P.current,Y=U.target;if(Y.hasPointerCapture(U.pointerId)&&Y.releasePointerCapture(U.pointerId),P.current=null,N.current=null,q){const W=U.currentTarget,H={originalEvent:U,delta:q};cF(q,S.swipeDirection,S.swipeThreshold)?vp(GD,v,H,{discrete:!0}):vp(zD,b,H,{discrete:!0}),W.addEventListener("click",J=>J.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),$D=t=>{const{__scopeToast:e,children:n,...a}=t,i=Xg(Km,e),[s,o]=x.useState(!1),[c,d]=x.useState(!1);return qD(()=>o(!0)),x.useEffect(()=>{const m=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(m)},[]),c?null:r.jsx(qg,{asChild:!0,children:r.jsx(Jg,{...a,children:s&&r.jsxs(r.Fragment,{children:[i.label," ",n]})})})},KD="ToastTitle",YE=x.forwardRef((t,e)=>{const{__scopeToast:n,...a}=t;return r.jsx(Tn.div,{...a,ref:e})});YE.displayName=KD;var YD="ToastDescription",qE=x.forwardRef((t,e)=>{const{__scopeToast:n,...a}=t;return r.jsx(Tn.div,{...a,ref:e})});qE.displayName=YD;var JE="ToastAction",XE=x.forwardRef((t,e)=>{const{altText:n,...a}=t;return n.trim()?r.jsx(QE,{altText:n,asChild:!0,children:r.jsx(w1,{...a,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${JE}\`. Expected non-empty \`string\`.`),null)});XE.displayName=JE;var ZE="ToastClose",w1=x.forwardRef((t,e)=>{const{__scopeToast:n,...a}=t,i=WD(ZE,n);return r.jsx(QE,{asChild:!0,children:r.jsx(Tn.button,{type:"button",...a,ref:e,onClick:vn(t.onClick,i.onClose)})})});w1.displayName=ZE;var QE=x.forwardRef((t,e)=>{const{__scopeToast:n,altText:a,...i}=t;return r.jsx(Tn.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...i,ref:e})});function e3(t){const e=[];return Array.from(t.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&e.push(a.textContent),JD(a)){const i=a.ariaHidden||a.hidden||a.style.display==="none",s=a.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=a.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...e3(a))}}),e}function vp(t,e,n,{discrete:a}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),a?IE(i,s):i.dispatchEvent(s)}var cF=(t,e,n=0)=>{const a=Math.abs(t.x),i=Math.abs(t.y),s=a>i;return e==="left"||e==="right"?s&&a>n:!s&&i>n};function qD(t=()=>{}){const e=ua(t);fa(()=>{let n=0,a=0;return n=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(a)}},[e])}function JD(t){return t.nodeType===t.ELEMENT_NODE}function XD(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function cv(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var ZD=HE,t3=VE,n3=KE,r3=YE,a3=qE,i3=XE,s3=w1;function o3(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;
vendor: 5,302 bytes, line 8
8e++)t[e]&&(n=o3(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function l3(){for(var t,e,n=0,a="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=o3(t))&&(a&&(a+=" "),a+=e);return a}const uF=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,dF=l3,th=(t,e)=>n=>{var a;if(e?.variants==null)return dF(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(m=>{const f=n?.[m],p=s?.[m];if(f===null)return null;const b=uF(f)||uF(p);return i[m][b]}),c=n&&Object.entries(n).reduce((m,f)=>{let[p,b]=f;return b===void 0||(m[p]=b),m},{}),d=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((m,f)=>{let{class:p,className:b,...v}=f;return Object.entries(v).every(C=>{let[S,F]=C;return Array.isArray(F)?F.includes({...s,...c}[S]):{...s,...c}[S]===F})?[...m,p,b]:m},[]);return dF(t,o,d,n?.class,n?.className)};const QD=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c3=(...t)=>t.filter((e,n,a)=>!!e&&e.trim()!==""&&a.indexOf(e)===n).join(" ").trim();var eP={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"};const tP=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:i="",children:s,iconNode:o,...c},d)=>x.createElement("svg",{ref:d,...eP,width:e,height:e,stroke:t,strokeWidth:a?Number(n)*24/Number(e):n,className:c3("lucide",i),...c},[...o.map(([m,f])=>x.createElement(m,f)),...Array.isArray(s)?s:[s]]));const tn=(t,e)=>{const n=x.forwardRef(({className:a,...i},s)=>x.createElement(tP,{ref:s,iconNode:e,className:c3(`lucide-${QD(t)}`,a),...i}));return n.displayName=`${t}`,n};const nP=tn("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const hF=tn("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const Zg=tn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const km=tn("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const lo=tn("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);const rP=tn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const Ty=tn("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);const u3=tn("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);const aP=tn("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);const iP=tn("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);const sP=tn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const oP=tn("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);const hu=tn("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const lP=tn("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"}]]);const oi=tn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ja=tn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Qg=tn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const nh=tn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const gl=tn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const po=tn("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const d3=tn("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const us=tn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const cP=tn("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);const h3=tn("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"}]]);const uP=tn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);
8const dP=tn("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);const hP=tn("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const S1=tn("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const mF=tn("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const mP=tn("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const ex=tn("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"}]]);const fF=tn("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const Fm=tn("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const pF=tn("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);const F1=tn("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"}]]);const _i=tn("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"}]]);const Fc=tn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const fP=tn("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const pP=tn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const gF=tn("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);const gP=tn("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);const xP=tn("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const m3=tn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const vP=tn("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);const f3=tn("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);const p3=tn("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
8]]);const Bd=tn("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);const yP=tn("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const xF=tn("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const bg=tn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const wg=tn("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const fc=tn("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);const My=tn("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const g3=tn("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"}]]);const C1=tn("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);const on=tn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const vF=tn("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const rh=tn("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"}]]);const Cr=tn("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const Ry=tn("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const x3=tn("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"}]]);const Dy=tn("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"}]]);const bP=tn("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"}]]);const wP=tn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);const SP=tn("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const FP=tn("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);const CP=tn("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const ko=tn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Rr=tn("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Py=tn("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"}]]);const Eu=tn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const tx=tn("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"}]]);const _P=tn("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const EP=tn("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);const yF=tn("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
8y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Ra=tn("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"}]]);const bF=tn("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"}]]);const kP=tn("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"}]]);const Sg=tn("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);const wF=tn("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);const v3=tn("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);const gu=tn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const y3=tn("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);const ah=tn("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"}]]);const AP=tn("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);const b3=tn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const jy=tn("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);const Cm=tn("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);const bo=tn("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);const Bs=tn("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const na=tn("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const NP=tn("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const TP=tn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const gr=tn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 7,455 bytes, line 8
8],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_1="-",MP=t=>{const e=DP(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:o=>{const c=o.split(_1);return c[0]===""&&c.length!==1&&c.shift(),w3(c,e)||RP(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&a[o]?[...d,...a[o]]:d}}},w3=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],a=e.nextPart.get(n),i=a?w3(t.slice(1),a):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(_1);return e.validators.find(({validator:o})=>o(s))?.classGroupId},SF=/^\[(.+)\]$/,RP=t=>{if(SF.test(t)){const e=SF.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},DP=t=>{const{theme:e,prefix:n}=t,a={nextPart:new Map,validators:[]};return jP(Object.entries(t.classGroups),n).forEach(([s,o])=>{Ly(o,a,s,e)}),a},Ly=(t,e,n,a)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:FF(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(PP(i)){Ly(i(a),e,n,a);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Ly(o,FF(e,s),n,a)})})},FF=(t,e)=>{let n=t;return e.split(_1).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},PP=t=>t.isThemeGetter,jP=(t,e)=>e?t.map(([n,a])=>{const i=a.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,c])=>[e+o,c])):s);return[n,i]}):t,LP=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,a=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,a=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=a.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},S3="!",IP=t=>{const{separator:e,experimentalParseClassName:n}=t,a=e.length===1,i=e[0],s=e.length,o=c=>{const d=[];let m=0,f=0,p;for(let F=0;F<c.length;F++){let w=c[F];if(m===0){if(w===i&&(a||c.slice(F,F+s)===e)){d.push(c.slice(f,F)),f=F+s;continue}if(w==="/"){p=F;continue}}w==="["?m++:w==="]"&&m--}const b=d.length===0?c:c.substring(f),v=b.startsWith(S3),C=v?b.substring(1):b,S=p&&p>f?p-f:void 0;return{modifiers:d,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:S}};return n?c=>n({className:c,parseClassName:o}):o},BP=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(a=>{a[0]==="["?(e.push(...n.sort(),a),n=[]):n.push(a)}),e.push(...n.sort()),e},OP=t=>({cache:LP(t.cacheSize),parseClassName:IP(t),...MP(t)}),UP=/\s+/,zP=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(UP);let c="";for(let d=o.length-1;d>=0;d-=1){const m=o[d],{modifiers:f,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:v}=n(m);let C=!!v,S=a(C?b.substring(0,v):b);if(!S){if(!C){c=m+(c.length>0?" "+c:c);continue}if(S=a(b),!S){c=m+(c.length>0?" "+c:c);continue}C=!1}const F=BP(f).join(":"),w=p?F+S3:F,A=w+S;if(s.includes(A))continue;s.push(A);const N=i(S,C);for(let P=0;P<N.length;++P){const z=N[P];s.push(w+z)}c=m+(c.length>0?" "+c:c)}return c};function GP(){let t=0,e,n,a="";for(;t<arguments.length;)(e=arguments[t++])&&(n=F3(e))&&(a&&(a+=" "),a+=n);return a}const F3=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=F3(t[a]))&&(n&&(n+=" "),n+=e);return n};function HP(t,...e){let n,a,i,s=o;function o(d){const m=e.reduce((f,p)=>p(f),t());return n=OP(m),a=n.cache.get,i=n.cache.set,s=c,c(d)}function c(d){const m=a(d);if(m)return m;const f=zP(d,n);return i(d,f),f}return function(){return s(GP.apply(null,arguments))}}const Ar=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},C3=/^\[(?:([a-z-]+):)?(.+)\]$/i,WP=/^\d+\/\d+$/,VP=new Set(["px","full","screen"]),$P=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KP=/\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$/,YP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tl=t=>Nd(t)||VP.has(t)||WP.test(t),Ql=t=>ih(t,"length",aj),Nd=t=>!!t&&!Number.isNaN(Number(t)),uv=t=>ih(t,"number",Nd),Yh=t=>!!t&&Number.isInteger(Number(t)),XP=t=>t.endsWith("%")&&Nd(t.slice(0,-1)),Jn=t=>C3.test(t),ec=t=>$P.test(t),ZP=new Set(["length","size","percentage"]),QP=t=>ih(t,ZP,_3),ej=t=>ih(t,"position",_3),tj=new Set(["image","url"]),nj=t=>ih(t,tj,sj),rj=t=>ih(t,"",ij),qh=()=>!0,ih=(t,e,n)=>{const a=C3.exec(t);return a?a[1]?typeof e=="string"?a[1]===e:e.has(a[1]):n(a[2]):!1},aj=t=>KP.test(t)&&!YP.test(t),_3=()=>!1,ij=t=>qP.test(t),sj=t=>JP.test(t),oj=()=>{const t=Ar("colors"),e=Ar("spacing"),n=Ar("blur"),a=Ar("brightness"),i=Ar("borderColor"),s=Ar("borderRadius"),o=Ar("borderSpacing"),c=Ar("borderWidth"),d=Ar("contrast"),m=Ar("grayscale"),f=Ar("hueRotate"),p=Ar("invert"),b=Ar("gap"),v=Ar("gradientColorStops"),C=Ar("gradientColorStopPositions"),S=Ar("inset"),F=Ar("margin"),w=Ar("opacity"),A=Ar("padding"),N=Ar("saturate"),P=Ar("scale"),z=Ar("sepia"),D=Ar("skew"),T=Ar("space"),K=Ar("translate"),B=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Jn,e],I=()=>[Jn,e],j=()=>["",tl,Ql],U=()=>["auto",Nd,Jn],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",Jn],ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[Nd,Jn];return{cacheSize:500,separator:":",theme:{colors:[qh],spacing:[tl,Ql],blur:["none","",ec,Jn],brightness:Q(),borderColor:[t],borderRadius:["none","","full",ec,Jn],borderSpacing:I(),borderWidth:j(),contrast:Q(),grayscale:J(),hueRotate:Q(),invert:J(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[XP,Ql],inset:O(),margin:O(),opacity:Q(),padding:I(),saturate:Q(),scale:Q(),sepia:J(),skew:Q(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Jn]}],container:["container"],columns:[{columns:[ec]}],"break-after":[{"break-after":ie()}],"break-before":[{"break-before":ie()}],"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:[...q(),Jn]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}
vendor: 9,947 bytes, line 8
8],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Yh,Jn]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Jn]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Yh,Jn]}],"grid-cols":[{"grid-cols":[qh]}],"col-start-end":[{col:["auto",{span:["full",Yh,Jn]},Jn]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[qh]}],"row-start-end":[{row:["auto",{span:[Yh,Jn]},Jn]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Jn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Jn]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[F]}],mx:[{mx:[F]}],my:[{my:[F]}],ms:[{ms:[F]}],me:[{me:[F]}],mt:[{mt:[F]}],mr:[{mr:[F]}],mb:[{mb:[F]}],ml:[{ml:[F]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Jn,e]}],"min-w":[{"min-w":[Jn,e,"min","max","fit"]}],"max-w":[{"max-w":[Jn,e,"none","full","min","max","fit","prose",{screen:[ec]},ec]}],h:[{h:[Jn,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Jn,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Jn,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Jn,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ec,Ql]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uv]}],"font-family":[{font:[qh]}],"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",Jn]}],"line-clamp":[{"line-clamp":["none",Nd,uv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tl,Jn]}],"list-image":[{"list-image":["none",Jn]}],"list-style-type":[{list:["none","disc","decimal",Jn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tl,Ql]}],"underline-offset":[{"underline-offset":["auto",tl,Jn]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Jn]}],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",Jn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),ej]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",QP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nj]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],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:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[tl,Jn]}],"outline-w":[{outline:[tl,Ql]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[tl,Ql]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ec,rj]}],"shadow-color":[{shadow:[qh]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[a]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ec,Jn]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Jn]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",Jn]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",Jn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Yh,Jn]}],"translate-x":[{"translate-x":[K]}],"translate-y":[{"translate-y":[K]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Jn]}],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",Jn]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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"]}
8],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",Jn]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[tl,Ql,uv]}],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"]}}},lj=HP(oj);function ln(...t){return lj(l3(t))}const cj=ZD,E3=x.forwardRef(({className:t,...e},n)=>r.jsx(t3,{ref:n,className:ln("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-[525px]",t),...e}));E3.displayName=t3.displayName;const uj=th("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"}}),k3=x.forwardRef(({className:t,variant:e,...n},a)=>r.jsx(n3,{ref:a,className:ln(uj({variant:e}),t),...n}));k3.displayName=n3.displayName;const dj=x.forwardRef(({className:t,...e},n)=>r.jsx(i3,{ref:n,className:ln("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}));dj.displayName=i3.displayName;const A3=x.forwardRef(({className:t,...e},n)=>r.jsx(s3,{ref:n,className:ln("absolute right-2 top-2 rounded-md p-1 text-foreground
8/50 opacity-70 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:r.jsx(gr,{className:"h-4 w-4"})}));A3.displayName=s3.displayName;const N3=x.forwardRef(({className:t,...e},n)=>r.jsx(r3,{ref:n,className:ln("text-sm font-semibold",t),...e}));N3.displayName=r3.displayName;const T3=x.forwardRef(({className:t,...e},n)=>r.jsx(a3,{ref:n,className:ln("text-sm opacity-90",t),...e}));T3.displayName=a3.displayName;function hj(){const{toasts:t}=nr();return r.jsxs(cj,{children:[t.map(function({id:e,title:n,description:a,action:i,...s}){return r.jsxs(k3,{...s,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(N3,{children:n}),a&&r.jsx(T3,{children:a})]}),i,r.jsx(A3,{})]},e)}),r.jsx(E3,{})]})}var CF=["light","dark"],mj="(prefers-color-scheme: dark)",fj=x.createContext(void 0),pj={setTheme:t=>{},themes:[]},gj=()=>{var t;return(t=x.useContext(fj))!=null?t:pj};x.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:a,enableColorScheme:i,defaultTheme:s,value:o,attrs:c,nonce:d})=>{let m=s==="system",f=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(C=>`'${C}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=i?CF.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",b=(C,S=!1,F=!0)=>{let w=o?o[C]:C,A=S?C+"|| ''":`'${w}'`,N="";return i&&F&&!S&&CF.includes(C)&&(N+=`d.style.colorScheme = '${C}';`),n==="class"?S||w?N+=`c.add(${A})`:N+="null":w&&(N+=`d[s](n,${A})`),N},v=t?`!function(){${f}${b(t)}}()`:a?`!function(){try{${f}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${m})){var t='${mj}',m=window.matchMedia(t);if(m.media!==t||m.matches){${b("dark")}}else{${b("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${b(o?"x[e]":"e",!0)}}${m?"":"else{"+b(s,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${b(o?"x[e]":"e",!0)}}else{${b(s,!1,!1)};}${p}}catch(t){}}();`;return x.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:v}})});var xj=t=>{switch(t){case"success":return bj;case"info":return Sj;case"warning":return wj;case"error":return Fj;default:return null}},vj=Array(12).fill(0),yj=({visible:t,className:e})=>Jt.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Jt.createElement("div",{className:"sonner-spinner"},vj.map((n,a)=>Jt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),bj=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.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"})),wj=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Jt.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"})),Sj=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.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"})),Fj=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.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"})),Cj=Jt.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"},Jt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Jt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),_j=()=>{let[t,e]=Jt.useState(document.hidden);return Jt.useEffect(()=>{let n=()=>{e(document.hidden)};
8return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Iy=1,Ej=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...a}=t,i=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Iy++,s=this.toasts.find(c=>c.id===i),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:n}),{...c,...t,id:i,dismissible:o,title:n}):c):this.addToast({title:n,...a,dismissible:o,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let a=t instanceof Promise?t:t(),i=n!==void 0,s,o=a.then(async d=>{if(s=["resolve",d],Jt.isValidElement(d))i=!1,this.create({id:n,type:"default",message:d});else if(Aj(d)&&!d.ok){i=!1;let m=typeof e.error=="function"?await e.error(`HTTP error! status: ${d.status}`):e.error,f=typeof e.description=="function"?await e.description(`HTTP error! status: ${d.status}`):e.description;this.create({id:n,type:"error",message:m,description:f})}else if(e.success!==void 0){i=!1;let m=typeof e.success=="function"?await e.success(d):e.success,f=typeof e.description=="function"?await e.description(d):e.description;this.create({id:n,type:"success",message:m,description:f})}}).catch(async d=>{if(s=["reject",d],e.error!==void 0){i=!1;let m=typeof e.error=="function"?await e.error(d):e.error,f=typeof e.description=="function"?await e.description(d):e.description;this.create({id:n,type:"error",message:m,description:f})}}).finally(()=>{var d;i&&(this.dismiss(n),n=void 0),(d=e.finally)==null||d.call(e)}),c=()=>new Promise((d,m)=>o.then(()=>s[0]==="reject"?m(s[1]):d(s[1])).catch(m));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,e)=>{let n=e?.id||Iy++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Si=new Ej,kj=(t,e)=>{let n=e?.id||Iy++;return Si.addToast({title:t,...e,id:n}),n},Aj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Nj=kj,Tj=()=>Si.toasts,Mj=()=>Si.getActiveToasts();Object.assign(Nj,{success:Si.success,info:Si.info,warning:Si.warning,error:Si.error,custom:Si.custom,message:Si.message,promise:Si.promise,dismiss:Si.dismiss,loading:Si.loading},{getHistory:Tj,getToasts:Mj});function Rj(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",e==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}Rj(`: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;
8left: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}
8: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%);
8--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%)}
9`);function yp(t){return t.label!==void 0}var Dj=3,Pj="32px",jj="16px",_F=4e3,Lj=356,Ij=14,Bj=20,Oj=200;function Es(...t){return t.filter(Boolean).join(" ")}function Uj(t){let[e,n]=t.split("-"),a=[];return e&&a.push(e),n&&a.push(n),a}var zj=t=>{var e,n,a,i,s,o,c,d,m,f,p;let{invert:b,toast:v,unstyled:C,interacting:S,setHeights:F,visibleToasts:w,heights:A,index:N,toasts:P,expanded:z,removeToast:D,defaultRichColors:T,closeButton:K,style:B,cancelButtonStyle:k,actionButtonStyle:O,className:I="",descriptionClassName:j="",duration:U,position:q,gap:Y,loadingIcon:W,expandByDefault:H,classNames:J,icons:ie,closeButtonAriaLabel:Q="Close toast",pauseWhenPageIsHidden:ve}=t,[pe,Me]=Jt.useState(null),[We,Ae]=Jt.useState(null),[Ce,He]=Jt.useState(!1),[Ct,bt]=Jt.useState(!1),[Rt,zt]=Jt.useState(!1),[Ut,Bt]=Jt.useState(!1),[re,wt]=Jt.useState(!1),[Nt,vt]=Jt.useState(0),[Tt,Wt]=Jt.useState(0),Dt=Jt.useRef(v.duration||U||_F),jt=Jt.useRef(null),he=Jt.useRef(null),ee=N===0,ze=N+1<=w,Ve=v.type,lt=v.dismissible!==!1,qe=v.className||"",It=v.descriptionClassName||"",gt=Jt.useMemo(()=>A.findIndex(Be=>Be.toastId===v.id)||0,[A,v.id]),Ee=Jt.useMemo(()=>{var Be;return(Be=v.closeButton)!=null?Be:K},[v.closeButton,K]),Je=Jt.useMemo(()=>v.duration||U||_F,[v.duration,U]),$e=Jt.useRef(0),Xe=Jt.useRef(0),X=Jt.useRef(0),ke=Jt.useRef(null),[De,oe]=q.split("-"),te=Jt.useMemo(()=>A.reduce((Be,Ze,ue)=>ue>=gt?Be:Be+Ze.height,0),[A,gt]),ye=_j(),Re=v.invert||b,Le=Ve==="loading";Xe.current=Jt.useMemo(()=>gt*Y+te,[gt,te]),Jt.useEffect(()=>{Dt.current=Je},[Je]),Jt.useEffect(()=>{He(!0)},[]),Jt.useEffect(()=>{let Be=he.current;if(Be){let Ze=Be.getBoundingClientRect().height;return Wt(Ze),F(ue=>[{toastId:v.id,height:Ze,position:v.position},...ue]),()=>F(ue=>ue.filter(rt=>rt.toastId!==v.id))}},[F,v.id]),Jt.useLayoutEffect(()=>{if(!Ce)return;let Be=he.current,Ze=Be.style.height;Be.style.height="auto";let ue=Be.getBoundingClientRect().height;Be.style.height=Ze,Wt(ue),F(rt=>rt.find(je=>je.toastId===v.id)?rt.map(je=>je.toastId===v.id?{...je,height:ue}:je):[{toastId:v.id,height:ue,position:v.position},...rt])},[Ce,v.title,v.description,F,v.id]);let fe=Jt.useCallback(()=>{bt(!0),vt(Xe.current),F(Be=>Be.filter(Ze=>Ze.toastId!==v.id)),setTimeout(()=>{D(v)},Oj)},[v,D,F,Xe]);Jt.useEffect(()=>{if(v.promise&&Ve==="loading"||v.duration===1/0||v.type==="loading")return;let Be;return z||S||ve&&ye?(()=>{if(X.current<$e.current){let Ze=new Date().getTime()-$e.current;Dt.current=Dt.current-Ze}
9X.current=new Date().getTime()})():Dt.current!==1/0&&($e.current=new Date().getTime(),Be=setTimeout(()=>{var Ze;(Ze=v.onAutoClose)==null||Ze.call(v,v),fe()},Dt.current)),()=>clearTimeout(Be)},[z,S,v,Ve,ve,ye,fe]),Jt.useEffect(()=>{v.delete&&fe()},[fe,v.delete]);function Se(){var Be,Ze,ue;return ie!=null&&ie.loading?Jt.createElement("div",{className:Es(J?.loader,(Be=v?.classNames)==null?void 0:Be.loader,"sonner-loader"),"data-visible":Ve==="loading"},ie.loading):W?Jt.createElement("div",{className:Es(J?.loader,(Ze=v?.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Ve==="loading"},W):Jt.createElement(yj,{className:Es(J?.loader,(ue=v?.classNames)==null?void 0:ue.loader),visible:Ve==="loading"})}return Jt.createElement("li",{tabIndex:0,ref:he,className:Es(I,qe,J?.toast,(e=v?.classNames)==null?void 0:e.toast,J?.default,J?.[Ve],(n=v?.classNames)==null?void 0:n[Ve]),"data-sonner-toast":"","data-rich-colors":(a=v.richColors)!=null?a:T,"data-styled":!(v.jsx||v.unstyled||C),"data-mounted":Ce,"data-promise":!!v.promise,"data-swiped":re,"data-removed":Ct,"data-visible":ze,"data-y-position":De,"data-x-position":oe,"data-index":N,"data-front":ee,"data-swiping":Rt,"data-dismissible":lt,"data-type":Ve,"data-invert":Re,"data-swipe-out":Ut,"data-swipe-direction":We,"data-expanded":!!(z||H&&Ce),style:{"--index":N,"--toasts-before":N,"--z-index":P.length-N,"--offset":`${Ct?Nt:Xe.current}px`,"--initial-height":H?"auto":`${Tt}px`,...B,...v.style},onDragEnd:()=>{zt(!1),Me(null),ke.current=null},onPointerDown:Be=>{Le||!lt||(jt.current=new Date,vt(Xe.current),Be.target.setPointerCapture(Be.pointerId),Be.target.tagName!=="BUTTON"&&(zt(!0),ke.current={x:Be.clientX,y:Be.clientY}))},onPointerUp:()=>{var Be,Ze,ue,rt;if(Ut||!lt)return;ke.current=null;let je=Number(((Be=he.current)==null?void 0:Be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_t=Number(((Ze=he.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kt=new Date().getTime()-((ue=jt.current)==null?void 0:ue.getTime()),gn=pe==="x"?je:_t,_e=Math.abs(gn)/Kt;if(Math.abs(gn)>=Bj||_e>.11){vt(Xe.current),(rt=v.onDismiss)==null||rt.call(v,v),Ae(pe==="x"?je>0?"right":"left":_t>0?"down":"up"),fe(),Bt(!0),wt(!1);return}zt(!1),Me(null)},onPointerMove:Be=>{var Ze,ue,rt,je;if(!ke.current||!lt||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;let _t=Be.clientY-ke.current.y,Kt=Be.clientX-ke.current.x,gn=(ue=t.swipeDirections)!=null?ue:Uj(q);!pe&&(Math.abs(Kt)>1||Math.abs(_t)>1)&&Me(Math.abs(Kt)>Math.abs(_t)?"x":"y");let _e={x:0,y:0};pe==="y"?(gn.includes("top")||gn.includes("bottom"))&&(gn.includes("top")&&_t<0||gn.includes("bottom")&&_t>0)&&(_e.y=_t):pe==="x"&&(gn.includes("left")||gn.includes("right"))&&(gn.includes("left")&&Kt<0||gn.includes("right")&&Kt>0)&&(_e.x=Kt),(Math.abs(_e.x)>0||Math.abs(_e.y)>0)&&wt(!0),(rt=he.current)==null||rt.style.setProperty("--swipe-amount-x",`${_e.x}px`),(je=he.current)==null||je.style.setProperty("--swipe-amount-y",`${_e.y}px`)}},Ee&&!v.jsx?Jt.createElement("button",{"aria-label":Q,"data-disabled":Le,"data-close-button":!0,onClick:Le||!lt?()=>{}:()=>{var Be;fe(),(Be=v.onDismiss)==null||Be.call(v,v)},className:Es(J?.closeButton,(i=v?.classNames)==null?void 0:i.closeButton)},(s=ie?.close)!=null?s:Cj):null,v.jsx||x.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Jt.createElement(Jt.Fragment,null,Ve||v.icon||v.promise?Jt.createElement("div",{"data-icon":"",className:Es(J?.icon,(o=v?.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Se():null,v.type!=="loading"?v.icon||ie?.[Ve]||xj(Ve):null):null,Jt.createElement("div",{"data-content":"",className:Es(J?.content,(c=v?.classNames)==null?void 0:c.content)},Jt.createElement("div",{"data-title":"",className:Es(J?.title,(d=v?.classNames)==null?void 0:d.title)},typeof v.title=="function"?v.title():v.title),v.description?Jt.createElement("div",{"data-description":"",className:Es(j,It,J?.description,(m=v?.classNames)==null?void 0:m.description)},typeof v.description=="function"?v.description():v.description):null),x.isValidElement(v.cancel)?v.cancel:v.cancel&&yp(v.cancel)?Jt.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||k,onClick:Be=>{var Ze,ue;yp(v.cancel)&&lt&&((ue=(Ze=v.cancel).onClick)==null||ue.call(Ze,Be),fe())},className:Es(J?.cancelButton,(f=v?.classNames)==null?void 0:f.cancelButton)},v.cancel.label):null,x.isValidElement(v.action)?v.action:v.action&&yp(v.action)?Jt.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||O,onClick:Be=>{var Ze,ue;yp(v.action)&&((ue=(Ze=v.action).onClick)==null||ue.call(Ze,Be),!Be.defaultPrevented&&fe())},className:Es(J?.actionButton,(p=v?.classNames)==null?void 0:p.actionButton)},v.action.label):null))};function EF(){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 Gj(t,e){let n={};return[t,e].forEach((a,i)=>{let s=i===1,o=s?"--mobile-offset":"--offset",c=s?jj:Pj;function d(m){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof m=="number"?`${m}px`:m})}
9typeof a=="number"||typeof a=="string"?d(a):typeof a=="object"?["top","right","bottom","left"].forEach(m=>{a[m]===void 0?n[`${o}-${m}`]=c:n[`${o}-${m}`]=typeof a[m]=="number"?`${a[m]}px`:a[m]}):d(c)}),n}var Hj=x.forwardRef(function(t,e){let{invert:n,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:o,className:c,offset:d,mobileOffset:m,theme:f="light",richColors:p,duration:b,style:v,visibleToasts:C=Dj,toastOptions:S,dir:F=EF(),gap:w=Ij,loadingIcon:A,icons:N,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:z}=t,[D,T]=Jt.useState([]),K=Jt.useMemo(()=>Array.from(new Set([a].concat(D.filter(ve=>ve.position).map(ve=>ve.position)))),[D,a]),[B,k]=Jt.useState([]),[O,I]=Jt.useState(!1),[j,U]=Jt.useState(!1),[q,Y]=Jt.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Jt.useRef(null),H=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=Jt.useRef(null),ie=Jt.useRef(!1),Q=Jt.useCallback(ve=>{T(pe=>{var Me;return(Me=pe.find(We=>We.id===ve.id))!=null&&Me.delete||Si.dismiss(ve.id),pe.filter(({id:We})=>We!==ve.id)})},[]);return Jt.useEffect(()=>Si.subscribe(ve=>{if(ve.dismiss){T(pe=>pe.map(Me=>Me.id===ve.id?{...Me,delete:!0}:Me));return}setTimeout(()=>{DE.flushSync(()=>{T(pe=>{let Me=pe.findIndex(We=>We.id===ve.id);return Me!==-1?[...pe.slice(0,Me),{...pe[Me],...ve},...pe.slice(Me+1)]:[ve,...pe]})})})}),[]),Jt.useEffect(()=>{if(f!=="system"){Y(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let ve=window.matchMedia("(prefers-color-scheme: dark)");try{ve.addEventListener("change",({matches:pe})=>{Y(pe?"dark":"light")})}catch{ve.addListener(({matches:Me})=>{try{Y(Me?"dark":"light")}catch(We){console.error(We)}})}},[f]),Jt.useEffect(()=>{D.length<=1&&I(!1)},[D]),Jt.useEffect(()=>{let ve=pe=>{var Me,We;i.every(Ae=>pe[Ae]||pe.code===Ae)&&(I(!0),(Me=W.current)==null||Me.focus()),pe.code==="Escape"&&(document.activeElement===W.current||(We=W.current)!=null&&We.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",ve),()=>document.removeEventListener("keydown",ve)},[i]),Jt.useEffect(()=>{if(W.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,ie.current=!1)}},[W.current]),Jt.createElement("section",{ref:e,"aria-label":`${P} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},K.map((ve,pe)=>{var Me;let[We,Ae]=ve.split("-");return D.length?Jt.createElement("ol",{key:ve,dir:F==="auto"?EF():F,tabIndex:-1,ref:W,className:c,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":We,"data-lifted":O&&D.length>1&&!s,"data-x-position":Ae,style:{"--front-toast-height":`${((Me=B[0])==null?void 0:Me.height)||0}px`,"--width":`${Lj}px`,"--gap":`${w}px`,...v,...Gj(d,m)},onBlur:Ce=>{ie.current&&!Ce.currentTarget.contains(Ce.relatedTarget)&&(ie.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:Ce=>{Ce.target instanceof HTMLElement&&Ce.target.dataset.dismissible==="false"||ie.current||(ie.current=!0,J.current=Ce.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{j||I(!1)},onDragEnd:()=>I(!1),onPointerDown:Ce=>{Ce.target instanceof HTMLElement&&Ce.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},D.filter(Ce=>!Ce.position&&pe===0||Ce.position===ve).map((Ce,He)=>{var Ct,bt;return Jt.createElement(zj,{key:Ce.id,icons:N,index:He,toast:Ce,defaultRichColors:p,duration:(Ct=S?.duration)!=null?Ct:b,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:n,visibleToasts:C,closeButton:(bt=S?.closeButton)!=null?bt:o,interacting:j,position:ve,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,removeToast:Q,toasts:D.filter(Rt=>Rt.position==Ce.position),heights:B.filter(Rt=>Rt.position==Ce.position),setHeights:k,expandByDefault:s,gap:w,loadingIcon:A,expanded:O,pauseWhenPageIsHidden:z,swipeDirections:t.swipeDirections})})):null}))});const Wj=({...t})=>{const{theme:e="system"}=gj();return r.jsx(Hj,{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 Vj=v1[" useId ".trim().toString()]||(()=>{}),$j=0;function wo(t){const[e,n]=x.useState(Vj());return fa(()=>{n(a=>a??String($j++))},[t]),e?`radix-${e}
9`:""}const Kj=["top","right","bottom","left"],Cc=Math.min,Ui=Math.max,Fg=Math.round,bp=Math.floor,So=t=>({x:t,y:t}),Yj={left:"right",right:"left",bottom:"top",top:"bottom"},qj={start:"end",end:"start"};function By(t,e,n){return Ui(t,Cc(e,n))}function bl(t,e){return typeof t=="function"?t(e):t}function wl(t){return t.split("-")[0]}function sh(t){return t.split("-")[1]}function E1(t){return t==="x"?"y":"x"}function k1(t){return t==="y"?"height":"width"}const Jj=new Set(["top","bottom"]);function go(t){return Jj.has(wl(t))?"y":"x"}function A1(t){return E1(go(t))}function Xj(t,e,n){n===void 0&&(n=!1);const a=sh(t),i=A1(t),s=k1(i);let o=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Cg(o)),[o,Cg(o)]}function Zj(t){const e=Cg(t);return[Oy(t),e,Oy(e)]}function Oy(t){return t.replace(/start|end/g,e=>qj[e])}const kF=["left","right"],AF=["right","left"],Qj=["top","bottom"],eL=["bottom","top"];function tL(t,e,n){switch(t){case"top":case"bottom":return n?e?AF:kF:e?kF:AF;case"left":case"right":return e?Qj:eL;default:return[]}}function nL(t,e,n,a){const i=sh(t);let s=tL(wl(t),n==="start",a);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Oy)))),s}function Cg(t){return t.replace(/left|right|bottom|top/g,e=>Yj[e])}function rL(t){return{top:0,right:0,bottom:0,left:0,...t}}function M3(t){return typeof t!="number"?rL(t):{top:t,right:t,bottom:t,left:t}}function _g(t){const{x:e,y:n,width:a,height:i}=t;return{width:a,height:i,top:n,left:e,right:e+a,bottom:n+i,x:e,y:n}}function NF(t,e,n){let{reference:a,floating:i}=t;const s=go(e),o=A1(e),c=k1(o),d=wl(e),m=s==="y",f=a.x+a.width/2-i.width/2,p=a.y+a.height/2-i.height/2,b=a[c]/2-i[c]/2;let v;switch(d){case"top":v={x:f,y:a.y-i.height};break;case"bottom":v={x:f,y:a.y+a.height};break;case"right":v={x:a.x+a.width,y:p};break;case"left":v={x:a.x-i.width,y:p};break;default:v={x:a.x,y:a.y}}switch(sh(e)){case"start":v[o]-=b*(n&&m?-1:1);break;case"end":v[o]+=b*(n&&m?-1:1);break}return v}const aL=async(t,e,n)=>{const{placement:a="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,c=s.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(e));let m=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=NF(m,a,d),b=a,v={},C=0;for(let S=0;S<c.length;S++){const{name:F,fn:w}=c[S],{x:A,y:N,data:P,reset:z}=await w({x:f,y:p,initialPlacement:a,placement:b,strategy:i,middlewareData:v,rects:m,platform:o,elements:{reference:t,floating:e}});f=A??f,p=N??p,v={...v,[F]:{...v[F],...P}},z&&C<=50&&(C++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(m=z.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):z.rects),{x:f,y:p}=NF(m,b,d)),S=-1)}return{x:f,y:p,placement:b,strategy:i,middlewareData:v}};async function Am(t,e){var n;e===void 0&&(e={});const{x:a,y:i,platform:s,rects:o,elements:c,strategy:d}=t,{boundary:m="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:b=!1,padding:v=0}=bl(e,t),C=M3(v),F=c[b?p==="floating"?"reference":"floating":p],w=_g(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(F)))==null||n?F:F.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:m,rootBoundary:f,strategy:d})),A=p==="floating"?{x:a,y:i,width:o.floating.width,height:o.floating.height}:o.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),P=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},z=_g(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:N,strategy:d}):A);return{top:(w.top-z.top+C.top)/P.y,bottom:(z.bottom-w.bottom+C.bottom)/P.y,left:(w.left-z.left+C.left)/P.x,right:(z.right-w.right+C.right)/P.x}}const iL=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:a,placement:i,rects:s,platform:o,elements:c,middlewareData:d}=e,{element:m,padding:f=0}=bl(t,e)||{};if(m==null)return{};const p=M3(f),b={x:n,y:a},v=A1(i),C=k1(v),S=await o.getDimensions(m),F=v==="y",w=F?"top":"left",A=F?"bottom":"right",N=F?"clientHeight":"clientWidth",P=s.reference[C]+s.reference[v]-b[v]-s.floating[C],z=b[v]-s.reference[v],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(m));let T=D?D[N]:0;(!T||!await(o.isElement==null?void 0:o.isElement(D)))&&(T=c.floating[N]||s.floating[C]);const K=P/2-z/2,B=T/2-S[C]/2-1,k=Cc(p[w],B),O=Cc(p[A],B),I=k,j=T-S[C]-O,U=T/2-S[C]/2+K,q=By(I,U,j),Y=!d.arrow&&sh(i)!=null&&U!==q&&s.reference[C]/2-(U<I?k:O)-S[C]/2<0,W=Y?U<I?U-I:U-j:0;return{[v]:b[v]+W,data:{[v]:q,centerOffset:U-q-W,...Y&&{alignmentOffset:W}},reset:Y}}}),sL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,a;const{placement:i,middlewareData:s,rects:o,initialPlacement:c,platform:d,elements:m}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...F}=bl(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=wl(i),A=go(c),N=wl(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(m.floating)),z=b||(N||!S?[Cg(c)]:Zj(c)),D=C!=="none";!b&&D&&z.push(...nL(c,S,C,P));const T=[c,...z],K=await Am(e,F),B=[];let k=((a=s.flip)==null?void 0:a.overflows)||[];if(f&&B.push(K[w]),p){const U=Xj(i,o,P);B.push(K[U[0]],K[U[1]])}if(k=[...k,{placement:i,overflows:B}],!B.every(U=>U<=0)){var O,I;const U=(((O=s.flip)==null?void 0:O.index)||0)+1,q=T[U];if(q&&(!(p==="alignment"?A!==go(q):!1)||k.every(H=>go(H.placement)===A?H.overflows[0]>0:!0)))return{data:{index:U,overflows:k},reset:{placement:q}};let Y=(I=k.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:I.placement;if(!Y)switch(v){case"bestFit":{var j;const W=(j=k.filter(H=>{if(D){const J=go(H.placement);return J===A||J==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(J=>J>0).reduce((J,ie)=>J+ie,0)]).sort((H,J)=>H[1]-J[1])[0])==null?void 0:j[0];W&&(Y=W);break}case"initialPlacement":Y=c;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function TF(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function MF(t){return Kj.some(e=>t[e]>=0)}const oL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:a="referenceHidden",...i}=bl(t,e);switch(a){case"referenceHidden":{const s=await Am(e,{...i,elementContext:"reference"}),o=TF(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:MF(o)}}}case"escaped":{const s=await Am(e,{...i,altBoundary:!0}),o=TF(s,n.floating);return{data:{escapedOffsets:o,escaped:MF(o)}}}default:return{}}}}},R3=new Set(["left","top"]);async function lL(t,e){const{placement:n,platform:a,elements:i}=t,s=await(a.isRTL==null?void 0:a.isRTL(i.floating)),o=wl(n),c=sh(n),d=go(n)==="y",m=R3.has(o)?-1:1,f=s&&d?-1:1,p=bl(e,t);let{mainAxis:b,crossAxis:v,alignmentAxis:C}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}
vendor: 9,500 bytes, line 9
9:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof C=="number"&&(v=c==="end"?C*-1:C),d?{x:v*f,y:b*m}:{x:b*m,y:v*f}}const cL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,a;const{x:i,y:s,placement:o,middlewareData:c}=e,d=await lL(e,t);return o===((n=c.offset)==null?void 0:n.placement)&&(a=c.arrow)!=null&&a.alignmentOffset?{}:{x:i+d.x,y:s+d.y,data:{...d,placement:o}}}}},uL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:a,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:c={fn:F=>{let{x:w,y:A}=F;return{x:w,y:A}}},...d}=bl(t,e),m={x:n,y:a},f=await Am(e,d),p=go(wl(i)),b=E1(p);let v=m[b],C=m[p];if(s){const F=b==="y"?"top":"left",w=b==="y"?"bottom":"right",A=v+f[F],N=v-f[w];v=By(A,v,N)}if(o){const F=p==="y"?"top":"left",w=p==="y"?"bottom":"right",A=C+f[F],N=C-f[w];C=By(A,C,N)}const S=c.fn({...e,[b]:v,[p]:C});return{...S,data:{x:S.x-n,y:S.y-a,enabled:{[b]:s,[p]:o}}}}}},dL=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:a,placement:i,rects:s,middlewareData:o}=e,{offset:c=0,mainAxis:d=!0,crossAxis:m=!0}=bl(t,e),f={x:n,y:a},p=go(i),b=E1(p);let v=f[b],C=f[p];const S=bl(c,e),F=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const N=b==="y"?"height":"width",P=s.reference[b]-s.floating[N]+F.mainAxis,z=s.reference[b]+s.reference[N]-F.mainAxis;v<P?v=P:v>z&&(v=z)}if(m){var w,A;const N=b==="y"?"width":"height",P=R3.has(wl(i)),z=s.reference[p]-s.floating[N]+(P&&((w=o.offset)==null?void 0:w[p])||0)+(P?0:F.crossAxis),D=s.reference[p]+s.reference[N]+(P?0:((A=o.offset)==null?void 0:A[p])||0)-(P?F.crossAxis:0);C<z?C=z:C>D&&(C=D)}return{[b]:v,[p]:C}}}},hL=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,a;const{placement:i,rects:s,platform:o,elements:c}=e,{apply:d=()=>{},...m}=bl(t,e),f=await Am(e,m),p=wl(i),b=sh(i),v=go(i)==="y",{width:C,height:S}=s.floating;let F,w;p==="top"||p==="bottom"?(F=p,w=b===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(w=p,F=b==="end"?"top":"bottom");const A=S-f.top-f.bottom,N=C-f.left-f.right,P=Cc(S-f[F],A),z=Cc(C-f[w],N),D=!e.middlewareData.shift;let T=P,K=z;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(K=N),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(T=A),D&&!b){const k=Ui(f.left,0),O=Ui(f.right,0),I=Ui(f.top,0),j=Ui(f.bottom,0);v?K=C-2*(k!==0||O!==0?k+O:Ui(f.left,f.right)):T=S-2*(I!==0||j!==0?I+j:Ui(f.top,f.bottom))}await d({...e,availableWidth:K,availableHeight:T});const B=await o.getDimensions(c.floating);return C!==B.width||S!==B.height?{reset:{rects:!0}}:{}}}};function nx(){return typeof window<"u"}function oh(t){return D3(t)?(t.nodeName||"").toLowerCase():"#document"}function Hi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ro(t){var e;return(e=(D3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function D3(t){return nx()?t instanceof Node||t instanceof Hi(t).Node:!1}function Vs(t){return nx()?t instanceof Element||t instanceof Hi(t).Element:!1}function Ao(t){return nx()?t instanceof HTMLElement||t instanceof Hi(t).HTMLElement:!1}function RF(t){return!nx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Hi(t).ShadowRoot}const mL=new Set(["inline","contents"]);function Ym(t){const{overflow:e,overflowX:n,overflowY:a,display:i}=$s(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&!mL.has(i)}const fL=new Set(["table","td","th"]);function pL(t){return fL.has(oh(t))}const gL=[":popover-open",":modal"];function rx(t){return gL.some(e=>{try{return t.matches(e)}catch{return!1}})}const xL=["transform","translate","scale","rotate","perspective"],vL=["transform","translate","scale","rotate","perspective","filter"],yL=["paint","layout","strict","content"];function N1(t){const e=T1(),n=Vs(t)?$s(t):t;return xL.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||vL.some(a=>(n.willChange||"").includes(a))||yL.some(a=>(n.contain||"").includes(a))}function bL(t){let e=_c(t);for(;Ao(e)&&!Od(e);){if(N1(e))return e;if(rx(e))return null;e=_c(e)}return null}function T1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wL=new Set(["html","body","#document"]);function Od(t){return wL.has(oh(t))}function $s(t){return Hi(t).getComputedStyle(t)}function ax(t){return Vs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function _c(t){if(oh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||RF(t)&&t.host||Ro(t);return RF(e)?e.host:e}function P3(t){const e=_c(t);return Od(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ao(e)&&Ym(e)?e:P3(e)}function Nm(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=P3(t),s=i===((a=t.ownerDocument)==null?void 0:a.body),o=Hi(i);if(s){const c=Uy(o);return e.concat(o,o.visualViewport||[],Ym(i)?i:[],c&&n?Nm(c):[])}return e.concat(i,Nm(i,[],n))}function Uy(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function j3(t){const e=$s(t);let n=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const i=Ao(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:a,c=Fg(n)!==s||Fg(a)!==o;return c&&(n=s,a=o),{width:n,height:a,$:c}}function M1(t){return Vs(t)?t:t.contextElement}function Td(t){const e=M1(t);if(!Ao(e))return So(1);const n=e.getBoundingClientRect(),{width:a,height:i,$:s}=j3(e);let o=(s?Fg(n.width):n.width)/a,c=(s?Fg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const SL=So(0);function L3(t){const e=Hi(t);return!T1()||!e.visualViewport?SL:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FL(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Hi(t)?!1:e}function xu(t,e,n,a){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=M1(t);let o=So(1);e&&(a?Vs(a)&&(o=Td(a)):o=Td(t));const c=FL(s,n,a)?L3(s):So(0);let d=(i.left+c.x)/o.x,m=(i.top+c.y)/o.y,f=i.width/o.x,p=i.height/o.y;if(s){const b=Hi(s),v=a&&Vs(a)?Hi(a):a;let C=b,S=Uy(C);for(;S&&a&&v!==C;){const F=Td(S),w=S.getBoundingClientRect(),A=$s(S),N=w.left+(S.clientLeft+parseFloat(A.paddingLeft))*F.x,P=w.top+(S.clientTop+parseFloat(A.paddingTop))*F.y;d*=F.x,m*=F.y,f*=F.x,p*=F.y,d+=N,m+=P,C=Hi(S),S=Uy(C)}}return _g({width:f,height:p,x:d,y:m})}function ix(t,e){const n=ax(t).scrollLeft;return e?e.left+n:xu(Ro(t)).left+n}function I3(t,e){const n=t.getBoundingClientRect(),a=n.left+e.scrollLeft-ix(t,n),i=n.top+e.scrollTop;return{x:a,y:i}}function CL(t){let{elements:e,rect:n,offsetParent:a,strategy:i}=t;const s=i==="fixed",o=Ro(a),c=e?rx(e.floating):!1;if(a===o||c&&s)return n;let d={scrollLeft:0,scrollTop:0},m=So(1);const f=So(0),p=Ao(a);if((p||!p&&!s)&&((oh(a)!=="body"||Ym(o))&&(d=ax(a)),Ao(a))){const v=xu(a);m=Td(a),f.x=v.x+a.clientLeft,f.y=v.y+a.clientTop}const b=o&&!p&&!s?I3(o,d):So(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-d.scrollLeft*m.x+f.x+b.x,y:n.y*m.y-d.scrollTop*m.y+f.y+b.y}}function _L(t){return Array.from(t.getClientRects())}function EL(t){const e=Ro(t),n=ax(t),a=t.ownerDocument.body,i=Ui(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=Ui(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let o=-n.scrollLeft+ix(t);const c=-n.scrollTop;return $s(a).direction==="rtl"&&(o+=Ui(e.clientWidth,a.clientWidth)-i),{width:i,height:s,x:o,y:c}}const DF=25;function kL(t,e){const n=Hi(t),a=Ro(t),i=n.visualViewport;let s=a.clientWidth,o=a.clientHeight,c=0,d=0;if(i){s=i.width,o=i.height;const f=T1();(!f||f&&e==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const m=ix(a);if(m<=0){const f=a.ownerDocument,p=f.body,b=getComputedStyle(p),v=f.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,C=Math.abs(a.clientWidth-p.clientWidth-v);C<=DF&&(s-=C)}else m<=DF&&(s+=m);return{width:s,height:o,x:c,y:d}}const AL=new Set(["absolute","fixed"]);function NL(t,e){const n=xu(t,!0,e==="fixed"),a=n.top+t.clientTop,i=n.left+t.clientLeft,s=Ao(t)?Td(t):So(1),o=t.clientWidth*s.x,c=t.clientHeight*s.y,d=i*s.x,m=a*s.y;return{width:o,height:c,x:d,y:m}}function PF(t,e,n){let a;if(e==="viewport")a=kL(t,n);else if(e==="document")a=EL(Ro(t));else if(Vs(e))a=NL(e,n);else{const i=L3(t);a={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _g(a)}function B3(t,e){const n=_c(t);return n===e||!Vs(n)||Od(n)?!1:$s(n).position==="fixed"||B3(n,e)}function TL(t,e){const n=e.get(t);if(n)return n;let a=Nm(t,[],!1).filter(c=>Vs(c)&&oh(c)!=="body"),i=null;const s=$s(t).position==="fixed";let o=s?_c(t):t;for(;Vs(o)&&!Od(o);){const c=$s(o),d=N1(o);!d&&c.position==="fixed"&&(i=null),(s?!d&&!i:!d&&c.position==="static"&&!!i&&AL.has(i.position)||Ym(o)&&!d&&B3(t,o))?a=a.filter(f=>f!==o):i=c,o=_c(o)}return e.set(t,a),a}function ML(t){let{element:e,boundary:n,rootBoundary:a,strategy:i}=t;const o=[...n==="clippingAncestors"?rx(e)?[]:TL(e,this._c):[].concat(n),a],c=o[0],d=o.reduce((m,f)=>{const p=PF(e,f,i);return m.top=Ui(p.top,m.top),m.right=Cc(p.right,m.right),m.bottom=Cc(p.bottom,m.bottom),m.left=Ui(p.left,m.left),m},PF(e,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function RL(t){const{width:e,height:n}=j3(t);return{width:e,height:n}}function DL(t,e,n){const a=Ao(e),i=Ro(e),s=n==="fixed",o=xu(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const d=So(0);function m(){d.x=ix(i)}
vendor: 6,362 bytes, line 9
9if(a||!a&&!s)if((oh(e)!=="body"||Ym(i))&&(c=ax(e)),a){const v=xu(e,!0,s,e);d.x=v.x+e.clientLeft,d.y=v.y+e.clientTop}else i&&m();s&&!a&&i&&m();const f=i&&!a&&!s?I3(i,c):So(0),p=o.left+c.scrollLeft-d.x-f.x,b=o.top+c.scrollTop-d.y-f.y;return{x:p,y:b,width:o.width,height:o.height}}function dv(t){return $s(t).position==="static"}function jF(t,e){if(!Ao(t)||$s(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ro(t)===n&&(n=n.ownerDocument.body),n}function O3(t,e){const n=Hi(t);if(rx(t))return n;if(!Ao(t)){let i=_c(t);for(;i&&!Od(i);){if(Vs(i)&&!dv(i))return i;i=_c(i)}return n}let a=jF(t,e);for(;a&&pL(a)&&dv(a);)a=jF(a,e);return a&&Od(a)&&dv(a)&&!N1(a)?n:a||bL(t)||n}const PL=async function(t){const e=this.getOffsetParent||O3,n=this.getDimensions,a=await n(t.floating);return{reference:DL(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function jL(t){return $s(t).direction==="rtl"}const LL={convertOffsetParentRelativeRectToViewportRelativeRect:CL,getDocumentElement:Ro,getClippingRect:ML,getOffsetParent:O3,getElementRects:PL,getClientRects:_L,getDimensions:RL,getScale:Td,isElement:Vs,isRTL:jL};function U3(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function IL(t,e){let n=null,a;const i=Ro(t);function s(){var c;clearTimeout(a),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const m=t.getBoundingClientRect(),{left:f,top:p,width:b,height:v}=m;if(c||e(),!b||!v)return;const C=bp(p),S=bp(i.clientWidth-(f+b)),F=bp(i.clientHeight-(p+v)),w=bp(f),N={rootMargin:-C+"px "+-S+"px "+-F+"px "+-w+"px",threshold:Ui(0,Cc(1,d))||1};let P=!0;function z(D){const T=D[0].intersectionRatio;if(T!==d){if(!P)return o();T?o(!1,T):a=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!U3(m,t.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(z,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(z,N)}n.observe(t)}return o(!0),s}function BL(t,e,n,a){a===void 0&&(a={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=a,m=M1(t),f=i||s?[...m?Nm(m):[],...Nm(e)]:[];f.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const p=m&&c?IL(m,n):null;let b=-1,v=null;o&&(v=new ResizeObserver(w=>{let[A]=w;A&&A.target===m&&v&&(v.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(e)})),n()}),m&&!d&&v.observe(m),v.observe(e));let C,S=d?xu(t):null;d&&F();function F(){const w=xu(t);S&&!U3(S,w)&&n(),S=w,C=requestAnimationFrame(F)}return n(),()=>{var w;f.forEach(A=>{i&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),p?.(),(w=v)==null||w.disconnect(),v=null,d&&cancelAnimationFrame(C)}}const OL=cL,UL=uL,zL=sL,GL=hL,HL=oL,LF=iL,WL=dL,VL=(t,e,n)=>{const a=new Map,i={platform:LL,...n},s={...i.platform,_c:a};return aL(t,e,{...i,platform:s})};var $L=typeof document<"u",KL=function(){},cg=$L?x.useLayoutEffect:KL;function Eg(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,a,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(a=n;a--!==0;)if(!Eg(t[a],e[a]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(e,i[a]))return!1;for(a=n;a--!==0;){const s=i[a];if(!(s==="_owner"&&t.$$typeof)&&!Eg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function z3(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function IF(t,e){const n=z3(t);return Math.round(e*n)/n}function hv(t){const e=x.useRef(t);return cg(()=>{e.current=t}),e}function YL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:a=[],platform:i,elements:{reference:s,floating:o}={},transform:c=!0,whileElementsMounted:d,open:m}=t,[f,p]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[b,v]=x.useState(a);Eg(b,a)||v(a);const[C,S]=x.useState(null),[F,w]=x.useState(null),A=x.useCallback(H=>{H!==D.current&&(D.current=H,S(H))},[]),N=x.useCallback(H=>{H!==T.current&&(T.current=H,w(H))},[]),P=s||C,z=o||F,D=x.useRef(null),T=x.useRef(null),K=x.useRef(f),B=d!=null,k=hv(d),O=hv(i),I=hv(m),j=x.useCallback(()=>{if(!D.current||!T.current)return;const H={placement:e,strategy:n,middleware:b};O.current&&(H.platform=O.current),VL(D.current,T.current,H).then(J=>{const ie={...J,isPositioned:I.current!==!1};U.current&&!Eg(K.current,ie)&&(K.current=ie,_u.flushSync(()=>{p(ie)}))})},[b,e,n,O,I]);cg(()=>{m===!1&&K.current.isPositioned&&(K.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[m]);const U=x.useRef(!1);cg(()=>(U.current=!0,()=>{U.current=!1}),[]),cg(()=>{if(P&&(D.current=P),z&&(T.current=z),P&&z){if(k.current)return k.current(P,z,j);j()}},[P,z,j,k,B]);const q=x.useMemo(()=>({reference:D,floating:T,setReference:A,setFloating:N}),[A,N]),Y=x.useMemo(()=>({reference:P,floating:z}),[P,z]),W=x.useMemo(()=>{const H={position:n,left:0,top:0};if(!Y.floating)return H;const J=IF(Y.floating,f.x),ie=IF(Y.floating,f.y);return c?{...H,transform:"translate("+J+"px, "+ie+"px)",...z3(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:ie}},[n,c,Y.floating,f.x,f.y]);return x.useMemo(()=>({...f,update:j,refs:q,elements:Y,floatingStyles:W}),[f,j,q,Y,W])}const qL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:a,padding:i}=typeof t=="function"?t(n):t;return a&&e(a)?a.current!=null?LF({element:a.current,padding:i}).fn(n):{}:a?LF({element:a,padding:i}).fn(n):{}}}},JL=(t,e)=>({...OL(t),options:[t,e]}),XL=(t,e)=>({...UL(t),options:[t,e]}),ZL=(t,e)=>({...WL(t),options:[t,e]}),QL=(t,e)=>({...zL(t),options:[t,e]}),e5=(t,e)=>({...GL(t),options:[t,e]}),t5=(t,e)=>({...HL(t),options:[t,e]}),n5=(t,e)=>({...qL(t),options:[t,e]});var r5="Arrow",G3=x.forwardRef((t,e)=>{const{children:n,width:a=10,height:i=5,...s}=t;return r.jsx(Tn.svg,{...s,ref:e,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});G3.displayName=r5;var a5=G3;function sx(t){const[e,n]=x.useState(void 0);return fa(()=>
vendor: 4,926 bytes, line 9
9{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,c;if("borderBoxSize"in s){const d=s.borderBoxSize,m=Array.isArray(d)?d[0]:d;o=m.inlineSize,c=m.blockSize}else o=t.offsetWidth,c=t.offsetHeight;n({width:o,height:c})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else n(void 0)},[t]),e}var R1="Popper",[H3,ox]=Xa(R1),[i5,W3]=H3(R1),V3=t=>{const{__scopePopper:e,children:n}=t,[a,i]=x.useState(null);return r.jsx(i5,{scope:e,anchor:a,onAnchorChange:i,children:n})};V3.displayName=R1;var $3="PopperAnchor",K3=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:a,...i}=t,s=W3($3,n),o=x.useRef(null),c=Hn(e,o),d=x.useRef(null);return x.useEffect(()=>{const m=d.current;d.current=a?.current||o.current,m!==d.current&&s.onAnchorChange(d.current)}),a?null:r.jsx(Tn.div,{...i,ref:c})});K3.displayName=$3;var D1="PopperContent",[s5,o5]=H3(D1),Y3=x.forwardRef((t,e)=>{const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:C,...S}=t,F=W3(D1,n),[w,A]=x.useState(null),N=Hn(e,Ce=>A(Ce)),[P,z]=x.useState(null),D=sx(P),T=D?.width??0,K=D?.height??0,B=a+(s!=="center"?"-"+s:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(m)?m:[m],I=O.length>0,j={padding:k,boundary:O.filter(c5),altBoundary:I},{refs:U,floatingStyles:q,placement:Y,isPositioned:W,middlewareData:H}=YL({strategy:"fixed",placement:B,whileElementsMounted:(...Ce)=>BL(...Ce,{animationFrame:v==="always"}),elements:{reference:F.anchor},middleware:[JL({mainAxis:i+K,alignmentAxis:o}),d&&XL({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?ZL():void 0,...j}),d&&QL({...j}),e5({...j,apply:({elements:Ce,rects:He,availableWidth:Ct,availableHeight:bt})=>{const{width:Rt,height:zt}=He.reference,Ut=Ce.floating.style;Ut.setProperty("--radix-popper-available-width",`${Ct}px`),Ut.setProperty("--radix-popper-available-height",`${bt}px`),Ut.setProperty("--radix-popper-anchor-width",`${Rt}px`),Ut.setProperty("--radix-popper-anchor-height",`${zt}px`)}}),P&&n5({element:P,padding:c}),u5({arrowWidth:T,arrowHeight:K}),b&&t5({strategy:"referenceHidden",...j})]}),[J,ie]=X3(Y),Q=ua(C);fa(()=>{W&&Q?.()},[W,Q]);const ve=H.arrow?.x,pe=H.arrow?.y,Me=H.arrow?.centerOffset!==0,[We,Ae]=x.useState();return fa(()=>{w&&Ae(window.getComputedStyle(w).zIndex)},[w]),r.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:W?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:We,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(s5,{scope:n,placedSide:J,onArrowChange:z,arrowX:ve,arrowY:pe,shouldHideArrow:Me,children:r.jsx(Tn.div,{"data-side":J,"data-align":ie,...S,ref:N,style:{...S.style,animation:W?void 0:"none"}})})})});Y3.displayName=D1;var q3="PopperArrow",l5={top:"bottom",right:"left",bottom:"top",left:"right"},J3=x.forwardRef(function(e,n){const{__scopePopper:a,...i}=e,s=o5(q3,a),o=l5[s.placedSide];return r.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:r.jsx(a5,{...i,ref:n,style:{...i.style,display:"block"}})})});J3.displayName=q3;function c5(t){return t!==null}var u5=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:a,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,c=o?0:t.arrowWidth,d=o?0:t.arrowHeight,[m,f]=X3(n),p={start:"0%",center:"50%",end:"100%"}[f],b=(i.arrow?.x??0)+c/2,v=(i.arrow?.y??0)+d/2;let C="",S="";return m==="bottom"?(C=o?p:`${b}px`,S=`${-d}px`):m==="top"?(C=o?p:`${b}px`,S=`${a.floating.height+d}px`):m==="right"?(C=`${-d}px`,S=o?p:`${v}px`):m==="left"&&(C=`${a.floating.width+d}px`,S=o?p:`${v}px`),{data:{x:C,y:S}}}});function X3(t){const[e,n="center"]=t.split("-");return[e,n]}var Z3=V3,Q3=K3,ek=Y3,tk=J3,[lx]=Xa("Tooltip",[ox]),cx=ox(),nk="TooltipProvider",d5=700,zy="tooltip.open",[h5,P1]=lx(nk),rk=t=>{const{__scopeTooltip:e,delayDuration:n=d5,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:s}=t,o=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const m=d.current;return()=>window.clearTimeout(m)},[]),r.jsx(h5,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>
vendor: 5,673 bytes, line 9
9o.current=!0,a)},[a]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(m=>{c.current=m},[]),disableHoverableContent:i,children:s})};rk.displayName=nk;var Tm="Tooltip",[m5,ux]=lx(Tm),ak=t=>{const{__scopeTooltip:e,children:n,open:a,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:c}=t,d=P1(Tm,t.__scopeTooltip),m=cx(e),[f,p]=x.useState(null),b=wo(),v=x.useRef(0),C=o??d.disableHoverableContent,S=c??d.delayDuration,F=x.useRef(!1),[w,A]=ds({prop:a,defaultProp:i??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(zy))):d.onClose(),s?.(T)},caller:Tm}),N=x.useMemo(()=>w?F.current?"delayed-open":"instant-open":"closed",[w]),P=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,F.current=!1,A(!0)},[A]),z=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,A(!1)},[A]),D=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{F.current=!0,A(!0),v.current=0},S)},[S,A]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),r.jsx(Z3,{...m,children:r.jsx(m5,{scope:e,contentId:b,open:w,stateAttribute:N,trigger:f,onTriggerChange:p,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?D():P()},[d.isOpenDelayedRef,D,P]),onTriggerLeave:x.useCallback(()=>{C?z():(window.clearTimeout(v.current),v.current=0)},[z,C]),onOpen:P,onClose:z,disableHoverableContent:C,children:n})})};ak.displayName=Tm;var Gy="TooltipTrigger",ik=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...a}=t,i=ux(Gy,n),s=P1(Gy,n),o=cx(n),c=x.useRef(null),d=Hn(e,c,i.onTriggerChange),m=x.useRef(!1),f=x.useRef(!1),p=x.useCallback(()=>m.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),r.jsx(Q3,{asChild:!0,...o,children:r.jsx(Tn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:d,onPointerMove:vn(t.onPointerMove,b=>{b.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:vn(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:vn(t.onPointerDown,()=>{i.open&&i.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:vn(t.onFocus,()=>{m.current||i.onOpen()}),onBlur:vn(t.onBlur,i.onClose),onClick:vn(t.onClick,i.onClose)})})});ik.displayName=Gy;var f5="TooltipPortal",[Xre,p5]=lx(f5,{forceMount:void 0}),Ud="TooltipContent",sk=x.forwardRef((t,e)=>{const n=p5(Ud,t.__scopeTooltip),{forceMount:a=n.forceMount,side:i="top",...s}=t,o=ux(Ud,t.__scopeTooltip);return r.jsx(Yi,{present:a||o.open,children:o.disableHoverableContent?r.jsx(ok,{side:i,...s,ref:e}):r.jsx(g5,{side:i,...s,ref:e})})}),g5=x.forwardRef((t,e)=>{const n=ux(Ud,t.__scopeTooltip),a=P1(Ud,t.__scopeTooltip),i=x.useRef(null),s=Hn(e,i),[o,c]=x.useState(null),{trigger:d,onClose:m}=n,f=i.current,{onPointerInTransitChange:p}=a,b=x.useCallback(()=>{c(null),p(!1)},[p]),v=x.useCallback((C,S)=>{const F=C.currentTarget,w={x:C.clientX,y:C.clientY},A=w5(w,F.getBoundingClientRect()),N=S5(w,A),P=F5(S.getBoundingClientRect()),z=_5([...N,...P]);c(z),p(!0)},[p]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(d&&f){const C=F=>v(F,f),S=F=>v(F,d);return d.addEventListener("pointerleave",C),f.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",C),f.removeEventListener("pointerleave",S)}}},[d,f,v,b]),x.useEffect(()=>{if(o){const C=S=>{const F=S.target,w={x:S.clientX,y:S.clientY},A=d?.contains(F)||f?.contains(F),N=!C5(w,o);A?b():N&&(b(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[d,f,o,m,b]),r.jsx(ok,{...t,ref:s})}),[x5,v5]=lx(Tm,{isInside:!1}),y5=LE("TooltipContent"),ok=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:a,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...c}=t,d=ux(Ud,n),m=cx(n),{onClose:f}=d;return x.useEffect(()=>(document.addEventListener(zy,f),()=>document.removeEventListener(zy,f)),[f]),x.useEffect(()=>{if(d.trigger){const p=b=>{b.target?.contains(d.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,f]),r.jsx($m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:r.jsxs(ek,{"data-state":d.stateAttribute,...m,...c,ref:e,style:{...c.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:[r.jsx(y5,{children:a}),r.jsx(x5,{scope:n,isInside:!0,children:r.jsx(PD,{id:d.contentId,role:"tooltip",children:i||a})})]})})});sk.displayName=Ud;var lk="TooltipArrow",b5=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...a}=t,i=cx(n);return v5(lk,n).isInside?null:r.jsx(tk,{...i,...a,ref:e})});b5.displayName=lk;function w5(t,e){const n=Math.abs(e.top-t.y),a=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,a,i,s)){case s:return"left";case i:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function S5(t,e,n=5){const a=[];switch(e){case"top":a.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":a.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":a.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":a.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return a}
vendor: 20,084 bytes, line 9
9function F5(t){const{top:e,right:n,bottom:a,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:a},{x:i,y:a}]}function C5(t,e){const{x:n,y:a}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const c=e[s],d=e[o],m=c.x,f=c.y,p=d.x,b=d.y;f>a!=b>a&&n<(p-m)*(a-f)/(b-f)+m&&(i=!i)}return i}function _5(t){const e=t.slice();return e.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),E5(e)}function E5(t){if(t.length<=1)return t.slice();const e=[];for(let a=0;a<t.length;a++){const i=t[a];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let a=t.length-1;a>=0;a--){const i=t[a];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.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 k5=rk,A5=ak,N5=ik,ck=sk;const Lr=k5,Gr=A5,Hr=N5,Ir=x.forwardRef(({className:t,sideOffset:e=4,...n},a)=>r.jsx(ck,{ref:a,sideOffset:e,className:ln("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Ir.displayName=ck.displayName;var dx=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(){}},T5={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},M5=class{#e=T5;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Hy=new M5;function R5(t){setTimeout(t,0)}var hx=typeof window>"u"||"Deno"in globalThis;function Rs(){}function D5(t,e){return typeof t=="function"?t(e):t}function P5(t){return typeof t=="number"&&t>=0&&t!==1/0}function j5(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Wy(t,e){return typeof t=="function"?t(e):t}function L5(t,e){return typeof t=="function"?t(e):t}function BF(t,e){const{type:n="all",exact:a,fetchStatus:i,predicate:s,queryKey:o,stale:c}=t;if(o){if(a){if(e.queryHash!==j1(o,e.options))return!1}else if(!Rm(e.queryKey,o))return!1}if(n!=="all"){const d=e.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function OF(t,e){const{exact:n,status:a,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Mm(e.options.mutationKey)!==Mm(s))return!1}else if(!Rm(e.options.mutationKey,s))return!1}return!(a&&e.state.status!==a||i&&!i(e))}function j1(t,e){return(e?.queryKeyHashFn||Mm)(t)}function Mm(t){return JSON.stringify(t,(e,n)=>Vy(n)?Object.keys(n).sort().reduce((a,i)=>(a[i]=n[i],a),{}):n)}function Rm(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Rm(t[n],e[n])):!1}var I5=Object.prototype.hasOwnProperty;function uk(t,e){if(t===e)return t;const n=UF(t)&&UF(e);if(!n&&!(Vy(t)&&Vy(e)))return e;const i=(n?t:Object.keys(t)).length,s=n?e:Object.keys(e),o=s.length,c=n?new Array(o):{};let d=0;for(let m=0;m<o;m++){const f=n?m:s[m],p=t[f],b=e[f];if(p===b){c[f]=p,(n?m<i:I5.call(t,f))&&d++;continue}if(p===null||b===null||typeof p!="object"||typeof b!="object"){c[f]=b;continue}const v=uk(p,b);c[f]=v,v===p&&d++}return i===o&&d===i?t:c}function UF(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Vy(t){if(!zF(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!zF(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function zF(t){return Object.prototype.toString.call(t)==="[object Object]"}function B5(t){return new Promise(e=>{Hy.setTimeout(e,t)})}function O5(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?uk(t,e):e}function U5(t,e,n=0){const a=[...t,e];return n&&a.length>n?a.slice(1):a}function z5(t,e,n=0){const a=[e,...t];return n&&a.length>n?a.slice(0,-1):a}var L1=Symbol();function dk(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===L1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var G5=class extends dx{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!hx&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},hk=new G5;function H5(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function a(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{a({status:"fulfilled",value:i}),t(i)},n.reject=i=>{a({status:"rejected",reason:i}),e(i)},n}var W5=R5;function V5(){let t=[],e=0,n=c=>{c()},a=c=>{c()},i=W5;const s=c=>{e?t.push(c):i(()=>{n(c)})},o=()=>{const c=t;t=[],c.length&&i(()=>{a(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;e++;try{d=c()}finally{e--,e||o()}return d},batchCalls:c=>(...d)=>{s(()=>{c(...d)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{a=c},setScheduler:c=>{i=c}}}var si=V5(),$5=class extends dx{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!hx&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},kg=new $5;function K5(t){return Math.min(1e3*2**t,3e4)}function mk(t){return(t??"online")==="online"?kg.isOnline():!0}var $y=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function fk(t){let e=!1,n=0,a;const i=H5(),s=()=>i.status!=="pending",o=S=>{if(!s()){const F=new $y(S);b(F),t.onCancel?.(F)}},c=()=>{e=!0},d=()=>{e=!1},m=()=>hk.isFocused()&&(t.networkMode==="always"||kg.isOnline())&&t.canRun(),f=()=>mk(t.networkMode)&&t.canRun(),p=S=>{s()||(a?.(),i.resolve(S))},b=S=>{s()||(a?.(),i.reject(S))},v=()=>new Promise(S=>{a=F=>{(s()||m())&&S(F)},t.onPause?.()}).then(()=>{a=void 0,s()||t.onContinue?.()}),C=()=>{if(s())return;let S;const F=n===0?t.initialPromise:void 0;try{S=F??t.fn()}catch(w){S=Promise.reject(w)}Promise.resolve(S).then(p).catch(w=>{if(s())return;const A=t.retry??(hx?0:3),N=t.retryDelay??K5,P=typeof N=="function"?N(n,w):N,z=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,w);if(e||!z){b(w);return}n++,t.onFail?.(n,w),B5(P).then(()=>m()?void 0:v()).then(()=>{e?b(w):C()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(a?.(),i),cancelRetry:c,continueRetry:d,canStart:f,start:()=>(f()?C():v().then(C),i)}}var pk=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P5(this.gcTime)&&(this.#e=Hy.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(hx?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Hy.clearTimeout(this.#e),this.#e=void 0)}},Y5=class extends pk{#e;#t;#n;#a;#r;#s;#o;constructor(t){super(),this.#o=!1,this.#s=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#n=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=GF(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#s,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=GF(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=O5(this.state.data,t,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#i({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(Rs).catch(Rs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>L5(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===L1||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Wy(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!j5(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,a=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=dk(this.options,e),m=(()=>{const f={client:this.#a,queryKey:this.queryKey,meta:this.meta};return a(f),f})();return this.#o=!1,this.options.persister?this.options.persister(c,m,this):c(m)},o=(()=>{const c={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:i};return a(c),c})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#i({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=fk({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof $y&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#i({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof $y){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#i({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#i(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...q5(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?a:void 0,a;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),si.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function q5(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mk(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function GF(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,a=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function HF(t){return{onFetch:(e,n)=>{const a=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const m=async()=>{let f=!1;const p=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},b=dk(e.options,e.fetchOptions),v=async(C,S,F)=>{if(f)return Promise.reject();if(S==null&&C.pages.length)return Promise.resolve(C);const A=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:S,direction:F?"backward":"forward",meta:e.options.meta};return p(D),D})(),N=await b(A),{maxPages:P}=e.options,z=F?z5:U5;return{pages:z(C.pages,N,P),pageParams:z(C.pageParams,S,P)}};if(i&&s.length){const C=i==="backward",S=C?J5:WF,F={pages:s,pageParams:o},w=S(a,F);c=await v(F,w,C)}else{const C=t??s.length;do{const S=d===0?o[0]??a.initialPageParam:WF(a,c);if(d>0&&S==null)break;c=await v(c,S),d++}while(d<C)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(m,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=m}}}function WF(t,{pages:e,pageParams:n}){const a=e.length-1;return e.length>0?t.getNextPageParam(e[a],e,n[a],n):void 0}function J5(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var X5=class extends pk{#e;#t;#n;#a;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Z5(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=fk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,o)=>{this.#r({type:"failed",failureCount:s,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",i=!this.#a.canStart();try{if(a)e();else{this.#r({type:"pending",variables:t,isPaused:i}),await this.#n.config.onMutate?.(t,this,n);const o=await this.options.onMutate?.(t,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:t,isPaused:i})}const s=await this.#a.start();return await this.#n.config.onSuccess?.(s,t,this.state.context,this,n),await this.options.onSuccess?.(s,t,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,t,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{throw await this.#n.config.onError?.(s,t,this.state.context,this,n),await this.options.onError?.(s,t,this.state.context,n),await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,s,t,this.state.context,n),s}finally{this.#r({type:"error",error:s})}}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),si.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Z5(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Q5=class extends dx{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const a=new X5({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(a),a}add(t){this.#e.add(t);const e=wp(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=wp(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=wp(t);if(typeof e=="string"){const a=this.#t.get(e)?.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){const e=wp(t);return typeof e=="string"?this.#t.get(e)?.find(a=>a!==t&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){si.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>OF(e,n))}findAll(t={}){return this.getAll().filter(e=>OF(t,e))}notify(t){si.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>
9e.state.isPaused);return si.batch(()=>Promise.all(t.map(e=>e.continue().catch(Rs))))}};function wp(t){return t.options.scope?.id}var eI=class extends dx{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const a=e.queryKey,i=e.queryHash??j1(a,e);let s=this.get(i);return s||(s=new Y5({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){si.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>BF(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>BF(t,n)):e}notify(t){si.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){si.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){si.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tI=class{#e;#t;#n;#a;#r;#s;#o;#i;constructor(t={}){this.#e=t.queryCache||new eI,this.#t=t.mutationCache||new Q5,this.#n=t.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#o=hk.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=kg.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),a=n.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Wy(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(a))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const a=n.data;return[e,a]})}setQueryData(t,e,n){const a=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(a.queryHash)?.state.data,o=D5(e,s);if(o!==void 0)return this.#e.build(this,a).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return si.batch(()=>this.#e.findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;si.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return si.batch(()=>(n.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},a=si.batch(()=>this.#e.findAll(t).map(i=>i.cancel(n)));return Promise.all(a).then(Rs).catch(Rs)}invalidateQueries(t,e={}){return si.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},a=si.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Rs)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(a).then(Rs)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Wy(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Rs).catch(Rs)}fetchInfiniteQuery(t){return t.behavior=HF(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Rs).catch(Rs)}ensureInfiniteQueryData(t){return t.behavior=HF(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return kg.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(Mm(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],n={};return e.forEach(a=>{Rm(t,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(t,e){this.#r.set(Mm(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(a=>{Rm(t,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=j1(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===L1&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},nI=x.createContext(void 0),rI=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),r.jsx(nI.Provider,{value:t,children:e}));function Dm(){return Dm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Dm.apply(this,arguments)}var gc;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(gc||(gc={}));const VF="popstate";function aI(t){t===void 0&&(t={});function e(a,i){let{pathname:s,search:o,hash:c}=a.location;return Ky("",{pathname:s,search:o,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(a,i){return typeof i=="string"?i:Ag(i)}return sI(e,n,null,t)}function Kr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function I1(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function iI(){return Math.random().toString(36).substr(2,8)}function $F(t,e){return{usr:t.state,key:t.key,idx:e}}function Ky(t,e,n,a){return n===void 0&&(n=null),Dm({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?lh(e):e,{state:n,key:e&&e.key||a||iI()})}function Ag(t){let{pathname:e="/",search:n="",hash:a=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function lh(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}function sI(t,e,n,a){a===void 0&&(a={});let{window:i=document.defaultView,v5Compat:s=!1}=a,o=i.history,c=gc.Pop,d=null,m=f();m==null&&(m=0,o.replaceState(Dm({},o.state,{idx:m}),""));function f(){return(o.state||{idx:null}).idx}function p(){c=gc.Pop;let F=f(),w=F==null?null:F-m;m=F,d&&d({action:c,location:S.location,delta:w})}function b(F,w){c=gc.Push;let A=Ky(S.location,F,w);m=f()+1;let N=$F(A,m),P=S.createHref(A);try{o.pushState(N,"",P)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;i.location.assign(P)}s&&d&&d({action:c,location:S.location,delta:1})}function v(F,w){c=gc.Replace;let A=Ky(S.location,F,w);m=f();let N=$F(A,m),P=S.createHref(A);o.replaceState(N,"",P),s&&d&&d({action:c,location:S.location,delta:0})}function C(F){let w=i.location.origin!=="null"?i.location.origin:i.location.href,A=typeof F=="string"?F:Ag(F);return A=A.replace(/ $/,"%20"),Kr(w,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,w)}let S={get action(){return c},get location(){return t(i,o)},listen(F){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(VF,p),d=F,()=>{i.removeEventListener(VF,p),d=null}},createHref(F){return e(i,F)},createURL:C,encodeLocation(F){let w=C(F);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:b,replace:v,go(F){return o.go(F)}};return S}var KF;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(KF||(KF={}));function oI(t,e,n){return n===void 0&&(n="/"),lI(t,e,n)}function lI(t,e,n,a){let i=typeof e=="string"?lh(e):e,s=B1(i.pathname||"/",n);if(s==null)return null;let o=gk(t);cI(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let m=wI(s);c=vI(o[d],m)}return c}function gk(t,e,n,a){e===void 0&&(e=[]),n===void 0&&(n=[]),a===void 0&&(a="");let i=(s,o,c)=>{let d={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};d.relativePath.startsWith("/")&&(Kr(d.relativePath.startsWith(a),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+a+'" is not val
9id. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(a.length));let m=bc([a,d.relativePath]),f=n.concat(d);s.children&&s.children.length>0&&(Kr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+m+'".')),gk(s.children,e,f,m)),!(s.path==null&&!s.index)&&e.push({path:m,score:gI(m,s.index),routesMeta:f})};return t.forEach((s,o)=>{var c;if(s.path===""||!((c=s.path)!=null&&c.includes("?")))i(s,o);else for(let d of xk(s.path))i(s,o,d)}),e}function xk(t){let e=t.split("/");if(e.length===0)return[];let[n,...a]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return i?[s,""]:[s];let o=xk(a.join("/")),c=[];return c.push(...o.map(d=>d===""?s:[s,d].join("/"))),i&&c.push(...o),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function cI(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:xI(e.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}const uI=/^:[\w-]+$/,dI=3,hI=2,mI=1,fI=10,pI=-2,YF=t=>t==="*";function gI(t,e){let n=t.split("/"),a=n.length;return n.some(YF)&&(a+=pI),e&&(a+=hI),n.filter(i=>!YF(i)).reduce((i,s)=>i+(uI.test(s)?dI:s===""?mI:fI),a)}function xI(t,e){return t.length===e.length&&t.slice(0,-1).every((a,i)=>a===e[i])?t[t.length-1]-e[e.length-1]:0}function vI(t,e,n){let{routesMeta:a}=t,i={},s="/",o=[];for(let c=0;c<a.length;++c){let d=a[c],m=c===a.length-1,f=s==="/"?e:e.slice(s.length)||"/",p=yI({path:d.relativePath,caseSensitive:d.caseSensitive,end:m},f),b=d.route;if(!p)return null;
vendor: 6,865 bytes, line 9
9Object.assign(i,p.params),o.push({params:i,pathname:bc([s,p.pathname]),pathnameBase:EI(bc([s,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(s=bc([s,p.pathnameBase]))}return o}function yI(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,a]=bI(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:a.reduce((m,f,p)=>{let{paramName:b,isOptional:v}=f;if(b==="*"){let S=c[p]||"";o=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const C=c[p];return v&&!C?m[b]=void 0:m[b]=(C||"").replace(/%2F/g,"/"),m},{}),pathname:s,pathnameBase:o,pattern:t}}function bI(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),I1(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 a=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(a.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),a]}function wI(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return I1(!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 B1(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,a=t.charAt(n);return a&&a!=="/"?null:t.slice(n)||"/"}const SI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FI=t=>SI.test(t);function CI(t,e){e===void 0&&(e="/");let{pathname:n,search:a="",hash:i=""}=typeof t=="string"?lh(t):t,s;if(n)if(FI(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),I1(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=qF(n.substring(1),"/"):s=qF(n,e)}else s=e;return{pathname:s,search:kI(a),hash:AI(i)}}function qF(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 mv(t,e,n,a){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(a)+"].  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 _I(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function O1(t,e){let n=_I(t);return e?n.map((a,i)=>i===n.length-1?a.pathname:a.pathnameBase):n.map(a=>a.pathnameBase)}function U1(t,e,n,a){a===void 0&&(a=!1);let i;typeof t=="string"?i=lh(t):(i=Dm({},t),Kr(!i.pathname||!i.pathname.includes("?"),mv("?","pathname","search",i)),Kr(!i.pathname||!i.pathname.includes("#"),mv("#","pathname","hash",i)),Kr(!i.search||!i.search.includes("#"),mv("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,c;if(o==null)c=n;else{let p=e.length-1;if(!a&&o.startsWith("..")){let b=o.split("/");for(;b[0]==="..";)b.shift(),p-=1;i.pathname=b.join("/")}c=p>=0?e[p]:"/"}let d=CI(i,c),m=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(m||f)&&(d.pathname+="/"),d}const bc=t=>t.join("/").replace(/\/\/+/g,"/"),EI=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),kI=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,AI=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function NI(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const vk=["post","put","patch","delete"];new Set(vk);const TI=["get",...vk];new Set(TI);function Pm(){return Pm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Pm.apply(this,arguments)}const z1=x.createContext(null),MI=x.createContext(null),Ac=x.createContext(null),mx=x.createContext(null),Nc=x.createContext({outlet:null,matches:[],isDataRoute:!1}),yk=x.createContext(null);function RI(t,e){let{relative:n}=e===void 0?{}:e;ch()||Kr(!1);let{basename:a,navigator:i}=x.useContext(Ac),{hash:s,pathname:o,search:c}=wk(t,{relative:n}),d=o;return a!=="/"&&(d=o==="/"?a:bc([a,o])),i.createHref({pathname:d,search:c,hash:s})}function ch(){return x.useContext(mx)!=null}function Do(){return ch()||Kr(!1),x.useContext(mx).location}function bk(t){x.useContext(Ac).static||x.useLayoutEffect(t)}function _r(){let{isDataRoute:t}=x.useContext(Nc);return t?VI():DI()}function DI(){ch()||Kr(!1);let t=x.useContext(z1),{basename:e,future:n,navigator:a}=x.useContext(Ac),{matches:i}=x.useContext(Nc),{pathname:s}=Do(),o=JSON.stringify(O1(i,n.v7_relativeSplatPath)),c=x.useRef(!1);return bk(()=>{c.current=!0}),x.useCallback(function(m,f){if(f===void 0&&(f={}),!c.current)return;if(typeof m=="number"){a.go(m);return}let p=U1(m,JSON.parse(o),s,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:bc([e,p.pathname])),(f.replace?a.replace:a.push)(p,f.state,f)},[e,a,o,s,t])}function wk(t,e){let{relative:n}=e===void 0?{}:e,{future:a}=x.useContext(Ac),{matches:i}=x.useContext(Nc),{pathname:s}=Do(),o=JSON.stringify(O1(i,a.v7_relativeSplatPath));return x.useMemo(()=>U1(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function PI(t,e){return jI(t,e)}function jI(t,e,n,a){ch()||Kr(!1);let{navigator:i}=x.useContext(Ac),{matches:s}=x.useContext(Nc),o=s[s.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let m=Do(),f;if(e){var p;let F=typeof e=="string"?lh(e):e;d==="/"||(p=F.pathname)!=null&&p.startsWith(d)||Kr(!1),f=F}else f=m;let b=f.pathname||"/",v=b;if(d!=="/"){let F=d.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(F.length).join("/")}let C=oI(t,{pathname:v}),S=UI(C&&C.map(F=>Object.assign({},F,{params:Object.assign({},c,F.params),pathname:bc([d,i.encodeLocation?i.encodeLocation(F.pathname).pathname:F.pathname]),pathnameBase:F.pathnameBase==="/"?d:bc([d,i.encodeLocation?i.encodeLocation(F.pathnameBase).pathname:F.pathnameBase])})),s,n,a);return e&&S?x.createElement(mx.Provider,{value:{location:Pm({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:gc.Pop}},S):S}function LI(){let t=WI(),e=NI(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 x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application 
9Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),n?x.createElement("pre",{style:i},n):null,null)}const II=x.createElement(LI,null);class BI extends x.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?x.createElement(Nc.Provider,{value:this.props.routeContext},x.createElement(yk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function OI(t){let{routeContext:e,match:n,children:a}=t,i=x.useContext(z1);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Nc.Provider,{value:e},a)}function UI(t,e,n,a){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),a===void 0&&(a=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=a)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,c=(i=n)==null?void 0:i.errors;if(c!=null){let f=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);f>=0||Kr(!1),o=o.slice(0,Math.min(o.length,f+1))}let d=!1,m=-1;if(n&&a&&a.v7_partialHydration)for(let f=0;f<o.length;f++){let p=o[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(m=f),p.route.id){let{loaderData:b,errors:v}=n,C=p.route.loader&&b[p.route.id]===void 0&&(!v||v[p.route.id]===void 0);if(p.route.lazy||C){d=!0,m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}return o.reduceRight((f,p,b)=>{let v,C=!1,S=null,F=null;n&&(v=c&&p.route.id?c[p.route.id]:void 0,S=p.route.errorElement||II,d&&(m<0&&b===0?($I("route-fallback"),C=!0,F=null):m===b&&(C=!0,F=p.route.hydrateFallbackElement||null)));let w=e.concat(o.slice(0,b+1)),A=()=>{let N;return v?N=S:C?N=F:p.route.Component?N=x.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=f,x.createElement(OI,{match:p,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?x.createElement(BI,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:A(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):A()},null)}var Sk=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(Sk||{}),Fk=(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})(Fk||{});function zI(t){let e=x.useContext(z1);return e||Kr(!1),e}function GI(t){let e=x.useContext(MI);return e||Kr(!1),e}function HI(t){let e=x.useContext(Nc);return e||Kr(!1),e}function Ck(t){let e=HI(),n=e.matches[e.matches.length-1];return n.route.id||Kr(!1),n.route.id}function WI(){var t;let e=x.useContext(yk),n=GI(),a=Ck();return e!==void 0?e:(t=n.errors)==null?void 0:t[a]}function VI(){let{router:t}=zI(Sk.UseNavigateStable),e=Ck(Fk.UseNavigateStable),n=x.useRef(!1);return bk(()=>{n.current=!0}),x.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Pm({fromRouteId:e},s)))},[t,e])}const JF={};function $I(t,e,n){JF[t]||(JF[t]=!0)}function KI(t,e){t?.v7_startTransition,t?.v7_relativeSplatPath}function uc(t){let{to:e,replace:n,state:a,relative:i}=t;ch()||Kr(!1);let{future:s,static:o}=x.useContext(Ac),{matches:c}=x.useContext(Nc),{pathname:d}=Do(),m=_r(),f=U1(e,O1(c,s.v7_relativeSplatPath),d,i==="path"),p=JSON.stringify(f);return x.useEffect(()=>m(JSON.parse(p),{replace:n,state:a,relative:i}),[m,p,i,n,a]),null}function tr(t){Kr(!1)}function YI(t){let{basename:e="/",children:n=null,location:a,navigationType:i=gc.Pop,navigator:s,static:o=!1,future:c}=t;ch()&&Kr(!1);let d=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:d,navigator:s,static:o,future:Pm({v7_relativeSplatPath:!1},c)}),[d,c,s,o]);
9typeof a=="string"&&(a=lh(a));let{pathname:f="/",search:p="",hash:b="",state:v=null,key:C="default"}=a,S=x.useMemo(()=>{let F=B1(f,d);return F==null?null:{location:{pathname:F,search:p,hash:b,state:v,key:C},navigationType:i}},[d,f,p,b,v,C,i]);return S==null?null:x.createElement(Ac.Provider,{value:m},x.createElement(mx.Provider,{children:n,value:S}))}function _k(t){let{children:e,location:n}=t;return PI(Yy(e),n)}new Promise(()=>{});function Yy(t,e){e===void 0&&(e=[]);let n=[];return x.Children.forEach(t,(a,i)=>{if(!x.isValidElement(a))return;let s=[...e,i];if(a.type===x.Fragment){n.push.apply(n,Yy(a.props.children,s));return}a.type!==tr&&Kr(!1),!a.props.index||!a.props.children||Kr(!1);let o={id:a.props.id||s.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(o.children=Yy(a.props.children,s)),n.push(o)}),n}function qy(){return qy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},qy.apply(this,arguments)}function qI(t,e){if(t==null)return{};var n={},a=Object.keys(t),i,s;for(s=0;s<a.length;s++)i=a[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function JI(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function XI(t,e){return t.button===0&&(!e||e==="_self")&&!JI(t)}function Jy(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 a=t[n];return e.concat(Array.isArray(a)?a.map(i=>[n,i]):[[n,a]])},[]))}function ZI(t,e){let n=Jy(t);return e&&e.forEach((a,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const QI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],e6="6";try{window.__reactRouterVersion=e6}catch{}const t6="startTransition",XF=v1[t6];function n6(t){let{basename:e,children:n,future:a,window:i}=t,s=x.useRef();s.current==null&&(s.current=aI({window:i,v5Compat:!0}));let o=s.current,[c,d]=x.useState({action:o.action,location:o.location}),{v7_startTransition:m}=a||{},f=x.useCallback(p=>{m&&XF?XF(()=>d(p)):d(p)},[d,m]);return x.useLayoutEffect(()=>o.listen(f),[o,f]),x.useEffect(()=>KI(a),[a]),x.createElement(YI,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:o,future:a})}const r6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xo=x.forwardRef(function(e,n){let{onClick:a,relative:i,reloadDocument:s,replace:o,state:c,target:d,to:m,preventScrollReset:f,viewTransition:p}=e,b=qI(e,QI),{basename:v}=x.useContext(Ac),C,S=!1;if(typeof m=="string"&&a6.test(m)&&(C=m,r6))try{let N=new URL(window.location.href),P=m.startsWith("//")?new URL(N.protocol+m):new URL(m),z=B1(P.pathname,v);P.origin===N.origin&&z!=null?m=z+P.search+P.hash:S=!0}catch{}let F=RI(m,{relative:i}),w=i6(m,{replace:o,state:c,target:d,preventScrollReset:f,relative:i,viewTransition:p});function A(N){a&&a(N),N.defaultPrevented||w(N)}return x.createElement("a",qy({},b,{href:C||F,onClick:S||s?a:A,ref:n,target:d}))});var ZF;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ZF||(ZF={}));var QF;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(QF||(QF={}));function i6(t,e){let{target:n,replace:a,state:i,preventScrollReset:s,relative:o,viewTransition:c}=e===void 0?{}:e,d=_r(),m=Do(),f=wk(t,{relative:o});return x.useCallback(p=>{if(XI(p,n)){p.preventDefault();let b=a!==void 0?a:Ag(m)===Ag(f);d(t,{replace:b,state:i,preventScrollReset:s,relative:o,viewTransition:c})}},[m,d,f,a,i,n,t,s,o,c])}function G1(t){let e=x.useRef(Jy(t)),n=x.useRef(!1),a=Do(),i=x.useMemo(()=>ZI(a.search,n.current?null:e.current),[a.search]),s=_r(),o=x.useCallback((c,d)=>{const m=Jy(typeof c=="function"?c(i):c);n.current=!0,s("?"+m,d)},[s,i]);return[i,o]}const s6={theme:"system",setTheme:()=>null},Ek=x.createContext(s6);function o6({children:t,defaultTheme:e="system",...n}){const[a,i]=x.useState(()=>localStorage.getItem("theme")||e);x.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),a==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
9k":"light";o.classList.add(c);return}o.classList.add(a)},[a]);const s={theme:a,setTheme:o=>{localStorage.setItem("theme",o),i(o)}};return r.jsx(Ek.Provider,{...n,value:s,children:t})}const H1=()=>{const t=x.useContext(Ek);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},l6=()=>{const{theme:t,setTheme:e}=H1(),[n,a]=x.useState(!0),i=Do();if(x.useEffect(()=>{const d=i.pathname==="/timeline"||i.pathname.startsWith("/timeline/")||i.pathname.includes("/timeline-editor"),m=d?"themeSwitcherVisible:timeline":"themeSwitcherVisible",f=localStorage.getItem(m);f!==null?a(f==="true"):d&&a(!1)},[i.pathname]),i.pathname==="/standby")return null;const s=i.pathname==="/timeline"||i.pathname.startsWith("/timeline/")||i.pathname.includes("/timeline-editor")?"themeSwitcherVisible:timeline":"themeSwitcherVisible",o=()=>{a(!1),localStorage.setItem(s,"false")},c=()=>{a(!0),localStorage.setItem(s,"true")};return n?r.jsx("div",{className:"fixed bottom-3 right-3 md:bottom-6 md:right-6 z-50",children:r.jsxs("div",{className:"flex items-center gap-1 bg-card border-2 border-border rounded-lg p-1 shadow-lg",children:[r.jsx("button",{onClick:()=>e("light"),className:`p-2 rounded-md transition-colors ${t==="light"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Light mode","aria-label":"Switch to light mode",children:r.jsx(wF,{className:"w-5 h-5"})}),r.jsx("button",{onClick:()=>e("system"),className:`p-2 rounded-md transition-colors ${t==="system"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"System mode","aria-label":"Use system theme",children:r.jsx(bP,{className:"w-5 h-5"})}),r.jsx("button",{onClick:()=>e("dark"),className:`p-2 rounded-md transition-colors ${t==="dark"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Dark mode","aria-label":"Switch to dark mode",children:r.jsx(wP,{className:"w-5 h-5"})}),r.jsx("div",{className:"w-px h-6 bg-border mx-1"}),r.jsx("button",{onClick:o,className:"p-2 rounded-md transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",title:"Hide theme switcher","aria-label":"Close theme switcher",children:r.jsx(gr,{className:"w-4 h-4"})})]})}):r.jsx("div",{className:"fixed bottom-3 right-3 md:bottom-6 md:right-6 z-50",children:r.jsx("button",{onClick:c,className:"p-3 rounded-lg bg-card border-2 border-border shadow-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"Show theme switcher","aria-label":"Open theme switcher",children:r.jsx(wF,{className:"w-5 h-5"})})})},jm=th("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","toggle-on":"border-2 border-primary bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-[0_0_8px_2px_rgba(168,85,247,0.5)] rounded-sm duration-150 hover:duration-0","toggle-off":"border-2 border-input bg-background hover:bg-accent hover:border-primary/50 rounded-sm duration-150 hover:duration-0"},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"}}),Fe=x.forwardRef(({className:t,variant:e,size:n,asChild:a=!1,...i},s)=>{const o=a?dD:"button";return r.jsx(o,{className:ln(jm({variant:e,size:n,className:t})),ref:s,...i})});Fe.displayName="Button";var fv="focusScope.autoFocusOnMount",pv="focusScope.autoFocusOnUnmount",eC={bubbles:!1,cancelable:!0},c6="FocusScope",W1=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[c,d]=x.useState(null),m=ua(i),f=ua(s),p=x.useRef(null),b=Hn(e,S=>d(S)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let S=function(N){if(v.paused||!c)return;const P=N.target;c.contains(P)?p.current=P:dc(p.current,{select:!0})},F=function(N){if(v.paused||!c)return;const P=N.relatedTarget;P!==null&&(c.contains(P)||dc(p.current,{select:!0}))},w=function(N){if(document.activeElement===document.body)for(const z of N)z.removedNodes.length>0&&dc(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",F);const A=new MutationObserver(w);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",F),A.disconnect()}}},[a,c,v.paused]),x.useEffect(()=>{if(c){nC.add(v);const S=document.activeElement;if(!c.contains(S)){const w=new CustomEvent(fv,eC);c.addEventListener(fv,m),c.dispatchEvent(w),w.defaultPrevented||(u6(p6(kk(c)),{select:!0}),document.activeElement===S&&dc(c))}return()=>{c.removeEventListener(fv,m),setTimeout(()=>{const w=new CustomEvent(pv,eC);c.addEventListener(pv,f),c.dispatchEvent(w),w.defaultPrevented||dc(S??document.body,{select:!0}),c.removeEventListener(pv,f),nC.remove(v)},0)}}},[c,m,f,v]);const C=x.useCallback(S=>{if(!n&&!a||v.paused)return;const F=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,w=document.activeElement;if(F&&w){const A=S.currentTarget,[N,P]=d6(A);N&&P?!S.shiftKey&&w===P?(S.preventDefault(),n&&dc(N,{select:!0})):S.shiftKey&&w===N&&(S.preventDefault(),n&&dc(P,{select:!0})):w===A&&S.preventDefault()}},[n,a,v.paused]);return r.jsx(Tn.div,{tabIndex:-1,...o,ref:b,onKeyDown:C})});W1.displayName=c6;function u6(t,{select:e=!1}={}){const n=document.activeElement;for(const a of t)if(dc(a,{select:e}),document.activeElement!==n)return}function d6(t){const e=kk(t),n=tC(e,t),a=tC(e.reverse(),t);return[n,a]}function kk(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function tC(t,e){for(const n of t)if(!h6(n,{upTo:e}))return n}function h6(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 m6(t){return t instanceof HTMLInputElement&&"select"in t}function dc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&m6(t)&&e&&t.select()}}var nC=f6();function f6(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=rC(t,e),t.unshift(e)},remove(e){t=rC(t,e),t[0]?.resume()}}}function rC(t,e){const n=[...t],a=n.indexOf(e);return a!==-1&&n.splice(a,1),n}function p6(t){return t.filter(e=>e.tagName!=="A")}var gv=0;function Ak(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??aC()),document.body.insertAdjacentElement("beforeend",t[1]??aC()),gv++,()=>{gv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,838 bytes, lines 9-24
9=>e.remove()),gv--}},[])}function aC(){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 mo=function(){return mo=Object.assign||function(e){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mo.apply(this,arguments)};function Nk(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]]);return n}function g6(t,e,n){if(n||arguments.length===2)for(var a=0,i=e.length,s;a<i;a++)(s||!(a in e))&&(s||(s=Array.prototype.slice.call(e,0,a)),s[a]=e[a]);return t.concat(s||Array.prototype.slice.call(e))}var ug="right-scroll-bar-position",dg="width-before-scroll-bar",x6="with-scroll-bars-hidden",v6="--removed-body-scroll-bar-size";function xv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function y6(t,e){var n=x.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(a){var i=n.value;i!==a&&(n.value=a,n.callback(a,i))}}}})[0];return n.callback=e,n.facade}var b6=typeof window<"u"?x.useLayoutEffect:x.useEffect,iC=new WeakMap;function w6(t,e){var n=y6(null,function(a){return t.forEach(function(i){return xv(i,a)})});return b6(function(){var a=iC.get(n);if(a){var i=new Set(a),s=new Set(t),o=n.current;i.forEach(function(c){s.has(c)||xv(c,null)}),s.forEach(function(c){i.has(c)||xv(c,o)})}iC.set(n,t)},[t]),n}function S6(t){return t}function F6(t,e){e===void 0&&(e=S6);var n=[],a=!1,i={read:function(){if(a)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 o=e(s,a);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(s){for(a=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){a=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(s),o=n}var d=function(){var f=o;o=[],f.forEach(s)},m=function(){return Promise.resolve().then(d)};m(),n={push:function(f){o.push(f),m()},filter:function(f){return o=o.filter(f),n}}}};return i}function C6(t){t===void 0&&(t={});var e=F6(null);return e.options=mo({async:!0,ssr:!1},t),e}var Tk=function(t){var e=t.sideCar,n=Nk(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=e.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,mo({},n))};Tk.isSideCarExport=!0;function _6(t,e){return t.useMedium(e),Tk}var Mk=C6(),vv=function(){},fx=x.forwardRef(function(t,e){var n=x.useRef(null),a=x.useState({onScrollCapture:vv,onWheelCapture:vv,onTouchMoveCapture:vv}),i=a[0],s=a[1],o=t.forwardProps,c=t.children,d=t.className,m=t.removeScrollBar,f=t.enabled,p=t.shards,b=t.sideCar,v=t.noRelative,C=t.noIsolation,S=t.inert,F=t.allowPinchZoom,w=t.as,A=w===void 0?"div":w,N=t.gapMode,P=Nk(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=b,D=w6([n,e]),T=mo(mo({},P),i);return x.createElement(x.Fragment,null,f&&x.createElement(z,{sideCar:Mk,removeScrollBar:m,shards:p,noRelative:v,noIsolation:C,inert:S,setCallbacks:s,allowPinchZoom:!!F,lockRef:n,gapMode:N}),o?x.cloneElement(x.Children.only(c),mo(mo({},T),{ref:D})):x.createElement(A,mo({},T,{className:d,ref:D}),c))});fx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fx.classNames={fullWidth:dg,zeroRight:ug};var E6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function k6(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=E6();return e&&t.setAttribute("nonce",e),t}function A6(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function N6(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var T6=function(){var t=0,e=null;return{add:function(n){t==0&&(e=k6())&&(A6(e,n),N6(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},M6=function(){var t=T6();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Rk=function(){var t=M6(),e=function(n){var a=n.styles,i=n.dynamic;return t(a,i),null};return e},R6={left:0,top:0,right:0,gap:0},yv=function(t){return parseInt(t||"",10)||0},D6=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],a=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[yv(n),yv(a),yv(i)]},P6=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return R6;var e=D6(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,a-n+e[2]-e[0])}},j6=Rk(),Md="data-scroll-locked",L6=function(t,e,n,a){var i=t.left,s=t.top,o=t.right,c=t.gap;return n===void 0&&(n="margin"),`
10  .`.concat(x6,` {
11   overflow: hidden `).concat(a,`;
12   padding-right: `).concat(c,"px ").concat(a,`;
13  }
14  body[`).concat(Md,`] {
15    overflow: hidden `).concat(a,`;
16    overscroll-behavior: contain;
17    `).concat([e&&"position: relative ".concat(a,";"),n==="margin"&&`
18    padding-left: `.concat(i,`px;
19    padding-top: `).concat(s,`px;
20    padding-right: `).concat(o,`px;
21    margin-left:0;
22    margin-top:0;
23    margin-right: `).concat(c,"px ").concat(a,`;
24    `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(a,";
24")].filter(Boolean).join(""),`
25  }
26  
27  .`).concat(ug,` {
28    right: `).concat(c,"px ").concat(a,`;
29  }
30  
31  .`).concat(dg,` {
32    margin-right: `).concat(c,"px ").concat(a,`;
33  }
34  
35  .`).concat(ug," .").concat(ug,` {
36    right: 0 `).concat(a,`;
37  }
38  
39  .`).concat(dg," .").concat(dg,` {
40    margin-right: 0 `).concat(a,`;
41  }
42  
43  body[`).concat(Md,`] {
44    `).concat(v6,": ").concat(c,`px;
45  }
46`)},sC=function(){var t=parseInt(document.body.getAttribute(Md)||"0",10);return isFinite(t)?t:0},I6=function(){x.useEffect(function(){return document.body.setAttribute(Md,(sC()+1).toString()),function(){var t=sC()-1;t<=0?document.body.removeAttribute(Md):document.body.setAttribute(Md,t.toString())}},[])},B6=function(t){var e=t.noRelative,n=t.noImportant,a=t.gapMode,i=a===void 0?"margin":a;I6();var s=x.useMemo(function(){return P6(i)},[i]);return x.createElement(j6,{styles:L6(s,!e,i,n?"":"!important")})},Xy=!1;if(typeof window<"u")try{var Sp=Object.defineProperty({},"passive",{get:function(){return Xy=!0,!0}});window.addEventListener("test",Sp,Sp),window.removeEventListener("test",Sp,Sp)}catch{Xy=!1}var nd=Xy?{passive:!1}:!1,O6=function(t){return t.tagName==="TEXTAREA"},Dk=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!O6(t)&&n[e]==="visible")},U6=function(t){return Dk(t,"overflowY")},z6=function(t){return Dk(t,"overflowX")},oC=function(t,e){var n=e.ownerDocument,a=e;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var i=Pk(t,a);if(i){var s=jk(t,a),o=s[1],c=s[2];if(o>c)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},G6=function(t){var e=t.scrollTop,n=t.scrollHeight,a=t.clientHeight;return[e,n,a]},H6=function(t){var e=t.scrollLeft,n=t.scrollWidth,a=t.clientWidth;return[e,n,a]},Pk=function(t,e){return t==="v"?U6(e):z6(e)},jk=function(t,e){return t==="v"?G6(e):H6(e)},W6=function(t,e){return t==="h"&&e==="rtl"?-1:1},V6=function(t,e,n,a,i){var s=W6(t,window.getComputedStyle(e).direction),o=s*a,c=n.target,d=e.contains(c),m=!1,f=o>0,p=0,b=0;do{if(!c)break;var v=jk(t,c),C=v[0],S=v[1],F=v[2],w=S-F-s*C;(C||w)&&Pk(t,c)&&(p+=w,b+=C);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(f&&Math.abs(p)<1||!f&&Math.abs(b)<1)&&(m=!0),m},Fp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},lC=function(t){return[t.deltaX,t.deltaY]},cC=function(t){return t&&"current"in t?t.current:t},$6=function(t,e){return t[0]===e[0]&&t[1]===e[1]},K6=function(t){return`
47  .block-interactivity-`.concat(t,` {pointer-events: none;}
48  .allow-interactivity-`).concat(t,` {pointer-events: all;}
49`)},Y6=0,rd=[];function q6(t){var e=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),i=x.useState(Y6++)[0],s=x.useState(Rk)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var S=g6([t.lockRef.current],(t.shards||[]).map(cC),!0).filter(Boolean);return S.forEach(function(F){return F.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(F){return F.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=x.useCallback(function(S,F){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!o.current.allowPinchZoom;var w=Fp(S),A=n.current,N="deltaX"in S?S.deltaX:A[0]-w[0],P="deltaY"in S?S.deltaY:A[1]-w[1],z,D=S.target,T=Math.abs(N)>Math.abs(P)?"h":"v";if("touches"in S&&T==="h"&&D.type==="range")return!1;var K=oC(T,D);if(!K)return!0;if(K?z=T:(z=T==="v"?"h":"v",K=oC(T,D)),!K)return!1;if(!a.current&&"changedTouches"in S&&(N||P)&&(a.current=z),!z)return!0;var B=a.current||z;return V6(B,F,S,B==="h"?N:P)},[]),d=x.useCallback(function(S){var F=S;if(!(!rd.length||rd[rd.length-1]!==s)){var w="deltaY"in F?lC(F):Fp(F),A=e.current.filter(function(z){return z.name===F.type&&(z.target===F.target||F.target===z.shadowParent)&&$6(z.delta,w)})[0];if(A&&A.should){F.cancelable&&F.preventDefault();return}
vendor: 6,340 bytes, line 49
49if(!A){var N=(o.current.shards||[]).map(cC).filter(Boolean).filter(function(z){return z.contains(F.target)}),P=N.length>0?c(F,N[0]):!o.current.noIsolation;P&&F.cancelable&&F.preventDefault()}}},[]),m=x.useCallback(function(S,F,w,A){var N={name:S,delta:F,target:w,should:A,shadowParent:J6(w)};e.current.push(N),setTimeout(function(){e.current=e.current.filter(function(P){return P!==N})},1)},[]),f=x.useCallback(function(S){n.current=Fp(S),a.current=void 0},[]),p=x.useCallback(function(S){m(S.type,lC(S),S.target,c(S,t.lockRef.current))},[]),b=x.useCallback(function(S){m(S.type,Fp(S),S.target,c(S,t.lockRef.current))},[]);x.useEffect(function(){return rd.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",d,nd),document.addEventListener("touchmove",d,nd),document.addEventListener("touchstart",f,nd),function(){rd=rd.filter(function(S){return S!==s}),document.removeEventListener("wheel",d,nd),document.removeEventListener("touchmove",d,nd),document.removeEventListener("touchstart",f,nd)}},[]);var v=t.removeScrollBar,C=t.inert;return x.createElement(x.Fragment,null,C?x.createElement(s,{styles:K6(i)}):null,v?x.createElement(B6,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function J6(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const X6=_6(Mk,q6);var V1=x.forwardRef(function(t,e){return x.createElement(fx,mo({},t,{ref:e,sideCar:X6}))});V1.classNames=fx.classNames;var Z6=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ad=new WeakMap,Cp=new WeakMap,_p={},bv=0,Lk=function(t){return t&&(t.host||Lk(t.parentNode))},Q6=function(t,e){return e.map(function(n){if(t.contains(n))return n;var a=Lk(n);return a&&t.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},eB=function(t,e,n,a){var i=Q6(e,Array.isArray(t)?t:[t]);_p[n]||(_p[n]=new WeakMap);var s=_p[n],o=[],c=new Set,d=new Set(i),m=function(p){!p||c.has(p)||(c.add(p),m(p.parentNode))};i.forEach(m);var f=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(b){if(c.has(b))f(b);else try{var v=b.getAttribute(a),C=v!==null&&v!=="false",S=(ad.get(b)||0)+1,F=(s.get(b)||0)+1;ad.set(b,S),s.set(b,F),o.push(b),S===1&&C&&Cp.set(b,!0),F===1&&b.setAttribute(n,"true"),C||b.setAttribute(a,"true")}catch(w){console.error("aria-hidden: cannot operate on ",b,w)}})};return f(e),c.clear(),bv++,function(){o.forEach(function(p){var b=ad.get(p)-1,v=s.get(p)-1;ad.set(p,b),s.set(p,v),b||(Cp.has(p)||p.removeAttribute(a),Cp.delete(p)),v||p.removeAttribute(n)}),bv--,bv||(ad=new WeakMap,ad=new WeakMap,Cp=new WeakMap,_p={})}},Ik=function(t,e,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),i=Z6(t);return i?(a.push.apply(a,Array.from(i.querySelectorAll("[aria-live], script"))),eB(a,i,n,"aria-hidden")):function(){return null}},px="Dialog",[Bk,Ok]=Xa(px),[tB,qs]=Bk(px),Uk=t=>{const{__scopeDialog:e,children:n,open:a,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,c=x.useRef(null),d=x.useRef(null),[m,f]=ds({prop:a,defaultProp:i??!1,onChange:s,caller:px});return r.jsx(tB,{scope:e,triggerRef:c,contentRef:d,contentId:wo(),titleId:wo(),descriptionId:wo(),open:m,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(p=>!p),[f]),modal:o,children:n})};Uk.displayName=px;var zk="DialogTrigger",Gk=x.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,i=qs(zk,n),s=Hn(e,i.triggerRef);return r.jsx(Tn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Y1(i.open),...a,ref:s,onClick:vn(t.onClick,i.onOpenToggle)})});Gk.displayName=zk;var $1="DialogPortal",[nB,Hk]=Bk($1,{forceMount:void 0}),Wk=t=>{const{__scopeDialog:e,forceMount:n,children:a,container:i}=t,s=qs($1,e);return r.jsx(nB,{scope:e,forceMount:n,children:x.Children.map(a,o=>r.jsx(Yi,{present:n||s.open,children:r.jsx(qg,{asChild:!0,container:i,children:o})}))})};Wk.displayName=$1;var Ng="DialogOverlay",Vk=x.forwardRef((t,e)=>{const n=Hk(Ng,t.__scopeDialog),{forceMount:a=n.forceMount,...i}=t,s=qs(Ng,t.__scopeDialog);return s.modal?r.jsx(Yi,{present:a||s.open,children:r.jsx(aB,{...i,ref:e})}):null});Vk.displayName=Ng;var rB=Id("DialogOverlay.RemoveScroll"),aB=x.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,i=qs(Ng,n);return r.jsx(V1,{as:rB,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(Tn.div,{"data-state":Y1(i.open),...a,ref:e,style:{pointerEvents:"auto",...a.style}})})}),vu="DialogContent",$k=x.forwardRef((t,e)=>{const n=Hk(vu,t.__scopeDialog),{forceMount:a=n.forceMount,...i}=t,s=qs(vu,t.__scopeDialog);return r.jsx(Yi,{present:a||s.open,children:s.modal?r.jsx(iB,{...i,ref:e}):r.jsx(sB,{...i,ref:e})})});$k.displayName=vu;var iB=x.forwardRef((t,e)=>{const n=qs(vu,t.__scopeDialog),a=x.useRef(null),i=Hn(e,n.contentRef,a);return x.useEffect(()=>{const s=a.current;if(s)return Ik(s)},[]),r.jsx(Kk,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vn(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:vn(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&s.preventDefault()}),onFocusOutside:vn(t.onFocusOutside,s=>s.preventDefault())})}),sB=x.forwardRef((t,e)=>{const n=qs(vu,t.__scopeDialog),a=x.useRef(!1),i=x.useRef(!1);return r.jsx(Kk,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(a.current||n.triggerRef.current?.focus(),s.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Kk=x.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,c=qs(vu,n),d=x.useRef(null),m=Hn(e,d);return Ak(),r.jsxs(r.Fragment,{children:[r.jsx(W1,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:r.jsx($m,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Y1(c.open
49),...o,ref:m,onDismiss:()=>c.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(lB,{titleId:c.titleId}),r.jsx(uB,{contentRef:d,descriptionId:c.descriptionId})]})]})}),K1="DialogTitle",Yk=x.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,i=qs(K1,n);return r.jsx(Tn.h2,{id:i.titleId,...a,ref:e})});Yk.displayName=K1;var qk="DialogDescription",Jk=x.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,i=qs(qk,n);return r.jsx(Tn.p,{id:i.descriptionId,...a,ref:e})});Jk.displayName=qk;var Xk="DialogClose",Zk=x.forwardRef((t,e)=>{const{__scopeDialog:n,...a}=t,i=qs(Xk,n);return r.jsx(Tn.button,{type:"button",...a,ref:e,onClick:vn(t.onClick,()=>i.onOpenChange(!1))})});Zk.displayName=Xk;function Y1(t){return t?"open":"closed"}var Qk="DialogTitleWarning",[oB,eA]=cD(Qk,{contentName:vu,titleName:K1,docsSlug:"dialog"}),lB=({titleId:t})=>{const e=eA(Qk),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
50
51If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
52
53For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},cB="DialogDescriptionWarning",uB=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eA(cB).contentName}}.`;return x.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},q1=Uk,tA=Gk,J1=Wk,qm=Vk,Jm=$k,Xm=Yk,Zm=Jk,gx=Zk;const nA=q1,rA=tA,dB=J1,aA=x.forwardRef(({className:t,...e},n)=>r.jsx(qm,{className:ln("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}));aA.displayName=qm.displayName;const hB=th("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"}}),X1=x.forwardRef(({side:t="right",className:e,children:n,...a},i)=>r.jsxs(dB,{children:[r.jsx(aA,{}),r.jsxs(Jm,{ref:i,className:ln(hB({side:t}),e),...a,children:[n,r.jsxs(gx,{className:"absolute right-4 top-4 roun
53ded-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:[r.jsx(gr,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));X1.displayName=Jm.displayName;const mB=x.forwardRef(({className:t,...e},n)=>r.jsx(Xm,{ref:n,className:ln("text-lg font-semibold text-foreground",t),...e}));mB.displayName=Xm.displayName;const fB=x.forwardRef(({className:t,...e},n)=>r.jsx(Zm,{ref:n,className:ln("text-sm text-muted-foreground",t),...e}));fB.displayName=Zm.displayName;const pB={SIM_RESOLUTION:64,DYE_RESOLUTION:512,DENSITY_DISSIPATION:1,VELOCITY_DISSIPATION:.1,PRESSURE:.8,PRESSURE_ITERATIONS:30,CURL:40,SPLAT_RADIUS:1,SPLAT_FORCE:5e3,SHADING:!0,COLORFUL:!0,COLOR_UPDATE_SPEED:4,BLOOM:!0,BLOOM_ITERATIONS:4,BLOOM_RESOLUTION:128,BLOOM_INTENSITY:.8,BLOOM_THRESHOLD:.6,BLOOM_SOFT_KNEE:.7,TRANSPARENT:!0};function Z1({className:t="",config:e,autoSplatInterval:n=2e3,requireFocus:a=!0,splatPattern:i="circle",blendMode:s="normal"}){const o=x.useRef(null),c=x.useRef(null),d=x.useRef(null),m=x.useRef(null),f=x.useCallback((p,b,v,C,S)=>{const F={alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!1};let w=p.getContext("webgl2",F);const A=!!w;if(w||(w=p.getContext("webgl",F)||p.getContext("experimental-webgl",F)),!w)return console.warn("WebGL not supported"),null;let N=null,P;A?(w.getExtension("EXT_color_buffer_float"),P=w.getExtension("OES_texture_float_linear")):(N=w.getExtension("OES_texture_half_float"),P=w.getExtension("OES_texture_half_float_linear")),w.clearColor(0,0,0,1);const z=A?w.HALF_FLOAT:N?.HALF_FLOAT_OES??w.HALF_FLOAT;function D(le,Ne,Oe,at){if(!T(le,Ne,Oe,at))switch(Ne){case le.R16F:return D(le,le.RG16F,le.RG,at);case le.RG16F:return D(le,le.RGBA16F,le.RGBA,at);default:return null}return{internalFormat:Ne,format:Oe}}function T(le,Ne,Oe,at){const xt=le.createTexture();le.bindTexture(le.TEXTURE_2D,xt),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MIN_FILTER,le.NEAREST),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MAG_FILTER,le.NEAREST),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_S,le.CLAMP_TO_EDGE),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_T,le.CLAMP_TO_EDGE),le.texImage2D(le.TEXTURE_2D,0,Ne,4,4,0,Oe,at,null);const Qt=le.createFramebuffer();return le.bindFramebuffer(le.FRAMEBUFFER,Qt),le.framebufferTexture2D(le.FRAMEBUFFER,le.COLOR_ATTACHMENT0,le.TEXTURE_2D,xt,0),le.checkFramebufferStatus(le.FRAMEBUFFER)===le.FRAMEBUFFER_COMPLETE}let K,B,k;A?(K=D(w,w.RGBA16F,w.RGBA,z),B=D(w,w.RG16F,w.RG,z),k=D(w,w.R16F,w.RED,z)):(K=D(w,w.RGBA,w.RGBA,z),B=D(w,w.RGBA,w.RGBA,z),k=D(w,w.RGBA,w.RGBA,z));const O={formatRGBA:K,formatRG:B,formatR:k,halfFloatTexType:z,supportLinearFiltering:P},I=/Mobi|Android/i.test(navigator.userAgent),j={...b};I&&(j.DYE_RESOLUTION=512),O.supportLinearFiltering||(j.DYE_RESOLUTION=512,j.SHADING=!1,j.BLOOM=!1);function U(){return{id:-1,texcoordX:0,texcoordY:0,prevTexcoordX:0,prevTexcoordY:0,startTexcoordX:0,startTexcoordY:0,deltaX:0,deltaY:0,down:!1,moved:!1,color:{r:.1,g:0,b:1}}}const q=[U()],Y=[];function W(le,Ne,Oe){Oe&&(Ne=Oe.map(Qt=>`#define ${Qt}
54`).join("")+Ne);const at=w.createShader(le);if(w.shaderSource(at,Ne),w.compileShader(at),!w.getShaderParameter(at,w.COMPILE_STATUS))throw w.getShaderInfoLog(at);return at}function H(le,Ne){const Oe=w.createProgram();if(w.attachShader(Oe,le),w.attachShader(Oe,Ne),w.linkProgram(Oe),!w.getProgramParameter(Oe,w.LINK_STATUS))throw w.getProgramInfoLog(Oe);return Oe}function J(le){const Ne={},Oe=w.getProgramParameter(le,w.ACTIVE_UNIFORMS);for(let at=0;at<Oe;at++){const xt=w.getActiveUniform(le,at).name;Ne[xt]=w.getUniformLocation(le,xt)}return Ne}function ie(le){if(le.length===0)return 0;let Ne=0;for(let Oe=0;Oe<le.length;Oe++)Ne=(Ne<<5)-Ne+le.charCodeAt(Oe),Ne|=0;return Ne}class Q{program;uniforms;constructor(Ne,Oe){this.program=H(Ne,Oe),this.uniforms=J(this.program)}bind(){w.useProgram(this.program)}}class ve{vertexShader;fragmentShaderSource;programs={};activeProgram=null;uniforms={};constructor(Ne,Oe){this.vertexShader=Ne,this.fragmentShaderSource=Oe}setKeywords(Ne){let Oe=0;for(const xt of Ne)Oe+=ie(xt);let at=this.programs[Oe];
54if(!at){const xt=W(w.FRAGMENT_SHADER,this.fragmentShaderSource,Ne);at=H(this.vertexShader,xt),this.programs[Oe]=at}at!==this.activeProgram&&(this.uniforms=J(at),this.activeProgram=at)}bind(){w.useProgram(this.activeProgram)}}const pe=W(w.VERTEX_SHADER,`
55      precision highp float;
56      attribute vec2 aPosition;
57      varying vec2 vUv;
58      varying vec2 vL;
59      varying vec2 vR;
60      varying vec2 vT;
61      varying vec2 vB;
62      uniform vec2 texelSize;
63
64      void main () {
65        vUv = aPosition * 0.5 + 0.5;
66        vL = vUv - vec2(texelSize.x, 0.0);
67        vR = vUv + vec2(texelSize.x, 0.0);
68        vT = vUv + vec2(0.0, texelSize.y);
69        vB = vUv - vec2(0.0, texelSize.y);
70        gl_Position = vec4(aPosition, 0.0, 1.0);
71      }
72    `),Me=W(w.VERTEX_SHADER,`
73      precision highp float;
74      attribute vec2 aPosition;
75      varying vec2 vUv;
76      varying vec2 vL;
77      varying vec2 vR;
78      uniform vec2 texelSize;
79
80      void main () {
81        vUv = aPosition * 0.5 + 0.5;
82        float offset = 1.33333333;
83        vL = vUv - texelSize * offset;
84        vR = vUv + texelSize * offset;
85        gl_Position = vec4(aPosition, 0.0, 1.0);
86      }
87    `),We=W(w.FRAGMENT_SHADER,`
88      precision mediump float;
89      precision mediump sampler2D;
90      varying vec2 vUv;
91      varying vec2 vL;
92      varying vec2 vR;
93      uniform sampler2D uTexture;
94
95      void main () {
96        vec4 sum = texture2D(uTexture, vUv) * 0.29411764;
97        sum += texture2D(uTexture, vL) * 0.35294117;
98        sum += texture2D(uTexture, vR) * 0.35294117;
99        gl_FragColor = sum;
100      }
101    `),Ae=W(w.FRAGMENT_SHADER,`
102      precision mediump float;
103      precision mediump sampler2D;
104      varying highp vec2 vUv;
105      uniform sampler2D uTexture;
106
107      void main () {
108        gl_FragColor = texture2D(uTexture, vUv);
109      }
110    `),Ce=W(w.FRAGMENT_SHADER,`
111      precision mediump float;
112      precision mediump sampler2D;
113      varying highp vec2 vUv;
114      uniform sampler2D uTexture;
115      uniform float value;
116
117      void main () {
118        gl_FragColor = value * texture2D(uTexture, vUv);
119      }
120    `),He=W(w.FRAGMENT_SHADER,`
121      precision highp float;
122      precision highp sampler2D;
123      varying vec2 vUv;
124      uniform sampler2D uTarget;
125      uniform float aspectRatio;
126      uniform vec3 color;
127      uniform vec2 point;
128      uniform float radius;
129
130      void main () {
131        vec2 p = vUv - point.xy;
132        p.x *= aspectRatio;
133        vec3 splat = exp(-dot(p, p) / radius) * color;
134        vec3 base = texture2D(uTarget, vUv).xyz;
135        gl_FragColor = vec4(base + splat, 1.0);
136      }
137    `),Ct=W(w.FRAGMENT_SHADER,`
138      precision highp float;
139      precision highp sampler2D;
140      varying vec2 vUv;
141      uniform sampler2D uVelocity;
142      uniform sampler2D uSource;
143      uniform vec2 texelSize;
144      uniform vec2 dyeTexelSize;
145      uniform float dt;
146      uniform float dissipation;
147
148      vec4 bilerp (sampler2D sam, vec2 uv, vec2 tsize) {
149        vec2 st = uv / tsize - 0.5;
150        vec2 iuv = floor(st);
151        vec2 fuv = fract(st);
152        vec4 a = texture2D(sam, (iuv + vec2(0.5, 0.5)) * tsize);
153        vec4 b = texture2D(sam, (iuv + vec2(1.5, 0.5)) * tsize);
154        vec4 c = texture2D(sam, (iuv + vec2(0.5, 1.5)) * tsize);
155        vec4 d = texture2D(sam, (iuv + vec2(1.5, 1.5)) * tsize);
156        return mix(mix(a, b, fuv.x), mix(c, d, fuv.x), fuv.y);
157      }
158
159      void main () {
160        #ifdef MANUAL_FILTERING
161          vec2 coord = vUv - dt * bilerp(uVelocity, vUv, texelSize).xy * texelSize;
162          vec4 result = bilerp(uSource, coord, dyeTexelSize);
163        #else
164          vec2 coord = vUv - dt * texture2D(uVelocity, vUv).xy * texelSize;
165          vec4 result = texture2D(uSource, coord);
166        #endif
167        float decay = 1.0 + dissipation * dt;
168        gl_FragColor = result / decay;
169      }
170    `,O.supportLinearFiltering?null:["MANUAL_FILTERING"]),bt=W(w.FRAGMENT_SHADER,`
171      precision mediump float;
172      precision mediump sampler2D;
173      varying highp vec2 vUv;
174      varying highp vec2 vL;
175      varying highp vec2 vR;
176      varying highp vec2 vT;
177      varying highp vec2 vB;
178      uniform sampler2D uVelocity;
179
180      void main () {
181        float L = texture2D(uVelocity, vL).x;
182        float R = texture2D(uVelocity, vR).x;
183        float T = texture2D(uVelocity, vT).y;
184        float B = texture2D(uVelocity, vB).y;
185        vec2 C = texture2D(uVelocity, vUv).xy;
186        if (vL.x < 0.0) { L = -C.x; }
187        if (vR.x > 1.0) { R = -C.x; }
188        if (vT.y > 1.0) { T = -C.y; }
189        if (vB.y < 0.0) { B = -C.y; }
190        float div = 0.5 * (R - L + T - B);
191        gl_FragColor = vec4(div, 0.0, 0.0, 1.0);
192      }
193    `),Rt=W(w.FRAGMENT_SHADER,`
194      precision mediump float;
195      precision mediump sampler2D;
196      varying highp vec2 vUv;
197      varying highp vec2 vL;
198      varying highp vec2 vR;
199      varying highp vec2 vT;
200      varying highp vec2 vB;
201      uniform sampler2D uVelocity;
202
203      void main () {
204        float L = texture2D(uVelocity, vL).y;
205        float R = texture2D(uVelocity, vR).y;
206        float T = texture2D(uVelocity, vT).x;
207        float B = texture2D(uVelocity, vB).x;
208        float vorticity = R - L - T + B;
209        gl_FragColor = vec4(0.5 * vorticity, 0.0, 0.0, 1.0);
210      }
211    `),zt=W(w.FRAGMENT_SHADER,`
212      precision highp float;
213      precision highp sampler2D;
214      varying vec2 vUv;
215      varying vec2 vL;
216      varying vec2 vR;
217      varying vec2 vT;
218      varying vec2 vB;
219      uniform sampler2D uVelocity;
220      uniform sampler2D uCurl;
221      uniform float curl;
222      uniform float dt;
223
224      void main () {
225        float L = texture2D(uCurl, vL).x;
226        float R = texture2D(uCurl, vR).x;
227        float T = texture2D(uCurl, vT).x;
228        float B = texture2D(uCurl, vB).x;
229        float C = texture2D(uCurl, vUv).x;
230        vec2 force = 0.5 * vec2(abs(T) - abs(B), abs(R) - abs(L));
231        force /= length(force) + 0.0001;
232        force *= curl * C;
233        force.y *= -1.0;
234        vec2 vel = texture2D(uVelocity, vUv).xy;
235        gl_FragColor = vec4(vel + force * dt, 0.0, 1.0);
236      }
237    `),Ut=W(w.FRAGMENT_SHADER,`
238      precision mediump float;
239      precision mediump sampler2D;
240      varying highp vec2 vUv;
241      varying highp vec2 vL;
242      varying highp vec2 vR;
243      varying highp vec2 vT;
244      varying highp vec2 vB;
245      uniform sampler2D uPressure;
246      uniform sampler2D uDivergence;
247
248      void main () {
249        float L = texture2D(uPressure, vL).x;
250        float R = texture2D(uPressure, vR).x;
251        float T = texture2D(uPressure, vT).x;
252        float B = texture2D(uPressure, vB).x;
253        float C = texture2D(uPressure, vUv).x;
254        float divergence = texture2D(uDivergence, vUv).x;
255        float pressure = (L + R + B + T - divergence) * 0.25;
256        gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0);
257      }
258    `),Bt=W(w.FRAGMENT_SHADER,`
259      precision mediump float;
260      precision mediump sampler2D;
261      varying highp vec2 vUv;
262      varying highp vec2 vL;
263      varying highp vec2 vR;
264      varying highp vec2 vT;
265      varying highp vec2 vB;
266      uniform sampler2D uPressure;
267      uniform sampler2D uVelocity;
268
269      void main () {
270        float L = texture2D(uPressure, vL).x;
271        float R = texture2D(uPressure, vR).x;
272        float T = texture2D(uPressure, vT).x;
273        float B = texture2D(uPressure, vB).x;
274        vec2 velocity = texture2D(uVelocity, vUv).xy;
275        velocity.xy -= vec2(R - L, T - B);
276        gl_FragColor = vec4(velocity, 0.0, 1.0);
277      }
278    `),re=W(w.FRAGMENT_SHADER,`
279      precision mediump float;
280      precision mediump sampler2D;
281      varying vec2 vUv;
282      uniform sampler2D uTexture;
283      uniform vec3 curve;
284      uniform float threshold;
285
286      void main () {
287        vec3 c = texture2D(uTexture, vUv).rgb;
288        float br = max(c.r, max(c.g, c.b));
289        float rq = clamp(br - curve.x, 0.0, curve.y);
290        rq = curve.z * rq * rq;
291        c *= max(rq, br - threshold) / max(br, 0.0001);
292        gl_FragColor = vec4(c, 0.0);
293      }
294    `),wt=W(w.FRAGMENT_SHADER,`
295      precision mediump float;
296      precision mediump sampler2D;
297      varying vec2 vL;
298      varying vec2 vR;
299      varying vec2 vT;
300      varying vec2 vB;
301      uniform sampler2D uTexture;
302
303      void main () {
304        vec4 sum = vec4(0.0);
305        sum += texture2D(uTexture, vL);
306        sum += texture2D(uTexture, vR);
307        sum += texture2D(uTexture, vT);
308        sum += texture2D(uTexture, vB);
309        sum *= 0.25;
310        gl_FragColor = sum;
311      }
312    `),Nt=W(w.FRAGMENT_SHADER,`
313      precision mediump float;
314      precision mediump sampler2D;
315      varying vec2 vL;
316      varying vec2 vR;
317      varying vec2 vT;
318      varying vec2 vB;
319      uniform sampler2D uTexture;
320      uniform float intensity;
321
322      void main () {
323        vec4 sum = vec4(0.0);
324        sum += texture2D(uTexture, vL);
325        sum += texture2D(uTexture, vR);
326        sum += texture2D(uTexture, vT);
327        sum += texture2D(uTexture, vB);
328        sum *= 0.25;
329        gl_FragColor = sum * intensity;
330      }
331    `),vt=`
332      precision highp float;
333      precision highp sampler2D;
334      varying vec2 vUv;
335      varying vec2 vL;
336      varying vec2 vR;
337      varying vec2 vT;
338      varying vec2 vB;
339      uniform sampler2D uTexture;
340      uniform sampler2D uBloom;
341      uniform vec2 texelSize;
342
343      vec3 linearToGamma (vec3 color) {
344        color = max(color, vec3(0));
345        return max(1.055 * pow(color, vec3(0.416666667)) - 0.055, vec3(0));
346      }
347
348      void main () {
349        vec3 c = texture2D(uTexture, vUv).rgb;
350
351        #ifdef SHADING
352          vec3 lc = texture2D(uTexture, vL).rgb;
353          vec3 rc = texture2D(uTexture, vR).rgb;
354          vec3 tc = texture2D(uTexture, vT).rgb;
355          vec3 bc = texture2D(uTexture, vB).rgb;
356          float dx = length(rc) - length(lc);
357          float dy = length(tc) - length(bc);
358          vec3 n = normalize(vec3(dx, dy, length(texelSize)));
359          vec3 l = vec3(0.0, 0.0, 1.0);
360          float diffuse = clamp(dot(n, l) + 0.7, 0.7, 1.0);
361          c *= diffuse;
362        #endif
363
364        #ifdef BLOOM
365          vec3 bloom = texture2D(uBloom, vUv).rgb;
366          bloom = linearToGamma(bloom);
367          c += bloom;
368        #endif
369
370        float a = max(c.r, max(c.g, c.b));
371        gl_FragColor = vec4(c, a);
372      }
373    `;new Q(Me,We);const Tt=new Q(pe,Ae),Wt=new Q(pe,Ce),Dt=new Q(pe,He),jt=new Q(pe,Ct),he=new Q(pe,bt),ee=new Q(pe,Rt),ze=new Q(pe,zt),Ve=new Q(pe,Ut),lt=new Q(pe,Bt),qe=new Q(pe,re),It=new Q(pe,wt),gt=new Q(pe,Nt),Ee=new ve(pe,vt);w.bindBuffer(w.ARRAY_BUFFER,w.createBuffer()),w.bufferData(w.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),w.STATIC_DRAW),w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,w.createBuffer()),w.bufferData(w.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),w.STATIC_DRAW),w.vertexAttribPointer(0,2,w.FLOAT,!1,0,0),w.enableVertexAttribArray(0);function Je(le){w.bindFramebuffer(w.FRAMEBUFFER,le),w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}function $e(le,Ne,Oe,at,xt,Qt){w.activeTexture(w.TEXTURE0);const Gt=w.createTexture();w.bindTexture(w.TEXTURE_2D,Gt),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MIN_FILTER,Qt),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_MAG_FILTER,Qt),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_S,w.CLAMP_TO_EDGE),w.texParameteri(w.TEXTURE_2D,w.TEXTURE_WRAP_T,w.CLAMP_TO_EDGE),w.texImage2D(w.TEXTURE_2D,0,Oe,le,Ne,0,at,xt,null);const Xt=w.createFramebuffer();return w.bindFramebuffer(w.FRAMEBUFFER,Xt),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,Gt,0),w.viewport(0,0,le,Ne),w.clear(w.COLOR_BUFFER_BIT),{texture:Gt,fbo:Xt,width:le,height:Ne,texelSizeX:1/le,texelSizeY:1/Ne,attach(Zt){return w.activeTexture(w.TEXTURE0+Zt),w.bindTexture(w.TEXTURE_2D,Gt),Zt}}}function Xe(le,Ne,Oe,at,xt,Qt){let Gt=$e(le,Ne,Oe,at,xt,Qt),Xt=$e(le,Ne,Oe,at,xt,Qt);return{width:le,height:Ne,texelSizeX:Gt.texelSizeX,texelSizeY:Gt.texelSizeY,get read(){return Gt},set read(Zt){Gt=Zt},get write(){return Xt},set write(Zt){Xt=Zt},swap(){const Zt=Gt;Gt=Xt,Xt=Zt}}}function X(le,Ne,Oe,at,xt,Qt,Gt){const Xt=$e(Ne,Oe,at,xt,Qt,Gt);return Tt.bind(),w.uniform1i(Tt.uniforms.uTexture,le.attach(0)),Je(Xt.fbo),Xt}function ke(le,Ne,Oe,at,xt,Qt,Gt){return le.width===Ne&&le.height===Oe||(le.read=X(le.read,Ne,Oe,at,xt,Qt,Gt),le.write=$e(Ne,Oe,at,xt,Qt,Gt),le.width=Ne,le.height=Oe,le.texelSizeX=1/Ne,le.texelSizeY=1/Oe),le}function De(le){let Ne=w.drawingBufferWidth/w.drawingBufferHeight;Ne<1&&(Ne=1/Ne);const Oe=Math.round(le),at=Math.round(le*Ne);return w.drawingBufferWidth>w.drawingBufferHeight?{width:at,height:Oe}:{width:Oe,height:at}}function oe(le){const Ne=window.devicePixelRatio||1;return Math.floor(le*Ne)}let te=null,ye=null,Re=null,Le=null,fe=null,Se=null,Be=[],Ze=Date.now(),ue=0,rt=!0;function je(){const le=De(j.SIM_RESOLUTION),Ne=De(j.DYE_RESOLUTION),Oe=O.halfFloatTexType,at=O.formatRGBA,xt=O.formatRG,Qt=O.formatR,Gt=O.supportLinearFiltering?w.LINEAR:w.NEAREST;te?te=ke(te,Ne.width,Ne.height,at.internalFormat,at.format,Oe,Gt):te=Xe(Ne.width,Ne.height,at.internalFormat,at.format,Oe,Gt),ye?ye=ke(ye,le.width,le.height,xt.internalFormat,xt.format,Oe,Gt):ye=Xe(le.width,le.height,xt.internalFormat,xt.format,Oe,Gt),Re=$e(le.width,le.height,Qt.internalFormat,Qt.format,Oe,w.NEAREST),Le=$e(le.width,le.height,Qt.internalFormat,Qt.format,Oe,w.NEAREST),fe=Xe(le.width,le.height,Qt.internalFormat,Qt.format,Oe,w.NEAREST),_t()}function _t(){const le=De(j.BLOOM_RESOLUTION),Ne=O.halfFloatTexType,Oe=O.formatRGBA,at=O.supportLinearFiltering?w.LINEAR:w.NEAREST;Se=$e(le.width,le.height,Oe.internalFormat,Oe.format,Ne,at),Be=[];for(let xt=0;xt<j.BLOOM_ITERATIONS;xt++){const Qt=le.width>>xt+1,Gt=le.height>>xt+1;if(Qt<2||Gt<2)break;const Xt=$e(Qt,Gt,Oe.internalFormat,Oe.format,Ne,at);Be.push(Xt)}}function Kt(){const le=[];j.SHADING&&le.push("SHADING"),j.BLOOM&&le.push("BLOOM"),Ee.setKeywords(le)}function gn(){const le=oe(p.clientWidth),Ne=oe(p.clientHeight);return p.width!==le||p.height!==Ne?(p.width=le,p.height=Ne,!0):!1}function _e(le,Ne,Oe){let at=0,xt=0,Qt=0;const Gt=Math.floor(le*6),Xt=le*6-Gt,Zt=Oe*(1-Ne),_n=Oe*(1-Xt*Ne),rn=Oe*(1-(1-Xt)*Ne);switch(Gt%6){case 0:at=Oe,xt=rn,Qt=Zt;break;case 1:at=_n,xt=Oe,Qt=Zt;break;case 2:at=Zt,xt=Oe,Qt=rn;break;case 3:at=Zt,xt=_n,Qt=Oe;break;case 4:at=rn,xt=Zt,Qt=Oe;break;case 5:at=Oe,xt=Zt,Qt=_n;break}return{r:at,g:xt,b:Qt}}function et(){const le=_e(Math.random(),1,1);return le.r*=.15,le.g*=.15,le.b*=.15,le}function Ge(le,Ne,Oe){const at=Oe-Ne;return(le-Ne)%at+Ne}function ht(le){const Ne=p.width/p.height;return Ne>1&&(le*=Ne),le}function ft(le){const Ne=p.width/p.height;return Ne<1&&(le*=Ne),le}function Mt(le){const Ne=p.width/p.height;return Ne>1&&(le/=Ne),le}function be(le,Ne,Oe,at,xt){w.viewport(0,0,ye.width,ye.height),Dt.bind(),w.uniform1i(Dt.uniforms.uTarget,ye.read.attach(0)),w.uniform1f(Dt.uniforms.aspectRatio,p.width/p.height),w.uniform2f(Dt.uniforms.point,le,Ne),w.uniform3f(Dt.uniforms.color,Oe,at,0),w.uniform1f(Dt.uniforms.radius,ht(j.SPLAT_RADIUS/100)),Je(ye.write.fbo),ye.swap(),w.viewport(0,0,te.width,te.height),w.uniform1i(Dt.uniforms.uTarget,te.read.attach(0)),w.uniform3f(Dt.uniforms.color,xt.r,xt.g,xt.b),Je(te.write.fbo),te.swap()}function Z(le){for(let Ne=0;Ne<le;Ne++){const Oe=et();Oe.r*=10,Oe.g*=10,Oe.b*=10;const at=Math.random(),xt=Math.random(),Qt=1e3*(Math.random()-.5),Gt=1e3*(Math.random()-.5);be(at,xt,Qt,Gt,Oe)}}function it(){if(document.hidden||C&&!document.hasFocus())return;let le=Math.random()*.4+.5,Ne=Math.random()*.4+.5,Oe=-le*.5,at=-Ne*.5,xt=et();xt.r*=10,xt.g*=10,xt.b*=10,be(le,Ne,Oe*1e3,at*1e3,xt),le+=Oe*.1,Ne+=at*.1,le=1-le,Ne=1-Ne,Oe=-Oe,at=-at,xt=et(),xt.r*=10,xt.g*=10,xt.b*=10,be(le,Ne,Oe*1e3,at*1e3,xt)}function we(){if(document.hidden||C&&!document.hasFocus())return;const le=2400,Ne=()=>le*(.75+Math.random()*.5),Oe=Math.random();let at=et();at.r*=10,at.g*=10,at.b*=10;const xt=Math.random()*.1,Qt=Ne(),Gt=(Math.random()-.5)*200;
373be(xt,Oe,Qt,Gt,at),at=et(),at.r*=10,at.g*=10,at.b*=10;const Xt=.9+Math.random()*.1,Zt=Math.random(),_n=-Ne(),rn=(Math.random()-.5)*200;be(Xt,Zt,_n,rn,at)}const st=S==="horizontal"?we:it;function Lt(le){w.disable(w.BLEND),w.viewport(0,0,ye.width,ye.height),ee.bind(),w.uniform2f(ee.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),w.uniform1i(ee.uniforms.uVelocity,ye.read.attach(0)),Je(Le.fbo),ze.bind(),w.uniform2f(ze.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),w.uniform1i(ze.uniforms.uVelocity,ye.read.attach(0)),w.uniform1i(ze.uniforms.uCurl,Le.attach(1)),w.uniform1f(ze.uniforms.curl,j.CURL),w.uniform1f(ze.uniforms.dt,le),Je(ye.write.fbo),ye.swap(),he.bind(),w.uniform2f(he.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),w.uniform1i(he.uniforms.uVelocity,ye.read.attach(0)),Je(Re.fbo),Wt.bind(),w.uniform1i(Wt.uniforms.uTexture,fe.read.attach(0)),w.uniform1f(Wt.uniforms.value,j.PRESSURE),Je(fe.write.fbo),fe.swap(),Ve.bind(),w.uniform2f(Ve.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),w.uniform1i(Ve.uniforms.uDivergence,Re.attach(0));for(let Oe=0;Oe<j.PRESSURE_ITERATIONS;Oe++)w.uniform1i(Ve.uniforms.uPressure,fe.read.attach(1)),Je(fe.write.fbo),fe.swap();lt.bind(),w.uniform2f(lt.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),w.uniform1i(lt.uniforms.uPressure,fe.read.attach(0)),w.uniform1i(lt.uniforms.uVelocity,ye.read.attach(1)),Je(ye.write.fbo),ye.swap(),jt.bind(),w.uniform2f(jt.uniforms.texelSize,ye.texelSizeX,ye.texelSizeY),O.supportLinearFiltering||w.uniform2f(jt.uniforms.dyeTexelSize,ye.texelSizeX,ye.texelSizeY);const Ne=ye.read.attach(0);w.uniform1i(jt.uniforms.uVelocity,Ne),w.uniform1i(jt.uniforms.uSource,Ne),w.uniform1f(jt.uniforms.dt,le),w.uniform1f(jt.uniforms.dissipation,j.VELOCITY_DISSIPATION),Je(ye.write.fbo),ye.swap(),w.viewport(0,0,te.width,te.height),O.supportLinearFiltering||w.uniform2f(jt.uniforms.dyeTexelSize,te.texelSizeX,te.texelSizeY),w.uniform1i(jt.uniforms.uVelocity,ye.read.attach(0)),w.uniform1i(jt.uniforms.uSource,te.read.attach(1)),w.uniform1f(jt.uniforms.dissipation,j.DENSITY_DISSIPATION),Je(te.write.fbo),te.swap()}function Ot(le,Ne){if(Be.length<2)return;let Oe=Ne;w.disable(w.BLEND),qe.bind();const at=j.BLOOM_THRESHOLD*j.BLOOM_SOFT_KNEE+1e-4,xt=j.BLOOM_THRESHOLD-at,Qt=at*2,Gt=.25/at;w.uniform3f(qe.uniforms.curve,xt,Qt,Gt),w.uniform1f(qe.uniforms.threshold,j.BLOOM_THRESHOLD),w.uniform1i(qe.uniforms.uTexture,le.attach(0)),w.viewport(0,0,Oe.width,Oe.height),Je(Oe.fbo),It.bind();for(let Xt=0;Xt<Be.length;Xt++){const Zt=Be[Xt];w.uniform2f(It.uniforms.texelSize,Oe.texelSizeX,Oe.texelSizeY),w.uniform1i(It.uniforms.uTexture,Oe.attach(0)),w.viewport(0,0,Zt.width,Zt.height),Je(Zt.fbo),Oe=Zt}w.blendFunc(w.ONE,w.ONE),w.enable(w.BLEND);for(let Xt=Be.length-2;Xt>=0;Xt--){const Zt=Be[Xt];w.uniform2f(It.uniforms.texelSize,Oe.texelSizeX,Oe.texelSizeY),w.uniform1i(It.uniforms.uTexture,Oe.attach(0)),w.viewport(0,0,Zt.width,Zt.height),Je(Zt.fbo),Oe=Zt}w.disable(w.BLEND),gt.bind(),w.uniform2f(gt.uniforms.texelSize,Oe.texelSizeX,Oe.texelSizeY),w.uniform1i(gt.uniforms.uTexture,Oe.attach(0)),w.uniform1f(gt.uniforms.intensity,j.BLOOM_INTENSITY),w.viewport(0,0,Ne.width,Ne.height),Je(Ne.fbo)}function Et(le){j.BLOOM&&Ot(te.read,Se),w.blendFunc(w.ONE,w.ONE_MINUS_SRC_ALPHA),w.enable(w.BLEND);const Ne=w.drawingBufferWidth,Oe=w.drawingBufferHeight;w.viewport(0,0,Ne,Oe),tt(null,Ne,Oe)}function tt(le,Ne,Oe){Ee.bind(),j.SHADING&&w.uniform2f(Ee.uniforms.texelSize,1/Ne,1/Oe),w.uniform1i(Ee.uniforms.uTexture,te.read.attach(0)),j.BLOOM&&w.uniform1i(Ee.uniforms.uBloom,Se.attach(1)),Je(le)}function ge(){const le=Date.now();let Ne=(le-Ze)/1e3;return Ne=Math.min(Ne,.016666),Ze=le,Ne*=.25,Ne>1&&(Ne=1),Ne}function $(le){j.COLORFUL&&(ue+=le*j.COLOR_UPDATE_SPEED,ue>=1&&(ue=Ge(ue,0,1),q.forEach(Ne=>{Ne.color=et()})))}const xe=10;let ne=0;function me(){Y.length>0&&Z(Y.pop());const le=Date.now(),Ne=le-ne>=xe;q.forEach(Oe=>{if(Oe.down&&Ne){const at=Oe.texcoordX-Oe.startTexcoordX,xt=Oe.texcoordY-Oe.startTexcoordY,Qt=Math.sqrt(at*at+xt*xt);if(Qt>.005){const Zt=2400*Math.min(Qt*10,2),_n=at/Qt*Zt,rn=xt/Qt*Zt,or={r:Oe.color.r*.5,g:Oe.color.g*.5,b:Oe.color.b*.5};be(Oe.texcoordX,Oe.texcoordY,_n,rn,or),Oe.startTexcoordX=Oe.texcoordX,Oe.startTexcoordY=Oe.texcoordY}}}),Ne&&q.some(Oe=>Oe.down)&&(ne=le)}let de=!0;function Ie(){const le=de;de=!document.hidden,de&&!le&&(Ze=Date.now())}document.addEventListener("visibilitychange",Ie);function Ke(){if(!rt)return;if(!de){c.current=requestAnimationFrame(Ke);return}const le=ge();gn()&&je(),$(le),me(),Lt(le),Et(),c.current=requestAnimationFrame(Ke)}function ut(le,Ne,Oe,at){le.id=Ne,le.down=!0,le.moved=!1,le.texcoordX=Oe/p.width,le.texcoordY=1-at/p.height,le.prevTexcoordX=le.texcoordX,le.prevTexcoordY=le.texcoordY,le.startTexcoordX=le.texcoordX,le.startTexcoordY=le.texcoordY,le.deltaX=0,le.deltaY=0,le.color=et()}function ae(le,Ne,Oe){le.prevTexcoordX=le.texcoordX,le.prevTexcoordY=le.texcoordY,le.texcoordX=Ne/p.width,le.texcoordY=1-Oe/p.height,le.deltaX=ft(le.texcoordX-le.prevTexcoordX),le.deltaY=Mt(le.texcoordY-le.prevTexcoordY),le.moved=Math.abs(le.deltaX)>0||Math.abs(le.deltaY)>0}function Te(le){const Ne=le.texcoordX-le.startTexcoordX,Oe=le.texcoordY-le.startTexcoordY,at=Math.sqrt(Ne*Ne+Oe*Oe);if(at>.01){const Gt=2400*Math.min(at*10,2),Xt=Ne/at*Gt,Zt=Oe/at*Gt,_n={r:le.color.r*.5,g:le.color.g*.5,b:le.color.b*.5};be(le.texcoordX,le.texcoordY,Xt,Zt,_n)}le.down=!1}const Qe=le=>{const Ne=oe(le.offsetX),Oe=oe(le.offsetY);let at=q.find(xt=>xt.id===-1);at||(at=U()),ut(at,-1,Ne,Oe)}
373,ot=le=>{const Ne=q[0];if(!Ne.down)return;const Oe=oe(le.offsetX),at=oe(le.offsetY);ae(Ne,Oe,at)},pt=()=>{Te(q[0])},ct=le=>{const Ne=le.targetTouches;for(;Ne.length>=q.length;)q.push(U());for(let Oe=0;Oe<Ne.length;Oe++){const at=oe(Ne[Oe].pageX),xt=oe(Ne[Oe].pageY);ut(q[Oe+1],Ne[Oe].identifier,at,xt)}},Vt=le=>{const Ne=le.targetTouches;for(let Oe=0;Oe<Ne.length;Oe++){const at=q[Oe+1];if(!at?.down)continue;const xt=oe(Ne[Oe].pageX),Qt=oe(Ne[Oe].pageY);ae(at,xt,Qt)}},sn=le=>{const Ne=le.changedTouches;for(let Oe=0;Oe<Ne.length;Oe++){const at=q.find(xt=>xt.id===Ne[Oe].identifier);at&&Te(at)}};if(p.addEventListener("mousedown",Qe),p.addEventListener("mousemove",ot),window.addEventListener("mouseup",pt),p.addEventListener("touchstart",ct),p.addEventListener("touchmove",Vt,!1),window.addEventListener("touchend",sn),gn(),Kt(),je(),S==="horizontal")for(let le=0;le<5;le++)we();else Z(20);const cn=.016;for(let le=0;le<30;le++)Lt(cn);let St=null;return v>0&&(St=setInterval(st,v),d.current=St),Ze=Date.now(),Ke(),()=>{rt=!1,c.current&&cancelAnimationFrame(c.current),St&&clearInterval(St),p.removeEventListener("mousedown",Qe),p.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",pt),p.removeEventListener("touchstart",ct),p.removeEventListener("touchmove",Vt),window.removeEventListener("touchend",sn),document.removeEventListener("visibilitychange",Ie)}},[]);return x.useEffect(()=>{const p=o.current;if(!p)return;const b={...pB,...e},v=f(p,b,n,a,i);return m.current=v,()=>{m.current&&m.current(),c.current&&cancelAnimationFrame(c.current),d.current&&clearInterval(d.current)}},[f,e,n,a,i]),r.jsx("canvas",{ref:o,className:t,style:{display:"block",width:"100%",height:"100%",mixBlendMode:s}})}const uC=[{name:"About",href:"#about"},{name:"Mission",href:"#mission"},{name:"Support",href:"#support"},{name:"Join",href:"#join"},{name:"Resources",href:"#resources"},{name:"Members",href:"/member"}],gB={SIM_RESOLUTION:32,DYE_RESOLUTION:256,DENSITY_DISSIPATION:.4,VELOCITY_DISSIPATION:.02,PRESSURE:.8,CURL:40,SPLAT_RADIUS:1,SPLAT_FORCE:5e4,SHADING:!1,BLOOM:!0,BLOOM_INTENSITY:.8,BLOOM_THRESHOLD:.6,TRANSPARENT:!0};function xB(){const{theme:t}=H1(),[e,n]=x.useState(!1),a=t==="dark"||t==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=o=>{if(n(!1),!o.startsWith("#")){window.location.href=o;return}const c=document.querySelector(o);c?c.scrollIntoView({behavior:"smooth"}):window.location.href=`/${o}`},s=()=>{window.location.href="/"};return r.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 h-20 overflow-hidden backdrop-blur-sm",children:[r.jsx("div",{className:`absolute inset-0 ${a?"bg-black/50":"bg-gray-800/70"}`}),r.jsx("div",{className:"absolute inset-0 pointer-events-auto",children:r.jsx(Z1,{className:"absolute inset-0",config:gB,autoSplatInterval:3e3,requireFocus:!1,splatPattern:"horizontal",blendMode:"plus-lighter"})}),r.jsx("div",{className:`absolute inset-0 pointer-events-none ${a?"bg-gradient-to-b from-black/20 to-black/40":"bg-gradient-to-b from-white/20 to-white/40"}`}),r.jsx("div",{className:`absolute bottom-0 left-0 right-0 h-px ${a?"bg-white/20":"bg-black/10"}`}),r.jsxs("div",{className:"relative h-full px-4 sm:px-6 lg:px-8 flex items-center justify-between pointer-events-none",children:[r.jsx("button",{onClick:s,className:"relative flex items-center gap-3 p-2 -m-2 rounded-lg hover:bg-white/10 dark:hover:bg-black/20 transition-colors pointer-events-auto",style:{filter:a?"drop-shadow(0 0 8px rgba(0,0,0,0.5)) drop-shadow(0 0 16px rgba(0,0,0,0.3))":"drop-shadow(0 0 8px rgba(255,255,255,0.7)) drop-shadow(0 0 16px rgba(255,255,255,0.5))"},children:r.jsx("svg",{width:"736",height:"624",viewBox:"0 0 736 624",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-auto",style:{mixBlendMode:"plus-lighter"},children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.225 0.815017C17.4105 0.815017 13.9105 3 9.41051 6.5C5.97354 9.1732 2.91051 14 1.91051 19C0.91051 24 0.910511 29.5 3.87402 33.5C6.83753 37.5 68.304 107.926 68.304 107.926C103.741 148.861 132.438 182.836 132.075 183.426C131.501 184.359 15.6264 325.647 11.9099 330.5C8.1934 335.353 1.90962 343 0.909656 347.5C-2.59043 360.5 4.12706 374.757 19.04 37
3737.207C26.9099 378.5 23.809 379.505 68.1 380L112.866 380.5L156.6 327.58C180.654 298.473 200.785 274.536 201.335 274.385C201.885 274.235 221.857 297.712 245.717 326.556L289.099 379L348.217 378.998C380.732 378.996 417.123 378.7 429.085 378.338L450.835 377.681V311.341V245L485.085 245.058C503.922 245.089 521.112 245.431 523.282 245.816L527.229 246.517L559.812 297.008C577.733 324.779 596.9 354.475 602.407 363L612.42 378.5L662.348 378.759C662.348 378.759 692.778 379.019 712.277 379.019C718.412 379.019 723.412 376.5 725.912 373.5C728.412 370.5 730.318 368.894 732.758 363C735.112 357.313 734.145 350.449 732.758 347.825C732.083 346.546 722.489 332.9 711.438 317.5C700.387 302.1 684.267 279.629 675.615 267.565L659.885 245.63L668.11 241.247C679.042 235.423 689.078 227.629 698.555 217.606C735.063 178.994 743.198 121.848 719.066 73.515C700.608 36.546 666.981 10.886 625.836 2.37302C615.839 0.305015 626.136 0.390016 434.335 0.791016L295.335 1.08102L253.335 50.596C230.235 77.83 210.66 100.714 209.835 101.452C208.538 102.61 206.03 100.004 191.335 82.227C181.985 70.916 163.247 48.291 149.696 31.95L125.056 2.23802L87.196 1.59502C66.372 1.24102 44.335 0.850016 38.225 0.726016C32.114 0.602016 26.264 0.642017 25.225 0.815017ZM606.263 108.405C610.331 110.105 614.469 115.041 615.939 119.949C618.255 127.679 614.478 143.905 606.843 147.761L602.367 150.022L481.85 149.35C361.611 148.68 362.91 150.086 356.686 150.738C349.41 151.5 343.41 156.5 341.41 161C339.41 165.5 339.549 170.5 339.549 170.5L340.193 220.973C340.819 266.184 340.787 255.393 338.991 253.473C337.975 252.388 324.178 236.93 308.329 219.122C282.04 189.582 279.624 186.568 280.763 184.743C281.984 182.789 328.218 129.296 342.262 113.589L349.335 105.679L476.216 106.381C577.936 106.943 603.725 107.345 606.263 108.405ZM46.598 413.027C26.606 416.416 10.1 430.581 3.59602 449.928C1.44002 456.343 1.37902 457.846 1.03602 513C0.63702 577.174 0.850016 580.03 6.98602 592.841C14.212 607.93 28.245 618.807 44.835 622.179C54.487 624.141 681.227 624.135 690.836 622.173C712.34 617.783 728.595 601.74 733.566 580C735.07 573.422 735.284 565.858 735.308 518.5C735.339 458.019 735.125 455.484 728.872 442.5C722.433 429.13 711.091 419.464 695.836 414.345C690.539 412.568 678.556 412.495 370.835 412.362C195.11 412.286 49.204 412.586 46.598 413.027ZM124.67 452.297C142.076 458.377 153.942 469.925 156.29 483.071C157.087 487.533 154.474 492.693 149.835 495.818C147.082 497.673 145.414 498.076 142.023 497.704C136.999 497.154 134.261 494.914 128.761 486.86C120.58 474.879 112.435 470.632 97.837 470.735C73.774 470.905 58.711 487.284 57.13 515C55.91 536.375 62.055 553.852 73.828 562.495C81.171 567.885 88.433 570 99.597 570C110.33 570 118.265 568.269 128.085 563.786L134.835 560.704V549.442V538.179L119.406 537.84C105.619 537.536 103.679 537.277 101.178 535.409C95.897 531.462 96.416 522.446 102.123 518.966C105.051 517.18 107.254 517.007 127.065 517.004C152.823 516.999 155.507 517.626 158.79 524.406C160.626 528.2 160.833 530.512 160.813 547.066C160.782 572.87 160.382 573.604 141.459 582.568C126.246 589.775 119.046 591.324 100.335 591.419C81.85 591.513 76.213 590.38 63.057 583.933C46.591 575.862 34.336 559.223 30.331 539.5C26.967 522.932 28.84 500.454 34.727 486.743C41.984 469.843 57.069 457.148 75.88 452.11C86.92 449.153 87.139 449.131 102.835 449.445C115.354 449.695 118.337 450.085 124.67 452.297ZM223.521 450.95C229.391 454.529 229.285 453.687 229.916 502C230.399 538.981 230.768 547.319 232.098 551.347C234.737 559.343 238.115 563.5 244.534 566.652C249.756 569.216 251.333 569.497 260.335 569.47C272.71 569.433 279.424 566.93 283.965 560.661C289.955 552.393 290.15 550.711 290.769 502C291.202 467.933 291.643 456.96 292.649 455.196C294.672 451.649 299.804 449.008 304.681 449.004C309.896 448.999 313.896 451.168 316.449 455.386C318.224 458.316 318.335 461.189 318.335 504C318.335 553.192 318.106 555.682 312.554 566.882C306.851 578.385 294.218 587.414 279.627 590.415C269.164 592.567 252.562 592.433 241.288 590.106C220.87 585.892 210.014 575.885 204.643 556.325C202.649 549.063 202.464 545.591 202.076 508.038C201.846 485.783 201.967 465.098 202.345 462.071C202.916 457.502 203.676 455.923 206.816 452.783C2
37310.16 449.44 211.166 449 215.467 449.004C218.522 449.006 221.522 449.731 223.521 450.95ZM390.795 450.636C392.318 451.535 394.412 453.673 395.449 455.386C397.232 458.33 397.35 461.756 397.615 518.281C397.794 556.459 397.529 579.423 396.881 581.829C395.358 587.486 390.945 591.187 385.047 591.754C378.344 592.398 374.231 590.15 371.718 584.468C369.854 580.254 369.787 577.625 370.055 518.789C370.321 460.558 370.429 457.361 372.228 454.707C373.27 453.171 375.295 451.276 376.728 450.497C380.269 448.572 387.422 448.643 390.795 450.636ZM474.521 450.95C480.478 454.583 480.292 452.777 480.835 512L481.335 566.5L512.836 567C535.506 567.36 544.952 567.853 546.535 568.758C550.023 570.753 551.836 574.115 551.836 578.588C551.836 583.815 549.006 587.581 544.041 588.96C538.903 590.387 468.599 590.333 463.335 588.899C458.057 587.46 455.308 584.774 453.9 579.679C453.071 576.68 452.828 558.988 453.04 517C453.318 461.888 453.443 458.321 455.208 455.407C456.238 453.706 458.263 451.58 459.708 450.684C463.34 448.429 470.601 448.56 474.521 450.95ZM667.255 453.382C686.354 458.804 700.014 473.76 706.071 495.882C709.129 507.052 709.098 534.056 706.014 545.342C699.805 568.062 685.413 583.017 664.836 588.133C660.808 589.134 651.438 589.5 629.836 589.5C596.993 589.5 595.672 589.263 592.103 582.733C590.47 579.746 590.336 575.019 590.336 520.5C590.336 453.717 589.991 456.698 598.152 452.891C602.069 451.064 604.219 450.963 631.836 451.321C655.588 451.628 662.489 452.029 667.255 453.382ZM618.294 474.25C618.03 474.938 617.932 496.193 618.075 521.485L618.336 567.47L635.836 567.232C655.609 566.963 660.179 565.966 666.515 560.542C671.588 556.201 676.539 546.896 678.367 538.27C680.515 528.133 680.27 509.018 677.873 499.643C673.723 483.418 665.314 476.251 647.858 474.062C635.835 472.554 618.903 472.662 618.294 474.25Z",fill:a?"white":"#1a1a2e"})})}),r.jsx("nav",{className:"hidden md:flex items-center gap-1 pointer-events-auto",children:uC.map(o=>r.jsx("button",{onClick:()=>i(o.href),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${a?"text-white/80 hover:text-white hover:bg-white/10":"text-gray-700 hover:text-gray-900 hover:bg-black/5"}`,style:{textShadow:a?"0 0 8px rgba(0,0,0,0.5), 0 0 16px rgba(0,0,0,0.3)":"0 0 8px rgba(255,255,255,0.7), 0 0 16px rgba(255,255,255,0.5)"},children:o.name},o.name))}),r.jsxs(nA,{open:e,onOpenChange:n,children:[r.jsx(rA,{asChild:!0,className:"md:hidden pointer-events-auto",children:r.jsx(Fe,{variant:"ghost",size:"icon",className:a?"text-white hover:bg-white/10":"text-gray-700 hover:bg-black/5",children:r.jsx(x3,{className:"h-6 w-6"})})}),r.jsx(X1,{children:r.jsx("div",{className:"flex flex-col gap-4 mt-8",children:uC.map(o=>r.jsx("button",{onClick:()=>i(o.href),className:"text-left text-lg font-medium text-foreground/70 hover:text-primary transition-colors py-2",children:o.name},o.name))})})]})]})]})}const vB=({className:t})=>r.jsx("svg",{viewBox:"0 0 736 624",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-label":"XR Guild Logo",children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.225 0.815017C17.4105 0.815017 13.9105 3 9.41051 6.5C5.97354 9.1732 2.91051 14 1.91051 19C0.91051 24 0.910511 29.5 3.87402 33.5C6.83753 37.5 68.304 107.926 68.304 107.926C103.741 148.861 132.438 182.836 132.075 183.426C131.501 184.359 15.6264 325.647 11.9099 330.5C8.1934 335.353 1.90962 343 0.909656 347.5C-2.59043 360.5 4.12706 374.757 19.04 377.207C26.9099 378.5 23.809 379.505 68.1 380L112.866 380.5L156.6 327.58C180.654 298.473 200.785 274.536 201.335 274.385C201.885 274.235 221.857 297.712 245.717 326.556L289.099 379L348.217 378.998C380.732 378.996 417.123 378.7 429.085 378.338L450.835 377.681V311.341V245L485.085 245.058C503.922 245.089 521.112 245.431 523.282 245.816L527.229 246.517L559.812 297.008C577.733 324.779 596.9 354.475 602.407 363L612.42 378.5L662.348 378.759C662.348 378.759 692.778 379.019 712.277 379.019C718.412 379.019 723.412 376.5 725.912 373.5C728.412 370.5 730.318 368.894 732.758 363C735.112 357.313 734.145 350.449 732.758 347.825C732.083 346.546 722.489 332.9 711.438 317.5C700.387 302.1 684.267 279.629 675.615 267.565L659.885 245.63L668.11 241.247C679.042 235.423 689.078 227.629 698.555 217.606C735.063 178.994 743.198 121.848 719.066 73.515C700.608 36.546 666.981 10.886 625.836 2.37302C615.839 0.30501
3735 626.136 0.390016 434.335 0.791016L295.335 1.08102L253.335 50.596C230.235 77.83 210.66 100.714 209.835 101.452C208.538 102.61 206.03 100.004 191.335 82.227C181.985 70.916 163.247 48.291 149.696 31.95L125.056 2.23802L87.196 1.59502C66.372 1.24102 44.335 0.850016 38.225 0.726016C32.114 0.602016 26.264 0.642017 25.225 0.815017ZM606.263 108.405C610.331 110.105 614.469 115.041 615.939 119.949C618.255 127.679 614.478 143.905 606.843 147.761L602.367 150.022L481.85 149.35C361.611 148.68 362.91 150.086 356.686 150.738C349.41 151.5 343.41 156.5 341.41 161C339.41 165.5 339.549 170.5 339.549 170.5L340.193 220.973C340.819 266.184 340.787 255.393 338.991 253.473C337.975 252.388 324.178 236.93 308.329 219.122C282.04 189.582 279.624 186.568 280.763 184.743C281.984 182.789 328.218 129.296 342.262 113.589L349.335 105.679L476.216 106.381C577.936 106.943 603.725 107.345 606.263 108.405ZM46.598 413.027C26.606 416.416 10.1 430.581 3.59602 449.928C1.44002 456.343 1.37902 457.846 1.03602 513C0.63702 577.174 0.850016 580.03 6.98602 592.841C14.212 607.93 28.245 618.807 44.835 622.179C54.487 624.141 681.227 624.135 690.836 622.173C712.34 617.783 728.595 601.74 733.566 580C735.07 573.422 735.284 565.858 735.308 518.5C735.339 458.019 735.125 455.484 728.872 442.5C722.433 429.13 711.091 419.464 695.836 414.345C690.539 412.568 678.556 412.495 370.835 412.362C195.11 412.286 49.204 412.586 46.598 413.027ZM124.67 452.297C142.076 458.377 153.942 469.925 156.29 483.071C157.087 487.533 154.474 492.693 149.835 495.818C147.082 497.673 145.414 498.076 142.023 497.704C136.999 497.154 134.261 494.914 128.761 486.86C120.58 474.879 112.435 470.632 97.837 470.735C73.774 470.905 58.711 487.284 57.13 515C55.91 536.375 62.055 553.852 73.828 562.495C81.171 567.885 88.433 570 99.597 570C110.33 570 118.265 568.269 128.085 563.786L134.835 560.704V549.442V538.179L119.406 537.84C105.619 537.536 103.679 537.277 101.178 535.409C95.897 531.462 96.416 522.446 102.123 518.966C105.051 517.18 107.254 517.007 127.065 517.004C152.823 516.999 155.507 517.626 158.79 524.406C160.626 528.2 160.833 530.512 160.813 547.066C160.782 572.87 160.382 573.604 141.459 582.568C126.246 589.775 119.046 591.324 100.335 591.419C81.85 591.513 76.213 590.38 63.057 583.933C46.591 575.862 34.336 559.223 30.331 539.5C26.967 522.932 28.84 500.454 34.727 486.743C41.984 469.843 57.069 457.148 75.88 452.11C86.92 449.153 87.139 449.131 102.835 449.445C115.354 449.695 118.337 450.085 124.67 452.297ZM223.521 450.95C229.391 454.529 229.285 453.687 229.916 502C230.399 538.981 230.768 547.319 232.098 551.347C234.737 559.343 238.115 563.5 244.534 566.652C249.756 569.216 251.333 569.497 260.335 569.47C272.71 569.433 279.424 566.93 283.965 560.661C289.955 552.393 290.15 550.711 290.769 502C291.202 467.933 291.643 456.96 292.649 455.196C294.672 451.649 299.804 449.008 304.681 449.004C309.896 448.999 313.896 451.168 316.449 455.386C318.224 458.316 318.335 461.189 318.335 504C318.335 553.192 318.106 555.682 312.554 566.882C306.851 578.385 294.218 587.414 279.627 590.415C269.164 592.567 252.562 592.433 241.288 590.106C220.87 585.892 210.014 575.885 204.643 556.325C202.649 549.063 202.464 545.591 202.076 508.038C201.846 485.783 201.967 465.098 202.345 462.071C202.916 457.502 203.676 455.923 206.816 452.783C210.16 449.44 211.166 449 215.467 449.004C218.522 449.006 221.522 449.731 223.521 450.95ZM390.795 450.636C392.318 451.535 394.412 453.673 395.449 455.386C397.232 458.33 397.35 461.756 397.615 518.281C397.794 556.459 397.529 579.423 396.881 581.829C395.358 587.486 390.945 591.187 385.047 591.754C378.344 592.398 374.231 590.15 371.718 584.468C369.854 580.254 369.787 577.625 370.055 518.789C370.321 460.558 370.429 457.361 372.228 454.707C373.27 453.171 375.295 451.276 376.728 450.497C380.269 448.572 387.422 448.643 390.795 450.636ZM474.521 450.95C480.478 454.583 480.292 452.777 480.835 512L481.335 566.5L512.836 567C535.506 567.36 544.952 567.853 546.535 568.758C550.023 570.753 551.836 574.115 551.836 578.588C551.836 583.815 549.006 587.581 544.041 588.96C538.903 590.387 468.599 590.333 463.335 588.899C458.057 587.46 455.308 584.774 453.9 579.679C453.071 576.68 452.828 558.988 453.04 517C453.318 461.888 453.443 458.321 455.208 455.407C456.238 453.706 458.263 451.58 459.708 450.684C463.34 448.429 470.601 448.56 474.521 450.95ZM667.255 453.382C686.354 458.804 700.014 473.76 706.071 495.882C709.129 507.052 709.098 534.056 706.014 545.342C699.805 568.062 685.413 583.017 664.836 588.133C660.808 589.134 651.438 589.5 629.836 589.5C596.993 589.5 595.672 589.263 592.103 582.733C590.47 579.746 590.336 575.019 590.336 520.5C590.336 453.717 589.991 456.698 598.152 452.891C602.069 451.064 604.219 450.963 631.836 451.321C655.588 451.628 662.489 452.029 667.255 453.382ZM618.294 474.25C618.03 474.938 617.932 496.193 618.075 521.485L618.336 567.47L635.836 567.232C655.609 566.963 660.179 565.966 666.515 560.542C671.588 556.201 676.539 546.896 678.367 538.27C680.515 528.133 680.27 509.018 677.873 499.643C673.723 483.418 665.314 476.251 647.858 474.062C635.835 472.554 618.903 472.662 618.294 474.25Z"})}),yB=()=>{const t=e=>{document.querySelector(e)?.scrollIntoView({behavior:"smooth"})};return r.jsx("section",{className:"min-h-screen flex items-start justify-center px-4 pt-[140px] pb-12 bg-gradient-to-br from-primary/5 via-background to-accent/5",children:r.jsxs("div",{className:"container mx-auto text-center max-w-4xl",children:[r.jsx("div",{className:"mb-8 inl
373ine-block",children:r.jsx(vB,{className:"h-48 w-auto mx-auto text-primary"})}),r.jsxs("p",{className:"text-base sm:text-lg text-foreground/80 mb-10 max-w-xl mx-auto",children:[r.jsxs("i",{children:['"Technology is not neutral',r.jsx("br",{}),"Because good outcomes require great care",r.jsx("br",{}),'and bad outcomes are often careless."']}),r.jsx("br",{}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"— Avi Bar-Zeev, Founder"})]}),r.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent leading-tight",children:"Ethics Lives in All of Us"}),r.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-6 max-w-2xl mx-auto leading-relaxed",children:"XR is becoming the interface through which we experience the digital world. We who build these technologies have a responsibility to ensure they empower people rather than manipulate them. As AI increasingly shapes what we see, hear, and believe we see our ethical or unethical choices having greater effect than ever. If you agree, join us."}),r.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-6 max-w-2xl mx-auto leading-relaxed",children:"We are a global community of professionals across XR, AI, and related technologies, united to establish a common ethical foundation on which we can safely build for everyone's benefit."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsx(Fe,{onClick:()=>t("#join"),size:"lg",className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 text-lg px-8",children:"Join Us"}),r.jsx(Fe,{onClick:()=>t("#support"),variant:"outline",size:"lg",className:"text-lg px-8 border-primary text-primary hover:bg-primary/5",children:"Support Our Mission"})]})]})})},Ft=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{ref:n,className:ln("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Ft.displayName="Card";const bn=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{ref:n,className:ln("flex flex-col space-y-1.5 p-6",t),...e}));bn.displayName="CardHeader";const wn=x.forwardRef(({className:t,...e},n)=>r.jsx("h3",{ref:n,className:ln("text-2xl font-semibold leading-none tracking-tight",t),...e}));wn.displayName="CardTitle";const Ln=x.forwardRef(({className:t,...e},n)=>r.jsx("p",{ref:n,className:ln("text-sm text-muted-foreground",t),...e}));Ln.displayName="CardDescription";const fn=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{ref:n,className:ln("p-6 pt-0",t),...e}));fn.displayName="CardContent";const bB=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{ref:n,className:ln("flex items-center p-6 pt-0",t),...e}));bB.displayName="CardFooter";const wB=th("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",donor:"border-transparent bg-red-600 text-white",volunteer:"border-transparent bg-primary text-primary-foreground","donor-future":"bg-background text-muted-foreground border border-dashed border-muted-foreground/50","volunteer-future":"bg-background text-muted-foreground border border-dashed border-muted-foreground/50"}},defaultVariants:{variant:"default"}});function an({className:t,variant:e,...n}){return r.jsx("div",{className:ln(wB({variant:e}),t),...n})}an.displayName="Badge";function Fo({name:t,profileImageUrl:e,bio:n,title:a,company:i,city:s,stateProvince:o,country:c,memberKey:d,variant:m="card",size:f="default",className:p="",onClose:b,isDonor:v,isVolunteer:C,showDonorBadge:S,showVolunteerBadge:F,officerRole:w,isPlaceholder:A,isPrivate:N,disableClick:P}){const z=f==="small",[D,T]=x.useState(!1),[K,B]=x.useState(!1),k=a||i?[a,i].filter(Boolean).join(", "):"Ethical Professional",O=({type:W,isFuture:H,small:J})=>{const ie=H?W==="donor"?"donor-future":"volunteer-future":W,Q=J?"px-1.5 py-0 text-[10px] gap-0.5":"gap-1",ve=J?"w-2.5 h-2.5":"w-3 h-3";return r.jsxs(an,{variant:ie,className:Q,children:[W==="donor"?r.jsx(Bd,{className:ve}):r.jsx(na,{className:ve}),H?W==="donor"?"Future Donor":"Future Volunteer":W==="donor"?"Donor":"Volunteer"]})},I=m==="expanded"?450:95,j=n&&n.length>I,U=j&&!D?n.substring(0,I)+"...":n,q=W=>{P||(W.stopPropagation(),B(!0))},Y=()=>K?r.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>B(!1),children:r.jsx("div",{onClick:W=>W.stopPropagation(),children:r.jsx(Fo,{name:t,profileImageUrl:e,bio:n,title:a,c
373ompany:i,city:s,stateProvince:o,country:c,memberKey:d,isDonor:v,isVolunteer:C,showDonorBadge:S,showVolunteerBadge:F,variant:"expanded",onClose:()=>B(!1)})})}):null;return m==="officer"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`flex items-center gap-4 ${p}`,children:[r.jsxs("div",{className:"flex-shrink-0 w-32",children:[a&&r.jsx("div",{className:"text-sm font-semibold text-muted-foreground",children:a}),i&&r.jsx("div",{className:"text-xs text-muted-foreground font-semibold",children:i})]}),r.jsx("div",{className:"flex-1 cursor-pointer hover:text-primary transition-colors",onClick:q,children:r.jsx("h4",{className:"font-semibold text-foreground",children:t})}),r.jsx("div",{className:"flex-shrink-0 cursor-pointer hover:opacity-80 transition-opacity",onClick:q,children:e?r.jsx("img",{src:e,alt:t,className:"w-12 h-12 rounded-md object-cover"}):r.jsx("div",{className:"w-12 h-12 rounded-md bg-muted flex items-center justify-center",children:r.jsx(Bs,{className:"w-6 h-6 text-muted-foreground"})})})]}),r.jsx(Y,{})]}):m==="expanded"?r.jsxs("div",{className:"relative",children:[(S||F)&&r.jsxs("div",{className:`absolute -top-2 right-0 flex ${z?"gap-0.5":"gap-1"} z-20`,children:[S&&r.jsx(O,{type:"donor",isFuture:!v,small:z}),F&&r.jsx(O,{type:"volunteer",isFuture:!C,small:z})]}),r.jsx(Ft,{className:`max-w-2xl w-full max-h-[90vh] overflow-y-auto border-primary/40 ${p}`,children:r.jsxs("div",{className:`${z?"p-3 pb-6":"p-6"} relative`,children:[b&&r.jsx("button",{onClick:b,className:"absolute top-4 right-4 p-2 hover:bg-muted rounded-full transition-colors",children:r.jsx(gr,{className:"w-5 h-5"})}),r.jsxs("div",{className:`flex flex-col items-center text-center ${z?"gap-2 mt-4":"gap-4 mt-4"}`,children:[r.jsx("div",{className:"flex-shrink-0",children:e?r.jsx("img",{src:e,alt:t,className:`${z?"w-24 h-24":"w-48 h-48"} rounded-lg object-cover`}):r.jsx("div",{className:`${z?"w-24 h-24":"w-48 h-48"} rounded-lg bg-muted flex items-center justify-center`,children:r.jsx(Bs,{className:`${z?"w-12 h-12":"w-24 h-24"} text-muted-foreground`})})}),r.jsxs("div",{children:[r.jsx("h2",{className:`${z?"text-lg":"text-3xl"} font-bold text-foreground`,children:t}),r.jsx("p",{className:`${z?"text-sm":"text-lg"} text-muted-foreground font-semibold ${z?"mt-1":"mt-2"}`,children:k}),(s||o||c)&&r.jsx("p",{className:`${z?"text-xs":"text-sm"} text-muted-foreground mt-1`,children:[s,o,c].filter(Boolean).join(", ")})]}),n&&r.jsxs("div",{className:"w-full text-left",children:[r.jsx("h3",{className:`${z?"text-sm":"text-lg"} font-semibold mb-1`,children:"About"}),r.jsxs("p",{className:`${z?"text-xs":"text-base"} text-muted-foreground`,children:[U,j&&r.jsx(Fe,{type:"button",variant:"link",size:"sm",onClick:()=>T(!D),className:`h-auto p-0 ml-2 ${z?"text-xs":"text-sm"} text-primary float-right`,children:D?"Show less":"Read more"})]})]})]})]})})]}):m==="compact"?r.jsxs(r.Fragment,{children:[r.jsxs(Ft,{className:`group relative p-3 cursor-pointer transition-all duration-150 hover:scale-105 hover:[filter:drop-shadow(0_0_6px_#FFD700)] border-primary/40 flex flex-col ${p}`,onClick:q,children:[r.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[r.jsx("div",{className:"flex-shrink-0",children:e&&!N?r.jsx("img",{src:e,alt:t,className:"w-12 h-12 rounded-md object-cover"}):r.jsx("div",{className:`w-12 h-12 rounded-md flex items-center justify-center ${A?"bg-muted/50 border border-dashed border-muted-foreground/30":"bg-muted"}`,children:r.jsx(Bs,{className:`w-6 h-6 ${A?"text-muted-foreground/50":"text-muted-foreground"}`})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:`font-semibold truncate ${A?"text-muted-foreground italic":"text-foreground"}`,title:t,children:t}),!N&&!A&&r.jsx("p",{className:"text-sm text-muted-foreground font-semibold line-clamp-2",title:k,children:k}),N&&r.jsx("p",{className:"text-sm text-muted-foreground/60 italic",children:"Private profile"})]})]}),w&&r.jsx("div",{className:"mt-2 pt-2 border-t border-primary/20 text-center",children:r.jsx("span",{className:"text-xs font-semibold text-primary",children:w})}),(S||F)&&r.jsxs("div",{className:"absolute -top-2 right-0 flex gap-0.5 z-20",children:[S&&r.jsx(O,{type:"donor",isFuture:!v,small:!0}),F&&r.jsx(O,{type:"volunteer",isFuture:!C,small:!0})]})]}),r.jsx(Y,{})]}
373):m==="compact-track"?r.jsxs(r.Fragment,{children:[r.jsxs(Ft,{className:`group relative p-3 cursor-pointer transition-all duration-150 hover:scale-105 ${p}`,onClick:q,children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"flex-shrink-0",children:e&&!N?r.jsx("img",{src:e,alt:t,className:"w-12 h-12 rounded-md object-cover"}):r.jsx("div",{className:`w-12 h-12 rounded-md flex items-center justify-center ${A?"bg-muted/50 border border-dashed border-muted-foreground/30":"bg-muted"}`,children:r.jsx(Bs,{className:`w-6 h-6 ${A?"text-muted-foreground/50":"text-muted-foreground"}`})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:`font-semibold truncate ${A?"text-muted-foreground italic":"text-foreground"}`,title:t,children:t}),!N&&!A&&r.jsx("p",{className:"text-sm text-muted-foreground font-semibold line-clamp-2",title:k,children:k}),N&&r.jsx("p",{className:"text-sm text-muted-foreground/60 italic",children:"Private profile"})]})]}),(S||F)&&r.jsxs("div",{className:"absolute -top-2 right-0 flex gap-0.5 z-20",children:[S&&r.jsx(O,{type:"donor",isFuture:!v,small:!0}),F&&r.jsx(O,{type:"volunteer",isFuture:!C,small:!0})]})]}),r.jsx(Y,{})]}):r.jsx(Ft,{className:`p-4 hover:shadow-lg transition-shadow ${p}`,children:r.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[r.jsx("div",{className:"flex-shrink-0",children:e?r.jsx("img",{src:e,alt:t,className:"w-24 h-24 rounded-lg object-cover"}):r.jsx("div",{className:"w-24 h-24 rounded-lg bg-muted flex items-center justify-center",children:r.jsx(Bs,{className:"w-12 h-12 text-muted-foreground"})})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg text-foreground",children:t}),(a||i)&&r.jsx("p",{className:"text-sm text-muted-foreground font-semibold mt-1",children:[a,i].filter(Boolean).join(", ")})]}),n&&r.jsxs("div",{className:"w-full",children:[r.jsx("p",{className:"text-sm text-muted-foreground text-left",children:U}),j&&r.jsx(Fe,{type:"button",variant:"link",size:"sm",onClick:()=>T(!D),className:"h-auto p-0 mt-1 text-sm text-primary",children:D?"Show less":"Read more"})]})]})})}const SB=[{icon:na,title:"Community Driven",description:"Built by professionals for professionals in Spatial Computing, XR and AI",link:{text:"View Member Profiles",url:"/profiles"}},{icon:Bd,title:"Ethics First",description:"Committed to the most ethical outcomes through education, community, and public outreach",link:{text:"Read our Principles",url:"https://principles.xrguild.org/principles"}},{icon:My,title:"Knowledge Sharing",description:"Accessible educational content and peer mentoring services",link:{text:"Browse the XR Guild Ethical Library",url:"https://library.xrguild.org"},link2:{text:"Timeline of XR",url:"/timeline"}},{icon:v3,title:"Industry Impact",description:"Active outreach and awareness programs for the entire industry",link:{text:"View Events",url:"#events"}}],FB=()=>{const[t,e]=x.useState(!1),[n,a]=x.useState([]),[i,s]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState([]),[f,p]=x.useState(!1),[b,v]=x.useState(!1),[C,S]=x.useState({}),[F,w]=x.useState("byPerson"),[A,N]=x.useState(!1),[P,z]=x.useState(null),D=x.useRef(new Map);return x.useEffect(()=>{const T=D.current,K=new Map;return T.forEach((B,k)=>{const O=()=>{const I=B.scrollLeft>0,j=B.scrollLeft<B.scrollWidth-B.clientWidth-1;S(U=>({...U,[k]:{canScrollLeft:I,canScrollRight:j}}))};K.set(k,O),B.addEventListener("scroll",O),O()}),()=>{T.forEach((B,k)=>{const O=K.get(k);O&&B.removeEventListener("scroll",O)})}},[n,i]),x.useEffect(()=>{t&&!b&&(async()=>{p(!0);try{const K=await fetch("/api/leadership");if(K.ok){const B=await K.json();B.success&&(m(B.officers||[]),c(B.boardMembers||[]),s(B.trackLeads||[]),a(B.tracks||[]),N(B.isDemoData||!1),v(!0))}}catch(K){console.error("Error fetching leadership data:",K)}finally{p(!1)}})()},[t,b]),r.jsx("section",{id:"about","data-testid":"about-section",className:"py-20 px-4 bg-background",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h2",{"data-testid":"about-title",className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"About the Guild"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"A community of professionals shaping the future of Spatial Computing, X
373R and AI with ethical principles at our core."})]}),r.jsx("div",{"data-testid":"value-cards",className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-12",children:SB.map((T,K)=>r.jsx(Ft,{"data-testid":`value-card-${K}`,className:"p-6 border-2 hover:border-primary/50 transition-all hover:shadow-lg",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg",children:r.jsx(T.icon,{className:"w-6 h-6 text-primary"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg mb-2 text-foreground",children:T.title}),r.jsx("p",{className:"text-muted-foreground",children:T.description}),T.link&&r.jsxs("div",{className:"mt-2 space-y-1",children:[r.jsxs("a",{href:T.link.url,"data-testid":`value-link-${K}`,target:T.link.url.startsWith("#")||T.link.url.startsWith("/")?"_self":"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm block",onClick:B=>{T.link.url.startsWith("#")&&(B.preventDefault(),document.querySelector(T.link.url)?.scrollIntoView({behavior:"smooth"}))},children:[T.link.text," →"]}),T.link2&&r.jsxs("a",{href:T.link2.url,"data-testid":`value-link2-${K}`,target:T.link2.url.startsWith("#")||T.link2.url.startsWith("/")?"_self":"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm block",onClick:B=>{T.link2.url.startsWith("#")&&(B.preventDefault(),document.querySelector(T.link2.url)?.scrollIntoView({behavior:"smooth"}))},children:[T.link2.text," →"]})]})]})]})},T.title))}),r.jsx("div",{className:"flex justify-center",children:r.jsxs(Ft,{"data-testid":"leadership-card",className:"p-6 border-2 w-full bg-primary/5 rounded-lg border border-primary/20",children:[r.jsxs("div",{"data-testid":"leadership-header",className:"flex items-center gap-3 mb-6 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>e(!t),children:[r.jsx("div",{className:"inline-flex p-3 bg-primary/10 rounded-full",children:r.jsx(na,{className:"w-6 h-6 text-primary"})}),r.jsxs("h3",{className:"text-xl font-semibold text-foreground flex-1",children:["Leadership",A&&r.jsx("span",{className:"ml-2 text-xs font-normal text-yellow-700 dark:text-yellow-300 bg-yellow-100 dark:bg-yellow-900/50 px-2 py-0.5 rounded",children:"⚠️ Demo Data Only -- These are not actual XR Guild leaders -- Photos are of random people, used with permission via Unsplash"})]}),t?r.jsx(gl,{className:"w-5 h-5 text-muted-foreground"}):r.jsx(Ja,{className:"w-5 h-5 text-muted-foreground"})]}),t&&r.jsxs("div",{"data-testid":"leadership-content",className:"space-y-8",children:[r.jsxs("div",{"data-testid":"officers-section",className:"bg-background/50 rounded-lg p-4 border border-primary/10",children:[r.jsx("h4",{className:"text-xl font-bold mb-4 text-primary",children:"Officers"}),f?r.jsx("p",{className:"text-muted-foreground",children:"Loading officers..."}):d.length>0?r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 items-stretch",children:d.map(T=>r.jsx("div",{className:"flex flex-col",children:r.jsx(Fo,{name:T.name,title:T.title,company:T.company,bio:T.bio,city:T.city,stateProvince:T.stateProvince,country:T.country,variant:"compact",memberKey:T.memberKey,profileImageUrl:T.profileImageUrl,className:"flex-1",isPlaceholder:T.isPlaceholder,isPrivate:T.isPrivate,officerRole:T.role})},T.memberKey||T.name))}):r.jsx("p",{className:"text-muted-foreground",children:"No officers found."})]}),r.jsxs("div",{"data-testid":"board-section",className:"bg-background/50 rounded-lg p-4 border border-primary/10",children:[r.jsx("h4",{className:"text-xl font-bold mb-4 text-primary",children:"Board of Directors"}),f?r.jsx("p",{className:"text-muted-foreground",children:"Loading board members..."}):o.length>0?r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 items-stretch",children:o.map(T=>r.jsx(Fo,{name:T.name,title:T.title,company:T.company,bio:T.bio,city:T.city,stateProvince:T.stateProvince,country:T.country,variant:"compact",memberKey:T.memberKey,profileImageUrl:T.profileImageUrl,className:"h-full",isPlaceholder:T.isPlaceholder,isPrivate:T.isPrivate},T.memberKey||T.name))}):r.jsx("p",{className:"text-muted-foreground",children:"No board members found."})]}),r.jsxs("div",{"data-testid":"track-leads-section",className:"bg-background/50 rounded-lg p-4 border border-primary/10 overflow-visible",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h4",{className:"text-xl font-bold text-primary",children:"Volunteer Track Leads"}),r.jsxs("div",{"data-testid":"track-leads-toggle",className:"flex items-center gap-2 bg-background rounded-lg p-1 border",children:[r.jsx("button",{"data-testid":"toggle-by-person",onClick:()=>w("byPerson"),className:`px-3 py-1 text-sm rounded transition-colors ${F==="byPerson"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"By Person"}),r.jsx("button",{"data-testid":"toggle-by-track",onClick:()=>
373w("byTrack"),className:`px-3 py-1 text-sm rounded transition-colors ${F==="byTrack"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"By Track"})]})]}),f?r.jsx("p",{className:"text-muted-foreground",children:"Loading track leads..."}):i.length>0?r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-4 gap-y-6 items-stretch overflow-visible",children:[[...i].sort((T,K)=>{if(F==="byPerson")return T.name.localeCompare(K.name);{const B=T.trackNames[0]||"",k=K.trackNames[0]||"";return B.localeCompare(k)||T.name.localeCompare(K.name)}}).map(T=>{const K=P&&T.trackNames.includes(P);return r.jsxs("div",{className:`relative pb-4 flex flex-col transition-all duration-150 ${K?"[filter:drop-shadow(0_0_6px_#FFD700)]":P?"opacity-40":""}`,children:[r.jsx(Fo,{name:T.name,title:T.title,company:T.company,bio:T.bio,city:T.city,stateProvince:T.stateProvince,country:T.country,variant:"compact-track",memberKey:T.memberKey,profileImageUrl:T.profileImageUrl,className:"flex-1"}),r.jsx("div",{className:"absolute -bottom-2 left-0 right-0 flex gap-1 px-1 z-10",children:T.trackNames.map(B=>r.jsx("span",{className:`flex-1 min-w-0 px-2 py-0.5 text-xs rounded-full truncate text-center cursor-pointer transition-all duration-150 ${P===B?"bg-primary text-primary-foreground border border-primary":"bg-background text-primary border border-primary/30 hover:bg-primary/10"}`,title:B,onMouseEnter:()=>z(B),onMouseLeave:()=>z(null),children:B},B))})]},T.memberKey)}),r.jsx("div",{className:"h-8 col-span-full"})]}):r.jsx("p",{className:"text-muted-foreground",children:"No track leads assigned yet."})]})]})]})})]})})},CB=[{icon:f3,name:"Peer Mentoring Services",href:"/mentorship"},{icon:iP,name:"Accessible Educational Content"},{icon:m3,name:"Industry Outreach and Awareness"},{icon:yP,name:"The XR Guild Hall & Library"},{icon:TP,name:"Infrastructure Development"}],_B=()=>r.jsx("section",{id:"mission",className:"py-20 px-4 bg-gradient-to-br from-primary/5 via-background to-accent/5",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Our Mission"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Making Spatial Computing better for everyone through education, mentorship, and ethical practices."})]}),r.jsxs(Ft,{className:"p-8 bg-card/50 backdrop-blur-sm border-2",children:[r.jsx("h3",{className:"text-2xl font-semibold mb-6 text-center text-foreground",children:"Programs We Support"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:CB.map(t=>{const e=r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"p-4 bg-gradient-to-br from-primary to-accent rounded-full mb-4",children:r.jsx(t.icon,{className:"w-6 h-6 text-primary-foreground"})}),r.jsx("p",{className:"font-medium text-foreground",children:t.name})]});return t.href?r.jsxs(xo,{to:t.href,className:"flex flex-col items-center text-center p-4 rounded-lg hover:bg-primary/5 transition-colors group",children:[e,r.jsx("span",{className:"text-sm text-primary mt-2 group-hover:underline",children:"Learn more"})]},t.name):r.jsx("div",{className:"flex flex-col items-center text-center p-4 rounded-lg hover:bg-primary/5 transition-colors",children:e},t.name)}
373)}),r.jsx("div",{className:"mt-8 p-6 bg-primary/5 rounded-lg border border-primary/20",children:r.jsxs("p",{className:"text-center text-foreground/80 font-medium",children:["We are ",r.jsx("span",{className:"text-primary font-bold",children:"100% volunteer operated"})," with no salaries.",r.jsx("br",{className:"hidden sm:block"}),"All donations directly support our programs and community."]})})]})]})}),EB=()=>r.jsx("section",{id:"partnerships",className:"py-20 px-4 bg-background",children:r.jsx("div",{className:"container mx-auto max-w-6xl",children:r.jsxs(Ft,{className:"p-6 border-2 w-full bg-primary/5 rounded-lg border border-primary/20",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[r.jsx("div",{className:"inline-flex p-3 bg-primary/10 rounded-full",children:r.jsx(Bd,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-xl font-semibold text-foreground",children:"Partnerships"})]}),r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 items-center",children:[r.jsx("a",{href:"https://www.virtualworldsociety.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-white rounded-lg hover:shadow-md transition-shadow h-24",children:r.jsx("img",{src:"/images/partners/vws-logo-color.png",alt:"The Virtual Worlds Society",className:"max-h-20 w-auto object-contain"})}),r.jsx("a",{href:"https://metaverse-standards.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-white rounded-lg hover:shadow-md transition-shadow h-24",children:r.jsx("img",{src:"/images/partners/msf-logo.png",alt:"Metaverse Standards Forum",className:"max-h-20 w-auto object-contain"})}),r.jsx("a",{href:"https://awexr.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-background rounded-lg hover:shadow-md transition-shadow h-24",children:r.jsx("img",{src:"/images/partners/awe-logo.svg",alt:"Augmented Worlds Expo",className:"max-h-20 w-auto object-contain dark:invert"})}),r.jsxs("a",{href:"https://responsiblemetaverse.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-background rounded-lg hover:shadow-md transition-shadow h-24",children:[r.jsx("img",{src:"/images/partners/rma-logo.png",alt:"Responsible Metaverse Alliance",className:"max-h-20 w-auto object-contain dark:hidden"}),r.jsx("img",{src:"/images/partners/rma-logo-white.png",alt:"Responsible Metaverse Alliance",className:"max-h-20 w-auto object-contain hidden dark:block"})]}),r.jsx("a",{href:"https://gatherverse.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-background rounded-lg hover:shadow-md transition-shadow h-24",children:r.jsx("img",{src:"/images/partners/gatherverse-logo-black.png",alt:"Gatherverse.org",className:"max-h-20 w-auto object-contain dark:invert"})}),r.jsx("a",{href:"https://www.virtualworlds.museum",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center p-2 bg-white rounded-lg hover:shadow-md transition-shadow h-24",children:r.jsx("img",{src:"/images/partners/virtual_worlds_museum_logo.png",alt:"The Virtual Worlds Museum",className:"max-h-20 w-auto object-contain"})})]})]})})}),kB=()=>r.jsx("section",{id:"support",className:"py-20 px-4 bg-background",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Support the Guild"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Help us build a more ethical future for spatial computing together"})]}),r.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 mb-6",children:[r.jsxs("div",{className:"flex flex-col gap-6 lg:w-1/3",children:[r.jsxs(Ft,{className:"p-6 text-center border-2",children:[r.jsx("div",{className:"inline-flex p-4 bg-primary/10 rounded-full mb-4",children:r.jsx(pF,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-xl font-semibold mb-2 text-foreground",children:"Tax Deductible"}),r.jsxs("p",{className:"text-muted-foreground",children:["Official 501(c)3 IRS non-profit charity",r.jsx("br",{}),"EIN: 87-4824339",r.jsx("br",{}),r.jsx("a",{href:"/docs/xr-guild-annual-report-2025.pdf",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Annual Report"})]})]}),r.jsxs(Ft,{className:"p-6 text-center border-2",children:[r.jsx("div",{className:"inline-flex p-4 bg-primary/10 rounded-full mb-4",children:r.jsx(Bd,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-xl font-semibold mb-2 text-foreground",children:"100% to Programs"}),r.jsxs("p",{className:"text-muted-foreground",children:["We minimize administrative costs",r.jsx("br",{}),"Direct impact for nearly every dollar"]})]}),r.jsxs(Ft,{className:"p-6 text-center border-2",children:[r.jsx("div",{className:"inline-flex p-4 bg-primary/10 rounded-full mb-4",children:r.jsx(y3,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-xl font-semibold mb-2 text-foreground",children:"Growing Impact"}),r.jsxs("p",{className:"text-muted-foreground",children:["Current goal: $10,000",r.jsx("br",{}),"Building the future together"]})]})]}),r.jsx(Ft,{className:"p-6 bg-gradient-to-br from-primary/5 to-accent/5 border-2 lg:flex-1 flex flex-col items-center justify-center",children:r.jsxs("div",{className:"text-center space-y-4 w-full max-w-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-2xl font-bold mb-2 text-foreground",children:"Make a Donation"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Support our mission to build ethical spatial computing"}),r.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[r.jsx("p",{children:"✓ Givebutter is secure and offers private receipts"}),r.jsx("p",{children:"✓ We won't sell, share your information or solicit you"}),r.jsx("p",{children:"✓ Consider recurring charitable tax deductions and employer matches"})]})]}),r.jsxs("div",{className:"w-full max-w-full overflow-hidden",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground mb-2",children:"Suggested Donation Levels:"}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[r.jsx("span",{className:"text-xs sm:text-sm font-semibold text-foreground sm:w-24 min-w-[80px]",children:"Supporter"}),r.jsxs("div",{className:"flex gap-1.5 sm:gap-2 flex-1 min-w-0",children:[r.jsx(Fe,{size:"sm",variant:"outline",className:"flex-1 min-w-0 border-2 hover:bg-primary/10 hover:border-primary py-3 sm:py-6 px-2 sm:px-4 text-[10px] sm:text-sm",onClick:()=>window.open("https://givebutter.com/boostxrguild?amount=5&frequency=monthly","_blank"),children:"$5/mo"}),r.jsx(Fe,{size:"sm",variant:"outline",className:"flex-1 min-w-0 border-2 hover:bg-primary/10 hover:border-primary py-3 sm:py-6 px-2 sm:px-4 text-[10px] sm:text-sm",onClick:()=>window.open("https://givebutter.com/boostxrguild?amount=60&frequency=yearly","_blank"),children:"$60/yr"})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[r.jsx("span",{className:"text-xs sm:text-sm font-semibold text-foreground sm:w-24 min-w-[80px]",children:"Booster"}),r.jsxs("div",{className:"flex gap-1.5 sm:gap-2 flex-1 min-w-0",children:[r.jsx(Fe,{size:"sm",variant:"outline",className:"flex-1 min-w-0 border-2 hover:bg-primary/10 hover:border-primary py-3 sm:py-6 px-2 sm:px-4 text-[10px] sm:text-sm",onClick:()=>window.open("https://givebutter.com/boostxrguild?amount=10&frequency=monthly","_blank"),children:"$10/mo"}),r.jsx(Fe,{size:"sm",variant:"outline",className:"flex-1 min-w-0 border-2 hover:bg-primary/10 hover:border-primary py-3 sm:py-6 px-2 sm:px-4 text-[10px] sm:text-sm",onClick:()=>window.open("https://givebutter.com/boostxrguild?amount=120&frequency=yearly","_blank"),children:"$120/yr"})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[r.jsx("span",{className:"text-xs sm:text-sm font-semibold text-foreground sm:w-24 min-w-[80px]",children:"Sponsor"}),r.jsx("div",{className:"flex gap-1.5 sm:gap-2 flex-1 min-w-0",children:r.jsx(Fe,{size:"sm",variant:"outline",className:"flex-1 min-w-0 border-2 hover:bg-primary/10 hover:border-primary py-3 sm:py-6 px-2 sm:px-4 text-[10px] sm:text-sm",onClick:()=>window.open("https://givebutter.com/boostxrguild?amount=1000&frequency=yearly","_blank"),children:"$1000/yr"})})]})]})]}),r.jsxs(Fe,{size:"lg",className:"w-full bg-gradient-to-r from-primary to-accent hover:opacity-90 text-sm sm:text-base md:text-lg py-4 sm:py-6",onClick:()=>window.open("https://givebutter.com/boostxrguild","_blank"),children:[r.jsx(pF,{className:"w-4 h-4 sm:w-5 sm:h-5 mr-1 sm:mr-2"}),"Custom Amount"]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Or text ",r.jsx("span",{className:"font-semibold text-foreground",children:"XRGUILD"})," to ",r.jsx("span",{className:"font-semibold text-foreground",children:"53-555"})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["For ",r.jsx("span",{className:"font-semibold text-foreground",children:"Corporate donations"}),","," ",r.jsx("a",{href:"mailto:[email protected]?subject=Corporate%2
3730Donation%20Inquiry",className:"text-primary hover:underline",children:"contact us directly"})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["All donations are tax-deductible for US taxpayers.",r.jsx("br",{}),"Check your local regulations."]})]})]})})]})]})}),AB=()=>{const[t,e]=x.useState(0),n=[{id:1,name:"Women's Relaxed V-Neck T-Shirt (Black)",image:"/merch/womens-relaxed-v-neck-t-shirt-solid-black-blend-front-68fdb3e230f3c.png",url:"https://xrguild.printful.me"},{id:2,name:"Women's Ideal Racerback Tank Top",image:"/merch/womens-ideal-racerback-tank-top-black-front-68fdb2be15490.png",url:"https://xrguild.printful.me"},{id:3,name:"Unisex Premium Sweatshirt",image:"/merch/unisex-premium-sweatshirt-black-front-68fdb4e846435.png",url:"https://xrguild.printful.me"},{id:4,name:"Organic Baseball Cap (Black)",image:"/merch/organic-baseball-cap-black-front-68fdb39409ac1.png",url:"https://xrguild.printful.me"},{id:5,name:"Classic Dad Hat (White)",image:"/merch/classic-dad-hat-white-front-68fdb43a3d406.png",url:"https://xrguild.printful.me"},{id:6,name:"Women's Relaxed V-Neck T-Shirt (White)",image:"/merch/womens-relaxed-v-neck-t-shirt-solid-white-blend-front-68fdb3e23116c.png",url:"https://xrguild.printful.me"},{id:7,name:"Large Eco Tote (Black)",image:"/merch/large-eco-tote-black-front-68fdb46299557.png",url:"https://xrguild.printful.me"},{id:8,name:"All-Over Print Tote Bag",image:"/merch/all-over-print-tote-bag-black-15x15-front-68fdb55b6c094.png",url:"https://xrguild.printful.me"},{id:9,name:"Pin Button Set",image:"/merch/set-of-pin-buttons-white-1.25-front-2-68fdb531ba950.png",url:"https://xrguild.printful.me"},{id:10,name:"Pin Button Set",image:"/merch/set-of-pin-buttons-white-1.25-front-2-68fdb531ba950.png",url:"https://xrguild.printful.me"},{id:11,name:"Women's Organic Ribbed-neck T-Shirt Set",image:"/merch/womens-organic-ribbed-neck-t-shirt-black-front-68fe7785133f3.png",url:"https://xrguild.printful.me"},{id:12,name:"White Glossy Mug",image:"/merch/white-glossy-mug-white-15-oz-front-view-68fe77361fb56.png",url:"https://xrguild.printful.me"},{id:13,name:"Unisex Relaxed Hoodie White",image:"/merch/unisex-organic-relaxed-hoodie-white-front-68fe76c9beb36.png",url:"https://xrguild.printful.me"}];x.useEffect(()=>{if(n.length===0)return;const s=setInterval(()=>{e(o=>(o+1)%n.length)},3e3);return()=>clearInterval(s)},[n.length]);const a=()=>{e(s=>(s+1)%n.length)},i=()=>{e(s=>(s-1+n.length)%n.length)};return r.jsx("section",{id:"join",className:"py-20 px-4 bg-gradient-to-br from-primary/5 via-background to-accent/5",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Join the Movement"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Be part of a community building ethical spatial computing for everyone."})]}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[r.jsxs("div",{className:"flex flex-col gap-6 md:w-1/2",children:[r.jsxs(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-lg mb-4",children:r.jsx(km,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold mb-3 text-foreground",children:"Join Us"}),r.jsxs("p",{className:"text-muted-foreground mb-3",children:["Think of the Guild not like modern Hollywood unions, but more like the craft guilds of the ",r.jsx("b",{children:"Guilded Age"}),":"]}),r.jsxs("ul",{className:"text-muted-foreground mb-6 space-y-1 list-disc pl-[10%] pr-[10%]",children:[r.jsx("li",{children:"A place to learn and grow among similar experts"}),r.jsx("li",{children:'An "ethical support group"'}),r.jsx("li",{children:"The more challenging the environment, the more important it becomes to have support"})]})]}),r.jsx(Fe,{size:"lg",className:"w-full bg-gradient-to-r from-primary to-accent hover:opacity-90",onClick:()=>window.location.href="/join","data-testid":"become-member-button",children:"Become a Member"}),r.jsx("a",{href:"/member",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm mt-2 items-right justify-right",children:"Already a member?"})]}),r.jsxs(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-lg mb-4",children:r.jsx(EP,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold mb-3 text-foreground",children:"Share Our Goals"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Support the mission to make Spatial Computing better for everyone."})]}),r.jsx("div",{className:"space-y-3 mb-4",children:r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs(Fe,{size:"sm",variant:"outline",className:"border-[#1DA1F2] text-[#1DA1F2] hover:bg-[#1DA1F2]/10",onClick:()=>{const s=encodeURIComponent(window.location.href),o=encodeURIComponent("Building ethical spatial computing for everyone with @XRGuild");window.open(`https://twitter.com/intent/tweet?url=${s}&text=${o}`,"_blank")}
373,children:[r.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X / Twitter"]}),r.jsxs(Fe,{size:"sm",variant:"outline",className:"border-[#0A66C2] text-[#0A66C2] hover:bg-[#0A66C2]/10",onClick:()=>{const s=encodeURIComponent(window.location.href);window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${s}`,"_blank")},children:[r.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),"LinkedIn"]}),r.jsxs(Fe,{size:"sm",variant:"outline",className:"border-[#0285FF] text-[#0285FF] hover:bg-[#0285FF]/10",onClick:()=>{const s=encodeURIComponent(window.location.href),o=encodeURIComponent("Building ethical spatial computing for everyone - XR Guild");window.open(`https://bsky.app/intent/compose?text=${o}%20${s}`,"_blank")},children:[r.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"})}),"Bluesky"]}),r.jsxs(Fe,{size:"sm",variant:"outline",className:"border-[#FF4500] text-[#FF4500] hover:bg-[#FF4500]/10",onClick:()=>{const s=encodeURIComponent(window.location.href),o=encodeURIComponent("XR Guild - Building ethical spatial computing for everyone");window.open(`https://www.reddit.com/submit?url=${s}&title=${o}`,"_blank")},children:[r.jsx("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})}),"Reddit"]})]})})]})]}),r.jsxs(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl md:w-1/2",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-lg mb-4",children:r.jsx(bF,{className:"w-8 h-8 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold mb-3 text-foreground",children:"XR Guild Merch"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Support us with grassroots advertising and word of mouth."})]}),r.jsxs("div",{className:"relative mb-6",children:[n.length>0?r.jsx("a",{href:n[t].url,target:"_blank",rel:"noopener noreferrer",className:"block aspect-square bg-muted rounded-lg overflow-hidden hover:opacity-90 transition-opacity cursor-pointer",children:r.jsx("img",{src:n[t].image,alt:n[t].name,className:"w-full h-full object-cover",onError:s=>{s.currentTarget.src='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="400" height="400"%3E%3Crect fill="%23ddd" width="400" height="400"/%3E%3Ctext fill="%23999" font-family="sans-serif" font-size="24" dy="10.5" font-weight="bold" x="50%25" y="50%25" text-anchor="middle"%3EXR Guild%3C/text%3E%3C/svg%3E'}})}):r.jsx("div",{className:"aspect-square bg-muted rounded-lg overflow-hidden flex items-center justify-center",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading products..."})}),r.jsx("button",{onClick:i,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-background/80 hover:bg-background rounded-full p-2 shadow-lg transition-all","aria-label":"Previous item",children:r.jsx(Qg,{className:"w-5 h-5 text-foreground"})}),r.jsx("button",{onClick:a,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-background/80 hover:bg-background rounded-full p-2 shadow-lg transition-all","aria-label":"Next item",children:r.jsx(nh,{className:"w-5 h-5 text-foreground"})}),n.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent p-3",children:r.jsx("p",{className:"text-white text-sm font-medium text-center",children:n[t].name})}),r.jsx("div",{className:"flex justify-center gap-1.5 mt-3",children:n.map((s,o)=>r.jsx("button",{onClick:()=>e(o),className:`w-2 h-2 rounded-full transition-all ${o===t?"bg-primary w-6":"bg-muted-foreground
373/30 hover:bg-muted-foreground/50"}`,"aria-label":`Go to item ${o+1}`},o))})]})]}),r.jsxs(Fe,{size:"lg",className:"w-full bg-gradient-to-r from-primary to-accent hover:opacity-90",onClick:()=>window.open("https://xrguild.printful.me","_blank"),children:[r.jsx(bF,{className:"w-4 h-4 mr-2"}),"Shop XR Guild Merch"]})]})]})]})})};function sr(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function $i(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function ii(t,e){const n=sr(t);return isNaN(e)?$i(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ks(t,e){const n=sr(t);if(isNaN(e))return $i(t,NaN);if(!e)return n;const a=n.getDate(),i=$i(t,n.getTime());i.setMonth(n.getMonth()+e+1,0);const s=i.getDate();return a>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),a),n)}const Q1=6048e5,NB=864e5;let TB={};function Qm(){return TB}function No(t,e){const n=Qm(),a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=sr(t),s=i.getDay(),o=(s<a?7:0)+s-a;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function yu(t){return No(t,{weekStartsOn:1})}function iA(t){const e=sr(t),n=e.getFullYear(),a=$i(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=yu(a),s=$i(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=yu(s);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function zd(t){const e=sr(t);return e.setHours(0,0,0,0),e}function Tg(t){const e=sr(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function vo(t,e){const n=zd(t),a=zd(e),i=+n-Tg(n),s=+a-Tg(a);return Math.round((i-s)/NB)}function MB(t){const e=iA(t),n=$i(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),yu(n)}function Zy(t,e){const n=e*7;return ii(t,n)}function RB(t,e){return Ks(t,e*12)}function DB(t){let e;return t.forEach(function(n){const a=sr(n);(e===void 0||e<a||isNaN(Number(a)))&&(e=a)}),e||new Date(NaN)}function PB(t){let e;return t.forEach(n=>{const a=sr(n);(!e||e>a||isNaN(+a))&&(e=a)}),e||new Date(NaN)}function Ci(t,e){const n=zd(t),a=zd(e);return+n==+a}function ew(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function jB(t){if(!ew(t)&&typeof t!="number")return!1;const e=sr(t);return!isNaN(Number(e))}function Lm(t,e){const n=sr(t),a=sr(e),i=n.getFullYear()-a.getFullYear(),s=n.getMonth()-a.getMonth();return i*12+s}function LB(t,e,n){const a=No(t,n),i=No(e,n),s=+a-Tg(a),o=+i-Tg(i);return Math.round((s-o)/Q1)}function tw(t){const e=sr(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Ei(t){const e=sr(t);return e.setDate(1),e.setHours(0,0,0,0),e}function sA(t){const e=sr(t),n=$i(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nw(t,e){const n=Qm(),a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=sr(t),s=i.getDay(),o=(s<a?-7:0)+6-(s-a);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function oA(t){return nw(t,{weekStartsOn:1})}const IB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},BB=(t,e,n)=>{let a;const i=IB[t];return typeof i=="string"?a=i:e===1?a=i.one:a=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function wv(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const OB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},UB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GB={date:wv({formats:OB,defaultWidth:"full"}),time:wv({formats:UB,defaultWidth:"full"}),dateTime:wv({formats:zB,defaultWidth:"full"})},HB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WB=(t,e,n,a)=>HB[t];function Jh(t){return(e,n)=>{const a=n?.context?String(n.context):"standalone";let i;if(a==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,c=n?.width?String(n.width):o;i=t.formattingValues[c]||t.formattingValues[o]}else{const o=t.defaultWidth,c=n?.width?String(n.width):t.defaultWidth;i=t.values[c]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const VB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$B={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},YB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
373ay","Saturday"]},qB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},JB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},XB=(t,e)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ZB={ordinalNumber:XB,era:Jh({values:VB,defaultWidth:"wide"}),quarter:Jh({values:$B,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Jh({values:KB,defaultWidth:"wide"}),day:Jh({values:YB,defaultWidth:"wide"}),dayPeriod:Jh({values:qB,defaultWidth:"wide",formattingValues:JB,defaultFormattingWidth:"wide"})};function Xh(t){return(e,n={})=>{const a=n.width,i=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],c=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(c)?e9(c,p=>p.test(o)):QB(c,p=>p.test(o));let m;m=t.valueCallback?t.valueCallback(d):d,m=n.valueCallback?n.valueCallback(m):m;const f=e.slice(o.length);return{value:m,rest:f}}}function QB(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function e9(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function t9(t){return(e,n={})=>{const a=e.match(t.matchPattern);if(!a)return null;const i=a[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const c=e.slice(i.length);return{value:o,rest:c}}}const n9=/^(\d+)(th|st|nd|rd)?/i,r9=/\d+/i,a9={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},i9={any:[/^b/i,/^(a|c)/i]},s9={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},o9={any:[/1/i,/2/i,/3/i,/4/i]},l9={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},c9={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},u9={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d9={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},h9={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},m9={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},f9={ordinalNumber:t9({matchPattern:n9,parsePattern:r9,valueCallback:t=>parseInt(t,10)}),era:Xh({matchPatterns:a9,defaultMatchWidth:"wide",parsePatterns:i9,defaultParseWidth:"any"}),quarter:Xh({matchPatterns:s9,defaultMatchWidth:"wide",parsePatterns:o9,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Xh({matchPatterns:l9,defaultMatchWidth:"wide",parsePatterns:c9,defaultParseWidth:"any"}),day:Xh({matchPatterns:u9,defaultMatchWidth:"wide",parsePatterns:d9,defaultParseWidth:"any"}),dayPeriod:Xh({matchPatterns:h9,defaultMatchWidth:"any",parsePatterns:m9,defaultParseWidth:"any"})},lA={code:"en-US",formatDistance:BB,formatLong:GB,formatRelative:WB,localize:ZB,match:f9,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p9(t){const e=sr(t);return vo(e,sA(e))+1}function cA(t){const e=sr(t),n=+yu(e)-+MB(e);return Math.round(n/Q1)+1}function uA(t,e){const n=sr(t),a=n.getFullYear(),i=Qm(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=$i(t,0);o.setFullYear(a+1,0,s),o.setHours(0,0,0,0);const c=No(o,e),d=$i(t,0);d.setFullYear(a,0,s),d.setHours(0,0,0,0);const m=No(d,e);return n.getTime()>=c.getTime()?a+1:n.getTime()>=m.getTime()?a:a-1}function g9(t,e){const n=Qm(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=uA(t,e),s=$i(t,0);return s.setFullYear(i,0,a),s.setHours(0,0,0,0),No(s,e)}function dA(t,e){const n=sr(t),a=+No(n,e)-+g9(n,e);return Math.round(a/Q1)+1}function xr(t,e){const n=t<0?"-":"",a=Math.abs(t).toString().padStart(e,"0");return n+a}const tc={y(t,e){const n=t.getFullYear(),a=n>0?n:1-n;return xr(e==="yy"?a%100:a,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):xr(n+1,2)},d(t,e){return xr(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return xr(t.getHours()%12||12,e.length)},H(t,e){return xr(t.getHours(),e.length)},m(t,e){return xr(t.getMinutes(),e.length)},s(t,e){return xr(t.getSeconds(),e.length)},S(t,e){const n=e.length,a=t.getMilliseconds(),i=Math.trunc(a*Math.pow(10,n-3));return xr(i,e.length)}},id={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dC={G:function(t,e,n){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const a=t.getFullYear(),i=a>0?a:1-a;return n.ordinalNumber(i,{unit:"year"})}return tc.y(t,e)},Y:function(t,e,n,a){const i=uA(t,a),s=i>0?i:1-i;if(e==="YY"){const o=s%100;return xr(o,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):xr(s,e.length)},R:function(t,e){const n=iA(t);return xr(n,e.length)},u:function(t,e){const n=t.getFullYear();return xr(n,e.length)},Q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return xr(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return xr(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,n){const a=t.getMonth();switch(e){case"M":case"MM":return tc.M(t,e);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,n){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return xr(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,n,a){const i=dA(t,a);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):xr(i,e.length)},I:function(t,e,n){const a=cA(t);return e==="Io"?n.ordinalNumber(a,{unit:"week"}):xr(a,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):tc.d(t,e)},D:function(t,e,n){const a=p9(t);return e==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):xr(a,e.length)},E:function(t,e,n){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,n,a){const i=t.getDay(),s=(i-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return xr(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,a){const i=t.getDay(),s=(i-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return xr(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const a=t.getDay(),i=a===0?7:a;switch(e){case"i":return String(i);case"ii":return xr(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const a=t.getHours();let i;switch(a===12?i=id.noon:a===0?i=id.midnight:i=a/12>
vendor: 3,547 bytes, line 373
373=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const a=t.getHours();let i;switch(a>=17?i=id.evening:a>=12?i=id.afternoon:a>=4?i=id.morning:i=id.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let a=t.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return tc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):tc.H(t,e)},K:function(t,e,n){const a=t.getHours()%12;return e==="Ko"?n.ordinalNumber(a,{unit:"hour"}):xr(a,e.length)},k:function(t,e,n){let a=t.getHours();return a===0&&(a=24),e==="ko"?n.ordinalNumber(a,{unit:"hour"}):xr(a,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):tc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):tc.s(t,e)},S:function(t,e){return tc.S(t,e)},X:function(t,e,n){const a=t.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return mC(a);case"XXXX":case"XX":return su(a);default:return su(a,":")}},x:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"x":return mC(a);case"xxxx":case"xx":return su(a);default:return su(a,":")}},O:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+hC(a,":");default:return"GMT"+su(a,":")}},z:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+hC(a,":");default:return"GMT"+su(a,":")}},t:function(t,e,n){const a=Math.trunc(t.getTime()/1e3);return xr(a,e.length)},T:function(t,e,n){const a=t.getTime();return xr(a,e.length)}};function hC(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),i=Math.trunc(a/60),s=a%60;return s===0?n+String(i):n+String(i)+e+xr(s,2)}function mC(t,e){return t%60===0?(t>0?"-":"+")+xr(Math.abs(t)/60,2):su(t,e)}function su(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),i=xr(Math.trunc(a/60),2),s=xr(a%60,2);return n+i+e+s}const fC=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},hA=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},x9=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],a=n[1],i=n[2];if(!i)return fC(t,e);let s;switch(a){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",fC(a,e)).replace("{{time}}",hA(i,e))},v9={p:hA,P:x9},y9=/^D+$/,b9=/^Y+$/,w9=["D","DD","YY","YYYY"];function S9(t){return y9.test(t)}function F9(t){return b9.test(t)}function C9(t,e,n){const a=_9(t,e,n);if(console.warn(a),w9.includes(t))throw new RangeError(a)}function _9(t,e,n){const a=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}
373const E9=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k9=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,A9=/^'([^]*?)'?$/,N9=/''/g,T9=/[a-zA-Z]/;function Co(t,e,n){const a=Qm(),i=n?.locale??a.locale??lA,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,c=sr(t);if(!jB(c))throw new RangeError("Invalid time value");let d=e.match(k9).map(f=>{const p=f[0];if(p==="p"||p==="P"){const b=v9[p];return b(f,i.formatLong)}return f}).join("").match(E9).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const p=f[0];if(p==="'")return{isToken:!1,value:M9(f)};if(dC[p])return{isToken:!0,value:f};if(p.match(T9))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(d=i.localize.preprocessor(c,d));const m={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return d.map(f=>{if(!f.isToken)return f.value;const p=f.value;(!n?.useAdditionalWeekYearTokens&&F9(p)||!n?.useAdditionalDayOfYearTokens&&S9(p))&&C9(p,e,String(t));const b=dC[p[0]];return b(c,p,i.localize,m)}).join("")}function M9(t){const e=t.match(A9);return e?e[1].replace(N9,"'"):t}function R9(t){const e=sr(t),n=e.getFullYear(),a=e.getMonth(),i=$i(t,0);return i.setFullYear(n,a+1,0),i.setHours(0,0,0,0),i.getDate()}function D9(t){return Math.trunc(+sr(t)/1e3)}function P9(t){const e=sr(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function j9(t,e){return LB(P9(t),Ei(t),e)+1}function Qy(t,e){const n=sr(t),a=sr(e);return n.getTime()>a.getTime()}function mA(t,e){const n=sr(t),a=sr(e);return+n<+a}function rw(t,e){const n=sr(t),a=sr(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function L9(t,e){const n=sr(t),a=sr(e);return n.getFullYear()===a.getFullYear()}function Sv(t,e){return ii(t,-e)}function Fv(t,e){const n=sr(t),a=n.getFullYear(),i=n.getDate(),s=$i(t,0);s.setFullYear(a,e,15),s.setHours(0,0,0,0);const o=R9(s);return n.setMonth(e,Math.min(i,o)),n}function pC(t,e){const n=sr(t);return isNaN(+n)?$i(t,NaN):(n.setFullYear(e),n)}function fA({links:t,label:e="Add to your Calendar App to View Upcoming Events"}){const{toast:n}=nr(),[a,i]=x.useState(!1);if(!t)return null;async function s(){if(t)try{await navigator.clipboard.writeText(t.httpsUrl),i(!0),setTimeout(()=>i(!1),1500),n({title:"Calendar URL copied",description:'In Google Calendar, paste it into "Other calendars → From URL".'})}catch{n({variant:"destructive",title:"Could not copy",description:"Your browser blocked clipboard access. Long-press the Apple / Outlook button to copy the link instead."})}}return r.jsxs("div",{className:"flex items-center justify-center gap-3 flex-wrap text-sm text-muted-foreground",children:[r.jsx(hu,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsx("span",{children:e}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("a",{href:t.webcalUrl,className:"px-2.5 py-1 rounded-md bg-primary/10 hover:bg-primary/20 text-primary text-xs font-medium transition-colors",title:"Subscribe in Apple Calendar or Outlook",children:"Apple / Outlook"}),r.jsxs("button",{type:"button",onClick:s,className:"px-2.5 py-1 rounded-md bg-primary/10 hover:bg-primary/20 text-primary text-xs font-medium flex items-center gap-1.5 transition-colors",title:"Copy URL — paste into Google Calendar or anywhere else",children:[a?r.jsx(oi,{className:"w-3.5 h-3.5"}):r.jsx(ex,{className:"w-3.5 h-3.5"}),a?"Copied":"Copy Google URL"]})]})]})}const un=x.forwardRef(({className:t,type:e,...n},a)=>r.jsx("input",{type:e,className:ln("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/45 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:a,...n}));un.displayName="Input";var I9="Label",pA=x.forwardRef((t,e)=>r.jsx(Tn.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pA.displayName=I9;var gA=pA;const B9=th("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ht=x.forwardRef(({className:t,...e},n)=>r.jsx(gA,{ref:n,className:ln(B9(),t),...e}));Ht.displayName=gA.displayName;function xA({eventId:t,sessionId:e,compact:n=!0}){const{toast:a}=nr(),[i,s]=x.useState(null),[o,c]=x.useState(!0),[d,m]=x.useState(!1),[f,p]=x.useState("idle"),[b,v]=x.useState(""),[C,S]=x.useState(""),[F,w]=x.useState(!1),A=e?{"x-session-id":e}:{},N=x.useCallback(async()=>{try{const O=await fetch(`/api/events/${encodeURIComponent(t)}/rsvp`,{headers:A}),I=await O.json().catch(()=>({}));if(!O.ok||!I.success){s(null);return}s(I)}catch{s(null)}finally{c(!1)}},[t,e]);x.useEffect(()=>{N()},[N]);async function P(O,I){m(!0);try{const j=await fetch(O,{method:"POST",headers:{"Content-Type":"application/json",...A},body:JSON.stringify(I)}),U=await j.json().catch(()=>({}));if(!j.ok||!U.success)throw new Error(U.message||`Server returned ${j.status}`);return U}finally{m(!1)}}async function z(){try{await P(`/api/events/${encodeURIComponent(t)}/rsvp/add-me`,{}),a({title:"You're on the invite list"}),await N()}catch(O){a({variant:"destructive",title:"Could not add you",description:O.message})}}async function D(){try{await P(`/api/events/${encodeURIComponent(t)}/rsvp/remove-me`,{}),a({title:"Removed from invite list"}),await N()}catch(O){a({variant:"destructive",title:"Could not remove you",description:O.message})}}async function T(O){if(O.preventDefault(),!!b.trim())try{await P(`/api/events/${encodeURIComponent(t)}/rsvp/invite-by-email`,{email:b.trim()}),a({title:"Verification code sent",description:`Check ${b} for a 6-letter code.`}),p("awaiting-code")}catch(I){a({variant:"destructive",title:"Could not send code",description:I.message})}}async function K(O){if(O.preventDefault(),C.length===6)try{await P(`/api/events/${encodeURIComponent(t)}/rsvp/verify`,{email:b.trim(),code:C.toUpperCase()}),a({title:"You're on the invite list",description:"The calendar invite will arrive shortly."}),p("verified"),S(""),await N()}catch(I){a({variant:"destructive",title:"Code did not match",description:I.message})}}if(o||!i||!i.hasInviteGroup)return null;const B=i.attendeeCount??0,k=i.youAreIn===!0;if(n&&e)return r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(na,{className:"w-3.5 h-3.5 text-primary flex-shrink-0"}),r.jsxs("span",{children:[B," attending"]}),k?r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"inline-flex items-center gap-1 text-primary",children:[r.jsx(oi,{className:"w-3.5 h-3.5"})," you're on the list"]}),r.jsxs(Fe,{type:"button",size:"sm",variant:"ghost",onClick:D,disabled:d,className:"h-6 px-2 text-xs gap-1",children:[r.jsx(Cm,{className:"w-3 h-3"}),"Remove me"]})]}):r.jsxs(Fe,{type:"button",size:"sm",variant:"outline",onClick:z,disabled:d,className:"h-6 px-2 text-xs gap-1",children:[d?r.jsx(on,{className:"w-3 h-3 animate-spin"}):r.jsx(bo,{className:"w-3 h-3"}),"Add me to invite list"]})]});if(!e){const O=B>10;return r.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2 text-sm",children:[f==="idle"&&r.jsxs("div",{className:"space-y-1",children:[r.jsxs("form",{onSubmit:T,className:"flex flex-wrap items-center gap-2",children:[O&&r.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground whitespace-nowrap",children:[r.jsx(na,{className:"w-3.5 h-3.5 text-primary"}),B," attending"]}),r.jsx(un,{type:"email",placeholder:"Get a calendar invite by email",value:b,onChange:I=>v(I.target.value),required:!0,className:"max-w-[260px] h-8 text-xs flex-1 min-w-[180px]"}),r.jsxs(Fe,{type:"submit",size:"sm",disabled:d||!b.trim(),className:"h-8 gap-1",children:[d?r.jsx(on,{className:"w-3 h-3 animate-spin"}):r.jsx(Cr,{className:"w-3 h-3"}),"Validate Email & Invite"]}),r.jsx("button",{type:"button",onClick:()=>w(I=>
373!I),className:"text-[11px] text-muted-foreground/70 underline-offset-2 hover:underline",children:"Is this safe?"})]}),F&&r.jsx("p",{className:"text-[11px] text-muted-foreground/80 leading-relaxed max-w-prose",children:"We don't harvest or share email addresses with anyone — this is for receiving an invite only. As an alternative, you can download the calendar links above and add this event to your own calendar without sharing your email."})]}),f==="awaiting-code"&&r.jsxs("form",{onSubmit:K,className:"space-y-2",children:[r.jsxs("div",{className:"text-xs text-muted-foreground",children:["We sent a 6-letter code to ",r.jsx("span",{className:"font-mono",children:b}),". Enter it below."]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Ht,{htmlFor:`rsvp-code-${t}`,className:"sr-only",children:"Verification code"}),r.jsx(un,{id:`rsvp-code-${t}`,type:"text",inputMode:"text",autoComplete:"one-time-code",pattern:"[A-Za-z]{6}",maxLength:6,placeholder:"ABCDEF",value:C,onChange:I=>S(I.target.value.toUpperCase().replace(/[^A-Z]/g,"")),className:"max-w-[160px] h-8 text-center font-mono tracking-widest",autoFocus:!0}),r.jsxs(Fe,{type:"submit",size:"sm",disabled:d||C.length!==6,className:"h-8 gap-1",children:[d?r.jsx(on,{className:"w-3 h-3 animate-spin"}):r.jsx(oi,{className:"w-3 h-3"}),"Verify"]}),r.jsx(Fe,{type:"button",size:"sm",variant:"ghost",onClick:()=>{p("idle"),S("")},className:"h-8",children:"Cancel"})]})]}),f==="verified"&&r.jsxs("div",{className:"flex items-center gap-2 text-primary text-xs",children:[r.jsx(oi,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:"You're on the invite list."})]})]})}return r.jsxs("div",{className:"rounded-md border bg-card p-3 space-y-2 text-sm",children:[r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx(na,{className:"w-4 h-4 text-primary"}),r.jsxs("span",{children:[B," attending"]})]}),k?r.jsxs(Fe,{type:"button",size:"sm",variant:"outline",onClick:D,disabled:d,className:"gap-1",children:[r.jsx(Cm,{className:"w-3.5 h-3.5"}),"Remove me from invite list"]}):r.jsxs(Fe,{type:"button",size:"sm",onClick:z,disabled:d,className:"gap-1",children:[d?r.jsx(on,{className:"w-3.5 h-3.5 animate-spin"}):r.jsx(bo,{className:"w-3.5 h-3.5"}),"Add me to invite list"]})]})}function O9(t){return t.replace(/\n\nImage:\s*\S+\s*$/i,"").trim()}function U9(t){const e=t.match(/\n\nMore info:\s*(https?:\/\/\S+)\s*$/i);return e?{moreInfoUrl:e[1],rest:t.slice(0,e.index).trim()}:{moreInfoUrl:null,rest:t}}function vA(t){try{return new URL(t).hostname.replace(/^www\./,"")}catch{return t}}function z9(t,e){const n=[],a=/https?:\/\/[^\s<>")]+/g;let i=0,s,o=0;for(;(s=a.exec(t))!==null;){s.index>i&&n.push(t.slice(i,s.index));const c=s[0].replace(/[.,;:!?)]$/,"");n.push(r.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",title:c,className:"text-primary hover:underline",children:vA(c)},`${e}-url-${o++}`)),s[0].length>c.length&&n.push(s[0].slice(c.length)),i=s.index+s[0].length}return i<t.length&&n.push(t.slice(i)),n}const G9=/\bhttps?:\/\/(?:[a-z0-9-]+\.)?zoom\.us\/[^\s<)]+/i;function H9(t){if(!t)return null;const e=t.match(G9);return e?e[0]:null}function gC(t,e=new Date){return t.start.getTime()<=e.getTime()&&e.getTime()<=t.end.getTime()}function W9(t,e){const n=Math.max(0,t-e);if(n<=0)return null;const a=Math.floor(n/6e4),i=Math.floor(n/36e5),s=Math.floor(n/864e5);return s>=1?`${s}d`:i>=1?`${i}h`:a>=1?`${a}m`:"<1m"}function V9(t){try{const n=new Intl.DateTimeFormat(void 0,{timeZoneName:"short",hour:"numeric"}).formatToParts(t).find(d=>d.type==="timeZoneName")?.value;if(n&&n.length<=5)return n;const a=-t.getTimezoneOffset(),i=a>=0?"+":"-",s=Math.abs(a),o=Math.floor(s/60),c=s%60;return c===0?`UTC${i}${o}`:`UTC${i}${o}:${String(c).padStart(2,"0")}`}catch{return""}}const aw=7200*1e3;function $9(t,e=new Date){const n=t.end.getTime(),a=e.getTime();return Number.isFinite(n)&&n<a&&a-n<=aw}function K9(t,e){let n=1/0;for(const a of t){const i=a.start.getTime(),s=a.end.getTime();if(Number.isFinite(i)&&i>e&&i<n&&(n=i),Number.isFinite(s)&&s>e&&s<n&&(n=s),Number.isFinite(s)){const o=s+aw;o>e&&o<n&&(n=o)}}return Number.isFinite(n)?n-e:null}function Y9(t){const e=i=>i.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z",n=i=>i.replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;");return["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//XR Guild//Events//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH","BEGIN:VEVENT",`UID:${t.id}@xrguild.org`,`DTSTART:${e(t.start)}`,`DTEND:${e(t.end)}
373`,`SUMMARY:${n(t.title)}`,t.location?`LOCATION:${n(t.location)}`:"",t.description?`DESCRIPTION:${n(t.description)}`:"","STATUS:CONFIRMED","END:VEVENT","END:VCALENDAR"].filter(i=>i).join(`\r
374`)}function q9(t){const e=Y9(t),n=new Blob([e],{type:"text/calendar;charset=utf-8"}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a;const s=t.title.replace(/[^a-z0-9]/gi,"_").toLowerCase();i.download=`${s}.ics`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)}const J9=()=>{const[t,e]=x.useState([]),[n,a]=x.useState([]),[i,s]=x.useState(["All"]),[o,c]=x.useState("All"),[d,m]=x.useState(5),[f,p]=x.useState(!0),[b,v]=x.useState(null),[C,S]=x.useState(null),[F,w]=x.useState(0);x.useEffect(()=>{const P=Date.now(),z=K9(n,P),D=6e4,T=z==null?D:Math.min(z+100,D),K=window.setTimeout(()=>w(B=>B+1),Math.max(250,T));return()=>window.clearTimeout(K)},[n,F]),x.useEffect(()=>{A()},[]),x.useEffect(()=>{a(o==="All"?t:t.filter(P=>P.region===o)),m(5)},[o,t]);const A=async()=>{try{p(!0);const P=await fetch("/api/calendar/events"),z=await P.json().catch(()=>({}));if(!P.ok||!z.success)throw new Error(z.message||`Server returned ${P.status}`);const D=Array.isArray(z.events)?z.events:[];z.subscribe&&typeof z.subscribe.httpsUrl=="string"&&S(z.subscribe);const T=new Date,K=new Date(T.getTime()+4320*60*60*1e3),B=D.map(I=>({id:I.id,title:I.title,start:new Date(I.start),end:new Date(I.end),allDay:I.allDay,location:I.location,description:I.description,region:I.region,imageUrl:I.imageUrl||void 0,eventUrl:I.eventUrl||void 0,hasInviteGroup:!!I.hasInviteGroup})).filter(I=>!Number.isNaN(I.start.getTime())).filter(I=>{const j=I.end.getTime();return(Number.isFinite(j)?j+aw:I.start.getTime())>=T.getTime()&&I.start<=K}).sort((I,j)=>I.start.getTime()-j.start.getTime()).slice(0,20),k=new Set(B.map(I=>I.region)),O=Array.from(k).sort((I,j)=>I==="Online"?1:j==="Online"?-1:I==="Other"?1:j==="Other"?-1:I.localeCompare(j));s(["All",...O]),e(B),v(null)}catch(P){console.error("Error fetching events:",P),v("Failed to load events. Please try again later.")}finally{p(!1)}};if(f)return r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading events..."})});if(b)return r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-destructive",children:b})});if(t.length===0)return r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-muted-foreground",children:"No upcoming events at this time. Check back soon!"})});const N=(()=>{try{const P=new URLSearchParams(window.location.search),z=P.get("accept")||P.get("join");return z?z.toLowerCase().replace(/[^a-z0-9-]/g,""):""}catch{return""}})();return r.jsxs("div",{className:"space-y-6",children:[N&&r.jsx(Ft,{className:"border-primary/40 bg-primary/5 p-4",children:r.jsxs("div",{className:"flex items-start gap-3 flex-wrap",children:[r.jsx(hu,{className:"w-5 h-5 mt-0.5 text-primary flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[r.jsx("div",{className:"font-medium",children:"Accept your invite"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"You followed a link to join an event invite list. Sign in to your member account to accept, or sign up first if you're new to the guild."})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("a",{href:`/member?accept=${encodeURIComponent(N)}`,className:"px-3 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors font-medium text-xs sm:text-sm flex items-center gap-1",children:"Sign in"}),r.jsx("a",{href:"/join",className:"px-3 py-2 rounded-lg bg-primary/10 hover:bg-primary/20 text-primary font-medium text-xs sm:text-sm flex items-center gap-1",children:"Sign up"})]})]})}),r.jsx(fA,{links:C}),r.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:i.map(P=>r.jsx("button",{onClick:()=>c(P),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${o===P?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:P},P))}),r.jsx("div",{className:"space-y-4",children:n.length===0?r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-muted-foreground",children:"No events found for this region."})}):r.jsxs(r.Fragment,{children:[n.slice(0,d).map(P=>r.jsx(Ft,{className:"border-2 hover:border-primary/50 transition-all overflow-hidden",children:r.jsxs("div",{className:"flex flex-col sm:flex-row gap-0 sm:gap-4",children:[P.imageUrl?P.eventUrl?r.jsx("a",{href:P.eventUrl,target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-48 h-48 flex-shrink-0 flex items-start justify-center overflow-hidden group ring-inset hover:ring-2 hover:ring-primary/60 transition-all",title:"Open event page",children:r.jsx("img",{src:P.imageUrl,alt:P.title,className:"w-full h-auto max-h-full object-contain transition-transform duration-200 group-hover:scale-[1.03]"})}):r.jsx("div",{className:"w-full sm:w-48 h-48 flex-shrink-0 flex items-start justify-center overflow-hidden",children:r.jsx("img",{src:P.imageUrl,alt:P.title,className:"w-full h-auto max-h-full object-contain"})}):P.eventUrl?r.jsx("a",{href:P.eventUrl,target:"_blank",rel:"noopener noreferrer",className:"w-full sm:w-48 h-48 flex-shrink-0 bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center ring-inset hover:ring-2 hover:ring-primary/60 transition-all",title:"Open event page",children:r.jsx(hu,{className:"w-16 h-16 text-primary/40"})}):r.jsx("div",{className:"w-full sm:w-48 h-48 flex-shrink-0 bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center",children:r.jsx(hu,{className:"w-16 h-16 text-primary/40"})}),r.jsxs("div",{className:"flex-1 min-w-0 p-4 sm:p-6 space-y-3",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[r.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-foreground flex-1 min-w-0 break-words",children:P.title}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 flex-shrink-0",children:[P.region==="Online"&&r.jsx("span",{className:"px-3 py-1 bg-primary/10 text-primary text-xs sm:text-sm font-medium rounded-full whitespace-nowrap "+(gC(P)?"animate-pulse-glow":""),children:"Online"}),P.eventUrl&&r.jsxs("a",{href:P.eventUrl,target:"_blank",rel:"noopener noreferrer",className:"px-3 sm:px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors font-medium text-xs sm:text-sm flex items-center gap-1 sm:gap-2",title:"Register or RSVP",children:["Attend",r.jsx(_i,{className:"w-3 h-3 sm:w-4 sm:h-4"})]}),r.jsxs("button",{onClick:()=>q9(P),className:"ml-auto sm:ml-2 px-3 sm:px-4 py-2 rounded-lg bg-primary/10 hover:bg-primary/20 text-primary font-medium text-xs sm:text-sm flex items-center gap-1 sm:gap-2 transition-colors whitespace-nowrap",title:"Download .ics — add this event to your calendar",children:[r.jsx(oP,{className:"w-3 h-3 sm:w-4 sm:h-4"}),"Add to Calendar"]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3 text-xs sm:text-sm text-muted-foreground min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(hu,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsx("span",{className:"truncate",children:Co(P.start,"MMM d, yyyy")})]}),!P.allDay&&r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(S1,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsxs("span",{className:"truncate",children:[Co(P.start,"h:mm a")," - ",Co(P.end,"h:mm a"),(()=>{const z=V9(P.start);
374return z?r.jsx("span",{className:"text-muted-foreground/70 ml-1",children:z}):null})()]})]}),(()=>{const z=H9(P.location),D=$9(P);if(z){const T=gC(P),K=T||D?null:W9(P.start.getTime(),Date.now());return r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[r.jsx(Ry,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsx("span",{className:"font-medium",children:"Zoom"}),D?r.jsx("span",{className:"text-muted-foreground/80 text-xs sm:text-sm italic",children:"— Ended"}):T?r.jsxs("a",{href:z,target:"_blank",rel:"noopener noreferrer",title:z,className:"ml-1 px-2.5 py-1 rounded-md bg-primary text-primary-foreground text-xs font-medium hover:bg-primary/90 transition-colors flex items-center gap-1 animate-pulse-glow",children:["Join Now",r.jsx(_i,{className:"w-3 h-3"})]}):K?r.jsxs("span",{className:"text-muted-foreground/80 text-xs sm:text-sm",children:["— starts in ",r.jsx("span",{className:"font-mono",children:K})]}):null]})}return P.location||P.region==="Online"?r.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[r.jsx(Ry,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsx("span",{className:"truncate",children:P.location||"Online"}),D&&r.jsx("span",{className:"text-muted-foreground/80 text-xs sm:text-sm italic flex-shrink-0",children:"— Ended"})]}):D?r.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1 text-muted-foreground/80 text-xs sm:text-sm italic",children:"— Ended"}):null})()]}),(()=>{if(!P.description)return null;const z=O9(P.description),{moreInfoUrl:D,rest:T}=U9(z);return r.jsxs(r.Fragment,{children:[D&&r.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm",children:[r.jsx(g3,{className:"w-4 h-4 text-primary flex-shrink-0"}),r.jsxs("a",{href:D,target:"_blank",rel:"noopener noreferrer",title:D,className:"text-primary hover:underline truncate",children:["More info: ",vA(D)]})]}),T&&r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:z9(T,P.id).map((K,B)=>r.jsx(x.Fragment,{children:K},B))})]})})(),P.hasInviteGroup&&r.jsx(xA,{eventId:P.id,compact:!1})]})]})},P.id)),n.length>d&&r.jsxs("div",{className:"flex justify-center gap-3 pt-4",children:[d===5&&r.jsx("button",{onClick:()=>m(10),className:"px-6 py-3 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors font-medium",children:"Show More (10 events)"}),d===10&&r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>m(20),className:"px-6 py-3 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors font-medium",children:"Show All (up to 20)"}),r.jsx("button",{onClick:()=>m(5),className:"px-6 py-3 rounded-lg bg-muted text-muted-foreground hover:bg-muted/80 transition-colors font-medium",children:"Show Less"})]}),d===20&&r.jsx("button",{onClick:()=>m(5),className:"px-6 py-3 rounded-lg bg-muted text-muted-foreground hover:bg-muted/80 transition-colors font-medium",children:"Show Less"})]})]})})]})},X9=()=>r.jsx("section",{id:"resources",className:"py-20 px-4 bg-muted/30",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-16",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Resources"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Explore our curated collection of educational materials, research, and ethical guidelines for XR and AI professionals."})]}),r.jsx("div",{className:"flex justify-center mb-16",children:r.jsx(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl w-full md:w-2/3 lg:w-3/4",children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-center",children:[r.jsx("div",{className:"w-full md:w-1/2",children:r.jsxs(xo,{to:"/mentorship",className:"block relative rounded-lg overflow-hidden border-2 border-primary/20 shadow-lg hover:border-primary/40 hover:shadow-xl transition-all cursor-pointer",children:[r.jsx("img",{src:"/images/mentorship-stand-in.jpg",alt:"XR professionals participating in a small-group mentoring session",className:"w-full aspect-[3/2] object-cover"}),r.jsx("span",{className:"absolute bottom-3 left-3 px-3 py-1 text-xs font-medium rounded-full bg-background/90 text-muted-foreground shadow-sm",children:"Temporary stand-in image"})]})}),r.jsxs("div",{className:"w-full md:w-1/2 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg",children:r.jsx(na,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold text-foreground",children:"Mentorship Program"})]}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Build skills, confidence, and meaningful professional relationships through structured mentorship with XR and AI peers."}),r.jsxs("div",{className:"pt-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Mentor and mentee opportunities"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Career and leadership development"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Free for XR Guild members"})]})]}),r.jsxs(xo,{to:"/mentorship",className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground font-semibold rounded-lg hover:bg-primary/90 transition-colors mt-4 group",children:[r.jsx("span",{children:"Explore Mentorship"}),r.jsx(_i,{className:"w-4 h-4 group-hover:translate-x-1 group-hover:-translate-y-1 transition-transform"})]})]})]})})}),r.jsx("div",{className:"flex justify-center mb-16",children:r.jsx(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl w-full md:w-2/3 lg:w-3/4",children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-center",children:[r.jsx("div",{className:"w-full md:w-1/2",children:r.jsxs("a",{href:"https://library.xrguild.org",target:"_blank",rel:"noopener noreferrer",className:"block relative rounded-lg overflow-hidden border-2 border-primary/20 shadow-lg hover:border-primary/40 hover:shadow-xl transition-all cursor-pointer",children:[r.jsx("img",{src:"/images/library-light.png",alt:"X
374R Guild Library Preview - Click to visit",className:"w-full h-auto object-cover dark:hidden"}),r.jsx("img",{src:"/images/library-dark.png",alt:"XR Guild Library Preview - Click to visit",className:"w-full h-auto object-cover hidden dark:block"})]})}),r.jsxs("div",{className:"w-full md:w-1/2 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg",children:r.jsx(aP,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold text-foreground",children:"XR Guild Library"})]}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Access our comprehensive library of educational content, ethical guidelines, and research materials. Discover best practices, case studies, and frameworks for building responsible XR and AI technologies."}),r.jsxs("div",{className:"pt-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Ethical Frameworks & Principles"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Research & Case Studies"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Technical Best Practices"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Industry Resources & Guides"})]})]}),r.jsxs("a",{href:"https://library.xrguild.org",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground font-semibold rounded-lg hover:bg-primary/90 transition-colors mt-4 group",children:[r.jsx("span",{children:"Visit the Library"}),r.jsx(_i,{className:"w-4 h-4 group-hover:translate-x-1 group-hover:-translate-y-1 transition-transform"})]})]})]})})}),r.jsx("div",{className:"flex justify-center mb-16",children:r.jsx(Ft,{className:"p-8 border-2 hover:border-primary/50 transition-all hover:shadow-xl w-full md:w-2/3 lg:w-3/4",children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-center",children:[r.jsx("div",{className:"w-full md:w-1/2",children:r.jsxs(xo,{to:"/timeline",className:"block relative rounded-lg overflow-hidden border-2 border-primary/20 shadow-lg hover:border-primary/40 hover:shadow-xl transition-all cursor-pointer",children:[r.jsx("img",{src:"/images/timeline-light.png",alt:"XR Timeline Preview - Click to explore",className:"w-full h-auto object-cover dark:hidden"}),r.jsx("img",{src:"/images/timeline-dark.png",alt:"XR Timeline Preview - Click to explore",className:"w-full h-auto object-cover hidden dark:block"})]})}),r.jsxs("div",{className:"w-full md:w-1/2 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg",children:r.jsx(S1,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-2xl font-bold text-foreground",children:"Timeline of XR"})]}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Explore the evolution of XR terminology from early concepts to modern spatial computing. An interactive visual history of the ideas, research, products, and fiction that shaped our field."}),r.jsxs("div",{className:"pt-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Products, Research, Concepts & Fiction"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Interactive Pan & Zoom"})]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),r.jsx("span",{children:"Links to Original Sources"})]})]}),r.jsxs(xo,{to:"/timeline",className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground font-semibold rounded-lg hover:bg-primary/90 transition-colors mt-4 group",children:[r.jsx("span",{children:"Explore the Timeline"}),r.jsx(_i,{className:"w-4 h-4 group-hover:translate-x-1 group-hover:-translate-y-1 transition-transform"})]})]})]})})}),r.jsxs("div",{id:"events",className:"text-center mb-8",children:[r.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg",children:r.jsx(hu,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-2xl sm:text-3xl md:text-4xl font-bold text-foreground",children:"Upcoming Events"})]}),r.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Join us for workshops, meetups, and conferences around the world. Filter by region to find events near you."})]}),r.jsx(J9,{})]})}),yA="/assets/xr-guild-logo-DUUSJ2o9.jpg",iw=()=>
374r.jsx("footer",{className:"py-12 px-4 bg-foreground/5 border-t",children:r.jsx("div",{className:"container mx-auto max-w-6xl",children:r.jsxs("div",{className:"text-center",children:[r.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[r.jsx("img",{src:yA,alt:"XR Guild Logo",className:"h-16 w-auto dark:hidden"}),r.jsx("img",{src:"/images/logo-dark.png",alt:"XR Guild Logo",className:"h-16 w-auto hidden dark:block"})]}),r.jsx("p",{className:"text-muted-foreground mb-6 max-w-2xl mx-auto",children:"Building ethical spatial computing for everyone through community, education, and shared values."}),r.jsxs("div",{className:"flex items-center justify-center gap-6 mb-6",children:[r.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-colors",children:[r.jsx(Cr,{className:"w-5 h-5"}),r.jsx("span",{children:"[email protected]"})]}),r.jsxs("a",{href:"https://www.linkedin.com/company/xr-guild/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-muted-foreground hover:text-primary transition-colors",children:[r.jsx(C1,{className:"w-5 h-5"}),r.jsx("span",{children:"LinkedIn"})]})]}),r.jsx("div",{className:"border-t pt-6",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," XR Guild Inc. All rights reserved.",r.jsx("br",{}),"501(c)3 Non-Profit Organization • EIN: 87-4824339",r.jsx("br",{}),r.jsx("a",{href:"/docs/xr-guild-annual-report-2025.pdf",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors underline",children:"Annual Report"})," • ",r.jsx("a",{href:"/docs/privacy_policy.pdf",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors underline",children:"Privacy Policy"})]})})]})})}),Z9=()=>r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(xB,{}),r.jsx(yB,{}),r.jsx(FB,{}),r.jsx(_B,{}),r.jsx(EB,{}),r.jsx(kB,{}),r.jsx(AB,{}),r.jsx(X9,{}),r.jsx(iw,{})]});function Q9(){const[t,e]=x.useState(1),[n,a]=x.useState(""),[i,s]=x.useState(""),[o,c]=x.useState(!1),[d,m]=x.useState(""),[f,p]=x.useState(""),b=w=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(w).toLowerCase()),v=async()=>{if(!b(n)){p("Please enter a valid email address");return}c(!0),p(""),m("");try{const w=await fetch("/api/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:n.toLowerCase(),source:"join"})}),A=await w.json();w.ok&&A.success?(m("We've sent an email from [email protected]. Please check your inbox (and spam folder)."),e(2)):A.code==="EXISTING_MEMBER"?(p("You already have an account! Redirecting to login..."),setTimeout(()=>{window.location.href="/member"},2e3)):A.code==="GUILD_EMAIL_NOT_ALLOWED"?p(A.message):p(A.message||"Error sending code. Please try again.")}catch(w){console.error("Error sending code:",w),p("Error sending code. Please try again.")}finally{c(!1)}},C=async()=>{if(i.length===6){c(!0),p("");try{const w=await fetch("/api/verifyCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:n.toLowerCase(),code:i.toUpperCase()})}),A=await w.json();w.ok&&A.success&&A.sessionId?(sessionStorage.setItem("memberSession",A.sessionId),window.location.href="/member"):p(A.message||"Invalid code. Please try again.")}catch(w){console.error("Error verifying code:",w),p("Error verifying code. Please try again.")}finally{c(!1)}}},S=w=>{const A=w.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6);s(A),f&&p(""),A.length===6&&setTimeout(()=>C(),100)},F=w=>{w.preventDefault();const N=w.clipboardData.getData("text").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6);s(N),f&&p(""),N.length===6&&setTimeout(()=>C(),100)};return r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 py-12 px-4",children:r.jsxs("div",{className:"container mx-auto max-w-4xl",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold mb-6 text-foreground",children:"Join the XR Guild"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-8",children:"Become part of a community building ethical spatial computing for everyone"})]}),r.jsxs("div",{className:"flex justify-center items-center gap-4 mb-12",children:[r.jsxs("div",{className:`flex items-center gap-2 ${t>=1?"text-primary":"text-muted-foreground"}`,children:[r.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-semibold ${t>=1?"bg-primary text-primary-foreground":"bg-muted"}`,children:"1"}),r.jsx("span",{className:"hidden sm:inline",children:"Validate Email"})]}),r.jsx("div",{className:"w-8 h-0.5 bg-muted"}),r.jsxs("div",{className:`flex items-center gap-2 ${t>=2?"text-primary":"text-muted-foreground"}`,children:[r.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-semibold ${t>=2?"bg-primary text-primary-foreground":"bg-muted"}`,children:"2"}),r.jsx("span",{className:"hidden sm:inline",children:"Enter Code"})]}),r.jsx("div",{className:"w-8 h-0.5 bg-muted"}),r.jsxs("div",{className:`flex items-center gap-2 ${t>=3?"text-primary":"text-muted-foreground"}`,children:[r.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-semibold ${t>=3?"bg-primary text-primary-foreground":"bg-muted"}`,children:"3"}),r.jsx("span",{className:"hidden sm:inline",children:"Complete"})]})]}),t===1&&r.jsxs(Ft,{className:"p-8 max-w-md mx-auto border-2",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(Cr,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-2xl font-bold mb-2 text-foreground",children:"Step 1: Validate Your Email"}),r.jsx("p",{className:"text-muted-foreground",children:"Enter your email address to receive a verification code"})]}),r.jsxs("form",{className:"space-y-4",onSubmit:w=>{w.preventDefault(),b(n)&&v()},name:"email-form",autoComplete:"on",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"email",children:"Email Address"}),r.jsx(un,{id:"email",type:"email",name:"email",autoComplete:"email",placeholder:"[email protected]",value:n,onChange:w=>a(w.target.value),className:"mt-2","data-testid":"email-input"})]}),d&&r.jsx("div",{className:"p-4 bg-primary/10 border border-primary/20 rounded-lg text-sm",children:d}),f&&r.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive",children:f}),r.jsx(Fe,{type:"submit",size:"lg",className:"w-full",disabled:o||!n,"data-testid":"send-code
374-button",children:o?"Sending...":"Send Verification Code"})]})]}),t===2&&r.jsxs(Ft,{className:"p-8 max-w-md mx-auto border-2",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(Ra,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-2xl font-bold mb-2 text-foreground",children:"Step 2: Enter Verification Code"}),r.jsx("p",{className:"text-muted-foreground",children:"Check your email for a 6-character code"}),r.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Sent to: ",r.jsx("strong",{children:n})]})]}),r.jsxs("form",{className:"space-y-4",onSubmit:w=>{w.preventDefault(),i.length===6&&C()},name:"verification-form",autoComplete:"on",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"code",children:"Verification Code"}),r.jsx(un,{id:"code",type:"text",name:"one-time-code",autoComplete:"one-time-code",inputMode:"text",pattern:"[A-Za-z0-9]{6}",maxLength:6,placeholder:"ABC123",value:i,onChange:S,onPaste:F,className:"mt-2 text-center text-2xl tracking-widest font-mono",autoFocus:!0,"data-testid":"verification-code-input"})]}),d&&r.jsx("div",{className:"p-4 bg-primary/10 border border-primary/20 rounded-lg text-sm",children:d}),f&&r.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive",children:f}),r.jsx(Fe,{type:"submit",size:"lg",className:`w-full transition-all ${i.length===6&&!o?"animate-pulse bg-green-600 hover:bg-green-700":""}`,disabled:o||i.length!==6,"data-testid":"verify-button",children:o?"Verifying...":i.length===6?"✓ Ready to Verify":"Verify Code"}),r.jsx(Fe,{type:"button",variant:"outline",className:"w-full",onClick:()=>e(1),disabled:o,"data-testid":"change-email-button",children:"Resend or Change Email Address"})]})]}),r.jsxs("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-3 gap-6",children:[r.jsx(Ft,{className:"p-6 border",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx("span",{className:"font-bold text-primary",children:"1"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold mb-1",children:"Validate Your Email"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your email and receive a secure verification code"})]})]})}),r.jsx(Ft,{className:"p-6 border",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx("span",{className:"font-bold text-primary",children:"2"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold mb-1",children:"Read and Accept Principles"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Review our 7 ethical principles for spatial computing"})]})]})}),r.jsx(Ft,{className:"p-6 border",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:r.jsx("span",{className:"font-bold text-primary",children:"3"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold mb-1",children:"Build Your Profile"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete your membership profile and join the community"})]})]})})]})]})})}const xC=[{name:"About",href:"#about"},{name:"Mission",href:"#mission"},{name:"Support",href:"#support"},{name:"Join",href:"#join"},{name:"Resources",href:"#resources"},{name:"Members",href:"/member"}],Os=()=>{const t=n=>{if(!n.startsWith("#")){window.location.href=n;return}const a=document.querySelector(n);a?a.scrollIntoView({behavior:"smooth"}):window.location.href=`/${n}`},e=()=>{window.location.href="/"};return r.jsx("nav",{className:"fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-md border-b",children:r.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[r.jsxs("button",{onClick:e,className:"flex items-center gap-3 overflow-hidden hover:opacity-80 transition-opacity",children:[r.jsx("img",{src:yA,alt:"X
374R Guild Logo",className:"h-16 w-auto dark:hidden",style:{clipPath:"inset(0 0 19% 0)"}}),r.jsx("img",{src:"/images/logo-dark.png",alt:"XR Guild Logo",className:"h-16 w-auto hidden dark:block",style:{clipPath:"inset(0 0 19% 0)"}})]}),r.jsx("div",{className:"hidden md:flex items-center gap-6",children:xC.map(n=>r.jsx("button",{onClick:()=>t(n.href),className:"text-sm font-medium text-foreground/70 hover:text-primary transition-colors",children:n.name},n.name))}),r.jsxs(nA,{children:[r.jsx(rA,{asChild:!0,className:"md:hidden",children:r.jsx(Fe,{variant:"ghost",size:"icon",children:r.jsx(x3,{className:"h-6 w-6"})})}),r.jsx(X1,{children:r.jsx("div",{className:"flex flex-col gap-4 mt-8",children:xC.map(n=>r.jsx("button",{onClick:()=>t(n.href),className:"text-left text-lg font-medium text-foreground/70 hover:text-primary transition-colors py-2",children:n.name},n.name))})})]})]})})};function xx(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var vx="Checkbox",[eO]=Xa(vx),[tO,sw]=eO(vx);function nO(t){const{__scopeCheckbox:e,checked:n,children:a,defaultChecked:i,disabled:s,form:o,name:c,onCheckedChange:d,required:m,value:f="on",internal_do_not_use_render:p}=t,[b,v]=ds({prop:n,defaultProp:i??!1,onChange:d,caller:vx}),[C,S]=x.useState(null),[F,w]=x.useState(null),A=x.useRef(!1),N=C?!!o||!!C.closest("form"):!0,P={checked:b,disabled:s,setChecked:v,control:C,setControl:S,name:c,form:o,value:f,hasConsumerStoppedPropagationRef:A,required:m,defaultChecked:wc(i)?!1:i,isFormControl:N,bubbleInput:F,setBubbleInput:w};return r.jsx(tO,{scope:e,...P,children:rO(p)?p(P):a})}var bA="CheckboxTrigger",wA=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...a},i)=>{const{control:s,value:o,disabled:c,checked:d,required:m,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:b,isFormControl:v,bubbleInput:C}=sw(bA,t),S=Hn(i,f),F=x.useRef(d);return x.useEffect(()=>{const w=s?.form;if(w){const A=()=>p(F.current);return w.addEventListener("reset",A),()=>w.removeEventListener("reset",A)}},[s,p]),r.jsx(Tn.button,{type:"button",role:"checkbox","aria-checked":wc(d)?"mixed":d,"aria-required":m,"data-state":EA(d),"data-disabled":c?"":void 0,disabled:c,value:o,...a,ref:S,onKeyDown:vn(e,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:vn(n,w=>{p(A=>wc(A)?!0:!A),C&&v&&(b.current=w.isPropagationStopped(),b.current||w.stopPropagation())})})});wA.displayName=bA;var ow=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:a,checked:i,defaultChecked:s,required:o,disabled:c,value:d,onCheckedChange:m,form:f,...p}=t;return r.jsx(nO,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:c,required:o,onCheckedChange:m,name:a,form:f,value:d,internal_do_not_use_render:({isFormControl:b})=>r.jsxs(r.Fragment,{children:[r.jsx(wA,{...p,ref:e,__scopeCheckbox:n}),b&&r.jsx(_A,{__scopeCheckbox:n})]})})});ow.displayName=vx;var SA="CheckboxIndicator",FA=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:a,...i}=t,s=sw(SA,n);return r.jsx(Yi,{present:a||wc(s.checked)||s.checked===!0,children:r.jsx(Tn.span,{"data-state":EA(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});FA.displayName=SA;var CA="CheckboxBubbleInput",_A=x.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:o,required:c,disabled:d,name:m,value:f,form:p,bubbleInput:b,setBubbleInput:v}=sw(CA,t),C=Hn(n,v),S=xx(s),F=sx(a);x.useEffect(()=>{const A=b;if(!A)return;const N=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(N,"checked").set,D=!i.current;if(S!==s&&z){const T=new Event("click",{bubbles:D});A.indeterminate=wc(s),z.call(A,wc(s)?!1:s),A.dispatchEvent(T)}},[b,S,s,i]);const w=x.useRef(wc(s)?!1:s);return r.jsx(Tn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??w.current,required:c,disabled:d,name:m,value:f,form:p,...e,tabIndex:-1,ref:C,style:{...e.style,...F,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_A.displayName=CA;function rO(t){return typeof t=="function"}function wc(t){return t==="indeterminate"}function EA(t){return wc(t)?"indeterminate":t?"checked":"unchecked"}const ar=x.forwardRef(({className:t,...e},n)=>r.jsx(ow,{ref:n,className:ln("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:r.jsx(FA,{className:ln("flex items-center justify-center text-current"),children:r.jsx(oi,{className:"h-4 w-4"})})}));ar.displayName=ow.displayName;const aO=({memberKey:t,onAcceptanceComplete:e,existingAcceptance:n,isImpersonation:a=!1})=>{const[i,s]=x.useState(null),[o,c]=x.useState(!0),[d,m]=x.useState(""),[f,p]=x.useState(new Set),[b,v]=x.useState(null),[C,S]=x.useState(!1),[F,w]=x.useState(!1),A=x.useRef({}),N=x.useRef(null),P=x.useRef(!1);x.useEffect(()=>{D()},[]);const z=(Y,W)=>{const H=Y.split(".").map(Number),J=W.split(".").map(Number);for(let ie=0;ie<Math.max(H.length,J.length);ie++){const Q=H[ie]||0,ve=J[ie]||0;if(Q>ve)return 1;if(Q<ve)return-1}return 0};x.useEffect(()=>{if(n&&i&&!P.current&&z(i.version,n.version)<=0){S(!0);const W=new Set(i.principles.map(H=>H.id));p(W),P.current=!0,e?.(n.date,n.version,!1)}},[n,i]);const D=async()=>{try{const Y=await fetch("/api/principles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:t,existingAcceptance:n})}),W=await Y.json();Y.ok&&W.success?s(W.data):m("Error loading principles")}catch(Y){console.error("Error fetching principles:",Y),m("Error loading principles")}finally{c(!1)}},T=(Y,W)=>{const H=new Set(f);if(H.has(Y))H.delete(Y);else if(H.add(Y),i){const ie=Y+1,Q=b===Y;if(ie<=i.principles.length){if(Q&&v(ie),W){const ve=W.clientY;setTimeout(()=>{const pe=A.current[ie];if(pe){const Me=pe.getBoundingClientRect(),We=window.scrollY+Me.top-ve+40;window.scrollTo({top:We,behavior:"smooth"})}},50)}}else Q&&v(null)}p(H)},K=Y=>{v(b===Y?null:Y)},B=i?.principles.every(Y=>f.has(Y.id))||!1;x.useEffect(()=>{B&&N.current&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"center"})},150)},[B]);const k=async()=>
374{if(!(!B||!i)){w(!0);try{const Y=await fetch("/api/acceptPrinciples",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:t,principlesVersion:i.version})}),W=await Y.json();Y.ok&&W.success?(S(!0),e?.(W.acceptanceDate,W.version,!0)):m(W.message||"Error recording acceptance")}catch(Y){console.error("Error submitting acceptance:",Y),m("Error recording acceptance")}finally{w(!1)}}};if(o)return r.jsx(Ft,{className:"p-8",children:r.jsx("p",{className:"text-center text-muted-foreground",children:"Loading principles..."})});if(d)return r.jsx(Ft,{className:"p-8",children:r.jsx("p",{className:"text-center text-destructive",children:d})});if(!i)return null;if(a)return r.jsx(Ft,{className:"p-6 border-2 border-primary/20",children:r.jsx("div",{className:"flex items-center gap-3",children:n?r.jsxs(r.Fragment,{children:[r.jsx(us,{className:"w-6 h-6 text-green-600"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"font-semibold text-lg",children:"Principles Accepted"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Accepted version ",n.version," on ",new Date(n.date).toLocaleDateString()]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx(bg,{className:"w-6 h-6 text-orange-500"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"font-semibold text-lg",children:"Principles Not Yet Accepted"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["This member has not accepted the XR Guild Principles (version ",i.version,")"]})]})]})})});if(C)return r.jsx(Ft,{className:"p-6 border-2 border-primary/20","data-testid":"principles-collapsed",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(us,{className:"w-6 h-6 text-green-600"}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-lg",children:"Principles Accepted"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Accepted on ",new Date(n?.date||"").toLocaleDateString()]})]})]}),r.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>S(!1),children:[r.jsx(Ja,{className:"w-5 h-5"}),"Expand"]})]})});const O=()=>{if(!i)return;if(n&&z(i.version,n.version)<=0){S(!0);return}const Y=new Set(i.principles.map(W=>W.id));p(Y)},I=Y=>Y?new Date(Y).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",j=n&&n.version===i.version,U=n&&z(i.version,n.version)>0,q=Y=>Y?new Date(Y).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return r.jsxs("div",{className:"space-y-6",children:[U&&r.jsx(Ft,{className:"p-6 border-2 border-primary bg-primary/5",children:r.jsxs("div",{className:"flex gap-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx(bg,{className:"w-6 h-6 text-primary"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Principles Updated"}),r.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["The XR Guild Principles were updated on"," ",r.jsx("strong",{children:q(i.lastUpdated)}),". We're asking all members to review and endorse these changes."]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["You previously accepted version ",n.version," on"," ",I(n.date),". Please review the current version ",i.version," below and accept if you agree."]})]})]})}),r.jsxs(Ft,{className:"p-6 border-2","data-testid":"principles-expanded",children:[r.jsxs("div",{className:"flex items-start justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold mb-1",children:"XR Guild Principles"}),r.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Version ",i.version," • Last updated ",I(i.lastUpdated)]}),r.jsxs("p",{className:"text-muted-foreground",children:["Please review and accept all ",i.principles.length," principles to continue."]})]}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:O,disabled:B&&!j,className:"ml-4 mt-1 whitespace-nowrap","data-testid":"accept-all-button",children:j?`Accepted on ${I(n.date)}`:B?"All accepted":"Accept them all"})]}),r.jsx("div",{className:"space-y-3",children:i.principles.map(Y=>r.jsx(Ft,{ref:W=>A.current[Y.id]=W,className:`p-4 transition-all ${f.has(Y.id)?"border-primary/50 bg-primary/5":"border-muted"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{onClick:W=>T(Y.id,W),children:r.jsx(ar,{id:`principle-${Y.id}`,checked:f.has(Y.id),onCheckedChange:()=>{},className:"mt-1"})}),r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-start justify-between cursor-pointer",onClick:()=>K(Y.id),children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"font-semibold text-lg mb-1",children:Y.title}),r.jsx("p",{className:"text-sm text-muted-foreground",dangerouslySetInnerHTML:{__html:Y.keyLine}})]}),r.jsx(Fe,{variant:"ghost",size:"sm",className:"ml-2",children:b===Y.id?r.jsx(gl,{className:"w-4 h-4"}):r.jsx(Ja,{className:"w-4 h-4"})})]}),b===Y.id&&r.jsx("div",{className:"mt-4 pt-4 border-t prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:Y.details}})]})]})},Y.id))})]}),B&&!j&&r.jsx(Ft,{ref:N,className:"p-6 border-2 border-primary/50 bg-gradient-to-br from-primary/5 to-accent/5 animate-in fade-in duration-300",children:r.jsxs("div",{className:"text-center space-y-4",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full",children:r.jsx(us,{className:"w-12 h-12 text-primary"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-2xl font-bold mb-2",children:"Thank You!"}),r.jsx("p",{className:"text-muted-foreground max-w-xl mx-auto",children:"Thank y
374ou for accepting our principles. By doing so, you're committing to help make spatial computing more ethical and accessible for everyone."})]}),r.jsx(Fe,{size:"lg",onClick:k,disabled:F,className:"bg-gradient-to-r from-primary to-accent hover:opacity-90 animate-pulse","data-testid":"proceed",children:F?"Recording...":"Continue to Profile"})]})}),d&&r.jsx(Ft,{className:"p-4 bg-destructive/10 border-destructive/20",children:r.jsx("p",{className:"text-sm text-destructive text-center",children:d})})]})},zi=x.forwardRef(({className:t,...e},n)=>r.jsx("textarea",{className:ln("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/45 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}));zi.displayName="Textarea";var On=function(){return On=Object.assign||function(e){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},On.apply(this,arguments)};function iO(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]]);return n}function kA(t,e,n){for(var a=0,i=e.length,s;a<i;a++)(s||!(a in e))&&(s||(s=Array.prototype.slice.call(e,0,a)),s[a]=e[a]);return t.concat(s||Array.prototype.slice.call(e))}function ef(t){return t.mode==="multiple"}function tf(t){return t.mode==="range"}function yx(t){return t.mode==="single"}var sO={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function oO(t,e){return Co(t,"LLLL y",e)}function lO(t,e){return Co(t,"d",e)}function cO(t,e){return Co(t,"LLLL",e)}function uO(t){return"".concat(t)}function dO(t,e){return Co(t,"cccccc",e)}function hO(t,e){return Co(t,"yyyy",e)}var mO=Object.freeze({__proto__:null,formatCaption:oO,formatDay:lO,formatMonthCaption:cO,formatWeekNumber:uO,formatWeekdayName:dO,formatYearCaption:hO}),fO=function(t,e,n){return Co(t,"do MMMM (EEEE)",n)},pO=function(){return"Month: "},gO=function(){return"Go to next month"},xO=function(){return"Go to previous month"},vO=function(t,e){return Co(t,"cccc",e)},yO=function(t){return"Week n. ".concat(t)},bO=function(){return"Year: "},wO=Object.freeze({__proto__:null,labelDay:fO,labelMonthDropdown:pO,labelNext:gO,labelPrevious:xO,labelWeekNumber:yO,labelWeekday:vO,labelYearDropdown:bO});function SO(){var t="buttons",e=sO,n=lA,a={},i={},s=1,o={},c=new Date;return{captionLayout:t,classNames:e,formatters:mO,labels:wO,locale:n,modifiersClassNames:a,modifiers:i,numberOfMonths:s,styles:o,today:c,mode:"default"}}function FO(t){var e=t.fromYear,n=t.toYear,a=t.fromMonth,i=t.toMonth,s=t.fromDate,o=t.toDate;return a?s=Ei(a):e&&(s=new Date(e,0,1)),i?o=tw(i):n&&(o=new Date(n,11,31)),{fromDate:s?zd(s):void 0,toDate:o?zd(o):void 0}}var AA=x.createContext(void 0);
374function CO(t){var e,n=t.initialProps,a=SO(),i=FO(n),s=i.fromDate,o=i.toDate,c=(e=n.captionLayout)!==null&&e!==void 0?e:a.captionLayout;c!=="buttons"&&(!s||!o)&&(c="buttons");var d;(yx(n)||ef(n)||tf(n))&&(d=n.onSelect);var m=On(On(On({},a),n),{captionLayout:c,classNames:On(On({},a.classNames),n.classNames),components:On({},n.components),formatters:On(On({},a.formatters),n.formatters),fromDate:s,labels:On(On({},a.labels),n.labels),mode:n.mode||a.mode,modifiers:On(On({},a.modifiers),n.modifiers),modifiersClassNames:On(On({},a.modifiersClassNames),n.modifiersClassNames),onSelect:d,styles:On(On({},a.styles),n.styles),toDate:o});return r.jsx(AA.Provider,{value:m,children:t.children})}function Er(){var t=x.useContext(AA);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function NA(t){var e=Er(),n=e.locale,a=e.classNames,i=e.styles,s=e.formatters.formatCaption;return r.jsx("div",{className:a.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:s(t.displayMonth,{locale:n})})}function _O(t){return r.jsx("svg",On({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:r.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function TA(t){var e,n,a=t.onChange,i=t.value,s=t.children,o=t.caption,c=t.className,d=t.style,m=Er(),f=(n=(e=m.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&n!==void 0?n:_O;return r.jsxs("div",{className:c,style:d,children:[r.jsx("span",{className:m.classNames.vhidden,children:t["aria-label"]}),r.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:m.classNames.dropdown,style:m.styles.dropdown,value:i,onChange:a,children:s}),r.jsxs("div",{className:m.classNames.caption_label,style:m.styles.caption_label,"aria-hidden":"true",children:[o,r.jsx(f,{className:m.classNames.dropdown_icon,style:m.styles.dropdown_icon})]})]})}function EO(t){var e,n=Er(),a=n.fromDate,i=n.toDate,s=n.styles,o=n.locale,c=n.formatters.formatMonthCaption,d=n.classNames,m=n.components,f=n.labels.labelMonthDropdown;if(!a)return r.jsx(r.Fragment,{});if(!i)return r.jsx(r.Fragment,{});var p=[];if(L9(a,i))for(var b=Ei(a),v=a.getMonth();v<=i.getMonth();v++)p.push(Fv(b,v));else for(var b=Ei(new Date),v=0;v<=11;v++)p.push(Fv(b,v));var C=function(F){var w=Number(F.target.value),A=Fv(Ei(t.displayMonth),w);t.onChange(A)},S=(e=m?.Dropdown)!==null&&e!==void 0?e:TA;return r.jsx(S,{name:"months","aria-label":f(),className:d.dropdown_month,style:s.dropdown_month,onChange:C,value:t.displayMonth.getMonth(),caption:c(t.displayMonth,{locale:o}),children:p.map(function(F){return r.jsx("option",{value:F.getMonth(),children:c(F,{locale:o})},F.getMonth())})})}function kO(t){var e,n=t.displayMonth,a=Er(),i=a.fromDate,s=a.toDate,o=a.locale,c=a.styles,d=a.classNames,m=a.components,f=a.formatters.formatYearCaption,p=a.labels.labelYearDropdown,b=[];if(!i)return r.jsx(r.Fragment,{});if(!s)return r.jsx(r.Fragment,{});for(var v=i.getFullYear(),C=s.getFullYear(),S=v;S<=C;S++)b.push(pC(sA(new Date),S));var F=function(A){var N=pC(Ei(n),Number(A.target.value));t.onChange(N)},w=(e=m?.Dropdown)!==null&&e!==void 0?e:TA;return r.jsx(w,{name:"years","aria-label":p(),className:d.dropdown_year,style:c.dropdown_year,onChange:F,value:n.getFullYear(),caption:f(n,{locale:o}),children:b.map(function(A){return r.jsx("option",{value:A.getFullYear(),children:f(A,{locale:o})},A.getFullYear())})})}function AO(t,e){var n=x.useState(t),a=n[0],i=n[1],s=e===void 0?a:e;return[s,i]}function NO(t){var e=t.month,n=t.defaultMonth,a=t.today,i=e||n||a||new Date,s=t.toDate,o=t.fromDate,c=t.numberOfMonths,d=c===void 0?1:c;if(s&&Lm(s,i)<0){var m=-1*(d-1);i=Ks(s,m)}return o&&Lm(i,o)<0&&(i=o),Ei(i)}function TO(){var t=Er(),e=NO(t),n=AO(e,t.month),a=n[0],i=n[1],s=function(o){var c;if(!t.disableNavigation){var d=Ei(o);
374i(d),(c=t.onMonthChange)===null||c===void 0||c.call(t,d)}};return[a,s]}function MO(t,e){for(var n=e.reverseMonths,a=e.numberOfMonths,i=Ei(t),s=Ei(Ks(i,a)),o=Lm(s,i),c=[],d=0;d<o;d++){var m=Ks(i,d);c.push(m)}return n&&(c=c.reverse()),c}function RO(t,e){if(!e.disableNavigation){var n=e.toDate,a=e.pagedNavigation,i=e.numberOfMonths,s=i===void 0?1:i,o=a?s:1,c=Ei(t);if(!n)return Ks(c,o);var d=Lm(n,t);if(!(d<s))return Ks(c,o)}}function DO(t,e){if(!e.disableNavigation){var n=e.fromDate,a=e.pagedNavigation,i=e.numberOfMonths,s=i===void 0?1:i,o=a?s:1,c=Ei(t);if(!n)return Ks(c,-o);var d=Lm(c,n);if(!(d<=0))return Ks(c,-o)}}var MA=x.createContext(void 0);function PO(t){var e=Er(),n=TO(),a=n[0],i=n[1],s=MO(a,e),o=RO(a,e),c=DO(a,e),d=function(p){return s.some(function(b){return rw(p,b)})},m=function(p,b){d(p)||(b&&mA(p,b)?i(Ks(p,1+e.numberOfMonths*-1)):i(p))},f={currentMonth:a,displayMonths:s,goToMonth:i,goToDate:m,previousMonth:c,nextMonth:o,isDateDisplayed:d};return r.jsx(MA.Provider,{value:f,children:t.children})}function nf(){var t=x.useContext(MA);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function vC(t){var e,n=Er(),a=n.classNames,i=n.styles,s=n.components,o=nf().goToMonth,c=function(f){o(Ks(f,t.displayIndex?-t.displayIndex:0))},d=(e=s?.CaptionLabel)!==null&&e!==void 0?e:NA,m=r.jsx(d,{id:t.id,displayMonth:t.displayMonth});return r.jsxs("div",{className:a.caption_dropdowns,style:i.caption_dropdowns,children:[r.jsx("div",{className:a.vhidden,children:m}),r.jsx(EO,{onChange:c,displayMonth:t.displayMonth}),r.jsx(kO,{onChange:c,displayMonth:t.displayMonth})]})}function jO(t){return r.jsx("svg",On({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:r.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function LO(t){return r.jsx("svg",On({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:r.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Mg=x.forwardRef(function(t,e){var n=Er(),a=n.classNames,i=n.styles,s=[a.button_reset,a.button];t.className&&s.push(t.className);var o=s.join(" "),c=On(On({},i.button_reset),i.button);return t.style&&Object.assign(c,t.style),r.jsx("button",On({},t,{ref:e,type:"button",className:o,style:c}
374))});function IO(t){var e,n,a=Er(),i=a.dir,s=a.locale,o=a.classNames,c=a.styles,d=a.labels,m=d.labelPrevious,f=d.labelNext,p=a.components;if(!t.nextMonth&&!t.previousMonth)return r.jsx(r.Fragment,{});var b=m(t.previousMonth,{locale:s}),v=[o.nav_button,o.nav_button_previous].join(" "),C=f(t.nextMonth,{locale:s}),S=[o.nav_button,o.nav_button_next].join(" "),F=(e=p?.IconRight)!==null&&e!==void 0?e:LO,w=(n=p?.IconLeft)!==null&&n!==void 0?n:jO;return r.jsxs("div",{className:o.nav,style:c.nav,children:[!t.hidePrevious&&r.jsx(Mg,{name:"previous-month","aria-label":b,className:v,style:c.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:i==="rtl"?r.jsx(F,{className:o.nav_icon,style:c.nav_icon}):r.jsx(w,{className:o.nav_icon,style:c.nav_icon})}),!t.hideNext&&r.jsx(Mg,{name:"next-month","aria-label":C,className:S,style:c.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:i==="rtl"?r.jsx(w,{className:o.nav_icon,style:c.nav_icon}):r.jsx(F,{className:o.nav_icon,style:c.nav_icon})})]})}function yC(t){var e=Er().numberOfMonths,n=nf(),a=n.previousMonth,i=n.nextMonth,s=n.goToMonth,o=n.displayMonths,c=o.findIndex(function(C){return rw(t.displayMonth,C)}),d=c===0,m=c===o.length-1,f=e>1&&(d||!m),p=e>1&&(m||!d),b=function(){a&&s(a)},v=function(){i&&s(i)};return r.jsx(IO,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:p,nextMonth:i,previousMonth:a,onPreviousClick:b,onNextClick:v})}function BO(t){var e,n=Er(),a=n.classNames,i=n.disableNavigation,s=n.styles,o=n.captionLayout,c=n.components,d=(e=c?.CaptionLabel)!==null&&e!==void 0?e:NA,m;return i?m=r.jsx(d,{id:t.id,displayMonth:t.displayMonth}):o==="dropdown"?m=r.jsx(vC,{displayMonth:t.displayMonth,id:t.id}):o==="dropdown-buttons"?m=r.jsxs(r.Fragment,{children:[r.jsx(vC,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),r.jsx(yC,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):m=r.jsxs(r.Fragment,{children:[r.jsx(d,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),r.jsx(yC,{displayMonth:t.displayMonth,id:t.id})]}),r.jsx("div",{className:a.caption,style:s.caption,children:m})}function OO(t){var e=Er(),n=e.footer,a=e.styles,i=e.classNames.tfoot;return n?r.jsx("tfoot",{className:i,style:a.tfoot,children:r.jsx("tr",{children:r.jsx("td",{colSpan:8,children:n})})}):r.jsx(r.Fragment,{})}function UO(t,e,n){for(var a=n?yu(new Date):No(new Date,{locale:t,weekStartsOn:e}),i=[],s=0;s<7;s++){var o=ii(a,s);i.push(o)}return i}function zO(){var t=Er(),e=t.classNames,n=t.styles,a=t.showWeekNumber,i=t.locale,s=t.weekStartsOn,o=t.ISOWeek,c=t.formatters.formatWeekdayName,d=t.labels.labelWeekday,m=UO(i,s,o);return r.jsxs("tr",{style:n.head_row,className:e.head_row,children:[a&&r.jsx("td",{style:n.head_cell,className:e.head_cell}),m.map(function(f,p){return r.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":d(f,{locale:i}),children:c(f,{locale:i})},p)})]})}function GO(){var t,e=Er(),n=e.classNames,a=e.styles,i=e.components,s=(t=i?.HeadRow)!==null&&t!==void 0?t:zO;return r.jsx("thead",{style:a.head,className:n.head,children:r.jsx(s,{})})}function HO(t){var e=Er(),n=e.locale,a=e.formatters.formatDay;return r.jsx(r.Fragment,{children:a(t.date,{locale:n})})}var lw=x.createContext(void 0);function WO(t){if(!ef(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return r.jsx(lw.Provider,{value:e,children:t.children})}return r.jsx(VO,{initialProps:t.initialProps,children:t.children})}function VO(t){var e=t.initialProps,n=t.children,a=e.selected,i=e.min,s=e.max,o=function(m,f,p){var b,v;(b=e.onDayClick)===null||b===void 0||b.call(e,m,f,p);var C=!!(f.selected&&i&&a?.length===i);if(!C){var S=!!(!f.selected&&s&&a?.length===s);if(!S){var F=a?kA([],a):[];if(f.selected){var w=F.findIndex(function(A){return Ci(m,A)});F.splice(w,1)}else F.push(m);(v=e.onSelect)===null||v===void 0||v.call(e,F,m,f,p)}}},c={disabled:[]};a&&c.disabled.push(function(m){var f=s&&a.length>s-1,p=a.some(function(b){return Ci(b,m)});return!!(f&&!p)});var d={selected:a,onDayClick:o,modifiers:c};return r.jsx(lw.Provider,{value:d,children:n})}function cw(){var t=x.useContext(lw);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function $O(t,e){var n=e||{},a=n.from,i=n.to;return a&&i?Ci(i,t)&&Ci(a,t)?void 0:Ci(i,t)?{from:i,to:void 0}:Ci(a,t)?void 0:Qy(a,t)?{from:t,to:i}:{from:a,to:t}:i?Qy(t,i)?{from:i,to:t}:{from:t,to:i}:a?mA(t,a)?{from:t,to:a}:{from:a,to:t}:{from:t,to:void 0}}var uw=x.createContext(void 0);function KO(t){if(!tf(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return r.jsx(uw.Provider,{value:e,children:t.children})}return r.jsx(YO,{initialProps:t.initialProps,children:t.children})}function YO(t){var e=t.initialProps,n=t.children,a=e.selected,i=a||{},s=i.from,o=i.to,c=e.min,d=e.max,m=function(v,C,S){var F,w;(F=e.onDayClick)===null||F===void 0||F.call(e,v,C,S);var A=$O(v,a);(w=e.onSelect)===null||w===void 0||w.call(e,A,v,C,S)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(f.range_start=[s],o?(f.range_end=[o],Ci(s,o)||(f.range_middle=[{after:s,before:o}])):f.range_end=[s]):o&&(f.range_start=[o],f.range_end=[o]),c&&(s&&!o&&f.disabled.push({after:Sv(s,c-1),before:ii(s,c-1)}),s&&o&&f.disabled.push({after:s,before:ii(s,c-1)}),!s&&o&&f.disabled.push({after:Sv(o,c-1),before:ii(o,c-1)})),d){if(s&&!o&&(f.disabled.push({before:ii(s,-d+1)}),f.disabled.push({after:ii(s,d-1)})),s&&o){var p=vo(o,s)+1,b=d-p;f.disabled.push({before:Sv(s,b)}),f.disabled.push({after:ii(o,b)})}!s&&o&&(f.disabled.push({before:ii(o,-d+1)}),f.disabled.push({after:ii(o,d-1)}))}
374return r.jsx(uw.Provider,{value:{selected:a,onDayClick:m,modifiers:f},children:n})}function dw(){var t=x.useContext(uw);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function hg(t){return Array.isArray(t)?kA([],t):t!==void 0?[t]:[]}function qO(t){var e={};return Object.entries(t).forEach(function(n){var a=n[0],i=n[1];e[a]=hg(i)}),e}var Ys;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Ys||(Ys={}));var JO=Ys.Selected,nl=Ys.Disabled,XO=Ys.Hidden,ZO=Ys.Today,Cv=Ys.RangeEnd,_v=Ys.RangeMiddle,Ev=Ys.RangeStart,QO=Ys.Outside;function e8(t,e,n){var a,i=(a={},a[JO]=hg(t.selected),a[nl]=hg(t.disabled),a[XO]=hg(t.hidden),a[ZO]=[t.today],a[Cv]=[],a[_v]=[],a[Ev]=[],a[QO]=[],a);return t.fromDate&&i[nl].push({before:t.fromDate}),t.toDate&&i[nl].push({after:t.toDate}),ef(t)?i[nl]=i[nl].concat(e.modifiers[nl]):tf(t)&&(i[nl]=i[nl].concat(n.modifiers[nl]),i[Ev]=n.modifiers[Ev],i[_v]=n.modifiers[_v],i[Cv]=n.modifiers[Cv]),i}var RA=x.createContext(void 0);function t8(t){var e=Er(),n=cw(),a=dw(),i=e8(e,n,a),s=qO(e.modifiers),o=On(On({},i),s);return r.jsx(RA.Provider,{value:o,children:t.children})}function DA(){var t=x.useContext(RA);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function n8(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function r8(t){return!!(t&&typeof t=="object"&&"from"in t)}function a8(t){return!!(t&&typeof t=="object"&&"after"in t)}function i8(t){return!!(t&&typeof t=="object"&&"before"in t)}function s8(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function o8(t,e){var n,a=e.from,i=e.to;if(a&&i){var s=vo(i,a)<0;s&&(n=[i,a],a=n[0],i=n[1]);var o=vo(t,a)>=0&&vo(i,t)>=0;return o}return i?Ci(i,t):a?Ci(a,t):!1}function l8(t){return ew(t)}function c8(t){return Array.isArray(t)&&t.every(ew)}function u8(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(l8(n))return Ci(t,n);if(c8(n))return n.includes(t);if(r8(n))return o8(t,n);if(s8(n))return n.dayOfWeek.includes(t.getDay());if(n8(n)){var a=vo(n.before,t),i=vo(n.after,t),s=a>0,o=i<0,c=Qy(n.before,n.after);return c?o&&s:s||o}return a8(n)?vo(t,n.after)>0:i8(n)?vo(n.before,t)>0:typeof n=="function"?n(t):!1})}function hw(t,e,n){var a=Object.keys(e).reduce(function(s,o){var c=e[o];return u8(t,c)&&s.push(o),s},[]),i={};return a.forEach(function(s){return i[s]=!0}),n&&!rw(t,n)&&(i.outside=!0),i}function d8(t,e){for(var n=Ei(t[0]),a=tw(t[t.length-1]),i,s,o=n;o<=a;){var c=hw(o,e),d=!c.disabled&&!c.hidden;if(!d){o=ii(o,1);continue}if(c.selected)return o;c.today&&!s&&(s=o),i||(i=o),o=ii(o,1)}return s||i}var h8=365;function PA(t,e){var n=e.moveBy,a=e.direction,i=e.context,s=e.modifiers,o=e.retry,c=o===void 0?{count:0,lastFocused:t}:o,d=i.weekStartsOn,m=i.fromDate,f=i.toDate,p=i.locale,b={day:ii,week:Zy,month:Ks,year:RB,startOfWeek:function(F){return i.ISOWeek?yu(F):No(F,{locale:p,weekStartsOn:d})},endOfWeek:function(F){return i.ISOWeek?oA(F):nw(F,{locale:p,weekStartsOn:d})}},v=b[n](t,a==="after"?1:-1);a==="before"&&m?v=DB([m,v]):a==="after"&&f&&(v=PB([f,v]));var C=!0;if(s){var S=hw(v,s);C=!S.disabled&&!S.hidden}return C?v:c.count>h8?c.lastFocused:PA(v,{moveBy:n,direction:a,context:i,modifiers:s,retry:On(On({},c),{count:c.count+1})})}var jA=x.createContext(void 0);function m8(t){var e=nf(),n=DA(),a=x.useState(),i=a[0],s=a[1],o=x.use
374State(),c=o[0],d=o[1],m=d8(e.displayMonths,n),f=i??(c&&e.isDateDisplayed(c))?c:m,p=function(){d(i),s(void 0)},b=function(F){s(F)},v=Er(),C=function(F,w){if(i){var A=PA(i,{moveBy:F,direction:w,context:v,modifiers:n});Ci(i,A)||(e.goToDate(A,i),b(A))}},S={focusedDay:i,focusTarget:f,blur:p,focus:b,focusDayAfter:function(){return C("day","after")},focusDayBefore:function(){return C("day","before")},focusWeekAfter:function(){return C("week","after")},focusWeekBefore:function(){return C("week","before")},focusMonthBefore:function(){return C("month","before")},focusMonthAfter:function(){return C("month","after")},focusYearBefore:function(){return C("year","before")},focusYearAfter:function(){return C("year","after")},focusStartOfWeek:function(){return C("startOfWeek","before")},focusEndOfWeek:function(){return C("endOfWeek","after")}};return r.jsx(jA.Provider,{value:S,children:t.children})}function mw(){var t=x.useContext(jA);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function f8(t,e){var n=DA(),a=hw(t,n,e);return a}var fw=x.createContext(void 0);function p8(t){if(!yx(t.initialProps)){var e={selected:void 0};return r.jsx(fw.Provider,{value:e,children:t.children})}return r.jsx(g8,{initialProps:t.initialProps,children:t.children})}function g8(t){var e=t.initialProps,n=t.children,a=function(s,o,c){var d,m,f;if((d=e.onDayClick)===null||d===void 0||d.call(e,s,o,c),o.selected&&!e.required){(m=e.onSelect)===null||m===void 0||m.call(e,void 0,s,o,c);return}(f=e.onSelect)===null||f===void 0||f.call(e,s,s,o,c)},i={selected:e.selected,onDayClick:a};return r.jsx(fw.Provider,{value:i,children:n})}function LA(){var t=x.useContext(fw);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function x8(t,e){var n=Er(),a=LA(),i=cw(),s=dw(),o=mw(),c=o.focusDayAfter,d=o.focusDayBefore,m=o.focusWeekAfter,f=o.focusWeekBefore,p=o.blur,b=o.focus,v=o.focusMonthBefore,C=o.focusMonthAfter,S=o.focusYearBefore,F=o.focusYearAfter,w=o.focusStartOfWeek,A=o.focusEndOfWeek,N=function(W){var H,J,ie,Q;yx(n)?(H=a.onDayClick)===null||H===void 0||H.call(a,t,e,W):ef(n)?(J=i.onDayClick)===null||J===void 0||J.call(i,t,e,W):tf(n)?(ie=s.onDayClick)===null||ie===void 0||ie.call(s,t,e,W):(Q=n.onDayClick)===null||Q===void 0||Q.call(n,t,e,W)},P=function(W){var H;b(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,W)},z=function(W){var H;p(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,W)},D=function(W){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,W)},T=function(W){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,W)},K=function(W){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,W)},B=function(W){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,W)},k=function(W){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,W)},O=function(W){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,W)},I=function(W){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,W)},j=function(W){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,W)},U=function(W){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,W)},q=function(W){var H;switch(W.key){case"ArrowLeft":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?c():d();break;case"ArrowRight":W.preventDefault(),W.stopPropagation(),n.dir==="rtl"?d():c();break;case"ArrowDown":W.preventDefault(),W.stopPropagation(),m();break;case"ArrowUp":W.preventDefault(),W.stopPropagation(),f();break;case"PageUp":W.preventDefault(),W.stopPropagation(),W.shiftKey?S():v();break;case"PageDown":W.preventDefault(),W.stopPropagation(),W.shiftKey?F():C();break;case"Home":W.preventDefault(),W.stopPropagation(),w();break;case"End":W.preventDefault(),W.stopPropagation(),A();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,W)},Y={onClick:N,onFocus:P,onBlur:z,onKeyDown:q,onKeyUp:U,onMouseEnter:D,onMouseLeave:T,onPointerEnter:K,onPointerLeave:B,onTouchCancel:k,onTouchEnd:O,onTouchMove:I,onTouchStart:j};return Y}function v8(){var t=Er(),e=LA(),n=cw(),a=dw(),i=yx(t)?e.selected:ef(t)?n.selected:tf(t)?a.selected:void 0;return i}function y8(t){return Object.values(Ys).includes(t)}function b8(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(a){var i=t.modifiersClassNames[a];if(i)n.push(i);
374else if(y8(a)){var s=t.classNames["day_".concat(a)];s&&n.push(s)}}),n}function w8(t,e){var n=On({},t.styles.day);return Object.keys(e).forEach(function(a){var i;n=On(On({},n),(i=t.modifiersStyles)===null||i===void 0?void 0:i[a])}),n}function S8(t,e,n){var a,i,s,o=Er(),c=mw(),d=f8(t,e),m=x8(t,d),f=v8(),p=!!(o.onDayClick||o.mode!=="default");x.useEffect(function(){var D;d.outside||c.focusedDay&&p&&Ci(c.focusedDay,t)&&((D=n.current)===null||D===void 0||D.focus())},[c.focusedDay,t,n,p,d.outside]);var b=b8(o,d).join(" "),v=w8(o,d),C=!!(d.outside&&!o.showOutsideDays||d.hidden),S=(s=(i=o.components)===null||i===void 0?void 0:i.DayContent)!==null&&s!==void 0?s:HO,F=r.jsx(S,{date:t,displayMonth:e,activeModifiers:d}),w={style:v,className:b,children:F,role:"gridcell"},A=c.focusTarget&&Ci(c.focusTarget,t)&&!d.outside,N=c.focusedDay&&Ci(c.focusedDay,t),P=On(On(On({},w),(a={disabled:d.disabled,role:"gridcell"},a["aria-selected"]=d.selected,a.tabIndex=N||A?0:-1,a)),m),z={isButton:p,isHidden:C,activeModifiers:d,selectedDays:f,buttonProps:P,divProps:w};return z}function F8(t){var e=x.useRef(null),n=S8(t.date,t.displayMonth,e);return n.isHidden?r.jsx("div",{role:"gridcell"}):n.isButton?r.jsx(Mg,On({name:"day",ref:e},n.buttonProps)):r.jsx("div",On({},n.divProps))}function C8(t){var e=t.number,n=t.dates,a=Er(),i=a.onWeekNumberClick,s=a.styles,o=a.classNames,c=a.locale,d=a.labels.labelWeekNumber,m=a.formatters.formatWeekNumber,f=m(Number(e),{locale:c});if(!i)return r.jsx("span",{className:o.weeknumber,style:s.weeknumber,children:f});var p=d(Number(e),{locale:c}),b=function(v){i(e,n,v)};return r.jsx(Mg,{name:"week-number","aria-label":p,className:o.weeknumber,style:s.weeknumber,onClick:b,children:f})}function _8(t){var e,n,a=Er(),i=a.styles,s=a.classNames,o=a.showWeekNumber,c=a.components,d=(e=c?.Day)!==null&&e!==void 0?e:F8,m=(n=c?.WeekNumber)!==null&&n!==void 0?n:C8,f;return o&&(f=r.jsx("td",{className:s.cell,style:i.cell,children:r.jsx(m,{number:t.weekNumber,dates:t.dates})})),r.jsxs("tr",{className:s.row,style:i.row,children:[f,t.dates.map(function(p){return r.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:r.jsx(d,{displayMonth:t.displayMonth,date:p})},D9(p))})]})}function bC(t,e,n){for(var a=n?.ISOWeek?oA(e):nw(e,n),i=n?.ISOWeek?yu(t):No(t,n),s=vo(a,i),o=[],c=0;c<=s;c++)o.push(ii(i,c));var d=o.reduce(function(m,f){var p=n?.ISOWeek?cA(f):dA(f,n),b=m.find(function(v){return v.weekNumber===p});return b?(b.dates.push(f),m):(m.push({weekNumber:p,dates:[f]}),m)},[]);return d}function E8(t,e){var n=bC(Ei(t),tw(t),e);if(e?.useFixedWeeks){var a=j9(t,e);if(a<6){var i=n[n.length-1],s=i.dates[i.dates.length-1],o=Zy(s,6-a),c=bC(Zy(s,1),o,e);n.push.apply(n,c)}}return n}function k8(t){var e,n,a,i=Er(),s=i.locale,o=i.classNames,c=i.styles,d=i.hideHead,m=i.fixedWeeks,f=i.components,p=i.weekStartsOn,b=i.firstWeekContainsDate,v=i.ISOWeek,C=E8(t.displayMonth,{useFixedWeeks:!!m,ISOWeek:v,locale:s,weekStartsOn:p,firstWeekContainsDate:b}),S=(e=f?.Head)!==null&&e!==void 0?e:GO,F=(n=f?.Row)!==null&&n!==void 0?n:_8,w=(a=f?.Footer)!==null&&a!==void 0?a:OO;return r.jsxs("table",{id:t.id,className:o.table,style:c.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!d&&r.jsx(S,{}),r.jsx("tbody",{className:o.tbody,style:c.tbody,children:C.map(function(A){return r.jsx(F,{displayMonth:t.displayMonth,dates:A.dates,weekNumber:A.weekNumber},A.weekNumber)})}),r.jsx(w,{displayMonth:t.displayMonth})]})}function A8(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var N8=A8()?x.useLayoutEffect:x.useEffect,kv=!1,T8=0;function wC(){return"react-day-picker-".concat(++T8)}function M8(t){var e,n=t??(kv?wC():null),a=x.useState(n),i=a[0],s=a[1];return N8(function(){i===null&&s(wC())},[]),x.useEffect(function(){kv===!1&&(kv=!0)},[]),(e=t??i)!==null&&e!==void 0?e:void 0}function R8(t){var e,n,a=Er(),i=a.dir,s=a.classNames,o=a.styles,c=a.components,d=nf().displayMonths,m=M8(a.id?"".concat(a.id,"-").concat(t.displayIndex):void 0),f=a.id?"".concat(a.id,"-grid-").concat(t.displayIndex):void 0,p=[s.month],b=o.month,v=t.displayIndex===0,C=t.displayIndex===d.length-1,S=!v&&!C;i==="rtl"&&(e=[v,C],C=e[0],v=e[1]),v&&(p.push(s.caption_start),b=On(On({}
374,b),o.caption_start)),C&&(p.push(s.caption_end),b=On(On({},b),o.caption_end)),S&&(p.push(s.caption_between),b=On(On({},b),o.caption_between));var F=(n=c?.Caption)!==null&&n!==void 0?n:BO;return r.jsxs("div",{className:p.join(" "),style:b,children:[r.jsx(F,{id:m,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),r.jsx(k8,{id:f,"aria-labelledby":m,displayMonth:t.displayMonth})]},t.displayIndex)}function D8(t){var e=Er(),n=e.classNames,a=e.styles;return r.jsx("div",{className:n.months,style:a.months,children:t.children})}function P8(t){var e,n,a=t.initialProps,i=Er(),s=mw(),o=nf(),c=x.useState(!1),d=c[0],m=c[1];x.useEffect(function(){i.initialFocus&&s.focusTarget&&(d||(s.focus(s.focusTarget),m(!0)))},[i.initialFocus,d,s.focus,s.focusTarget,s]);var f=[i.classNames.root,i.className];i.numberOfMonths>1&&f.push(i.classNames.multiple_months),i.showWeekNumber&&f.push(i.classNames.with_weeknumber);var p=On(On({},i.styles.root),i.style),b=Object.keys(a).filter(function(C){return C.startsWith("data-")}).reduce(function(C,S){var F;return On(On({},C),(F={},F[S]=a[S],F))},{}),v=(n=(e=a.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:D8;return r.jsx("div",On({className:f.join(" "),style:p,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},b,{children:r.jsx(v,{children:o.displayMonths.map(function(C,S){return r.jsx(R8,{displayIndex:S,displayMonth:C},S)})})}))}function j8(t){var e=t.children,n=iO(t,["children"]);return r.jsx(CO,{initialProps:n,children:r.jsx(PO,{children:r.jsx(p8,{initialProps:n,children:r.jsx(WO,{initialProps:n,children:r.jsx(KO,{initialProps:n,children:r.jsx(t8,{children:r.jsx(m8,{children:e})})})})})})})}function L8(t){return r.jsx(j8,On({},t,{children:r.jsx(P8,{initialProps:t})}))}function IA({className:t,classNames:e,showOutsideDays:n=!0,...a}){return r.jsx(L8,{showOutsideDays:n,className:ln("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ln(jm({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ln(jm({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:({...i})=>r.jsx(Qg,{className:"h-4 w-4"}),IconRight:({...i})=>r.jsx(nh,{className:"h-4 w-4"})},...a})}IA.displayName="Calendar";const I8=1e3,B8=3e4;function O8({sessionId:t,isAuthenticated:e}){const[n,a]=x.useState(!1),[i,s]=x.useState({}),[o,c]=x.useState(null),d=x.useRef(null),m=x.useRef(0),f=x.useRef(null),p=x.useRef(null),b=()=>t?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?sessionId=${t}`:null,v=()=>{const k=b();if(!k||!e)return;console.log("[WS] Connecting to:",k);const O=new WebSocket(k);d.current=O,O.onopen=()=>{console.log("[WS] Connected"),a(!0),m.current=0},O.onmessage=I=>{try{const j=JSON.parse(I.data);S(j)}catch(j){console.error("[WS] Error parsing message:",j)}},O.onclose=I=>{console.log("[WS] Disconnected:",I.code,I.reason),a(!1),d.current=null,e&&C()},O.onerror=I=>{console.error("[WS] Error:",I)}},C=()=>{f.current&&clearTimeout(f.current);const k=Math.min(I8*Math.pow(2,m.current),B8);console.log(`[WS] Reconnecting in ${k}ms (attempt ${m.current+1})`),f.current=setTimeout(()=>{m.current++,v()},k)},S=k=>{switch(k.type){case"connected":console.log("[WS] Welcome message:",k.data);break;case"presence-changed":F(k.data);break;case"field-saved":console.log("[WS] Field saved:",k.data.fieldKey);break;case"field-updated":w(k.data);break;case"member-data-refreshed":A(k.data);break;case"events:calendar-changed":N(k.data);break;case"restart-scheduled":P(k.data);break;case"restart-cancelled":z();break;case"server-shutdown":console.log("[WS] Server is shutting down");break;default:console.warn("[WS] Unknown message type:",k.type)}},F=k=>{const{fieldKey:O,editing:I}=k;console.log("[useWebSocket] handlePresenceChanged received:",{fieldKey:O,editing:I,fullData:k}),s(j=>({...j,[O]:I})),console.log("[useWebSocket] presenceMap after update:",{[O]:I})},w=k=>{const{fieldKey:O,value:I,updatedBy:j,timestamp:U}=k;console.log("[WS] Dispatching ws-field-updated event:",{fieldKey:O,value:I,updatedBy:j,timestamp:U});const q=new CustomEvent("ws-field-updated",{detail:{fieldKey:O,value:I,updatedBy:j,timestamp:U}});window.dispatchEvent(q)},A=k=>{const{memberKey:O,member:I,source:j,timestamp:U}=k;console.log("[WS] Member updated (reverse sync):",{memberKey:O,source:j,timestamp:U});const q=new CustomEvent("ws-member-updated",{detail:{memberKey:O,member:I,source:j,timestamp:U}});window.dispatchEvent(q)},N=k=>{console.log("[WS] Dispatching ws-calendar-changed event:",k);const O=new CustomEvent("ws-calendar-changed",{detail:k});window.dispatchEvent(O)},P=k=>{p.current&&clearInterval(p.current),c(k),p.current=setInterval(()=>{c(O=>{if(!O)return null;const I=Date.now(),j=Math.max(0,Math.floor((O.restartAt-I)/1e3));return j<=0?(p.current&&clearInterval(p.current),null):{...O,remainingSeconds:j}})},1e3)},z=()=>{p.current&&(clearInterval(p.current),p.current=null),c(null)},D=(k,O,I)=>{!d.current||d.current.readyState!==WebSocket.OPEN||d.current.send(JSON.stringify({type:"presence-update",action:k,data:{fieldKey:O,...I}}))},T=(k,O,I,j,U)=>{if(!d.current||d.current.readyState!==WebSocket.OPEN){console.warn("[WS] Cannot send field change - not connected");return}d.current.send(JSON.stringify({type:"field-change",data:{resource:k,resourceId:O,fieldName:I,fieldKey:j,value:U,timestamp:Date.now()}}))};return x.useEffect(()=>(e&&t&&v(),()=>{f.current&&clearTimeout(f.current),p.current&&clearInterval(p.current),d.current&&d.current.close()}),[e,t]),{isConnected:n,presenceMap:i,restartCountdown:o,sendPresence:D,sendFieldChange:T,testRestartCountdown:k=>{if(!d.current||d.current.readyState!==WebSocket.OPEN){console.warn("[WS] Cannot send test restart - not connected");return}d.current.send(JSON.stringify({type:"test-restart-countdown",data:{delaySeconds:k}})),console.log(`[WS] Test restart countdown sent: ${k} seconds`)},cancelRestartCountdown:()=>
374{if(!d.current||d.current.readyState!==WebSocket.OPEN){console.warn("[WS] Cannot send cancel restart - not connected");return}d.current.send(JSON.stringify({type:"cancel-restart-countdown"})),console.log("[WS] Cancel restart countdown sent")}}}const BA=x.createContext(null);function OA({sessionId:t,isAuthenticated:e,children:n}){const a=O8({sessionId:t,isAuthenticated:e});return r.jsx(BA.Provider,{value:a,children:n})}function rf(){const t=x.useContext(BA);if(!t)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return t}function Oi({resource:t,resourceId:e,fieldName:n,value:a,onChange:i,type:s="input",disabled:o=!1,label:c,inputProps:d,textareaProps:m}){const{isConnected:f,presenceMap:p,sendPresence:b,sendFieldChange:v}=rf(),C=`${t}:${e}:${n}`,[S,F]=x.useState(!1),[w,A]=x.useState(!1),[N,P]=x.useState({start:0,end:0}),z=x.useRef(null),D=x.useRef(null),T=x.useRef(null),K=p[C],B=K&&(K.action==="focus"||K.action==="typing");x.useEffect(()=>{B&&K?.value!==void 0&&!w&&i(K.value)},[B,K?.value,w,i]);const k=()=>{if(T.current){const W=T.current.selectionStart??0,H=T.current.selectionEnd??0;P({start:W,end:H}),f&&w&&b("typing",C,{resource:t,resourceId:e,fieldName:n,value:a,cursorStart:W,cursorEnd:H})}},O=()=>{A(!0),k(),f&&b("focus",C,{resource:t,resourceId:e,fieldName:n,value:a,cursorStart:N.start,cursorEnd:N.end})},I=()=>{A(!1),f&&b("blur",C,{resource:t,resourceId:e,fieldName:n,value:a})},j=W=>{B||(i(W),F(!1),z.current&&clearTimeout(z.current),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{k(),f&&b("typing",C,{resource:t,resourceId:e,fieldName:n,value:W,cursorStart:T.current?.selectionStart??0,cursorEnd:T.current?.selectionEnd??0})},100),f&&(v(t,e,n,C,W),z.current=setTimeout(()=>{F(!0),setTimeout(()=>F(!1),2e3)},500)))};x.useEffect(()=>{const W=H=>{const{fieldKey:J,value:ie}=H.detail;J===C&&!w&&i(ie)};return window.addEventListener("ws-field-updated",W),()=>{window.removeEventListener("ws-field-updated",W)}},[C,w,i]),x.useEffect(()=>()=>{z.current&&clearTimeout(z.current),D.current&&clearTimeout(D.current)},[]);const U=()=>{if(!B||!K||K.cursorStart===void 0)return null;
374const W=a||"",H=K.cursorStart??0,J=K.cursorEnd??H,ie=H!==J,Q=W.substring(0,H),ve=W.substring(H,J),pe=W.substring(J);return r.jsxs("div",{className:"w-full rounded-md border border-red-500 border-2 bg-background px-3 py-2 text-sm ring-offset-background cursor-not-allowed whitespace-pre-wrap ",children:[r.jsx("span",{children:Q}),ie?r.jsx("span",{className:"relative",style:{backgroundColor:"rgba(96, 165, 250, 0.3)",boxShadow:"0 0 0 2px rgba(96, 165, 250, 0.3)"},children:ve}):r.jsx("span",{className:"relative inline",style:{position:"relative",display:"inline"},children:r.jsx("span",{className:"absolute text-red-500 font-bold",style:{left:"0",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",animation:"blink 1s step-end infinite",lineHeight:"1"},children:"|"})}),r.jsx("span",{children:pe}),r.jsx("style",{children:`
375          @keyframes blink {
376            0%, 50% { opacity: 1; }
377            51%, 100% { opacity: 0; }
378          }
379        `})]})};x.useEffect(()=>{console.log(`[CollaborativeField ${C}] isLockedByOther:`,B,"presence.value:",K?.value,"value:",a)},[B,K?.value,a,C]),x.useEffect(()=>{B&&console.log(`[CollaborativeField] Field ${C} is LOCKED by ${K.adminEmail}`)},[B,C,K]);let q=null,Y="outline";if(B&&K){const W=K.action==="typing"?"typing":"focus";q=`Locked by ${K.adminEmail} (${W})`,Y="destructive"}else S&&(q="Saved",Y="secondary");return r.jsxs("div",{children:[c&&r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("label",{className:"text-sm font-medium",children:c}),q&&r.jsx(an,{variant:Y,className:"text-xs",children:q})]}),B?U():s==="textarea"?r.jsx(zi,{...m,ref:W=>{T.current=W},value:a,onChange:W=>j(W.target.value),onFocus:O,onBlur:I,onSelect:k,disabled:o}):r.jsx(un,{...d,ref:W=>{T.current=W},value:a,onChange:W=>j(W.target.value),onFocus:O,onBlur:I,onSelect:k,disabled:o}),!c&&q&&r.jsx("div",{className:"flex justify-end mt-1",children:r.jsx(an,{variant:Y,className:"text-xs",children:q})})]})}const U8="JPG, PNG, GIF, WebP, or AVIF. Max 5MB.",z8="image/jpeg,image/png,image/gif,image/webp,image/avif",G8=new Set(["image/jpeg","image/png","image/gif","image/webp","image/avif"]),H8=/\.(jpe?g|png|gif|webp|avif)$/i;function UA({currentImageUrl:t,onUploaded:e,onRemoved:n,endpoint:a,extraFields:i={},headers:s={},pulseGlow:o=!1,disabled:c=!1,helperText:d,uploadLabel:m="Upload Photo",changeLabel:f="Change Photo",removeLabel:p="Remove",maxMB:b=5,alt:v="Image",thumbnailSize:C=50,nativeAspect:S=!1}){const{toast:F}=nr(),w=x.useRef(null),[A,N]=x.useState(!1);async function P(D){const T=D.target.files?.[0];if(!T)return;if(T.size>b*1024*1024){F({variant:"destructive",title:"File too large",description:`Please pick an image smaller than ${b} MB.`}),w.current&&(w.current.value="");return}const K=G8.has(T.type),B=H8.test(T.name);if(!K||!B){const k=T.type||T.name.split(".").pop()||"unknown format";F({variant:"destructive",title:"Unsupported image format",description:`${k} isn't supported. Please use JPG, PNG, GIF, WebP, or AVIF.`}),w.current&&(w.current.value="");return}N(!0);try{const k=new FormData;k.append("image",T);for(const[j,U]of Object.entries(i))k.append(j,U);const O=await fetch(a,{method:"POST",body:k,headers:s}),I=await O.json().catch(()=>({}));if(!O.ok||!I.imageUrl)throw new Error(I.error||I.message||`Server returned ${O.status}`);e(I.imageUrl),F({title:"Image uploaded"})}catch(k){console.error("[ImageUpload] failed",k),F({variant:"destructive",title:"Upload failed",description:k.message||"Please try again."})}finally{N(!1),w.current&&(w.current.value="")}}function z(){n?.()}return r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("input",{ref:w,type:"file",accept:z8,onChange:P,className:"hidden"}),r.jsxs("div",{className:"flex items-center gap-3",children:[t&&r.jsx("img",{src:t,alt:v,referrerPolicy:"no-referrer",style:S?{maxHeight:C,width:"auto"}:{width:C,height:C},className:`rounded border ${S?"":"object-cover"} ${o?"animate-pulse-glow":""}`}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(Fe,{type:"button",variant:"outline",size:"sm",onClick:()=>w.current?.click(),disabled:c||A,className:"gap-2",children:A?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 animate-spin"}),"Uploading..."]}):r.jsxs(r.Fragment,{children:[r.jsx(b3,{className:"w-4 h-4"}),t?f:m]})}),t&&n&&r.jsxs(Fe,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:c||A,className:"gap-2",title:"Remove image",children:[r.jsx(gr,{className:"w-4 h-4"}),p]})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground text-center mt-1",children:d??U8})]})}function Im(t,[e,n]){return Math.min(n,Math.max(e,t))}var W8=x.createContext(void 0);function uh(t){const e=x.useContext(W8);return t||e||"ltr"}var V8=[" ","Enter","ArrowUp","ArrowDown"],$8=[" ","Enter"],bu="Select",[bx,wx,K8]=Vm(bu),[dh]=Xa(bu,[K8,ox]),Sx=ox(),[Y8,Tc]=dh(bu),[q8,J8]=dh(bu),zA=t=>{const{__scopeSelect:e,children:n,open:a,defaultOpen:i,onOpenChange:s,value:o,defaultValue:c,onValueChange:d,dir:m,name:f,autoComplete:p,disabled:b,required:v,form:C}=t,S=Sx(e),[F,w]=x.useState(null),[A,N]=x.useState(null),[P,z]=x.use
vendor: 17,560 bytes, line 379
379State(!1),D=uh(m),[T,K]=ds({prop:a,defaultProp:i??!1,onChange:s,caller:bu}),[B,k]=ds({prop:o,defaultProp:c,onChange:d,caller:bu}),O=x.useRef(null),I=F?C||!!F.closest("form"):!0,[j,U]=x.useState(new Set),q=Array.from(j).map(Y=>Y.props.value).join(";");return r.jsx(Z3,{...S,children:r.jsxs(Y8,{required:v,scope:e,trigger:F,onTriggerChange:w,valueNode:A,onValueNodeChange:N,valueNodeHasChildren:P,onValueNodeHasChildrenChange:z,contentId:wo(),value:B,onValueChange:k,open:T,onOpenChange:K,dir:D,triggerPointerDownPosRef:O,disabled:b,children:[r.jsx(bx.Provider,{scope:e,children:r.jsx(q8,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(Y=>{U(W=>new Set(W).add(Y))},[]),onNativeOptionRemove:x.useCallback(Y=>{U(W=>{const H=new Set(W);return H.delete(Y),H})},[]),children:n})}),I?r.jsxs(dN,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:p,value:B,onChange:Y=>k(Y.target.value),disabled:b,form:C,children:[B===void 0?r.jsx("option",{value:""}):null,Array.from(j)]},q):null]})})};zA.displayName=bu;var GA="SelectTrigger",HA=x.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:a=!1,...i}=t,s=Sx(n),o=Tc(GA,n),c=o.disabled||a,d=Hn(e,o.onTriggerChange),m=wx(n),f=x.useRef("touch"),[p,b,v]=mN(S=>{const F=m().filter(N=>!N.disabled),w=F.find(N=>N.value===o.value),A=fN(F,S,w);A!==void 0&&o.onValueChange(A.value)}),C=S=>{c||(o.onOpenChange(!0),v()),S&&(o.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return r.jsx(Q3,{asChild:!0,...s,children:r.jsx(Tn.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":hN(o.value)?"":void 0,...i,ref:d,onClick:vn(i.onClick,S=>{S.currentTarget.focus(),f.current!=="mouse"&&C(S)}),onPointerDown:vn(i.onPointerDown,S=>{f.current=S.pointerType;const F=S.target;F.hasPointerCapture(S.pointerId)&&F.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:vn(i.onKeyDown,S=>{const F=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&b(S.key),!(F&&S.key===" ")&&V8.includes(S.key)&&(C(),S.preventDefault())})})})});HA.displayName=GA;var WA="SelectValue",VA=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:i,children:s,placeholder:o="",...c}=t,d=Tc(WA,n),{onValueNodeHasChildrenChange:m}=d,f=s!==void 0,p=Hn(e,d.onValueNodeChange);return fa(()=>{m(f)},[m,f]),r.jsx(Tn.span,{...c,ref:p,style:{pointerEvents:"none"},children:hN(d.value)?r.jsx(r.Fragment,{children:o}):s})});VA.displayName=WA;var X8="SelectIcon",$A=x.forwardRef((t,e)=>{const{__scopeSelect:n,children:a,...i}=t;return r.jsx(Tn.span,{"aria-hidden":!0,...i,ref:e,children:a||"▼"})});$A.displayName=X8;var Z8="SelectPortal",KA=t=>r.jsx(qg,{asChild:!0,...t});KA.displayName=Z8;var wu="SelectContent",YA=x.forwardRef((t,e)=>{const n=Tc(wu,t.__scopeSelect),[a,i]=x.useState();if(fa(()=>{i(new DocumentFragment)},[]),!n.open){const s=a;return s?_u.createPortal(r.jsx(qA,{scope:t.__scopeSelect,children:r.jsx(bx.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),s):null}return r.jsx(JA,{...t,ref:e})});YA.displayName=wu;var Ms=10,[qA,Mc]=dh(wu),Q8="SelectContentImpl",e7=Id("SelectContent.RemoveScroll"),JA=x.forwardRef((t,e)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:p,collisionBoundary:b,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:F,...w}=t,A=Tc(wu,n),[N,P]=x.useState(null),[z,D]=x.useState(null),T=Hn(e,Ce=>P(Ce)),[K,B]=x.useState(null),[k,O]=x.useState(null),I=wx(n),[j,U]=x.useState(!1),q=x.useRef(!1);x.useEffect(()=>{if(N)return Ik(N)},[N]),Ak();const Y=x.useCallback(Ce=>{const[He,...Ct]=I().map(zt=>zt.ref.current),[bt]=Ct.slice(-1),Rt=document.activeElement;for(const zt of Ce)if(zt===Rt||(zt?.scrollIntoView({block:"nearest"}),zt===He&&z&&(z.scrollTop=0),zt===bt&&z&&(z.scrollTop=z.scrollHeight),zt?.focus(),document.activeElement!==Rt))return},[I,z]),W=x.useCallback(()=>Y([K,N]),[Y,K,N]);x.useEffect(()=>{j&&W()},[j,W]);const{onOpenChange:H,triggerPointerDownPosRef:J}=A;x.useEffect(()=>{if(N){let Ce={x:0,y:0};const He=bt=>{Ce={x:Math.abs(Math.round(bt.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(bt.pageY)-(J.current?.y??0))}},Ct=bt=>{Ce.x<=10&&Ce.y<=10?bt.preventDefault():N.contains(bt.target)||H(!1),document.removeEventListener("pointermove",He),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",He),document.addEventListener("pointerup",Ct,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",He),document.removeEventListener("pointerup",Ct,{capture:!0})}}},[N,H,J]),x.useEffect(()=>{const Ce=()=>H(!1);return window.addEventListener("blur",Ce),window.addEventListener("resize",Ce),()=>{window.removeEventListener("blur",Ce),window.removeEventListener("resize",Ce)}},[H]);const[ie,Q]=mN(Ce=>{const He=I().filter(Rt=>!Rt.disabled),Ct=He.find(Rt=>Rt.ref.current===document.activeElement),bt=fN(He,Ce,Ct);bt&&setTimeout(()=>bt.ref.current.focus())}),ve=x.useCallback((Ce,He,Ct)=>{const bt=!q.current&&!Ct;(A.value!==void 0&&A.value===He||bt)&&(B(Ce),bt&&(q.current=!0))},[A.value]),pe=x.useCallback(()=>N?.focus(),[N]),Me=x.useCallback((Ce,He,Ct)=>{const bt=!q.current&&!Ct;(A.value!==void 0&&A.value===He||bt)&&O(Ce)},[A.value]),We=a==="popper"?eb:XA,Ae=We===eb?{side:c,sideOffset:d,align:m,alignOffset:f,arrowPadding:p,collisionBoundary:b,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:F}:{};return r.jsx(qA,{scope:n,content:N,viewport:z,onViewportChange:D,itemRefCallback:ve,selectedItem:K,onItemLeave:pe,itemTextRefCallback:Me,focusSelectedItem:W,selectedItemText:k,position:a,isPositioned:j,searchRef:ie,children:r.jsx(V1,{as:e7,allowPinchZoom:!0,children:r.jsx(W1,{asChild:!0,trapped:A.open,onMountAutoFocus:Ce=>{Ce.preventDefault()},onUnmountAutoFocus:vn(i,Ce=>{A.trigger?.focus({preventScroll:!0}),Ce.preventDefault()}),children:r.jsx($m,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:Ce=>Ce.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:r.jsx(We,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:Ce=>Ce.preventDefault(),...w,...Ae,onPlaced:()=>U(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:vn(w.onKeyDown,Ce=>{const He=Ce.ctrlKey||Ce.altKey||Ce.metaKey;if(Ce.key==="Tab"&&Ce.preventDefault(),!He&&Ce.key.length===1&&Q(Ce.key),["ArrowUp","ArrowDown","Home","End"].includes(Ce.key)){let bt=I().filter(Rt=>!Rt.disabled).map(Rt=>Rt.ref.current);if(["ArrowUp","End"].includes(Ce.key)&&(bt=bt.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ce.key)){const Rt=Ce.target,zt=bt.indexOf(Rt);bt=bt.slice(zt+1)}setTimeout(()=>Y(bt)),Ce.preventDefault()}})})})})})})});JA.displayName=Q8;var t7="SelectItemAlignedPosition",XA=x.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:a,...i}=t,s=Tc(wu,n),o=Mc(wu,n),[c,d]=x.useState(null),[m,f]=x.useState(null),p=Hn(e,T=>f(T)),b=wx(n),v=x.useRef(!1),C=x.useRef(!0),{viewport:S,selectedItem:F,selectedItemText:w,focusSelectedItem:A}=o,N=x.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&m&&S&&F&&w){const T=s.trigger.getBoundingClientRect(),K=m.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(s.dir!=="rtl"){const Rt=k.left-K.left,zt=B.left-Rt,Ut=T.left-zt,Bt=T.width+Ut,re=Math.max(Bt,K.width),wt=window.innerWidth-Ms,Nt=Im(zt,[Ms,Math.max(Ms,wt-re)]);c.style.minWidth=Bt+"px",c.style.left=Nt+"px"}else{const Rt=K.right-k.right,zt=window.innerWidth-B.right-Rt,Ut=window.innerWidth-T.right-zt,Bt=T.width+Ut,re=Math.max(Bt,K.width),wt=window.innerWidth-Ms,Nt=Im(zt,[Ms,Math.max(Ms,wt-re)]);c.style.minWidth=Bt+"px",c.style.right=Nt+"px"}const O=b(),I=window.innerHeight-Ms*2,j=S.scrollHeight,U=window.getComputedStyle(m),q=parseInt(U.borderTopWidth,10),Y=parseInt(U.paddingTop,10),W=parseInt(U.borderBottomWidth,10),H=parseInt(U.paddingBottom,10),J=q+Y+j+H+W,ie=Math.min(F.offsetHeight*5,J),Q=window.getComputedStyle(S),ve=parseInt(Q.paddingTop,10),pe=parseInt(Q.paddingBottom,10),Me=T.top+T.height/2-Ms,We=I-Me,Ae=F.offsetHeight/2,Ce=F.offsetTop+Ae,He=q+Y+Ce,Ct=J-He;if(He<=Me){const Rt=O.length>0&&F===O[O.length-1].ref.current;c.style.bottom="0px";const zt=m.clientHeight-S.offsetTop-S.offsetHeight,Ut=Math.max(We,Ae+(Rt?pe:0)+zt+W),Bt=He+Ut;c.style.height=Bt+"px"}else{const Rt=O.length>0&&F===O[0].ref.current;c.style.top="0px";const Ut=Math.max(Me,q+S.offsetTop+(Rt?ve:0)+Ae)+Ct;c.style.height=Ut+"px",S.scrollTop=He-Me+S.offsetTop}c.style.margin=`${Ms}px 0`,c.style.minHeight=ie+"px",c.style.maxHeight=I+"px",a?.(),requestAnimationFrame(()=>v.current=!0)}},[b,s.trigger,s.valueNode,c,m,S,F,w,s.dir,a]);fa(()=>N(),[N]);const[P,z]=x.useState();fa(()=>{m&&z(window.getComputedStyle(m).zIndex)},[m]);const D=x.useCallback(T=>{T&&C.current===!0&&(N(),A?.(),C.current=!1)},[N,A]);return r.jsx(r7,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:D,children:r.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:r.jsx(Tn.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});XA.displayName=t7;var n7="SelectPopperPosition",eb=x.forwardRef((t,e)=>{const{__scopeSelect:n,align:a="start",collisionPadding:i=Ms,...s}=t,o=Sx(n);return r.jsx(ek,{...o,...s,ref:e,align:a,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)"}})});eb.displayName=n7;var[r7,pw]=dh(wu,{}),tb="SelectViewport",ZA=x.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:a,...i}=t,s=Mc(tb,n),o=pw(tb,n),c=Hn(e,s.onViewportChange),d=x.useRef(0);return r.jsxs(r.Fragment,{children:[r.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:a}),r.jsx(bx.Slot,{scope:n,children:r.jsx(Tn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:vn(i.onScroll,m=>{const f=m.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=o;if(b?.current&&p){const v=Math.abs(d.current-f.scrollTop);if(v>0){const C=window.innerHeight-Ms*2,S=parseFloat(p.style.minHeight),F=parseFloat(p.style.height),w=Math.max(S,F);if(w<C){const A=w+v,N=Math.min(C,A),P=A-N;p.style.height=N+"px",p.style.bottom==="0px"&&(f.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});ZA.displayName=tb;var QA="SelectGroup",[a7,i7]=dh(QA),s7=x.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,i=wo();return r.jsx(a7,{scope:n,id:i,children:r.jsx(Tn.div,{role:"group","aria-labelledby":i,...a,ref:e})})});s7.displayName=QA;var eN="SelectLabel",tN=x.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,i=i7(eN,n);return r.jsx(Tn.div,{id:i.id,...a,ref:e})});tN.displayName=eN;var Rg="SelectItem",[o7,nN]=dh(Rg),rN=x.forwardRef((t,e)=>{const{__scopeSelect:n,value:a,disabled:i=!1,textValue:s,...o}=t,c=Tc(Rg,n),d=Mc(Rg,n),m=c.value===a,[f,p]=x.useState(s??""),[b,v]=x.useState(!1),C=Hn(e,A=>d.itemRefCallback?.(A,a,i)),S=wo(),F=x.useRef("touch"),w=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(a==="")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 r.jsx(o7,{scope:n,value:a,disabled:i,textId:S,isSelected:m,onItemTextChange:x.useCallback(A=>{p(N=>N||(A?.textContent??"").trim())},[]),children:r.jsx(bx.ItemSlot,{scope:n,value:a,disabled:i,textValue:f,children:r.jsx(Tn.div,{role:"option","aria-labelledby":S,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:C,onFocus:vn(o.onFocus,()=>v(!0)),onBlur:vn(o.onBlur,()=>v(!1)),onClick:vn(o.onClick,()=>{F.current!=="mouse"&&w()}),onPointerUp:vn(o.onPointerUp,()=>{F.current==="mouse"&&w()}),onPointerDown:vn(o.onPointerDown,A=>{F.current=A.pointerType}),onPointerMove:vn(o.onPointerMove,A=>{F.current=A.pointerType,i?d.onItemLeave?.():F.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:vn(o.onPointerLeave,A=>{A.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:vn(o.onKeyDown,A=>{d.searchRef?.current!==""&&A.key===" "||($8.includes(A.key)&&w(),A.key===" "&&A.preventDefault())})})})})});rN.displayName=Rg;var gm="SelectItemText",aN=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:a,style:i,...s}=t,o=Tc(gm,n),c=Mc(gm,n),d=nN(gm,n),m=J8(gm,n),[f,p]=x.useState(null),b=Hn(e,w=>p(w),d.onItemTextChange,w=>c.itemTextRefCallback?.(w,d.value,d.disabled)),v=f?.textContent,C=x.useMemo(()=>r.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:S,onNativeOptionRemove:F}=m;return fa(()=>(S(C),()=>F(C)),[S,F,C]),r.jsxs(r.Fragment,{children:[r.jsx(Tn.span,{id:d.textId,...s,ref:b}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?_u.createPortal(s.children,o.valueNode):null]})});aN.displayName=gm;var iN="SelectItemIndicator",sN=x.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return nN(iN,n).isSelected?r.jsx(Tn.span,{"aria-hidden":!0,...a,ref:e}):null});sN.displayName=iN;var nb="SelectScrollUpButton",oN=x.forwardRef((t,e)=>{const n=Mc(nb,t.__scopeSelect),a=pw(nb,t.__scopeSelect),[i,s]=x.useState(!1),o=Hn(e,a.onScrollButtonChange);return fa(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollTop>0;s(m)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?r.jsx(cN,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});oN.displayName=nb;var rb="SelectScrollDownButton",lN=x.forwardRef((t,e)=>{const n=Mc(rb,t.__scopeSelect),a=pw(rb,t.__scopeSelect),[i,s]=x.useState(!1),o=Hn(e,a.onScrollButtonChange);return fa(()=>{if(n.viewport&&n.isPositioned){let c=function(){const m=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<m;s(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?r.jsx(cN,{...t,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});lN.displayName=rb;var cN=x.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:a,...i}=t,s=Mc("SelectScrollButton",n),o=x.useRef(null),c=wx(n),d=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),fa(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),r.jsx(Tn.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:vn(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(a,50))}),onPointerMove:vn(i.onPointerMove,()=>{s.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(a,50))}),onPointerLeave:vn(i.onPointerLeave,()=>{d()})})}),l7="SelectSeparator",uN=x.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t;return r.jsx(Tn.div,{"aria-hidden":!0,...a,ref:e})});uN.displayName=l7;var ab="SelectArrow",c7=x.forwardRef((t,e)=>{const{__scopeSelect:n,...a}=t,i=Sx(n),s=Tc(ab,n),o=Mc(ab,n);return s.open&&o.position==="popper"?r.jsx(tk,{...i,...a,ref:e}):null});c7.displayName=ab;var u7="SelectBubbleInput",dN=x.forwardRef(({__scopeSelect:t,value:e,...n},a)=>{const i=x.useRef(null),s=Hn(a,i),o=xx(e);return x.useEffect(()=>{const c=i.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==e&&f){const p=new Event("change",{bubbles:!0});f.call(c,e),c.dispatchEvent(p)}},[o,e]),r.jsx(Tn.select,{...n,style:{...zE,...n.style},ref:s,defaultValue:e})});dN.displayName=u7;function hN(t){return t===""||t===void 0}function mN(t){const e=ua(t),n=x.useRef(""),a=x.useRef(0),i=x.useCallback(o=>{const c=n.current+o;e(c),(function d(m){n.current=m,window.clearTimeout(a.current),m!==""&&(a.current=window.setTimeout(()=>d(""),1e3))})(c)},[e]),s=x.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,i,s]}function fN(t,e,n){const i=e.length>1&&Array.from(e).every(m=>m===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=d7(t,Math.max(s,0));i.length===1&&(o=o.filter(m=>m!==n));const d=o.find(m=>m.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function d7(t,e){return t.map((n,a)=>t[(e+a)%t.length])}var h7=zA,pN=HA,m7=VA,f7=$A,p7=KA,gN=YA,g7=ZA,xN=tN,vN=rN,x7=aN,v7=sN,yN=oN,bN=lN,wN=uN;const Sl=h7,Fl=m7,To=x.forwardRef(({className:t,children:e,...n},a)=>r.jsxs(pN,{ref:a,className:ln("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
379ing-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,r.jsx(f7,{asChild:!0,children:r.jsx(Ja,{className:"h-4 w-4 opacity-50"})})]}));To.displayName=pN.displayName;const SN=x.forwardRef(({className:t,...e},n)=>r.jsx(yN,{ref:n,className:ln("flex cursor-default items-center justify-center py-1",t),...e,children:r.jsx(gl,{className:"h-4 w-4"})}));SN.displayName=yN.displayName;const FN=x.forwardRef(({className:t,...e},n)=>r.jsx(bN,{ref:n,className:ln("flex cursor-default items-center justify-center py-1",t),...e,children:r.jsx(Ja,{className:"h-4 w-4"})}));FN.displayName=bN.displayName;const Mo=x.forwardRef(({className:t,children:e,position:n="popper",...a},i)=>r.jsx(p7,{children:r.jsxs(gN,{ref:i,className:ln("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,...a,children:[r.jsx(SN,{}),r.jsx(g7,{className:ln("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),r.jsx(FN,{})]})}));Mo.displayName=gN.displayName;const y7=x.forwardRef(({className:t,...e},n)=>r.jsx(xN,{ref:n,className:ln("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));y7.displayName=xN.displayName;const ta=x.forwardRef(({className:t,children:e,...n},a)=>r.jsxs(vN,{ref:a,className:ln("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:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(v7,{children:r.jsx(oi,{className:"h-4 w-4"})})}),r.jsx(x7,{children:e})]}));ta.displayName=vN.displayName;const b7=x.forwardRef(({className:t,...e},n)=>r.jsx(wN,{ref:n,className:ln("-mx-1 my-1 h-px bg-muted",t),...e}));b7.displayName=wN.displayName;var CN="AlertDialog",[w7]=Xa(CN,[Ok]),kl=Ok(),_N=t=>{const{__scopeAlertDialog:e,...n}=t,a=kl(e);return r.jsx(q1,{...a,...n,modal:!0})};_N.displayName=CN;var S7="AlertDialogTrigger",F7=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,i=kl(n);return r.jsx(tA,{...i,...a,ref:e})});F7.displayName=S7;var C7="AlertDialogPortal",EN=t=>{const{__scopeAlertDialog:e,...n}=t,a=kl(e);return r.jsx(J1,{...a,...n})};EN.displayName=C7;var _7="AlertDialogOverlay",kN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,i=kl(n);return r.jsx(qm,{...i,...a,ref:e})});kN.displayName=_7;var Rd="AlertDialogContent",[E7,k7]=w7(Rd),A7=LE("AlertDialogContent"),AN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:a,...i}=t,s=kl(n),o=x.useRef(null),c=Hn(e,o),d=x.useRef(null);return r.jsx(oB,{contentName:Rd,titleName:NN,docsSlug:"alert-dialog",children:r.jsx(E7,{scope:n,cancelRef:d,children:r.jsxs(Jm,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:vn(i.onOpenAutoFocus,m=>{m.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(A7,{children:a}),r.jsx(T7,{contentRef:o})]})})})});AN.displayName=Rd;var NN="AlertDialogTitle",TN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,i=kl(n);return r.jsx(Xm,{...i,...a,ref:e})});TN.displayName=NN;var MN="AlertDialogDescription",RN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,i=kl(n);return r.jsx(Zm,{...i,...a,ref:e})});RN.displayName=MN;var N7="AlertDialogAction",DN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,i=kl(n);return r.jsx(gx,{...i,...a,ref:e})});DN.displayName=N7;var PN="AlertDialogCancel",jN=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:i}=k7(PN,n),s=kl(n),o=Hn(e,i);return r.jsx(gx,{...s,...a,ref:o})});jN.displayName=PN;var T7=({contentRef:t})=>{const e=`\`${Rd}\` requires a description for the component to be accessible for screen reader users.
380
381You can add a description to the \`${Rd}\` by passing a \`${MN}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
382
383Alternatively, 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 \`${Rd}\`. 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.
384
385For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},M7=_N,R7=EN,LN=kN,IN=AN,BN=DN,ON=jN,UN=TN,zN=RN;const Bm=M7,D7=R7,GN=x.forwardRef(({className:t,...e},n)=>r.jsx(LN,{className:ln("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}));GN.displayName=LN.displayName;const Gd=x.forwardRef(({className:t,...e},n)=>r.jsxs(D7,{children:[r.jsx(GN,{}),r.jsx(IN,{ref:n,className:ln("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})]}));Gd.displayName=IN.displayName;const Hd=({className:t,...e})=>r.jsx("div",{className:ln("flex flex-col space-y-2 text-center sm:text-left",t),...e});Hd.displayName="AlertDialogHeader";const Wd=({className:t,...e})=>r.jsx("div",{className:ln("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Wd.displayName="AlertDialogFooter";const Vd=x.forwardRef(({className:t,...e},n)=>r.jsx(UN,{ref:n,className:ln("text-lg font-semibold",t),...e}));Vd.displayName=UN.displayName;const $d=x.forwardRef(({className:t,...e},n)=>r.jsx(zN,{ref:n,className:ln("text-sm text-muted-foreground",t),...e}));$d.displayName=zN.displayName;const mu=x.forwardRef(({className:t,...e},n)=>r.jsx(BN,{ref:n,className:ln(jm(),t),...e}));mu.displayName=BN.displayName;const Fx=x.forwardRef(({className:t,...e},n)=>r.jsx(ON,{ref:n,className:ln(jm({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Fx.displayName=ON.displayName;const P7=[{value:"meetup",label:"Meetup"},{value:"conference",label:"Conference"},{value:"workshop",label:"Workshop"},{value:"other",label:"Other"}],ib="-invites";function j7(t){return t.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function L7(t){if(!t)return"";const e=t.split("@")[0]||"";return e.endsWith(ib)?e.slice(0,-ib.length):""}const I7=/^[a-z0-9][a-z0-9-]*$/,Av=6,SC=30,HN=[{name:"blue",swatch:"#3b82f6"},{name:"red",swatch:"#ef4444"},{name:"green",swatch:"#22c55e"},{name:"gray",swatch:"#9ca3af"},{name:"purple",swatch:"#a855f7"},{name:"orange",swatch:"#f97316"},{name:"teal",swatch:"#14b8a6"},{name:"pink",swatch:"#ec4899"}],Cx={meetup:"blue",conference:"red",workshop:"green",other:"gray"},FC=Object.fromEntries(HN.map(t=>[t.name,t.swatch]));function CC(t){const e=t?.color||Cx[t?.category||"other"]||"gray";return FC[e]||FC.gray}const B7="transition-[outline-color] duration-150 outline outline-2 outline-offset-1 outline-transparent hover:outline-[#FFD700]",O7="outline outline-2 outline-offset-1 outline-[#FFD700]",_C="outline outline-2 outline-offset-1 outline-[#FFD700]";function WN(t){if(!t)return null;const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return e?new Date(Number(e[1]),Number(e[2])-1,Number(e[3])):new Date(t)}function lu(t){return WN(t.start?.dateTime||t.start?.date)}function gw(t){return WN(t.end?.dateTime||t.end?.date)}function Kd(t){const e=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}T${e(t.getHours())}:${e(t.getMinutes())}`}function Dg(t,e,n){const a=new Date(t);return a.setHours(e,n,0,0),a}function EC(t){const e=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}`}function U7(t){if(t.allDay||t.start?.date)return"All day";const e=lu(t),n=gw(t);if(!e)return"";const a=e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return n?`${a} – ${n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}`:a}function z7(t){return new Date(t.getFullYear(),t.getMonth(),1)}function Nv(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Zh(t){const e=Dg(t,19,0),n=Dg(t,20,0);return{title:"",description:"",startISO:Kd(e),endISO:Kd(n),location:"",eventUrl:"",category:"meetup",tags:[],inviteGroup:"",inviteGroupEnabled:!1,inviteGroupName:"",othersCanEdit:!1,
385color:Cx.meetup,colorTouched:!1,allDay:!1,visibility:"public",imageUrl:""}}function G7(t){if(!t)return{description:"",eventUrl:""};let e=t;e=e.replace(/\n\nImage:\s*\S+\s*$/s,"");let n="";const a=e.match(/^(.*?)\n\nMore info:\s*(https?:\/\/\S+)\s*$/s);return a&&(e=a[1],n=a[2]),{description:e,eventUrl:n}}function H7(t){const{description:e,eventUrl:n}=G7(t.description),a=lu(t)||new Date,i=gw(t)||new Date(a.getTime()+3600*1e3),s=t.category||"meetup",o=t.color||Cx[s]||"gray",c=!!(t.allDay||t.start?.date),d=c?t.start?.date||EC(a):Kd(a),m=c?t.end?.date||EC(i):Kd(i);return{title:t.summary||"",description:e,startISO:d,endISO:m,location:t.location||"",eventUrl:n,category:s,tags:t.tags||[],inviteGroup:t.inviteGroup||"",inviteGroupEnabled:!!t.inviteGroup,inviteGroupName:L7(t.inviteGroup)||"",othersCanEdit:!!t.othersCanEdit,color:o,colorTouched:!0,allDay:c,imageUrl:t.imageUrl||"",visibility:t.visibility==="members-only"?"members-only":"public"}}function W7({eventId:t,sessionId:e}){const{toast:n}=nr(),[a,i]=x.useState(null),[s,o]=x.useState(!1);x.useEffect(()=>{let d=!1;return(async()=>{try{const m=await fetch(`/api/events/${encodeURIComponent(t)}/rsvp`,{headers:{"x-session-id":e}}),f=await m.json().catch(()=>({}));if(d)return;m.ok&&f.success&&f.hasInviteGroup&&i(f.youAreIn===!0)}catch{}})(),()=>{d=!0}},[t,e]);async function c(d){if(s)return;o(!0);const m=d?`/api/events/${encodeURIComponent(t)}/rsvp/add-me`:`/api/events/${encodeURIComponent(t)}/rsvp/remove-me`;i(d);try{const f=await fetch(m,{method:"POST",headers:{"x-session-id":e}}),p=await f.json().catch(()=>({}));(!f.ok||!p.success)&&(i(!d),n({variant:"destructive",title:d?"Couldn't add you":"Couldn't remove you",description:p.message||`Server returned ${f.status}`}))}catch(f){i(!d),n({variant:"destructive",title:"Network error",description:f.message})}finally{o(!1)}}return r.jsxs("label",{className:"flex flex-col items-center justify-center gap-1 px-3 self-stretch border-l cursor-pointer select-none text-xs",children:[r.jsx(ar,{checked:a===!0,onCheckedChange:d=>c(!!d),disabled:s,className:"h-5 w-5"}),r.jsx("span",{className:"font-medium",children:"Going"})]})}function V7({inviteGroupEmail:t}){const{toast:e}=nr(),[n,a]=x.useState(!1),i=t.split("@")[0]||"",s=i.endsWith("-invites")?i.slice(0,-8):"";if(!s)return null;const o=`${window.location.origin}/member?accept=${s}`;async function c(){try{await navigator.clipboard.writeText(o),a(!0),setTimeout(()=>a(!1),1500),e({title:"Link copied"})}catch{e({variant:"destructive",title:"Could not copy",description:"Your browser blocked clipboard access. Long-press or right-click the URL to copy it manually."})}}return r.jsxs("div",{className:"pt-1 space-y-1",children:[r.jsx(Ht,{className:"text-[11px] text-muted-foreground",children:"Share this link with members to one-click accept the invite:"}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"font-mono text-[11px] text-muted-foreground break-all flex-1 min-w-0",children:o}),r.jsxs(Fe,{type:"button",size:"sm",variant:"outline",onClick:c,className:"h-7 gap-1 flex-shrink-0",children:[n?r.jsx(oi,{className:"w-3 h-3"}):r.jsx(ex,{className:"w-3 h-3"}),n?"Copied":"Copy"]})]})]})}function $7({sessionId:t}){const{toast:e}=nr(),[n,a]=x.useState([]),[i,s]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState(null),[f,p]=x.useState(!0),[b,v]=x.useState(!1),[C,S]=x.useState(()=>new Date),[F,w]=x.useState(null),[A,N]=x.useState(0),P=x.useRef(null),[z,D]=x.useState(""),[T,K]=x.useState(()=>Zh(new Date)),[B,k]=x.useState(!1),[O,I]=x.useState(!1),[j,U]=x.useState(!1),[q,Y]=x.useState(null),W=x.useMemo(()=>(F?n.find(Ee=>Ee.id===F):null)||null,[n,F]),H=x.useMemo(()=>W?W.canEdit?"edit":"view":"create",[W]),J=H==="view",ie=x.useCallback(async()=>{try{const[Ee,Je,$e]=await Promise.all([fetch("/api/events",{headers:{"x-session-id":t}}),fetch("/api/events/mine",{headers:{"x-session-id":t}}),fetch("/api/events/tags",{headers:{"x-session-id":t}})]);if(Ee.ok){const Xe=await Ee.json();a(Xe.events||[]),Xe.subscribe?.httpsUrl&&m(Xe.subscribe)}Je.ok&&s((await Je.json()).events||[]),$e.ok&&c((await $e.json()).tags||[])}catch(Ee){console.error("[MEMBER-CALENDAR] load failed",Ee)}finally{p(!1)}},[t]);x.useEffect(()=>{let Ee=!1;return(async()=>await ie())(),()=>{Ee=!0}},[ie]),x.useEffect(()=>{let Ee=null;const Je=$e=>{const Xe=$e.detail;console.log("[MEMBER-CALENDAR] ws-calendar-changed:",Xe),Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{ie()},250)};return window.addEventListener("ws-calendar-changed",Je),()=>{Ee&&clearTimeout(Ee),window.removeEventListener("ws-calendar-changed",Je)}},[ie]);const Q=x.useMemo(()=>{const Ee=new Map;for(const Je of n){const $e=lu(Je);if(!$e)continue;const Xe=gw(Je)||$e,X=new Date($e.getFullYear(),$e.getMonth(),$e.getDate()),ke=new Date(Xe.getFullYear(),Xe.getMonth(),Xe.getDate());let De=0;for(;X<=ke&&De<60;){const oe=X.toDateString(),te=Ee.get(oe)||[];te.push(Je),Ee.set(oe,te),X.setDate(X.getDate()+1),De++}}for(const Je of Ee.values())Je.sort(($e,Xe)=>(lu($e)?.getTime()||0)-(lu(Xe)?.getTime()||0));return Ee},[n]),ve=x.useMemo(()=>Q.get(C.toDateString())||[],[Q,C]);x.useEffect(()=>{if(W){K(H7(W)),I(!1),k(!0);const Ee=lu(W);
385Ee&&S(Ee)}},[W]);function pe(Ee,Je){K($e=>({...$e,[Ee]:Je})),I(!0)}function Me(){I(!0)}function We(){w(null),K(Zh(C)),I(!1),D(""),k(!1)}function Ae(){w(null),S(new Date),K(Zh(new Date)),I(!1),D(""),k(!1)}function Ce(Ee){if(Ee&&(S(Ee),!W)){const Je=Dg(Ee,19,0),$e=Dg(Ee,20,0);K(Xe=>({...Xe,startISO:Kd(Je),endISO:Kd($e)}))}}function He(){setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"start"})},0)}function Ct(Ee){if(Ee.id!==F){if(O&&(W||B)){Y(Ee.id);return}w(Ee.id),He()}}function bt(){if(O&&W){Y("");return}We(),K(Zh(C)),I(!1),k(!0),He()}function Rt(Ee){const Je=Ee.trim().toLowerCase();return Je?T.tags.includes(Je)?(D(""),!1):T.tags.length>=Av?(e({variant:"destructive",title:`Maximum ${Av} tags per event`}),!1):Je.length>SC?(e({variant:"destructive",title:`Tags must be ${SC} characters or fewer`}),!1):I7.test(Je)?(pe("tags",[...T.tags,Je]),D(""),!0):(e({variant:"destructive",title:"Tags can use lowercase letters, numbers, and hyphens only"}),!1):!1}function zt(Ee){Ee.key==="Enter"||Ee.key===","?(Ee.preventDefault(),Rt(z)):Ee.key==="Backspace"&&!z&&T.tags.length>0&&pe("tags",T.tags.slice(0,-1))}function Ut(Ee){pe("tags",T.tags.filter(Je=>Je!==Ee))}async function Bt(){if(b||J)return!1;if(!T.title.trim())return e({variant:"destructive",title:"Title required"}),!1;if(!T.description.trim())return e({variant:"destructive",title:"Description required"}),!1;let Ee,Je;if(T.allDay){if(!T.startISO||!T.endISO)return e({variant:"destructive",title:"Both start and end dates are required"}),!1;if(T.endISO<T.startISO)return e({variant:"destructive",title:"End date must be on or after start date"}),!1;Ee=T.startISO,Je=T.endISO}else{const $e=new Date(T.startISO),Xe=new Date(T.endISO);if(Number.isNaN($e.getTime())||Number.isNaN(Xe.getTime()))return e({variant:"destructive",title:"Invalid date or time"}),!1;if(Xe<=$e)return e({variant:"destructive",title:"End time must be after start time"}),!1;Ee=$e.toISOString(),Je=Xe.toISOString()}v(!0);try{const $e={title:T.title.trim(),description:T.description.trim(),startISO:Ee,endISO:Je,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone||"America/Los_Angeles",location:T.location.trim()||void 0,eventUrl:T.eventUrl.trim()||void 0,category:T.category,tags:T.tags,inviteGroupEnabled:T.inviteGroupEnabled,inviteGroupName:T.inviteGroupEnabled?T.inviteGroupName.trim():"",othersCanEdit:T.othersCanEdit,color:T.color,allDay:T.allDay,imageUrl:T.imageUrl,visibility:T.visibility},Xe=H==="edit"&&W?`/api/events/${encodeURIComponent(W.id)}`:"/api/events",ke=await fetch(Xe,{method:H==="edit"?"PUT":"POST",headers:{"Content-Type":"application/json","x-session-id":t},body:JSON.stringify($e)}),De=await ke.json();return!ke.ok||!De.success?(e({variant:"destructive",title:H==="edit"?"Could not save changes":"Could not add event",description:De.message||`Server returned ${ke.status}`}),!1):(await ie(),I(!1),H==="edit"?e({title:"Changes saved"}):(e({title:"Event added"}),We()),!0)}catch($e){return console.error("[MEMBER-CALENDAR] submit failed",$e),e({variant:"destructive",title:"Network error",description:"Please try again."}),!1}finally{v(!1)}}function re(Ee){Ee.preventDefault(),Bt()}function wt(){const Ee=q;Y(null),Ee!==null&&(Ee===""?(We(),K(Zh(C)),I(!1),k(!0),He()):w(Ee))}async function Nt(){await Bt()&&wt(),Y(null)}function vt(){wt()}function Tt(){Y(null)}async function Wt(Ee){if(window.confirm("Delete this event from the public calendar?"))try{const Je=await fetch(`/api/events/${encodeURIComponent(Ee)}`,{method:"DELETE",headers:{"x-session-id":t}}),$e=await Je.json().catch(()=>({}));if(!Je.ok||!$e.success){e({variant:"destructive",title:"Could not delete event",description:$e.message||`Server returned ${Je.status}`});return}F===Ee&&We(),await ie(),e({title:"Event deleted"})}catch(Je){console.error("[MEMBER-CALENDAR] delete failed",Je),e({variant:"destructive",title:"Network error"})}}const Dt={create:"Add a new event",edit:"Edit event",view:"Event details"},jt={create:"Save event",edit:"Save event",view:""},he={create:r.jsx(ko,{className:"w-4 h-4 mr-2"}),edit:r.jsx(CP,{className:"w-4 h-4 mr-2"}),view:null},ee=!!W,ze=Nv(z7(new Date),A),Ve=[ze,Nv(ze,1),Nv(ze,2)],lt=Ve[Ve.length-1],qe=(()=>
385{const Ee=ze,Je=lt,$e=Ee.toLocaleString(void 0,{month:"short"}),Xe=Je.toLocaleString(void 0,{month:"short"});return Ee.getFullYear()===Je.getFullYear()?`${$e} – ${Xe} ${Je.getFullYear()}`:`${$e} ${Ee.getFullYear()} – ${Xe} ${Je.getFullYear()}`})(),It=x.useMemo(()=>o.filter(Ee=>!T.tags.includes(Ee)).slice(0,12),[o,T.tags]),gt=x.useMemo(()=>{if(!T.title.trim()||!T.description.trim()||!T.startISO||!T.endISO)return!1;if(T.allDay)return T.endISO>=T.startISO;const Ee=new Date(T.startISO).getTime(),Je=new Date(T.endISO).getTime();return Number.isNaN(Ee)||Number.isNaN(Je)?!1:Je>Ee},[T.title,T.description,T.startISO,T.endISO,T.allDay]);return r.jsxs(r.Fragment,{children:[r.jsxs(Ft,{"data-testid":"member-calendar-section",className:"mt-8",children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(hu,{className:"w-5 h-5"}),"XR Guild Events"]}),r.jsx(Ln,{children:"Submit new events, pick a date to see what's scheduled, and edit events you've created."})]}),r.jsxs(fn,{children:[r.jsx("div",{className:"mb-4",children:r.jsx(fA,{links:d})}),r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(Fe,{type:"button",variant:"outline",size:"icon",onClick:()=>N(Ee=>Math.max(0,Ee-1)),disabled:A===0,"aria-label":"Previous months",children:r.jsx(Qg,{className:"w-5 h-5"})}),r.jsx("div",{className:"flex-1 text-center text-sm font-medium",children:qe}),r.jsx(Fe,{type:"button",variant:"outline",size:"icon",onClick:()=>N(Ee=>Ee+1),"aria-label":"Next months",children:r.jsx(nh,{className:"w-5 h-5"})})]}),r.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Ve.map((Ee,Je)=>r.jsx("div",{className:`rounded-md border bg-card p-2 ${Je===2?"hidden xl:block":""}`,children:r.jsx(IA,{mode:"single",month:Ee,selected:C,onSelect:Ce,disableNavigation:!0,classNames:{day:`h-12 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md relative transition-all duration-150 hover:bg-muted/40 ${B7}`,day_today:"ring-2 ring-muted-foreground/60 text-foreground",day_selected:`${O7} bg-transparent text-foreground hover:bg-muted/40`},components:{DayContent:({date:$e})=>{const Xe=Q.get($e.toDateString())||[];return r.jsxs("div",{className:"flex flex-col items-center justify-start h-full pt-1",children:[r.jsx("span",{className:"text-sm leading-none",children:$e.getDate()}),Xe.length>0&&r.jsxs("div",{className:"flex flex-col gap-0.5 mt-1 w-7",children:[Xe.slice(0,3).map(X=>r.jsx("div",{className:"h-1 rounded-sm",style:{backgroundColor:CC(X)}},X.id)),Xe.length>3&&r.jsxs("div",{className:"text-[8px] leading-none text-muted-foreground text-center",children:["+",Xe.length-3]})]})]})}}})},Ee.toISOString()))}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Fe,{type:"button",variant:"ghost",size:"sm",onClick:Ae,children:"Today"})}),r.jsxs("div",{className:`mt-6 rounded-md border p-3 transition-all duration-150 ${_C}`,children:[r.jsx("h3",{className:"text-sm font-medium mb-2",children:C.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}),f?r.jsxs("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[r.jsx(on,{className:"w-4 h-4 animate-spin"})," Loading events…"]}):ve.length===0?r.jsx("div",{className:"text-sm text-muted-foreground",children:"No events on this day yet."}):r.jsx("ul",{className:"space-y-2",children:ve.map(Ee=>{const Je=Ee.id===F,$e=CC(Ee);return r.jsx("li",{children:r.jsxs("div",{className:`flex items-stretch gap-2 rounded-md border-l-4 border-y border-r p-2 transition-colors ${Je?"bg-accent":""}`,style:{borderLeftColor:$e},children:[r.jsx("button",{type:"button",onClick:()=>Ct(Ee),className:"flex-1 min-w-0 text-left hover:opacity-80 transition-opacity",children:r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"font-medium",children:Ee.summary}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:[U7(Ee),Ee.creatorName&&` · by ${Ee.creatorName}`]}),Ee.location&&r.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-1",children:[r.jsx(Ry,{className:"w-3 h-3"})," ",Ee.location]}),Ee.tags&&Ee.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Ee.tags.map(Xe=>r.jsx(an,{variant:"outline",className:"text-[10px] px-1 py-0",children:Xe},Xe))})]}),!Ee.canEdit&&r.jsx(vF,{className:"w-3 h-3 text-muted-foreground flex-shrink-0 mt-1"})]})}),Ee.inviteGroup?r.jsx(W7,{eventId:Ee.id,sessionId:t}):Ee.eventUrl?r.jsxs("a",{href:Ee.eventUrl,target:"_blank",rel:"noopener noreferrer",onClick:Xe=>Xe.stopPropagation(),className:"flex flex-col items-center justify-center gap-1 px-3 self-stretch border-l text-xs text-primary hover:underline text-center",children:[r.jsx(_i,{className:"w-4 h-4"}),r.jsx("span",{className:"font-medium leading-tight",children:"Invites managed here"})]}):null]})},Ee.id)})})]}),!B&&!W&&r.jsx("div",{className:"mt-4",children:r.jsxs(Fe,{type:"button",onClick:bt,children:[r.jsx(ko,{className:"w-4 h-4 mr-2"})," Add a new event"]})}),(B||W)&&r.jsxs("form",{ref:P,onSubmit:re,className:`space-y-4 mt
385-8 pt-6 ${W?`rounded-md border p-4 transition-all duration-150 ${_C}`:"border-t"}`,children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[r.jsxs("h3",{className:"text-base font-semibold flex items-center gap-2",children:[H==="view"&&r.jsx(vF,{className:"w-4 h-4"}),Dt[H]]}),W&&r.jsx(Fe,{type:"button",variant:"ghost",size:"icon",onClick:We,"aria-label":"Close",children:r.jsx(gr,{className:"w-4 h-4"})})]}),H==="view"&&r.jsx("div",{className:"text-xs text-muted-foreground -mt-2",children:"You can view this event but not edit it. The creator can mark it editable by others, or an admin can update it."}),J?T.imageUrl&&r.jsx("div",{className:"-mt-2",children:r.jsx("img",{src:T.imageUrl,alt:W?.summary||T.title,referrerPolicy:"no-referrer",className:"max-h-[200px] w-auto rounded-md border bg-card"})}):r.jsx("div",{className:"-mt-2",children:r.jsx(UA,{currentImageUrl:T.imageUrl||void 0,onUploaded:Ee=>pe("imageUrl",Ee),onRemoved:()=>pe("imageUrl",""),endpoint:"/api/uploadEventImage",extraFields:{eventId:W?.id||"new"},headers:{"x-session-id":t},disabled:b,uploadLabel:"Upload Image",changeLabel:"Change Image",removeLabel:"Use Default",helperText:"Optional. Leave blank to use the guild logo. JPG, PNG, GIF or WebP. Max 5MB.",alt:T.title||"Event image",thumbnailSize:200,nativeAspect:!0})}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[r.jsx("div",{className:"md:col-span-2",children:W?r.jsx(Oi,{resource:"event",resourceId:W.id,fieldName:"title",label:"Title",value:T.title,onChange:Ee=>pe("title",Ee),disabled:J,inputProps:{placeholder:"Something descriptive — e.g. 'XR Builders NYC Mixer'",maxLength:120,required:!0}}):r.jsxs(r.Fragment,{children:[r.jsx(Ht,{htmlFor:"event-title",children:"Title"}),r.jsx(un,{id:"event-title",value:T.title,onChange:Ee=>pe("title",Ee.target.value),placeholder:"Something descriptive — e.g. 'XR Builders NYC Mixer'",maxLength:120,required:!0})]})}),r.jsx("div",{className:"md:col-span-2",children:W?r.jsx(Oi,{resource:"event",resourceId:W.id,fieldName:"description",type:"textarea",label:"Description",value:T.description,onChange:Ee=>pe("description",Ee),disabled:J,textareaProps:{placeholder:"A few sentences about the event, who it's for, and what to expect.",rows:4,maxLength:4e3,required:!0}}):r.jsxs(r.Fragment,{children:[r.jsx(Ht,{htmlFor:"event-description",children:"Description"}),r.jsx(zi,{id:"event-description",value:T.description,onChange:Ee=>pe("description",Ee.target.value),placeholder:"A few sentences about the event, who it's for, and what to expect.",rows:4,maxLength:4e3,required:!0})]})}),r.jsxs("div",{className:"md:col-span-2 grid gap-3 md:grid-cols-[1fr_1fr_auto] md:items-end",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"event-start",children:"Start"}),r.jsx(un,{id:"event-start",type:T.allDay?"date":"datetime-local",value:T.startISO,onChange:Ee=>pe("startISO",Ee.target.value),required:!0,disabled:J})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"event-end",children:"End"}),r.jsx(un,{id:"event-end",type:T.allDay?"date":"datetime-local",value:T.endISO,onChange:Ee=>pe("endISO",Ee.target.value),required:!0,disabled:J})]}),r.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[r.jsx(ar,{id:"event-all-day",checked:T.allDay,disabled:J,onCheckedChange:Ee=>{const Je=!!Ee;Me(),K($e=>{if(Je){const Xe=$e.startISO.slice(0,10);let X=$e.endISO.slice(0,10);return X<Xe&&(X=Xe),{...$e,allDay:!0,startISO:Xe,endISO:X}}else return{...$e,allDay:!1,startISO:`${$e.startISO}T19:00`,endISO:`${$e.endISO}T20:00`}})}}),r.jsx(Ht,{htmlFor:"event-all-day",className:"cursor-pointer whitespace-nowrap",children:"All-day"})]}),T.allDay&&r.jsx("p",{className:"md:col-span-3 text-[10px] text-muted-foreground -mt-1",children:"End date is inclusive. Pick the last day the event runs."})]}),r.jsx("div",{children:W?r.jsx(Oi,{resource:"event",resourceId:W.id,fieldName:"location",label:"Location (optional)",value:T.location,onChange:Ee=>pe("location",Ee),disabled:J,inputProps:{placeholder:"Brooklyn, NY  ·  Zoom  ·  Spatial.io  ·  etc.",maxLength:200}}):r.jsxs(r.Fragment,{children:[r.jsx(Ht,{htmlFor:"event-location",children:"Location (optional)"}),r.jsx(un,{id:"event-location",value:T.location,onChange:Ee=>pe("location",Ee.target.value),placeholder:"Brooklyn, NY  ·  Zoom  ·  Spatial.io  ·  etc.",maxLength:200})]})}),r.jsx("div",{children:W?r.jsx(Oi,{resource:"event",resourceId:W.id,fieldName:"eventUrl",label:"More-info URL (optional)",value:T.eventUrl,onChange:Ee=>pe("eventUrl",Ee),disabled:J,inputProps:{type:"url",placeholder:"https://…"}}):r.jsxs(r.Fragment,{children:[r.jsx(Ht,{htmlFor:"event-url",children:"More-info URL (optional)"}),r.jsx(un,{id:"event-url",type:"url",value:T.eventUrl,onChange:Ee=>pe("eventUrl",Ee.target.value),placeholder:"https://…"})]})}),r.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-end gap-3",children:[r.jsxs("div",{className:"min-w-[140px]",children:[r.jsx(Ht,{htmlFor:"event-category",children:"Category"}),r.jsxs(Sl,{value:T.category,onValueChange:Ee=>{Me(),K(Je=>({...Je,category:Ee,color:Je.colorTouched?Je.color:Cx[Ee]||"gray"}))},disabled:J,children:[r.jsx(To,{id:"event-category",className:"w-[140px]",children:r.jsx(Fl,{})}),r.jsx(Mo,{children:P7.map(Ee=>r.jsx(ta,{value:Ee.value,children:Ee.label},Ee.value))})]})]}
385),r.jsxs("div",{className:"flex items-center gap-2 self-end pb-2",children:[r.jsx(ar,{id:"event-invite-enabled",checked:T.inviteGroupEnabled,onCheckedChange:Ee=>pe("inviteGroupEnabled",!!Ee),disabled:J}),r.jsx(Ht,{htmlFor:"event-invite-enabled",className:"m-0 cursor-pointer whitespace-nowrap",children:"Create/Use Invite Group"})]}),T.inviteGroupEnabled&&r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx(Ht,{htmlFor:"event-invite-name",className:"text-xs text-muted-foreground",children:"Group slug (e.g. “AWE-2026”, “SFBay”)"}),r.jsx(un,{id:"event-invite-name",value:T.inviteGroupName,onChange:Ee=>pe("inviteGroupName",Ee.target.value),placeholder:"AWE-2026",maxLength:40,disabled:J,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1})]})]}),T.inviteGroupEnabled&&r.jsxs("div",{className:"md:col-span-2 space-y-1 -mt-2",children:[(()=>{const Ee=j7(T.inviteGroupName.trim());if(Ee.length<3)return null;const Je=`${Ee}${ib}@xrguild.org`;return Je===T.inviteGroup?null:r.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Members will be added to"," ",r.jsx("span",{className:"font-mono",children:Je})]})})(),T.inviteGroup&&r.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Currently attached to"," ",r.jsx("span",{className:"font-mono",children:T.inviteGroup}),W?" (saved)":null]}),W&&T.inviteGroup&&r.jsx("div",{className:"pt-1",children:r.jsx(xA,{eventId:W.id,sessionId:t,compact:!0})}),W&&T.inviteGroup&&!J&&r.jsx(V7,{inviteGroupEmail:T.inviteGroup})]}),r.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center gap-x-4 gap-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ht,{className:"m-0",children:"Color"}),r.jsx("div",{className:"flex flex-wrap gap-1.5",children:HN.map(Ee=>{const Je=T.color===Ee.name;return r.jsx("button",{type:"button",disabled:J,onClick:()=>{Me(),K($e=>({...$e,color:Ee.name,colorTouched:!0}))},className:`w-5 h-5 rounded-full border transition-all ${Je?"ring-2 ring-offset-2 ring-primary scale-110":"border-muted"} ${J?"cursor-not-allowed opacity-60":"cursor-pointer"}`,style:{backgroundColor:Ee.swatch},"aria-label":`Pick color ${Ee.name}`,title:Ee.name},Ee.name)})})]}),r.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[r.jsx(Ht,{htmlFor:"event-tags",className:"m-0",children:"Tags"}),T.tags.map(Ee=>r.jsxs(an,{variant:"secondary",className:"gap-1",children:[Ee,!J&&r.jsx("button",{type:"button",onClick:()=>Ut(Ee),className:"ml-0.5 hover:text-destructive","aria-label":`Remove ${Ee}`,children:r.jsx(gr,{className:"w-3 h-3"})})]},Ee)),!J&&r.jsx(un,{id:"event-tags",value:z,onChange:Ee=>D(Ee.target.value.toLowerCase()),onKeyDown:zt,onBlur:()=>z&&Rt(z),placeholder:"add a tag…",disabled:T.tags.length>=Av,className:"w-[16rem] h-8"})]}),!J&&It.length>0&&r.jsx("div",{className:"basis-full flex flex-wrap gap-1.5",children:It.map(Ee=>r.jsxs("button",{type:"button",onClick:()=>Rt(Ee),className:"text-xs px-2 py-0.5 rounded-full border border-muted-foreground/30 hover:bg-accent",children:["+ ",Ee]},Ee))})]})]}),ee&&r.jsxs("div",{className:"text-xs text-muted-foreground border-t pt-2 mt-2 space-y-0.5",children:[r.jsxs("div",{children:["Submitted by ",r.jsx("span",{className:"font-medium",children:W?.creatorName||"Guild Member"}),W?.created&&` on ${new Date(W.created).toLocaleDateString()}`]}),W?.lastEditedAt&&r.jsxs("div",{children:["Last edited by ",r.jsx("span",{className:"font-medium",children:W.lastEditedName||"Guild Member"})," ","on ",new Date(W.lastEditedAt).toLocaleDateString()]})]}),H!=="view"&&r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"event-others-edit",checked:T.othersCanEdit,onCheckedChange:Ee=>pe("othersCanEdit",!!Ee),disabled:J}),r.jsx(Ht,{htmlFor:"event-others-edit",className:"cursor-pointer",children:"Allow any member to edit this event"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"event-members-only",checked:T.visibility==="members-only",onCheckedChange:Ee=>pe("visibility",Ee?"members-only":"public"),disabled:J}),r.jsx(Ht,{htmlFor:"event-members-only",className:"cursor-pointer",children:"Members only (hide from public page)"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[r.jsx(Fe,{type:"button",variant:"ghost",onClick:We,disabled:b,children:O?"Cancel":"Close"}),r.jsx(Fe,{type:"submit",disabled:b||!gt,children:b?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"})," Saving…"]}):r.jsxs(r.Fragment,{children:[he[H],jt[H]]})})]})]})]}),i.length>0&&r.jsxs("div",{className:"mt-8",children:[r.jsxs("button",{type:"button",onClick:()=>U(Ee=>!Ee),className:"w-full text-base font-semibold mb-3 flex items-center gap-2 hover:opacity-80 transition-opacity","aria-expanded":j,children:[r.jsx(Ja,{className:`w-4 h-4 transition-transform ${j?"":"-rotate-90"}`}),"My submissions (",i.length,")"]}),j&&r.jsxs("div",{children:[r.jsx("h3",{className:"sr-only",children:"My submissions"}),r.jsx("ul",{className:"space-y-2",children:i.map(Ee=>{const Je=lu(Ee),$e=Ee.id===F;return r.jsxs("li",{className:`rounded-md border p-3 flex items-start justify-between gap-3 ${$e?"border-primary":""}`,children:[r.jsxs("button",{type:"button",onClick:()=>Ct(Ee),className:"flex-1 text-left",children:[r.jsx("div",{className:"font-medium",children:Ee.summary}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:[Je?Je.toLocaleStr
385ing():"",Ee.location?` · ${Ee.location}`:""]}),Ee.tags&&Ee.tags.length>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Ee.tags.map(Xe=>r.jsx(an,{variant:"outline",className:"text-[10px] px-1 py-0",children:Xe},Xe))})]}),r.jsx(Fe,{type:"button",variant:"ghost",size:"sm",onClick:()=>Wt(Ee.id),"aria-label":"Delete event",children:r.jsx(gu,{className:"w-4 h-4"})})]},Ee.id)})})]})]})]})]}),r.jsx(Bm,{open:q!==null,onOpenChange:Ee=>{Ee||Tt()},children:r.jsxs(Gd,{children:[r.jsxs(Hd,{children:[r.jsx(Vd,{children:"Unsaved changes"}),r.jsx($d,{children:"You have unsaved changes on this event. Save them, discard them, or stay on this event?"})]}),r.jsxs(Wd,{children:[r.jsx(Fx,{onClick:Tt,children:"Cancel"}),r.jsx(Fe,{type:"button",variant:"ghost",onClick:vt,children:"Discard"}),r.jsx(mu,{onClick:Nt,children:"Save"})]})]})})]})}function K7(){const t=new URL(window.location.href);t.searchParams.delete("accept"),t.searchParams.delete("join"),window.history.replaceState({},"",t.pathname+(t.search?t.search:"")+t.hash)}function Y7({sessionId:t}){const{toast:e}=nr(),[n,a]=x.useState(null),[i,s]=x.useState(null),[o,c]=x.useState("loading"),[d,m]=x.useState("");x.useEffect(()=>{const b=new URLSearchParams(window.location.search),v=b.get("accept")||b.get("join");if(!v)return;const C=v.toLowerCase().replace(/[^a-z0-9-]/g,"");C&&a(C)},[]),x.useEffect(()=>{if(!n)return;let b=!1;return(async()=>{try{const v=await fetch(`/api/groups/${encodeURIComponent(n)}`,{headers:{"x-session-id":t}}),C=await v.json().catch(()=>({}));if(b)return;if(!v.ok||!C.success){m(C.message||"Group not found."),c("error");return}s({groupEmail:C.groupEmail,groupName:C.groupName,attendeeCount:C.attendeeCount??0}),c("ready")}catch{if(b)return;m("Could not load group info. Please try again."),c("error")}})(),()=>{b=!0}},[n,t]);async function f(){if(n)try{const b=await fetch(`/api/groups/${encodeURIComponent(n)}/join`,{method:"POST",headers:{"x-session-id":t}}),v=await b.json().catch(()=>({}));if(!b.ok||!v.success)throw new Error(v.message||`Server returned ${b.status}`);c("joined"),e({title:v.alreadyMember?"You're already on the list":"You're on the invite list",description:`${v.groupName}: ${v.attendeeCount} attending`}),K7()}catch(b){e({variant:"destructive",title:"Could not add you",description:b.message})}}function p(){c("dismissed"),stripJoinParam()}return!n||o==="loading"||o==="dismissed"?null:o==="error"?r.jsx(Ft,{className:"border-destructive/40 bg-destructive/5 p-3 mb-4",children:r.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[r.jsx(gr,{className:"w-4 h-4 mt-0.5 text-destructive flex-shrink-0"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"font-medium",children:"Couldn't find that invite list."}),r.jsxs("div",{className:"text-muted-foreground text-xs mt-0.5",children:[d," (Looking for: ",r.jsx("span",{className:"font-mono",children:n}),")"]})]}),r.jsx(Fe,{type:"button",size:"sm",variant:"ghost",onClick:p,className:"h-7",children:"Dismiss"})]})}):r.jsx(Ft,{className:"border-primary/40 bg-primary/5 p-4 mb-4",children:r.jsxs("div",{className:"flex items-start gap-3 flex-wrap",children:[r.jsx(na,{className:"w-5 h-5 mt-0.5 text-primary flex-shrink-0"}),r.jsx("div",{className:"flex-1 min-w-0 space-y-1",children:o==="joined"?r.jsxs("div",{className:"text-sm",children:[r.jsx(oi,{className:"inline w-4 h-4 mr-1 text-primary"}),"You're on the invite list for"," ",r.jsx("span",{className:"font-medium",children:i?.groupName}),"."]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"font-medium",children:["Join ",i?.groupName,"?"]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["You'll receive calendar invites for all events using this list (",i?.attendeeCount??0," attending so far)."]})]})}),o==="ready"&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Fe,{type:"button",size:"sm",onClick:f,className:"gap-1",children:[r.jsx(bo,{className:"w-3.5 h-3.5"}),"Yes, add me"]}),r.jsx(Fe,{type:"button",size:"sm",variant:"ghost",onClick:p,children:"Not now"})]}),o==="joined"&&r.jsx(Fe,{type:"button",size:"sm",variant:"ghost",onClick:p,children:"Dismiss"})]})})}const q7=1e3,J7=3e4;function X7(t,e,n,a,i){console.log("[MemberWS] Hook called with sessionId:",t?t.substring(0,20)+"...":null,"memberKey:",e);
385const[s,o]=x.useState(!1),[c,d]=x.useState(null),[m,f]=x.useState("idle"),p=x.useRef(null),b=x.useRef(0),v=x.useRef(null),C=x.useRef(null),S=x.useRef(0),F=x.useCallback(()=>t?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?sessionId=${t}`:null,[t]),w=x.useCallback(()=>{const z=F();if(!z){console.log("[MemberWS] No URL - sessionId:",t,"memberKey:",e);return}console.log("[MemberWS] Connecting to:",z);const D=new WebSocket(z);p.current=D,D.onopen=()=>{console.log("[MemberWS] Connected"),o(!0),b.current=0},D.onmessage=T=>{try{const K=JSON.parse(T.data);N(K)}catch(K){console.error("[MemberWS] Error parsing message:",K)}},D.onclose=T=>{console.log("[MemberWS] Disconnected:",T.code,T.reason),o(!1),p.current=null,A()},D.onerror=T=>{console.error("[MemberWS] Error:",T)}},[F,t,e]),A=x.useCallback(()=>{v.current&&clearTimeout(v.current);const z=Math.min(q7*Math.pow(2,b.current),J7);console.log(`[MemberWS] Reconnecting in ${z}ms (attempt ${b.current+1})`),v.current=setTimeout(()=>{b.current++,w()},z)},[w]),N=x.useCallback(z=>{switch(z.type){case"connected":console.log("[MemberWS] Welcome message received");break;case"member-updated":const D=z.data;console.log("[MemberWS] Member data updated:",D),d(D),n?.(D);break;case"member-field-saved":console.log("[MemberWS] Field saved:",z.data);break;case"member-save-error":const T=z.data;console.error("[MemberWS] Save error:",T),C.current&&clearTimeout(C.current),f("error"),T?.field&&T?.message&&a?.(T.field,T.message),C.current=setTimeout(()=>{f("idle")},3e3);break;case"guild-email-activate":console.log("[MemberWS] Guild email activation triggered from email link");const K=z.data;i?.(K);break}},[n,a,i]),P=x.useCallback((z,D)=>{if(!p.current||p.current.readyState!==WebSocket.OPEN){console.warn("[MemberWS] Cannot save - not connected");return}if(!e){console.warn("[MemberWS] Cannot save - no memberKey");return}console.log("[MemberWS] Saving field:",z,"- setting saveStatus to saving"),C.current&&clearTimeout(C.current),f("saving"),S.current=Date.now(),C.current=setTimeout(()=>{f("idle")},2e3),p.current.send(JSON.stringify({type:"member-field-save",data:{memberKey:e,field:z,value:D,timestamp:Date.now()}}))},[e]);return x.useEffect(()=>(t&&w(),()=>{v.current&&clearTimeout(v.current),C.current&&clearTimeout(C.current),p.current&&p.current.close()}),[t,w]),{isConnected:s,lastUpdate:c,saveStatus:m,saveField:P}}const Sa=q1,Z7=J1,VN=x.forwardRef(({className:t,...e},n)=>r.jsx(qm,{ref:n,className:ln("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}));VN.displayName=qm.displayName;const da=x.forwardRef(({className:t,children:e,...n},a)=>r.jsxs(Z7,{children:[r.jsx(VN,{}),r.jsxs(Jm,{ref:a,className:ln("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,r.jsxs(gx,{className:"absolute right-4 top-4 roun
385ded-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:[r.jsx(gr,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));da.displayName=Jm.displayName;const ha=({className:t,...e})=>r.jsx("div",{className:ln("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});ha.displayName="DialogHeader";const _o=({className:t,...e})=>r.jsx("div",{className:ln("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});_o.displayName="DialogFooter";const ma=x.forwardRef(({className:t,...e},n)=>r.jsx(Xm,{ref:n,className:ln("text-lg font-semibold leading-none tracking-tight",t),...e}));ma.displayName=Xm.displayName;const Fa=x.forwardRef(({className:t,...e},n)=>r.jsx(Zm,{ref:n,className:ln("text-sm text-muted-foreground",t),...e}));Fa.displayName=Zm.displayName;function Q7({track:t,open:e,onOpenChange:n,memberKey:a,sessionId:i}){const{toast:s}=nr(),[o,c]=x.useState(!1),[d,m]=x.useState(!1),[f,p]=x.useState(1),b=t&&a&&t.trackLeads.includes(a);if(x.useEffect(()=>{t&&(m(t.autoWelcome||!1),p(t.minHours||1))},[t]),!t)return null;const v=async()=>{if(!i){s({title:"Error",description:"Session not found. Please log in again.",variant:"destructive"});return}c(!0);try{const C=await fetch("/api/admin/update-track-info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:i,trackId:t.id,autoWelcome:d,minHours:f})}),S=await C.json();C.ok&&S.success?(s({title:"Success",description:"Track settings updated successfully"}),n(!1)):s({title:"Error",description:S.message||"Failed to update track settings",variant:"destructive"})}catch(C){console.error("Error updating track:",C),s({title:"Error",description:"An error occurred while updating track settings",variant:"destructive"})}finally{c(!1)}};return r.jsx(Sa,{open:e,onOpenChange:n,children:r.jsxs(da,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(ha,{children:[r.jsx(ma,{className:"text-2xl",children:t.name}),r.jsx(Fa,{className:"text-lg font-medium text-foreground pt-2",children:t.pitch})]}),r.jsxs("div",{className:"space-y-4 pt-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase mb-2",children:"Description"}),r.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.description})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase mb-2",children:"Meeting Cadence"}),r.jsx("p",{className:"text-sm",children:t.meetingCadence}),r.jsx("p",{className:"text-sm",children:"(Pacific Time, unless otherwise specified)"})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase mb-2",children:"Track Leads"}),r.jsx("p",{className:"text-sm",children:t.trackLeads.join(", ")})]}),b&&r.jsxs("div",{className:"border-t pt-4 space-y-4",children:[r.jsx("h4",{className:"font-semibold text-sm text-muted-foreground uppercase",children:"Track Lead Settings"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(ar,{id:"autoWelcome",checked:d,onCheckedChange:C=>m(C)}),r.jsx(Ht,{htmlFor:"autoWelcome",className:"text-sm font-normal cursor-pointer",children:"Auto-welcome new members (bypass approval process)"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"minHours",className:"text-sm",children:"Minimum Monthly Hours"}),r.jsx(un,{id:"minHours",type:"number",min:"0.5",max:"5",step:"0.5",value:f,onChange:C=>p(parseFloat(C.target.value)),className:"w-32"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Estimated monthly time commitment (0.5 - 5 hours)"})]}),r.jsxs(Fe,{onClick:v,disabled:o,className:"w-full",children:[o&&r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Settings"]})]})]})]})})}function eU(){const[t,e]=x.useState(!1);return x.useEffect(()=>{console.log("[useGivebutterScript] Hook initialized");const n="https://widgets.givebutter.com/latest.umd.cjs?acct=ec1jRN8y7kBsNTiT&p=other";if(document.querySelector(`script[src="${n}"]`)){console.log("[useGivebutterScript] Script already exists in DOM, marking as loaded"),e(!0);return}console.log("[useGivebutterScript] Creating and loading script");const i=document.createElement("script");return i.src=n,i.async=!0,i.onload=()=>{console.log("[useGivebutterScript] ✅ Script loaded successfully"),e(!0)},i.onerror=s=>{console.error("[useGivebutterScript] ❌ Failed to load Givebutter script:",s)},document.head.appendChild(i),console.log("[useGivebutterScript] Script element appended to head"),()=>{}},[]),t}function tU({donationStatus:t,memberKey:e,sessionId:n,onDonationStatusUpdate:a,isFormValid:i=!0}){const{toast:s}=nr(),[o,c]=x.useState(!1),[d,m]=x.useState(""),[f,p]=x.useState(!1),b=t?.isDonor||!1,v=eU(),C=t?.giveId?`https://givebutter.com/manage/plan/${t.giveId}`:"",S=P=>P?`$${P.toFixed(2)}`:"",F=P=>P?{monthly:"per month",annual:"per year",once:"one-time"}[P]||P:"",w=P=>P?new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"",A=()=>{c(!0),m("")},N=async()=>
385{if(!d.trim()){s({variant:"destructive",title:"Input Required",description:"Please enter your Givebutter ID or email address."});return}p(!0);try{const P=await fetch("/api/verifyDonor",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":n},body:JSON.stringify({memberKey:e,identifier:d.trim()})}),z=await P.json();P.ok&&z.success?(s({title:"Thank You!",description:"Your donation status has been verified and updated."}),c(!1),a&&z.donationStatus&&a(z.donationStatus)):s({variant:"destructive",title:"Verification Failed",description:r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{children:z.message||"We couldn't find a donation matching that information. Please check and try again."}),r.jsx("p",{className:"text-sm",children:"Double-check the spelling of your name. Names must match exactly if emails don't. Email us for help."})]}),duration:15e3})}catch(P){console.error("Error verifying donor:",P),s({variant:"destructive",title:"Error",description:"An error occurred while verifying your donation. Please try again."})}finally{p(!1)}};return x.useEffect(()=>{console.log("[DonateCard] Script load status:",{isDonor:b,isGivebutterScriptLoaded:v})},[b,v]),b?r.jsx(Ft,{className:"p-6 border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-accent/5",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(Bd,{className:"w-6 h-6 text-primary fill-primary"})})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Thank You for Your Support!"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Your generous contribution helps us build a more ethical XR industry."}),t?.amount&&r.jsxs("div",{className:"text-sm mb-2",children:[r.jsx("span",{className:"font-medium",children:"Current donation:"})," ",r.jsx("span",{className:"text-primary font-semibold",children:S(t.amount)}),t.frequency&&r.jsxs("span",{className:"text-muted-foreground",children:[" ",F(t.frequency)]})]}),t?.lastDonation&&r.jsxs("div",{className:"text-sm text-muted-foreground mb-3",children:["Last donation: ",w(t.lastDonation)]}),C&&r.jsxs(Fe,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>window.open(C,"_blank"),children:["Manage Donation",r.jsx(_i,{className:"w-4 h-4"})]})]})]})}):r.jsxs(r.Fragment,{children:[r.jsx(Ft,{className:"p-6 border-2 border-primary/20 bg-gradient-to-br from-primary/5 to-accent/5",children:r.jsxs("div",{className:"flex flex-col lg:flex-row items-start lg:items-center gap-4 lg:gap-6 flex-wrap",children:[r.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[r.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(Bd,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-lg font-semibold whitespace-nowrap",children:"Support the XR Guild"})]}),r.jsx("div",{className:"lg:max-w-[50%] flex-shrink-0",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Giving at least $5/month can help support our mission."})}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:items-center gap-3 lg:flex-1 lg:justify-center",children:[r.jsx("div",{className:"flex-shrink-0",children:v&&r.jsx("givebutter-widget",{id:"jb38WL"})}),r.jsx("button",{onClick:A,disabled:!i,className:`text-xs whitespace-nowrap flex-shrink-0 ${i?"text-muted-foreground hover:text-foreground underline cursor-pointer":"text-muted-foreground/40 cursor-not-allowed"}`,title:i?"":"Please fill out all required profile fields first",children:"Already donated? -- connect your Givebutter account"})]})]})}),r.jsx(Sa,{open:o,onOpenChange:c,children:r.jsxs(da,{children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Update Your Donation Status"}),r.jsx(Fa,{children:"We're sorry that we don't know about your valued donation. This can happen if you donated directly, or used slightly different information, where we couldn't match you automatically by email or name."})]}),r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{children:'Please enter the "Reference #" from a recent GiveButter receipt'}),r.jsx(un,{id:"donor-input",value:d,onChange:P=>m(P.target.value),placeholder:"Reference #, e.g. 0123456789",className:"mt-2",onKeyDown:P=>{P.key==="Enter"&&!f&&N()}})]}),r.jsxs(_o,{children:[r.jsx(Fe,{variant:"outline",onClick:()=>c(!1),disabled:f,children:"Cancel"}),r.jsx(Fe,{onClick:N,disabled:f||!d.trim(),children:f?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify"})]})]})})]})}function kC({email:t,fieldName:e,sessionId:n,isValidated:a,onValidated:i}){const[s,o]=x.useState(a?"validated":"idle"),[c,d]=x.useState(""),[m,f]=x.use
385State(""),[p,b]=x.useState(0);x.useEffect(()=>{if(p<=0)return;const S=setTimeout(()=>{b(F=>F-1)},1e3);return()=>clearTimeout(S)},[p]);const v=async(S=!1)=>{o("sending"),f("");try{const F=await fetch("/api/sendEmailValidationCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n,email:t,fieldName:e})}),w=await F.json();F.ok?(o("sent"),b(60),console.log(w.message)):(f(w.message||"Failed to send code"),o(S?"sent":"idle"))}catch(F){console.error("Error sending validation code:",F),f("Error sending code. Please try again."),o(S?"sent":"idle")}},C=async()=>{if(!c.trim()){f("Please enter the code");return}o("verifying"),f("");try{const S=await fetch("/api/verifyEmailValidationCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n,fieldName:e,code:c.toUpperCase()})}),F=await S.json();S.ok?(o("validated"),i(t)):(f(F.message||"Invalid code"),o("sent"))}catch(S){console.error("Error verifying code:",S),f("Error verifying code. Please try again."),o("sent")}};return s==="validated"?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(d3,{className:"h-5 w-5 text-green-600"}),r.jsx("span",{className:"text-sm text-green-600 font-medium",children:"Validated"})]}):s==="sending"?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(on,{className:"h-5 w-5 animate-spin text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Sending..."})]}):s==="sent"||s==="verifying"?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(un,{type:"text",value:c,onChange:S=>d(S.target.value.toUpperCase()),placeholder:"Enter 6-letter code",maxLength:6,className:"w-40 uppercase font-mono",disabled:s==="verifying"}),r.jsx(Fe,{size:"sm",onClick:C,disabled:s==="verifying"||!c.trim(),children:s==="verifying"?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-4 w-4 animate-spin mr-2"}),"Verifying..."]}):"Verify"}),r.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>v(!0),disabled:s==="verifying"||p>0,children:p>0?`Resend (${p}s)`:"Resend"})]}),m&&r.jsx("p",{className:"text-xs text-red-500",children:m}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Code sent to ",t]})]}):r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>v(),className:"w-fit",children:"Validate"}),m&&r.jsx("p",{className:"text-xs text-red-500",children:m})]})}const AC=[{id:"requested",label:"Requested"},{id:"approved",label:"Approved"},{id:"notified",label:"Notified"},{id:"activated",label:"Activated"},{id:"verified",label:"Verified"},{id:"primary",label:"Primary",labelUnchecked:"Make Primary"}];function NC(t,e){switch(t){case 1:return"step-approved";case 2:return"step-notified";case 3:return"step-activated";case 4:return"step-verified";case 5:return e?"primary-set":"step-primary";default:return"unknown"}}function nU(t,e,n){if(!e)return-1;switch(t){case"verified":return 5;case"activated":return 4;case"notified":return 3;case"approved":return 2;case"error":return 2;case"requested":return 1;default:return 0}}function sd({status:t,hasRequest:e,useGuildEmail:n,onFinalStepClick:a,onUseGuildEmailChange:i,hasError:s,hideStatusMessage:o}){const c=nU(t,e);return e?r.jsxs("div",{className:"w-full py-4","data-testid":"guild-email-progress-tracker","data-stage":NC(c,n),children:[r.jsx("div",{className:"flex items-center justify-between",children:AC.map((d,m)=>{const f=m<c,p=m===c,b=m>c,v=s&&p,C=d.id==="primary"&&c>=5&&i,S=d.id==="primary"&&c===5&&a&&!C;return r.jsxs("div",{className:"flex items-center flex-1 last:flex-none",children:[r.jsxs("div",{className:ln("flex flex-col items-center",S&&"cursor-pointer hover:opacity-80"),onClick:S?a:void 0,title:d.label,children:[C?r.jsx(ar,{"data-testid":"guild-email-make-primary-checkbox",checked:n||!1,onCheckedChange:F=>i(F),className:ln("w-6 h-6 border-2 transition-all",n?"rounded-full bg-green-500 border-green-500 data-[state=checked]:bg-green-500 data-[state=checked]:border-green-500":"rounded border-muted-foreground
385/50 bg-background hover:border-primary")}):r.jsx("div",{className:ln("w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium transition-all",f&&"bg-green-500 text-white",p&&!v&&"bg-primary text-primary-foreground ring-2 ring-primary/30 animate-pulse",p&&v&&"bg-red-500 text-white ring-2 ring-red-500/30",b&&"bg-muted text-muted-foreground"),children:f?r.jsx(oi,{className:"w-3.5 h-3.5"}):r.jsx("span",{className:"text-[10px]",children:m+1})}),r.jsx("span",{className:ln("mt-1 text-[10px] font-medium hidden sm:block text-center",d.id==="primary"&&"w-[70px] whitespace-nowrap",f&&"text-green-600 dark:text-green-400",p&&!v&&!C&&"text-primary",p&&!v&&C&&n&&"text-green-600 dark:text-green-400",p&&!v&&C&&!n&&"text-foreground",p&&v&&"text-red-500",b&&"text-muted-foreground"),children:C&&!n&&"labelUnchecked"in d?d.labelUnchecked:d.label})]}),m<AC.length-1&&r.jsx("div",{className:ln("flex-1 h-0.5 mx-1",m<c?"bg-green-500":"bg-muted")})]},d.id)})}),!o&&r.jsx("div",{className:"mt-2 text-center","data-testid":"guild-email-status-message","data-stage":NC(c,n),children:r.jsx(rU,{status:t,currentStepIndex:c,useGuildEmail:n})})]}):null}function rU({status:t,currentStepIndex:e,useGuildEmail:n}){if(n)return r.jsx("span",{className:"text-xs text-foreground",children:"Guild email is your primary contact for mailing lists (takes effect when you save your profile)"});switch(e){case 1:return r.jsx("span",{className:"text-xs text-muted-foreground",children:"Waiting for admin approval..."});case 2:return t==="error"?r.jsx("span",{className:"text-xs text-red-500",children:"An error occurred. Contact support."}):r.jsx("span",{className:"text-xs text-muted-foreground",children:"Approved! Notification email being sent..."});case 3:return r.jsx("span",{className:"text-xs text-muted-foreground",children:"Check your email for activation link"});case 4:return r.jsxs("span",{className:"text-xs text-muted-foreground",children:["We've sent you a new email with instructions to access and secure your new Guild email.",r.jsx("br",{}),"Log in and find a final verification link in your new email account to complete activation."]});case 5:return r.jsx("span",{className:"text-xs text-foreground/80",children:'Verified! Check "Make Primary" to use for mailing lists'});default:return null}}var _x="Collapsible",[aU,$N]=Xa(_x),[iU,xw]=aU(_x),KN=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:a,defaultOpen:i,disabled:s,onOpenChange:o,...c}=t,[d,m]=ds({prop:a,defaultProp:i??!1,onChange:o,caller:_x});return r.jsx(iU,{scope:n,disabled:s,contentId:wo(),open:d,onOpenToggle:x.useCallback(()=>m(f=>!f),[m]),children:r.jsx(Tn.div,{"data-state":ww(d),"data-disabled":s?"":void 0,...c,ref:e})})});KN.displayName=_x;var YN="CollapsibleTrigger",vw=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,...a}=t,i=xw(YN,n);return r.jsx(Tn.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ww(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...a,ref:e,onClick:vn(t.onClick,i.onOpenToggle)})});vw.displayName=YN;var yw="CollapsibleContent",bw=x.forwardRef((t,e)=>{const{forceMount:n,...a}=t,i=xw(yw,t.__scopeCollapsible);return r.jsx(Yi,{present:n||i.open,children:({present:s})=>r.jsx(sU,{...a,ref:e,present:s})})});bw.displayName=yw;var sU=x.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:a,children:i,...s}=t,o=xw(yw,n),[c,d]=x.useState(a),m=x.useRef(null),f=Hn(e,m),p=x.useRef(0),b=p.current,v=x.useRef(0),C=v.current,S=o.open||c,F=x.useRef(S),w=x.useRef(void 0);return x.useEffect(()=>{const A=requestAnimationFrame(()=>F.current=!1);return()=>cancelAnimationFrame(A)},[]),fa(()=>{const A=m.current;if(A){w.current=w.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const N=A.getBoundingClientRect();p.current=N.height,v.current=N.width,F.current||(A.style.transitionDuration=w.current.transitionDuration,A.style.animationName=w.current.animationName),d(a)}},[o.open,a]),r.jsx(Tn.div,{"data-state":ww(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!S,...s,ref:f,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...t.style},children:S&&i})});function ww(t){return t?"open":"closed"}var qN=KN,oU=vw,lU=bw;const JN=qN,XN=vw,ZN=bw;function fo(t){const e=new Uint8Array(t);let n="";for(const i of e)n+=String.fromCharCode(i);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pg(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4,a=e.padEnd(e.length+n,"="),i=atob(a),s=new ArrayBuffer(i.length),o=new Uint8Array(s);for(let c=0;c<i.length;c++)o[c]=i.charCodeAt(c);return s}function Sw(){return cU.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const cU={stubThis:t=>t};function QN(t){const{id:e}=t;return{...t,id:Pg(e),transports:t.transports}}function eT(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}
385class Ma extends Error{constructor({message:e,code:n,cause:a,name:i}){super(e,{cause:a}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i??a.name,this.code=n}}function uU({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 Ma({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new Ma({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new Ma({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(n.authenticatorSelection?.userVerification==="required")return new Ma({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 Ma({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Ma({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return n.pubKeyCredParams.filter(i=>i.type==="public-key").length===0?new Ma({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Ma({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=globalThis.location.hostname;if(eT(a)){if(n.rp.id!==a)return new Ma({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ma({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Ma({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 Ma({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 t}class dU{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}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 tT=new dU,hU=["cross-platform","platform"];function nT(t){if(t&&!(hU.indexOf(t)<0))return t}async function rT(t){!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useAutoRegister:n=!1}=t;if(!Sw())throw new Error("WebAuthn is not supported in this browser");const a={...e,challenge:Pg(e.challenge),user:{...e.user,id:Pg(e.user.id)},excludeCredentials:e.excludeCredentials?.map(QN)},i={};n&&(i.mediation="conditional"),i.publicKey=a,i.signal=tT.createNewAbortSignal();let s;try{s=await navigator.credentials.create(i)}catch(C){throw uU({error:C,options:i})}if(!s)throw new Error("Registration was not completed");const{id:o,rawId:c,response:d,type:m}=s;let f;typeof d.getTransports=="function"&&(f=d.getTransports());let p;if(typeof d.getPublicKeyAlgorithm=="function")try{p=d.getPublicKeyAlgorithm()}catch(C){Tv("getPublicKeyAlgorithm()",C)}let b;if(typeof d.getPublicKey=="function")try{const C=d.getPublicKey();C!==null&&(b=fo(C))}catch(C){Tv("getPublicKey()",C)}let v;if(typeof d.getAuthenticatorData=="function")try{v=fo(d.getAuthenticatorData())}catch(C){Tv("getAuthenticatorData()",C)}return{id:o,rawId:fo(c),response:{attestationObject:fo(d.attestationObject),clientDataJSON:fo(d.clientDataJSON),transports:f,publicKeyAlgorithm:p,publicKey:b,authenticatorData:v},type:m,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:nT(s.authenticatorAttachment)}}function Tv(t,e){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
386`,e)}function mU(){if(!Sw())return Mv.stubThis(new Promise(e=>e(!1)));const t=globalThis.PublicKeyCredential;return t?.isConditionalMediationAvailable===void 0?Mv.stubThis(new Promise(e=>e(!1))):Mv.stubThis(t.isConditionalMediationAvailable())}
386const Mv={stubThis:t=>t};function fU({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 Ma({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Ma({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=globalThis.location.hostname;if(eT(a)){if(n.rpId!==a)return new Ma({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ma({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Ma({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 t}async function jg(t){!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:a=!0}=t;if(!Sw())throw new Error("WebAuthn is not supported in this browser");let i;e.allowCredentials?.length!==0&&(i=e.allowCredentials?.map(QN));const s={...e,challenge:Pg(e.challenge),allowCredentials:i},o={};if(n){if(!await mU())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&a)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",s.allowCredentials=[]}o.publicKey=s,o.signal=tT.createNewAbortSignal();let c;try{c=await navigator.credentials.get(o)}catch(v){throw fU({error:v,options:o})}if(!c)throw new Error("Authentication was not completed");const{id:d,rawId:m,response:f,type:p}=c;let b;return f.userHandle&&(b=fo(f.userHandle)),{id:d,rawId:fo(m),response:{authenticatorData:fo(f.authenticatorData),clientDataJSON:fo(f.clientDataJSON),signature:fo(f.signature),userHandle:b},type:p,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:nT(c.authenticatorAttachment)}}const od="xrguild-member-passkey";function pU({sessionId:t,machineId:e,defaultOpen:n=!1,onPasskeyCountChange:a,onOpenChange:i,readOnly:s=!1}){const[o,c]=x.useState(n),[d,m]=x.useState([]),[f,p]=x.useState(null),[b,v]=x.useState(!1),[C,S]=x.useState(null),[F,w]=x.useState(!1),[A,N]=x.useState(null),[P,z]=x.useState(!1),[D,T]=x.useState(e||null),[K,B]=x.useState(!1),[k,O]=x.useState(!1),[I,j]=x.useState("");x.useEffect(()=>{e&&T(e)},[e]),x.useEffect(()=>{n&&c(!0)},[n]),x.useEffect(()=>{const ve=localStorage.getItem(od);z(!!ve)},[]),x.useEffect(()=>{t&&a&&fetch("/api/member/passkeys",{headers:{"x-session-id":t}}).then(ve=>ve.json()).then(ve=>{if(ve.success){const pe=ve.passkeys||[],Me=ve.currentRpId,We=pe.some(Ae=>Ae.rpId===Me);a(pe.length,We)}}).catch(()=>{})},[t]),x.useEffect(()=>{o&&t&&U()},[o,t]);async function U(){v(!0),S(null);try{const pe=await(await fetch("/api/member/passkeys",{headers:{"x-session-id":t}})).json();if(pe.success){const Me=(pe.passkeys||[]).sort((Ae,Ce)=>{const He=Ae.lastUsed?new Date(Ae.lastUsed).getTime():0;return(Ce.lastUsed?new Date(Ce.lastUsed).getTime():0)-He});m(Me),p(pe.currentRpId||null),B(pe.hasLocalStorageKey||!1);const We=Me.some(Ae=>Ae.rpId===pe.currentRpId);a?.(Me.length,We)}else S(pe.message||"Failed to load passkeys")}catch(ve){S("Failed to connect to server"),console.error("[MANAGE-PASSKEYS] Error loading passkeys:",ve)}finally{v(!1)}}async function q(ve){w(!0),S(null);try{const Me=await(await fetch("/api/member/passkey/registration-options",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":t}})).json();if(!Me.success)throw new Error(Me.message||"Failed to get registration options");const We=await rT(Me.options),Ae=Q&&D&&f?d.find(Ct=>Ct.machineId===D&&Ct.rpId===f):null,He=await(await fetch("/api/member/passkey/verify-registration",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":t},body:JSON.stringify({credential:We,deviceName:Ae?.deviceName||ve,replaceMachineId:Ae?D:void 0})})).json();if(!He.success)throw new Error(He.message||"Failed to verify registration");P&&He.localStorageKey&&localStorage.setItem(od,He.localStorageKey),He.machineId&&T(He.machineId),O(!1),j(""),await U()}catch(pe){pe instanceof Error&&pe.name==="NotAllowedError"?S("Passkey registration was cancelled"):pe instanceof Error?S(pe.message):S("Failed to register passkey"),console.error("[MANAGE-PASSKEYS] Registration error:",pe)}finally{w(!1)}}function Y(){if(Q){const ve=d.find(pe=>pe.machineId===D&&pe.rpId===f);if(ve){q(ve.deviceName);return}}O(!0),j("")}function W(){O(!1),j("")}function H(ve){ve.preventDefault(),I.trim()&&q(I.trim())}async function J(ve,pe){if(confirm("Are you sure you want to delete this passkey?")){N(pe),S(null);try{const We=await(await fetch(`/api/member/passkey/${encodeURIComponent(ve)}/${pe}`,{method:"DELETE",headers:{"x-session-id":t}})).json();if(!We.success)throw new Error(We.message||"Failed to delete passkey");pe===D&&(localStorage.removeItem(od),z(!1),T(null)),m(Ae=>Ae.filter(Ce=>!(Ce.rpId===ve&&Ce.machineId===pe)))}catch(Me){Me instanceof Error?S(Me.message):S("Failed to delete passkey"),console.error("[MANAGE-PASSKEYS] Delete error:",Me)}finally{N(null)}}}async function ie(ve){if(z(ve),ve){if(!localStorage.getItem(od)&&K)try{const We=await(await fetch("/api/member/passkey/trust-device",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":t}})).json();We.success&&We.localStorageKey&&localStorage.setItem(od,We.localStorageKey)}catch{}}else localStorage.removeItem(od)}const Q=d.some(ve=>ve.machineId===D);return r.jsx(JN,{open:o,onOpenChange:ve=>{c(ve),i?.(ve)},children:r.jsxs(Ft,{className:"mt-4",children:[r.jsx(XN,{asChild:!0,children:r.jsxs(bn,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fc,{className:"h-5 w-5"}),r.jsx(wn,{className:"text-lg",children:"Manage Passkeys"})]}),r.jsx(Ja,{className:`h-5 w-5 transition-transform ${o?"rotate-180":""}`})]}
386),r.jsx(Ln,{children:"Use passkeys for quick, secure login without email verification"})]})}),r.jsx(ZN,{children:r.jsx(fn,{className:"pt-0",children:b?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(on,{className:"h-6 w-6 animate-spin"})}):r.jsxs(r.Fragment,{children:[C&&r.jsx("div",{className:"mb-4 p-3 bg-destructive/10 text-destructive rounded-md text-sm",children:C}),d.length>0?r.jsxs("div",{className:"space-y-2 mb-4",children:[r.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Your Passkeys"}),d.map(ve=>{const pe=ve.machineId===D&&ve.rpId===f,Me=ve.rpId===f;return r.jsxs("div",{className:`flex items-center justify-between p-3 rounded-md border transition-all ${pe?"bg-primary/10 border-primary/40 shadow-[0_0_10px_rgba(var(--primary),0.3)]":Me?"":"opacity-60"}`,children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"font-medium",children:ve.deviceName}),r.jsx(an,{variant:"outline",className:"text-xs",children:ve.rpId}),pe&&r.jsx(an,{variant:"default",className:"text-xs",children:"This device"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Created: ",TC(ve.created)," · Last used: ",TC(ve.lastUsed)]})]}),!s&&r.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>J(ve.rpId,ve.machineId),disabled:A===ve.machineId,className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:A===ve.machineId?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsx(gu,{className:"h-4 w-4"})})]},`${ve.rpId}-${ve.machineId}`)})]}):r.jsx("div",{className:"text-sm text-muted-foreground mb-4 py-4 text-center",children:"No passkeys registered yet"}),!s&&(k?r.jsxs("form",{onSubmit:H,className:"mb-4 p-3 border rounded-md space-y-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"device-name",children:"Device Name"}),r.jsx(un,{id:"device-name",type:"text",placeholder:"MacBook Pro, iPhone 13, etc.",value:I,onChange:ve=>j(ve.target.value),disabled:F,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose a name to identify this device"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Fe,{type:"submit",disabled:F||!I.trim(),className:"flex-1",children:F?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}),"Registering..."]}):r.jsxs(r.Fragment,{children:[r.jsx(ko,{className:"h-4 w-4 mr-2"}),"Create Passkey"]})}),r.jsx(Fe,{type:"button",variant:"outline",onClick:W,disabled:F,children:r.jsx(gr,{className:"h-4 w-4"})})]})]}):r.jsx(Fe,{onClick:Y,disabled:F,className:"w-full mb-4",variant:Q?"outline":"default",children:F?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}),"Registering..."]}):Q?r.jsxs(r.Fragment,{children:[r.jsx(Rr,{className:"h-4 w-4 mr-2"}),"Replace Passkey for This Device"]}):r.jsxs(r.Fragment,{children:[r.jsx(ko,{className:"h-4 w-4 mr-2"}),"Add Passkey"]})})),!s&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4 py-2 border-t",children:[r.jsx(ar,{id:"trust-device",checked:P,onCheckedChange:ie}),r.jsx("label",{htmlFor:"trust-device",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"I trust this browser and device"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"When enabled, this device will remember your passkey for quick login. Uncheck to require email recovery on this device."})]})]})})})]})})}function TC(t){if(!t)return"Never";const e=new Date(t);return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:e.getFullYear()!==new Date().getFullYear()?"numeric":void 0})}const Rv=({hours:t,size:e="sm"})=>{const n=Math.max(5,Math.ceil(t)),a=e==="sm"?"w-1.5 h-1.5":"w-2.5 h-2.5",i=e==="sm"?"gap-0.5":"gap-1",s=o=>{const c=t-o;let d="",m="";return o<5?(d="bg-primary",m="bg-gradient-to-r from-primary from-50% to-muted-foreground/20 to-50%"):o<8?(d="bg-yellow-500",m="bg-gradient-to-r from-yellow-500 from-50% to-muted-foreground
386/20 to-50%"):o<10?(d="bg-orange-500",m="bg-gradient-to-r from-orange-500 from-50% to-muted-foreground/20 to-50%"):(d="bg-red-500",m="bg-gradient-to-r from-red-500 from-50% to-muted-foreground/20 to-50%"),c>=1?d:c>=.5?m:"bg-muted-foreground/20"};return r.jsx("div",{className:`flex ${i}`,children:Array.from({length:n}).map((o,c)=>r.jsx("div",{className:`${a} rounded-full ${s(c)}`},c))})},gU={sf:"CA","san francisco":"CA",oakland:"CA","san jose":"CA",la:"CA","los angeles":"CA","san diego":"CA",sacramento:"CA",berkeley:"CA","palo alto":"CA",nyc:"NY",ny:"NY","new york":"NY",brooklyn:"NY",manhattan:"NY",queens:"NY",bronx:"NY",chicago:"IL",seattle:"WA",portland:"OR",austin:"TX",dallas:"TX",houston:"TX",phoenix:"AZ",denver:"CO",boston:"MA",miami:"FL",atlanta:"GA",dc:"DC",washington:"DC",philadelphia:"PA",detroit:"MI",minneapolis:"MN",tampa:"FL",orlando:"FL","las vegas":"NV",baltimore:"MD",nashville:"TN",memphis:"TN"},Ep={CA:"United States",california:"United States",NY:"United States","new york":"United States",TX:"United States",texas:"United States",FL:"United States",florida:"United States",IL:"United States",illinois:"United States",PA:"United States",pennsylvania:"United States",OH:"United States",ohio:"United States",GA:"United States",georgia:"United States",NC:"United States","north carolina":"United States",MI:"United States",michigan:"United States",NJ:"United States","new jersey":"United States",VA:"United States",virginia:"United States",WA:"United States",washington:"United States",AZ:"United States",arizona:"United States",MA:"United States",massachusetts:"United States",TN:"United States",tennessee:"United States",IN:"United States",indiana:"United States",MO:"United States",missouri:"United States",MD:"United States",maryland:"United States",WI:"United States",wisconsin:"United States",CO:"United States",colorado:"United States",MN:"United States",minnesota:"United States",SC:"United States","south carolina":"United States",AL:"United States",alabama:"United States",LA:"United States",louisiana:"United States",KY:"United States",kentucky:"United States",OR:"United States",oregon:"United States",OK:"United States",oklahoma:"United States",CT:"United States",connecticut:"United States",UT:"United States",utah:"United States",IA:"United States",iowa:"United States",NV:"United States",nevada:"United States",AR:"United States",arkansas:"United States",MS:"United States",mississippi:"United States",KS:"United States",kansas:"United States",NM:"United States","new mexico":"United States",NE:"United States",nebraska:"United States",WV:"United States","west virginia":"United States",ID:"United States",idaho:"United States",HI:"United States",hawaii:"United States",NH:"United States","new hampshire":"United States",ME:"United States",maine:"United States",MT:"United States",montana:"United States",RI:"United States","rhode island":"United States",DE:"United States",delaware:"United States",SD:"United States","south dakota":"United States",ND:"United States","north dakota":"United States",AK:"United States",alaska:"United States",DC:"United States","district of columbia":"United States",VT:"United States",vermont:"United States",WY:"United States",wyoming:"United States",ON:"Canada",ontario:"Canada",QC:"Canada",quebec:"Canada",BC:"Canada","british columbia":"Canada",AB:"Canada",alberta:"Canada",MB:"Canada",manitoba:"Canada",SK:"Canada",saskatchewan:"Canada",NS:"Canada","nova scotia":"Canada",NB:"Canada","new brunswick":"Canada",NL:"Canada",newfoundland:"Canada",PE:"Canada","prince edward island":"Canada",NT:"Canada","northwest territories":"Canada",YT:"Canada",yukon:"Canada",NU:"Canada",nunavut:"Canada"},xU=["United States","---","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo","Costa Rica","Croatia","Cuba","Cyprus","Czech Republic","Democratic Republic of the Congo","Denmark","Djibouti","Dominica","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","North Korea","North Macedonia","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","S
386amoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"];function vU({memberData:t,sessionId:e,checkNameAvailability:n,getRequestedNames:a,handleInputChange:i,setMemberData:s,setHasManualSaveNeeded:o,onMigrationStatusChange:c,autoActivateGuildEmail:d=!1,onAutoActivateComplete:m}){const[f,p]=x.useState(!1),[b,v]=x.useState(!1),[C,S]=x.useState(!1),[F,w]=x.useState(0),[A,N]=x.useState(""),[P,z]=x.useState(""),[D,T]=x.useState(null),{toast:K}=nr(),B=t.requestedEmail?.useGuildEmail;x.useEffect(()=>{t.guildEmail&&t.memberKey?fetch("/api/getGuildEmailMigrationStatus",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":e},body:JSON.stringify({memberKey:t.memberKey})}).then(H=>H.json()).then(H=>{H.success&&H.hasGuildEmail&&(T({guildEmailGroups:H.guildEmailGroups||[],externalEmailGroups:H.externalEmailGroups||[],needsMigration:H.needsMigration}),c?.(!H.needsMigration))}).catch(H=>console.error("Error fetching migration status:",H)):c?.(!1)},[t.guildEmail,t.memberKey,c,e,B]),x.useEffect(()=>{if(F<=0)return;const H=setTimeout(()=>{w(J=>J-1)},1e3);return()=>clearTimeout(H)},[F]);const k=t.requestedEmail?.status,O=t.requestedEmail?.approvedHandle,I=O?`${O}@xrguild.org`:"",j=async()=>{p(!0),z("");try{const H=await fetch("/api/activate-guild-email",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":e},body:JSON.stringify({memberKey:t.memberKey})}),J=await H.json();H.ok&&J.success?(s(ie=>({...ie,requestedEmail:{...ie.requestedEmail,status:"activated",activatedAt:new Date().toISOString()}})),K({title:"Account Created!",description:"Check your personal email for login instructions, and your guild email for the verification code."})):z(J.message||"Failed to activate account")}catch(H){console.error("Activation error:",H),z("Error activating account. Please try again.")}finally{p(!1)}};x.useEffect(()=>{d&&k==="notified"&&!f?(console.log("[MEMBER-PROFILE] Auto-activating guild email from magic link"),j(),m?.()):d&&k!=="notified"&&(console.log("[MEMBER-PROFILE] Auto-activate requested but status is:",k),m?.())},[d,k,f]);const U=()=>{const H=document.getElementById("useGuildEmail");H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{s(J=>{const ie=typeof J.requestedEmail=="object"&&J.requestedEmail?J.requestedEmail:{};return{...J,requestedEmail:{...ie,useGuildEmail:!0}}})},500))},q=H=>{s(J=>{const ie=typeof J.requestedEmail=="object"&&J.requestedEmail?J.requestedEmail:{};return{...J,requestedEmail:{...ie,useGuildEmail:H}}}),o(!0)},Y=k==="requested",W=Y?r.jsx(sd,{status:k,hasRequest:!0,useGuildEmail:!1,onFinalStepClick:void 0,hasError:!1}):null;if(k==="verified"){const H=t.guildEmail?.includes("@")?t.guildEmail:t.guildEmail?`${t.guildEmail}@xrguild.org`:I,J=Q=>Q.replace(/@xrguild\.org$/,""),ie=D?.guildEmailGroups||[];return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Guild Email"}),r.jsx(un,{id:"guildEmail",type:"text",value:H,readOnly:!0,disabled:!0,className:"bg-green-50 dark:bg-green-950/30 border-green-300 dark:border-green-700 text-foreground dark:text-green-100"}),r.jsxs("p",{className:"text-xs text-green-600 dark:text-green-400 mt-1 font-medium",children:["✓ Your guild email is fully activated! You can now login with ",H]}),ie.length>0&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Contact address for: ",ie.map(J).join(", ")]}),r.jsx(sd,{status:k,hasRequest:!0,useGuildEmail:t.requestedEmail?.useGuildEmail,onFinalStepClick:U,onUseGuildEmailChange:q,hasError:!1})]})}if(k==="activated")return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Guild Email"}),r.jsx(un,{id:"guildEmail",type:"text",value:I,readOnly:!0,disabled:!0,className:"bg-amber-50 dark:bg-amber-950/30 border-amber-300 dark:border-amber-700"}),r.jsx(sd,{status:k,hasRequest:!0,useGuildEmail:t.requestedEmail?.useGuildEmail,onFinalStepClick:U,hasError:!1})]});if(k==="notified")return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Approved Guild Email"}),r.jsx(un,{id:"guildEmail",type:"text",value:I,readOnly:!0,disabled:!0,className:"bg-blue-50 dark:bg-blue-950/30 border-blue-300 dark:border-blue-700"}),r.jsx(sd,{status:k,hasRequest:!0,useGuildEmail:t.requestedEmail?.useGuildEmail,onFinalStepClick:U,hasError:!1,hideStatusMessage:!0}),r.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{children:"Check your email for activation link, or click"}),r.jsx(Fe,{onClick:j,disabled:f,size:"sm",variant:"outline",className:"h-6 px-2 text-xs",children:f?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-3 w-3 animate-spin mr-1"}),"Activating..."]}):"Activate"})]}),P&&r.jsx("p",{className:"text-xs text-red-500 mt-1 text-center",children:P})]});if(k==="approved")return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Guild Email Status"}),r.jsx(un,{id:"guildEmail",type:"text",value:I,readOnly:!0,disabled:!0,className:"bg-gray-50 dark:bg-gray-950/30"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your email request has been approved. You'll receive a notification email shortly."}),r.jsx(sd,{status:k,hasRequest:!0,useGuildEmail:t.requestedEmail?.useGuildEmail,onFinalStepClick:U,hasError:!1})]});if(k==="error")return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Guild Email"}),r.jsx(un,{id:"guildEmail",type:"text",value:I||t.requestedEmail?.names?.join(", ")||"",readOnly:!0,disabled:!0,className:"bg-red-50 dark:bg-red-950/30 border-red-300 dark:border-red-700"}),r.jsxs("p",{className:"text-sm text-red-600 dark:text-red-400 mt-1",children:["Error: ",t.requestedEmail?.error||"An error occurred during email setup"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Please contact an admin if this problem persists."})]});if(t.guildEmail?.trim()&&!k){const H=t.guildEmail.includes("@")?t.guildEmail:`${t.guildEmail}@xrguild.org`;return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"guildEmail",children:"Guild Email"}),r.jsx(un,{id:"guildEmail",type:"text",value:H,readOnly:!0,disabled:!0,className:"bg-green-50 dark:bg-green-950/30 border-green-300 dark:border-green-700 text-foreground dark:text-green-100"}),r.jsx(sd,{status:"verified",hasRequest:!0,useGuildEmail:typeof t.requestedEmail=="object"?t.requestedEmail?.useGuildEmail:void 0,onUseGuildEmailChange:async J=>{const ie=typeof t.requestedEmail=="object"&&t.requestedEmail?t.requestedEmail:{};i("requestedEmail",{...ie,useGuildEmail:J})}})]})}return r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"requestedEmail",children:"Request an XR Guild Email Address"}),r.jsx("div",{className:"relative mt-1",children:r.jsx(un,{id:"requestedEmail",type:"text",value:t.requestedEmail?._rawInput??t.requestedEmail?.names?.join(", ")??"",onChange:H=>{const J=H.target.value,ie=J.split(/[,;]/).map(Q=>Q.trim().toLowerCase().replace(/[^a-z0-9.-]/g,"")).filter(Q=>Q.length>0);
386i("requestedEmail",{...t.requestedEmail,names:ie,_rawInput:J})},placeholder:`e.g. ${t.preferredName||t.firstName||"yourname"}${t.firstName&&t.lastName?`, ${t.firstName}.${t.lastName}`:""}`,className:"font-mono"})}),a().length>0&&r.jsx("div",{className:"mt-2 space-y-1",children:a().map((H,J)=>{const ie=H.trim();if(!ie)return null;const Q=n(ie),ve=Q.available===!0,pe=Q.available===!1;let Me=ie;return ie.includes("@")&&ie.endsWith("@xrguild.org")&&(Me=ie.replace("@xrguild.org","")),r.jsxs("div",{className:"text-sm",children:[r.jsxs("span",{className:ve?"text-green-600":pe?"text-red-600 line-through":"text-muted-foreground",children:[Me,"@xrguild.org"]}),pe&&Q?.reason&&r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(",Q.reason==="taken"?"already taken":Q.reason==="blacklisted"?"not allowed":Q.reason==="invalid_characters"?"invalid characters":Q.reason==="invalid_domain"?"must be @xrguild.org":"unavailable",")"]}),ve&&r.jsx("span",{className:"ml-2 text-xs text-green-600",children:"✓ available"})]},J)})}),W,!Y&&r.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["All XR Guild volunteers are encouraged to request a free ",r.jsx("b",{children:"[email protected]"})," account, which includes email, cloud storage, groups, AI, and other Google Workplace apps & services that are useful for our volunteer activities."]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.jsxs("i",{children:["Note: these accounts are not automatic and can only be approved by your ",r.jsx("b",{children:"Track leads"})," and ",r.jsx("b",{children:"Admins"}),". Provide one or more desired email names separated by commas - unavailable names will appear with a strikethrough so you can try something else."]})})]})}function yU({memberKey:t,email:e,sessionId:n,isImpersonation:a=!1,autoActivateGuildEmail:i=!1,onAutoActivateComplete:s,scrollToGuildEmail:o=!1,machineId:c=null,onHasDevicePasskeyChange:d,triggerPasskeySetup:m=!1,onPasskeySetupTriggered:f}){const{toast:p}=nr(),[b,v]=x.useState(!0),[C,S]=x.useState(!1),[F,w]=x.useState(!1),[A,N]=x.useState(!1),[P,z]=x.useState(null),[D,T]=x.useState(!1),[K,B]=x.useState([]),[k,O]=x.useState({email:e,tracks:[]}),[I,j]=x.useState(""),[U,q]=x.useState([]),[Y,W]=x.useState({}),[H,J]=x.useState(new Set),[ie,Q]=x.useState(new Set),[ve,pe]=x.useState(!1),[Me,We]=x.useState(!1),[Ae,Ce]=x.useState({}),[He,Ct]=x.useState(!1),[bt,Rt]=x.useState([]),[zt,Ut]=x.useState(""),[Bt,re]=x.useState(!1),[wt,Nt]=x.useState(null),[vt,Tt]=x.useState(!1),[Wt,Dt]=x.useState(!1),jt=x.useRef(null);x.useEffect(()=>{d?.(wt)},[wt,d]),x.useEffect(()=>{m&&(Dt(!0),setTimeout(()=>{jt.current?.scrollIntoView({behavior:"smooth",block:"center"})},100),f?.())},[m,f]);
386const[he,ee]=x.useState(!1),[ze,Ve]=x.useState(!1),lt=x.useRef(null),qe=x.useRef(null),[It,gt]=x.useState(!1);x.useEffect(()=>{if(b)return;const ae=()=>{const Te=qe.current;if(!Te){gt(!1);return}const Qe=Te.getBoundingClientRect(),ot=Qe.top<window.innerHeight&&Qe.bottom>0;gt(ot)};return window.addEventListener("scroll",ae,{passive:!0}),window.addEventListener("resize",ae,{passive:!0}),ae(),()=>{window.removeEventListener("scroll",ae),window.removeEventListener("resize",ae)}},[b]);const[Ee,Je]=x.useState(0),$e=x.useRef();x.useEffect(()=>{const ae=k.requestedEmail?.useGuildEmail;$e.current!==void 0&&$e.current!==ae&&Je(Te=>Te+1),$e.current=ae},[k.requestedEmail?.useGuildEmail]);const[Xe,X]=x.useState(!1),[ke,De]=x.useState(!0),oe=x.useRef(null),te=x.useRef(new Map),ye=new Set(["email","secondaryEmails","requestedEmail","preferredName"]),Re=["firstName","lastName"],Le=x.useCallback(ae=>{O(ot=>({...ot,[ae.field]:ae.value}));let Te="Profile Updated",Qe=`Your ${ae.field} was updated.`;if(ae.field==="requestedEmail"){const ot=ae.value;ot.status==="notified"||ot.status==="approved"?(Te="Guild Email Approved!",Qe=`Your ${ot.approvedHandle}@xrguild.org email has been approved. Click 'Activate' to create your account.`):ot.status==="requested"&&(Te="Guild Email Status Changed",Qe="Your guild email request status has been updated.")}p({title:Te,description:Qe,duration:5e3})},[p]),fe=x.useCallback((ae,Te)=>{p({title:"Save failed",description:`Could not save ${ae}: ${Te}`,variant:"destructive",duration:5e3})},[p]),[Se,Be]=x.useState(!1),Ze=x.useCallback(ae=>{console.log("[MEMBER-PROFILE] Guild email activate from WebSocket, autoActivate:",ae.autoActivate),ae.autoActivate&&(Be(!0),p({title:"Activating Guild Email",description:"Creating your guild email account...",duration:5e3}))},[p]),{isConnected:ue,saveStatus:rt,saveField:je}=X7(n,t,Le,fe,Ze),_t=x.useCallback(()=>lt.current?!1:Re.every(ae=>{const Te=k[ae];return Te&&String(Te).trim().length>0}),[k]),Kt=x.useCallback((ae,Te)=>{!ke||ye.has(ae)||(te.current.set(ae,Te),ee(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{if(!_t()){ee(!1),Ve(!0);return}const Qe=new Map(te.current);te.current.clear();for(const[ot,pt]of Qe)je(ot,pt);ee(!1)},2e3))},[ke,_t,je]);x.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current)},[]),x.useEffect(()=>{ht(),gn()},[t]),x.useEffect(()=>{(async()=>{if(t)try{const Te=await fetch("/api/getEmailGroupMappings",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":n},body:JSON.stringify({memberKey:t})});if(Te.ok){const Qe=await Te.json();Qe.success&&Ce(Qe.emailToGroups||{})}}catch(Te){console.error("Error fetching email group mappings:",Te)}})()},[t,k.email,k.secondaryEmails,k.guildEmail]),x.useEffect(()=>{(async()=>{try{const Te=await fetch("/api/tracks");if(Te.ok){const Qe=await Te.json();B(Qe.tracks||[])}}catch(Te){console.error("Error fetching tracks:",Te)}})()},[]),x.useEffect(()=>{o&&!b&&setTimeout(()=>{const ae=document.getElementById("guild-email-section");ae&&ae.scrollIntoView({behavior:"smooth",block:"start"})},300)},[o,b]),x.useEffect(()=>{const ae=Te=>{if(he||ze){Te.preventDefault();const Qe="You have unsaved changes. Are you sure you want to leave this page?";return Te.returnValue=Qe,Qe}};return window.addEventListener("beforeunload",ae),()=>window.removeEventListener("beforeunload",ae)},[he,ze]);const gn=async()=>{try{const ae=await fetch("/api/getValidatedEmails",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})});if(ae.ok){const Te=await ae.json();W(Te.validatedEmails||{})}}catch(ae){console.error("Error fetching validated emails:",ae)}},_e=async(ae,Te)=>{try{let Qe={...k};if(ae==="email")Qe.email=Te;else if(ae.startsWith("secondaryEmails[")){const cn=[...k.secondaryEmails||[]],St=ae.match(/\[(\d+)\]/),le=St?parseInt(St[1],10):cn.length;cn[le]=Te,Qe.secondaryEmails=cn.filter(Ne=>Ne)}else{console.warn(`Unknown email field: ${ae}`);return}const ot=await fetch("/api/updateMemberProfileStreaming",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:t,sessionId:n,memberData:Qe})});if(!ot.ok||!ot.body)throw new Error("Failed to save email");const pt=ot.body.getReader(),ct=new TextDecoder;let Vt=!1,sn="";for(;;){const{done:cn,value:St}=await pt.read();if(cn)break;const Ne=ct.decode(St).split(`
387`).filter(Oe=>Oe.startsWith("data: "));for(const Oe of Ne)try{const at=JSON.parse(Oe.slice(6));at.type==="complete"?Vt=!0:at.type==="error"&&(sn=at.message)}catch{}}if(!Vt)throw new Error(sn||"Save did not complete");console.log(`✅ Saved validated ${ae}: ${Te}`),ae==="email"?(j(Te),O(Qe)):ae.startsWith("secondaryEmails[")&&(q(Qe.secondaryEmails||[]),O(Qe)),p({title:"Email Saved",description:`${Te} has been saved to your profile.`,duration:3e3})}catch(Qe){console.error("Error saving validated email:",Qe),p({variant:"destructive",title:"Save Failed",description:`Could not save ${Te}. Please try saving your profile manually.`,duration:5e3})}},et=()=>k.requestedEmail?.names?.filter(ae=>ae.length>0)||[],Ge=ae=>{const Te=ae.toLowerCase().trim();return Te?/^[a-z0-9.-]+$/.test(Te)?ie.has(Te)?{available:!1,reason:"blacklisted"}:H.has(Te)?{available:!1,reason:"taken"}:{available:!0}:{available:!1,reason:"invalid_characters"}:{available:!1,reason:"empty"}},ht=async()=>{try{const ae=await fetch("/api/getMemberProfile",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":n},body:JSON.stringify({memberKey:t})});if(ae.ok){const Te=await ae.json();if((!Te.preferredContactMethods||Te.preferredContactMethods.length===0)&&(Te.preferredContactMethods=["Primary Email"]),typeof Te.requestedEmail=="string"){const Qe=Te.requestedEmail.split(",").map(ot=>ot.trim()).filter(ot=>ot);Te.requestedEmail={names:Qe}}O({...k,...Te}),lt.current===null&&(lt.current=!Te.firstName?.trim()),Te.takenGuildEmails&&J(new Set(Te.takenGuildEmails.map(Qe=>Qe.toLowerCase()))),Te.blacklistedNames&&Q(new Set(Te.blacklistedNames.map(Qe=>Qe.toLowerCase()))),j(Te.email||""),q(Te.secondaryEmails||[]),We(Te.requestedEmail?.useGuildEmail||!1)}}catch(ae){console.error("Error fetching member data:",ae),p({variant:"destructive",title:"Error",description:"Failed to load your profile data."})}finally{v(!1)}},ft=(ae,Te)=>{O(Qe=>{const ot={...Qe,[ae]:Te};if(ae==="city"&&typeof Te=="string"&&Te&&!Qe.stateProvince){const pt=Te.toLowerCase().trim(),ct=gU[pt];if(ct&&(ot.stateProvince=ct,!Qe.country)){const Vt=ct.toUpperCase().trim(),sn=ct.toLowerCase().trim(),cn=E
387p[Vt]||Ep[sn];cn&&(ot.country=cn)}}if(ae==="stateProvince"&&typeof Te=="string"&&Te&&!Qe.country){const pt=Te.toLowerCase().trim(),ct=Te.toUpperCase().trim(),Vt=Ep[ct]||Ep[pt];Vt&&(ot.country=Vt)}return ot}),ye.has(ae)?Ve(!0):ue?Kt(ae,Te):Ve(!0)},Mt=ae=>{if(ae.preferredName)return ae.preferredName;const Te=[];ae.namePrefix&&Te.push(ae.namePrefix),ae.firstName&&Te.push(ae.firstName),ae.middleName&&Te.push(ae.middleName),ae.lastName&&Te.push(ae.lastName);let Qe=Te.length>0?Te.join(" "):"TBD";return ae.nameSuffix&&(Qe+=", "+ae.nameSuffix),Qe},be=ae=>{const Te=ae.public;return Te&&Object.values(Te).some(Qe=>Qe===!0)},Z=ae=>{const Te=ae.public;if(!Te)return!1;const Qe=Object.values(Te);return Qe.length>0&&Qe.every(ot=>ot===!0)},it=ae=>{const Te=ae.public;return Te?Object.values(Te).every(Qe=>!Qe):!0},[we,st]=x.useState({open:!1,trackName:""}),[Lt,Ot]=x.useState(!1),Et=ae=>{if((k.leading||[]).includes(ae)){const ot=K.find(pt=>pt.id===ae);st({open:!0,trackName:ot?.name||ae});return}O(ot=>{const pt=ot.requestedTracks||[],ct=ot.tracks||[],Vt=pt.includes(ae),sn=ct.includes(ae);return Vt||sn?{...ot,requestedTracks:pt.filter(St=>St!==ae),tracks:ct.filter(St=>St!==ae)}:{...ot,requestedTracks:[...pt,ae]}}),Ve(!0)},tt=ae=>{O(Te=>{const Qe=Te.pronouns||[],ot=Qe.includes(ae);return{...Te,pronouns:ot?Qe.filter(pt=>pt!==ae):[...Qe,ae]}}),Ve(!0)},ge=ae=>{const Te=K.find(Qe=>Qe.id===ae);Te&&(z(Te),T(!0))},$=[{id:"firstName",label:"First Name",getValue:()=>k.firstName?.trim()},{id:"lastName",label:"Last Name",getValue:()=>k.lastName?.trim()},{id:"stateProvince",label:"State/Province",getValue:()=>k.stateProvince?.trim()},{id:"country",label:"Country",getValue:()=>k.country?.trim()},{id:"linkedIn",label:"LinkedIn",getValue:()=>k.linkedIn?.trim()}],xe=()=>$.filter(ae=>!ae.getValue()),ne=()=>xe().length===0,me=ae=>{O(Te=>({...Te,profileImageUrl:ae}))},de=()=>{O(ae=>({...ae,profileImageUrl:void 0})),p({title:"Image removed",description:"Profile image will be removed when you save your profile."})},Ie=async()=>{S(!0);const ae={...k};if(ae.requestedEmail){const{_rawInput:ct,...Vt}=ae.requestedEmail,sn=Vt.names?.length>0,cn=!!Vt.status,St=!!Vt.approvedHandle,le=Vt.useGuildEmail===!0;sn||cn||St||le?sn&&!cn?ae.requestedEmail={...Vt,status:"requested"}:ae.requestedEmail=Vt:ae.requestedEmail=void 0}if(!a){k.email!==I&&(console.log("Using saved email value (unvalidated change discarded)"),ae.email=I);const ct=k.secondaryEmails||[],Vt=Y.secondaryEmails||[],sn=ct.filter(cn=>U.includes(cn)||Vt.includes(cn));JSON.stringify(sn.sort())!==JSON.stringify(ct.sort())&&console.log("Filtering secondary emails (unvalidated additions discarded, removals allowed)"),ae.secondaryEmails=sn}const Te=p({title:"Saving...",description:"Initializing...",duration:1/0}),Qe=[];let ot=[],pt=[];try{const ct=await fetch("/api/updateMemberProfileStreaming",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:t,memberData:ae,sessionId:n})});if(!ct.ok)throw new Error("Failed to update profile");const Vt=ct.body?.getReader(),sn=new TextDecoder;if(!Vt)throw new Error("No response body");let cn="";for(;;){const{done:St,value:le}=await Vt.read();if(St)break;cn+=sn.decode(le,{stream:!0});const Ne=cn.split(`
388`);cn=Ne.pop()||"";for(const Oe of Ne)if(Oe.startsWith("data: "))try{const at=JSON.parse(Oe.slice(6));if(at.type==="progress")Qe.push(at.message),Te.update({id:Te.id,title:"Saving...",description:r.jsx("div",{className:"space-y-1",children:Qe.map((xt,Qt)=>r.jsxs("div",{className:"text-sm",children:["✓ ",xt]},Qt))}),duration:1/0});else if(at.type==="preview"){const{todoList:xt}=at;ot=xt||[],pt=new Array(ot.length).fill(!1),ot.length>0&&Te.update({id:Te.id,title:"Updating Google Groups...",description:r.jsx("div",{className:"space-y-1",children:ot.map((Qt,Gt)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:"text-muted-foreground",children:"☐"}),r.jsxs("span",{children:[Qt.action==="add"?"Add":"Remove"," ",Qt.email," ",Qt.action==="add"?"to":"from"," ",Qt.group,Qt.reason?` (${Qt.reason})`:""]})]},Gt))}),duration:1/0})}else if(at.type==="item-complete"){const{index:xt,success:Qt}=at;pt&&xt<pt.length&&(pt[xt]=!0,Te.update({id:Te.id,title:"Updating Google Groups...",description:r.jsx("div",{className:"space-y-1",children:ot.map((Gt,Xt)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:pt[Xt]?"text-green-600":"text-muted-foreground",children:pt[Xt]?"✓":"☐"}),r.jsxs("span",{className:pt[Xt]?"text-muted-foreground":"",children:[Gt.action==="add"?"Add":"Remove"," ",Gt.email," ",Gt.action==="add"?"to":"from"," ",Gt.group,Gt.reason?` (${Gt.reason})`:""]})]},Xt))}),duration:1/0}))}else if(at.type==="complete"){const xt=at.memberData||ae;O(xt),j(xt.email),q(xt.secondaryEmails||[]);const Qt=ae.requestedEmail?.useGuildEmail||!1,Gt=Qt!==Me;let Xt=null;if(Gt&&k.guildEmail){const rn=Qt?"/api/migrateToGuildEmail":"/api/revertGuildEmailMigration";try{const or=await fetch(rn,{method:"POST",headers:{"Content-Type":"application/json","x-session-id":n},body:JSON.stringify({memberKey:t})}),Nr=await or.json();or.ok&&Nr.success?(We(Qt),Xt=Nr.message):(console.error("Migration failed:",Nr.message),Xt=`Migration issue: ${Nr.message}`)}catch(or){console.error("Migration error:",or)}}Qe.push("Profile saved successfully!"),Xt&&Qe.push(Xt),wt===!1&&!a&&Tt(!0);const Zt=Qe.length+ot.length,_n=Math.max(3e3,Zt*2e3);Te.update({id:Te.id,title:"Success",description:r.jsxs("div",{className:"space-y-1",children:[Qe.map((rn,or)=>r.jsxs("div",{className:"text-sm",children:["✓ ",rn]},`msg-${or}`)),ot.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-sm font-medium mt
388-2",children:"Google Groups:"}),ot.map((rn,or)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:"text-green-600",children:"✓"}),r.jsxs("span",{className:"text-muted-foreground",children:[rn.action==="add"?"Add":"Remove"," ",rn.email," ",rn.action==="add"?"to":"from"," ",rn.group,rn.reason?` (${rn.reason})`:""]})]},`todo-${or}`))]}),r.jsx("button",{onClick:()=>Te.dismiss(),className:"text-sm font-medium text-green-600 mt-2 pt-2 border-t w-full text-left hover:underline cursor-pointer",children:"Done"})]}),duration:_n}),Ve(!1),ee(!1),lt.current=!1}else if(at.type==="error")throw new Error(at.message)}catch(at){console.error("Error parsing SSE data:",at)}}}catch(ct){console.error("Error saving member data:",ct),Te.update({id:Te.id,variant:"destructive",title:"Error",description:"Failed to save your profile. Please try again.",duration:5e3})}finally{S(!1)}},Ke=ae=>{Rt(Te=>Te.includes(ae)?Te.filter(ot=>ot!==ae):[...Te,ae])},ut=async()=>{if(bt.length===0&&!zt.trim()){p({variant:"destructive",title:"Feedback Required",description:"Please select at least one reason or provide feedback before resigning."});return}re(!0);try{if((await fetch("/api/resignMembership",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":n},body:JSON.stringify({memberKey:t,reasons:bt,feedback:zt,firstName:k.firstName,lastName:k.lastName,email:k.email})}
388)).ok)p({title:"Membership Resigned",description:"Thank you for your time with the XR Guild. You will be redirected shortly."}),setTimeout(()=>{window.location.href="/"},3e3);else throw new Error("Failed to process resignation")}catch(ae){console.error("Error processing resignation:",ae),p({variant:"destructive",title:"Error",description:"Failed to process resignation. Please try again or contact support."})}finally{re(!1)}};return b?r.jsx(Ft,{className:"p-8 border-2",children:r.jsx("div",{className:"flex items-center justify-center",children:r.jsx(on,{className:"w-8 h-8 text-primary animate-spin"})})}):r.jsxs(r.Fragment,{children:[r.jsxs(Ft,{className:"p-2 sm:p-4 md:p-8 border-2",children:[r.jsx("div",{className:"flex items-center justify-between mb-4 md:mb-6",children:r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx(Bs,{className:"w-6 h-6 md:w-8 md:h-8 text-primary"}),r.jsx("h2",{className:"text-xl md:text-2xl font-bold",children:"Your Profile"})]})}),r.jsxs("form",{className:"space-y-4 md:space-y-6",onSubmit:ae=>{ae.preventDefault(),ne()&&Ie()},name:"profile-form",autoComplete:"on",children:[r.jsxs("div",{className:"relative flex flex-col items-center gap-4 md:grid md:grid-cols-2 md:grid-rows-[auto_auto_auto_auto_1fr] md:gap-x-8 md:gap-y-4 md:justify-items-center md:items-start",children:[r.jsx("p",{className:`font-bold md:hidden ${be(k)?"":"line-through text-muted-foreground"}`,children:"Compact Preview"}),r.jsx("p",{className:`font-bold hidden md:block ${be(k)?"":"line-through text-muted-foreground"}`,children:"Compact Preview"}),r.jsx("p",{className:`font-bold hidden md:block ${be(k)?"":"line-through text-muted-foreground"}`,children:"Expanded Preview"}),r.jsx("span",{className:`md:hidden font-bold ${be(k)?"text-green-600":"text-destructive"}`,children:be(k)?"Profile is Viewable":"Profile is Hidden"}),r.jsx("span",{className:`hidden md:block absolute left-1/2 -translate-x-1/2 font-bold ${be(k)?"text-green-600":"text-destructive"}`,children:be(k)?"Profile is Viewable":"Profile is Hidden"}),r.jsxs("div",{className:"relative w-72",children:[r.jsx("div",{className:be(k)?"":"opacity-50",children:r.jsx(Fo,{name:k.public?.name?Mt(k):"Member",title:k.public?.job?k.jobTitle:void 0,company:k.public?.job?k.company:void 0,city:k.public?.region?k.city:void 0,stateProvince:k.public?.region?k.stateProvince:void 0,country:k.public?.region?k.country:void 0,variant:"compact",memberKey:k.memberKey,bio:k.public?.bio?k.bio:void 0,profileImageUrl:k.public?.image?k.profileImageUrl:void 0,isDonor:k.donationStatus?.isDonor,isVolunteer:!!k.tracks?.length,showDonorBadge:k.public?.donation&&k.donationStatus?.isDonor||F&&!k.donationStatus?.isDonor,showVolunteerBadge:k.public?.tracks&&!!k.tracks?.length||A&&!k.tracks?.length})}),r.jsxs("div",{className:"hidden md:flex absolute top-1/2 -right-14 -translate-y-1/2 items-center pointer-events-none",children:[r.jsx("div",{className:"w-6 h-1 bg-primary rounded-l-full"}),r.jsx("div",{className:"w-0 h-0 border-t-[6px] border-t-transparent border-b-[6px] border-b-transparent border-l-[10px] border-l-primary"})]})]}),r.jsx("p",{className:`font-bold md:hidden ${be(k)?"":"line-through text-muted-foreground"}`,children:"Expanded Preview"}),r.jsx("div",{className:"md:row-span-4 relative w-72",children:r.jsx("div",{className:be(k)?"":"opacity-50",children:r.jsx(Fo,{name:k.public?.name?Mt(k):"Member",title:k.public?.job?k.jobTitle:void 0,company:k.public?.job?k.company:void 0,city:k.public?.region?k.city:void 0,stateProvince:k.public?.region?k.stateProvince:void 0,country:k.public?.region?k.country:void 0,variant:"expanded",size:"small",memberKey:k.memberKey,bio:k.public?.bio?k.bio:void 0,profileImageUrl:k.public?.image?k.profileImageUrl:void 0,isDonor:k.donationStatus?.isDonor,isVolunteer:!!k.tracks?.length,showDonorBadge:k.public?.donation&&k.donationStatus?.isDonor||F&&!k.donationStatus?.isDonor,showVolunteerBadge:k.public?.tracks&&!!k.tracks?.length||A&&!k.tracks?.length})})}),r.jsx("div",{className:"my-4",children:r.jsx(UA,{currentImageUrl:k.profileImageUrl,onUploaded:me,onRemoved:de,endpoint:"/api/uploadProfileImage",extraFields:{memberKey:t},pulseGlow:!!k.profileImageUrl&&!k.public?.image,alt:"Profile"})}),r.jsxs("div",{className:"w-72",children:[r.jsx(Ht,{className:"font-medium mb-6 block text-center",children:"Profile Visibility"}),r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:"absolute -top-3 left-0 right-0 flex gap-1 justify-center z-10",children:[r.jsx(Fe,{type:"button",variant:Z(k)?"toggle-on":"toggle-off",size:"sm",onClick:()=>{O(ae=>({...ae,public:{name:!0,image:!0,job:!0,bio:!0,region:!0,donation:!0,tracks:!0}})),Ve(!0)},className:"text-xs h-6 px-2 rounded-none",children:"All Public"}),r.jsx(Fe,{type:"button",variant:it(k)?"toggle-on":"toggle-off",size:"sm",onClick:()=>{O(ae=>({...ae,public:{name:!1,image:!1,job:!1,bio:!1,region:!1,donation:!1,tracks:!1}})),Ve(!0)},className:"text-xs h-6 px-2 rounded-none",children:"All Private"})]}),r.jsx("div",{className:"border border-primary/40 rounded-md pt-6 pb-3 px-4",children:r.jsx("div",{className:"flex flex-wrap gap-1 justify-center",children:[{key:"name",label:"Name"},{key:"image",label:"Photo"},{key:"job",label:"Job"},{key:"bio",label:"Bio"},{key:"region",label:"Region"},{key:"donation",label:"Donor"},{key:"tracks",label:"Volunteer"}].map(({key:ae,label:Te})=>{const Qe=ae==="image"&&k.profileImageUrl&&!k.public?.image;return r.jsx(Fe,{type:"button",variant:k.public?.[ae]?"toggle-on":"toggle-off",size:"sm",onClick:()=>{O(ot=>{const pt=ot.public||{};return{...ot,public:{...pt,[ae]:!pt[ae]}}}),Ve(!0)},onMouseEnter:()=>{ae==="donation"&&w(!0),ae==="tracks"&&N(!0)},onMouseLeave:()=>{ae==="donation"&&w(!1),ae==="tracks"&&N(!1)},className:`text-xs h-6 px-2 ${Qe?"animate-pulse-glow":""}`,children:Te},ae)})})})]})]}),r.jsx("div",{})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-3 md:mb-4 text-primary",children:"Personal Information"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 md:gap-4 md:grid-cols-[auto_1fr_1fr_1fr_auto]",children:[r.jsxs("div",{className:"w-20",children:[r.jsx(Ht,{htmlFor:"namePrefix",children:"Prefix"}),r.jsx(un,{id:"namePrefix",value:k.namePrefix||"",onChange:ae=>ft("namePrefix",ae.target.value),placeholder:"Dr."})]}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"firstName",children:["First Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx(un,{id:"firstName",name:"firstName",autoComplete:"given-name",value:k.firstName||"",onChange:ae=>ft("firstName",ae.target.value),placeholder:"Your first name",required:!0,className:Xe&&!k.firstName?.trim()?"border-red-500 focus:ring-red-500":""})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"middleName",children:"Middle Name"}),r.jsx(un,{id:"middleName",value:k.middleName||"",onChange:ae=>ft("middleName",ae.target.value),placeholder:"Middle name"})]}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"lastName",children:["Last Name ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx(un,{id:"lastName",name:"lastName",autoComplete:"family-name",value:k.lastName||"",onChange:ae=>ft("lastName",ae.target.value),placeholder:"Your last name",required:!0,className:Xe&&!k.lastName?.trim()?"border-red-500 focus:ring-red-500":""})]}),r.jsxs("div",{className:"w-20",children:[r.jsx(Ht,{htmlFor:"nameSuffix",children:"Suffix"}),r.jsx(un,{id:"nameSuffix",value:k.nameSuffix||"",onChange:ae=>ft("nameSuffix",ae.target.value),placeholder:"PhD"})]})]}),r.jsxs("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-4",children:[r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"preferredName",children:["Preferred Name ",r.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(overrides full name)"})]}),r.jsx(un,{id:"preferredName",value:k.preferredName||"",onChange:ae=>ft("preferredName",ae.target.value),placeholder:"Leave blank to use First Middle Last"})]}),r.jsxs("div",{children:[r.jsxs(Ht,{children:["Display Name ",r.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(how you will appear to others
388)"})]}),r.jsx(un,{value:Mt(k),readOnly:!0,className:"bg-muted"})]})]}),r.jsxs("div",{className:"mt-4",children:[r.jsx(Ht,{htmlFor:"bio",children:"Bio"}),r.jsx(zi,{id:"bio",value:k.bio||"",onChange:ae=>ft("bio",ae.target.value),placeholder:"Tell us about yourself, your background, and what you're passionate about...",rows:4})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4 text-primary",children:"Professional Information"}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"jobTitle",children:"Role/Title"}),r.jsx(un,{id:"jobTitle",value:k.jobTitle||"",onChange:ae=>ft("jobTitle",ae.target.value),placeholder:"Your role or position"})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Ht,{htmlFor:"company",children:"Current Company"}),r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",title:"Let others know you're open to new opportunities",children:[r.jsx(ar,{checked:k.openToWork??!1,onCheckedChange:ae=>O(Te=>({...Te,openToWork:ae}))}),r.jsx("span",{className:"text-sm",children:"Open to Work"})]})]}),r.jsx(un,{id:"company",value:k.company||"",onChange:ae=>ft("company",ae.target.value),placeholder:"Your company or organization"})]}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"linkedIn",children:["LinkedIn Profile",r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(un,{id:"linkedIn",type:"text",value:k.linkedIn||"",onChange:ae=>ft("linkedIn",ae.target.value),placeholder:"https://linkedin.com/in/yourprofile",className:`flex-1 ${Xe&&!k.linkedIn?.trim()?"border-red-500 focus:ring-red-500":""}`}),r.jsx(Fe,{type:"button",variant:"outline",size:"sm",className:"h-10 px-3",onClick:()=>ft("linkedIn","NA"),"data-testid":"linkedin-na-button",children:"NA"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:`Click "NA" if you don't have a LinkedIn profile`})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"website",children:"Personal Website"}),r.jsx(un,{id:"website",type:"url",value:k.website||"",onChange:ae=>ft("website",ae.target.value),placeholder:"https://yourwebsite.com"})]})]})]}),r.jsxs("div",{id:"guild-email-section",children:[r.jsx("h3",{className:"text-lg font-semibold mb-4 text-primary",children:"Contact Information"}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{children:r.jsx(vU,{memberData:k,sessionId:n,checkNameAvailability:Ge,getRequestedNames:et,handleInputChange:ft,setMemberData:O,setHasManualSaveNeeded:Ve,onMigrationStatusChange:pe,autoActivateGuildEmail:i||Se,onAutoActivateComplete:()=>{s?.(),Be(!1)}})}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"email",children:["External Email ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsxs("div",{className:"flex gap-2 items-start",children:[r.jsx(un,{id:"email",type:"email",value:k.email||"",onChange:ae=>ft("email",ae.target.value),placeholder:"[email protected]",required:!0,className:k.email!==I&&k.email&&(a||Y.email===k.email)?"border-green-500":""}),!a&&k.email&&k.email!==I&&r.jsx(kC,{email:k.email,fieldName:"email",sessionId:n,isValidated:Y.email===k.email,onValidated:ae=>{W(Te=>({...Te,email:ae})),_e("email",ae)}})]}),k.email&&Ae[k.email]?.length>0&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Contact address for ",Ae[k.email].join(", ")]})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"secondaryEmails",children:"Backup Emails"}),r.jsxs("div",{className:"space-y-2",children:[(k.secondaryEmails||[]).map((ae,Te)=>{const Qe=U.includes(ae),ot=a||(Y.secondaryEmails||[]).includes(ae),pt=ae?Ae[ae]:[];return r.jsxs("div",{children:[r.jsxs("div",{className:"flex gap-2 items-start",children:[r.jsx(un,{type:"email",value:ae,onChange:ct=>{const Vt=[...k.secondaryEmails||[]];Vt[Te]=ct.target.value,O(sn=>({...sn,secondaryEmails:Vt})),Ve(!0)},placeholder:"[email protected]",className:!Qe&&ae&&ot?"border-green-500":""}),!a&&!Qe&&ae&&r.jsx(kC,{email:ae,fieldName:`secondaryEmails[${Te}]`,sessionId:n,isValidated:ot,onValidated:ct=>{W(Vt=>({...Vt,secondaryEmails:[...Vt.secondaryEmails||[],ct]})),_e(`secondaryEmails[${Te}]`,ct)}}),r.jsx(Fe,{type:"button",variant:"outline",size:"sm",onClick:()=>{const ct=(k.secondaryEmails||[]).filter((Vt,sn)=>sn!==Te);O(Vt=>({...Vt,secondaryEmails:ct})),Ve(!0)},className:"h-10 px-3",children:r.jsx(gr,{className:"w-4 h-4"})})]}),pt&&pt.length>0&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1 ml-1",children:["Contact address for ",pt.join(", ")
388]})]},Te)}),r.jsx(Fe,{type:"button",variant:"outline",size:"sm",onClick:()=>{const ae=[...k.secondaryEmails||[],""];O(Te=>({...Te,secondaryEmails:ae})),Ve(!0)},className:"gap-2",children:r.jsx("span",{children:"+ Add Backup Email"})})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Fallback for login and contact if primary bounces — not added to mailing groups by default"})]}),r.jsx("div",{className:"p-4 bg-muted/50 rounded-lg space-y-3",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"minimalEmailsOnly",checked:k.minimalEmailsOnly||!1,onCheckedChange:ae=>{O(Te=>({...Te,minimalEmailsOnly:ae})),Ve(!0)}}),r.jsxs(Ht,{htmlFor:"minimalEmailsOnly",className:"cursor-pointer font-normal",children:["Minimal Emails Only ",r.jsx("i",{children:"(omits newsletter, event notices, but keeps volunteer track emails you sign up for)"})]})]})}),r.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[r.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[r.jsx("strong",{children:"Contact Policy:"})," We'll contact you at ",r.jsx("b",{children:"one"})," of your verified addresses, in this order of preference:"]}),r.jsxs("ol",{className:"text-xs text-muted-foreground list-decimal list-inside space-y-1 ml-4",children:[k.requestedEmail?.useGuildEmail?r.jsxs(r.Fragment,{children:[r.jsx("li",{className:Ee>0?"animate-flash rounded":"",children:"Your personal Guild email"},`guild-${Ee}`),r.jsx("li",{className:Ee>0?"animate-flash rounded":"",children:"Your External Email (if no bounces)"},`external-${Ee}`)]}):r.jsxs(r.Fragment,{children:[r.jsx("li",{className:Ee>0?"animate-flash rounded":"",children:"Your External Email (if no bounces)"},`external-${Ee}`),r.jsx("li",{className:Ee>0?"animate-flash rounded":"",children:"Your personal Guild email (if any)"},`guild-${Ee}`)]}),r.jsx("li",{children:"Your Backup Emails (if any, in the given order)"}),r.jsx("li",{children:"Your Street Address is only ever used for sending you swag (e.g., volunteer tracks sometimes provide swag)"})]})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"discordId",children:"Discord ID"}),r.jsx(un,{id:"discordId",type:"text",value:k.discordId||"",onChange:ae=>ft("discordId",ae.target.value),placeholder:"username#1234"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"We have a discord channel for ad hoc discussions. We don't currently integrate directly, but may in the future"})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"streetAddress",children:"Street Address"}),r.jsx(un,{id:"streetAddress",name:"streetAddress",autoComplete:"street-address",value:k.streetAddress||"",onChange:ae=>ft("streetAddress",ae.target.value),placeholder:"Your street address"})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 md:gap-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"city",children:"City"}),r.jsx(un,{id:"city",name:"city",autoComplete:"address-level2",value:k.city||"",onChange:ae=>ft("city",ae.target.value),placeholder:"e.g., San Francisco"})]}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"stateProvince",children:["State/Province ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx(un,{id:"stateProvince",name:"stateProvince",autoComplete:"address-level1",value:k.stateProvince||"",onChange:ae=>ft("stateProvince",ae.target.value),placeholder:"e.g., CA, Ontario",required:!0,className:Xe&&!k.stateProvince?.trim()?"border-red-500 focus:ring-red-500":""})]}),r.jsxs("div",{children:[r.jsxs(Ht,{htmlFor:"country",children:["Country ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsxs("select",{id:"country",name:"country",autoComplete:"country-name",value:k.country||"",onChange:ae=>ft("country",ae.target.value),className:`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
388ing-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${Xe&&!k.country?.trim()?"border-red-500 focus:ring-red-500":""}`,required:!0,children:[r.jsx("option",{value:"",disabled:!0,children:"Select your country"}),xU.filter(ae=>ae!=="---").map(ae=>r.jsx("option",{value:ae,children:ae},ae))]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"postalCode",children:"Postal/Zip Code"}),r.jsx(un,{id:"postalCode",name:"postalCode",autoComplete:"postal-code",value:k.postalCode||"",onChange:ae=>ft("postalCode",ae.target.value),placeholder:"e.g., 94102, SW1A 1AA"})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"phone",children:"Phone Number"}),r.jsx(un,{id:"phone",name:"phone",type:"tel",autoComplete:"tel",value:k.phone||"",onChange:ae=>ft("phone",ae.target.value),placeholder:"e.g., +1 (555) 123-4567"})]})]})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4 text-primary",children:"More About You"}),r.jsxs("div",{className:"mt-4",children:[r.jsx(Ht,{children:"Preferred Pronouns (select any that apply)"}),r.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Select individual pronouns - they'll be displayed with slashes (e.g., he/him/they)"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:["he","him","his","she","her","hers","they","them","theirs","xe","xem","xyr","ze","zir","hir","fae","faer","ey","em","eir"].map(ae=>r.jsx(Fe,{type:"button",variant:k.pronouns?.includes(ae)?"toggle-on":"toggle-off",size:"sm",onClick:()=>tt(ae),className:"text-xs h-7 px-2",children:ae},ae))}),k.pronouns&&k.pronouns.length>0&&r.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Display: ",r.jsx("strong",{children:k.pronouns.join("/")})]})]}),r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"skills",children:"Skills & Expertise"}),r.jsx(zi,{id:"skills",value:k.skills||"",onChange:ae=>ft("skills",ae.target.value),placeholder:"e.g., Unity, Unreal Engine, 3D Modeling, VR Development, etc.",rows:2})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"interests",children:"XR Interests"}),r.jsx(zi,{id:"interests",value:k.interests||"",onChange:ae=>ft("interests",ae.target.value),placeholder:"What areas of XR are you most interested in? (VR, AR, MR, gaming, education, etc.)",rows:2})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"aspirations",children:"Aspirations for the XR Guild"}),r.jsx(zi,{id:"aspirations",value:k.aspirations||"",onChange:ae=>ft("aspirations",ae.target.value),placeholder:"What would you like to see the XR Guild accomplish? What role would you like to play?",rows:2})]})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4 text-primary",children:"How Would You Like to Participate?"}),r.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["You can most easily support the XR Guild by ",r.jsx("b",{children:"volunteering"})," or ",r.jsx("b",{children:"donating"}),":"]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Typical participation: 5 hours per month volunteering -or- $5/month volunatry dues"}),r.jsx("div",{className:"mb-4",children:r.jsx(tU,{donationStatus:k.donationStatus,memberKey:t,sessionId:n,isFormValid:ne(),onDonationStatusUpdate:ae=>{O(Te=>({...Te,donationStatus:ae}))}})}),r.jsxs("div",{className:"text-sm text-muted-foreground mb-4 flex items-center gap-2",children:[r.jsxs("span",{children:["Or, select desired volunteer track(s). Click the ",r.jsx(bg,{className:"inline w-3.5 h-3.5 -mt-0.5"})," for more details. "]}),r.jsx(Rv,{hours:3,size:"sm"}),r.jsx("span",{children:"shows estimated hours/month."})]}),(()=>{const Te=K.filter(Qe=>k.requestedTracks?.includes(Qe.id)||k.tracks?.includes(Qe.id)||k.leading?.includes(Qe.id)).reduce((Qe,ot)=>Qe+(Number(ot.minHours)||1),0);return r.jsx("div",{className:"mb-4 p-3 border rounded-lg bg-accent/20",children:r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[r.jsx("span",{className:"text-sm font-medium",children:"Estimated Time Commitment:"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Rv,{hours:Te,size:"md"}),r.jsxs("span",{className:"text-sm font-semibold whitespace-nowrap",children:[Te," hrs/month"]})]})]})})})(),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:K.map(ae=>{const Te=k.requestedTracks?.includes(ae.id)||!1,Qe=k.tracks?.includes(ae.id)||!1,ot=k.leading?.includes(ae.id)||!1,pt=Te||Qe||ot;return r.jsxs("div",{className:`relative border rounded-lg hover:bg-accent/50 transition-all pt-3 pb-3 px-3 cursor-pointer select-none ${pt?"shadow-[0_0_5px_3px_rgba(220,120,255,0.9)] border-primary":""}`,onClick:ct=>{ct.target.closest("button")||Et(ae.id)},"data-testid":`track-card-${ae.id}`,children:[Qe||ot?r.jsxs("div",{className:"absolute top-0 right-1.5 -translate-y-1/2 flex gap-1",children:[ot&&r.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:"Lead"}),Qe&&r.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Member"})]}):r.jsx("div",{className:"absolute top-0 right-1.5 -translate-y-1/2",children:r.jsx(Rv,{hours:ae.minHours||1,size:"sm"})}),r.jsxs("div",{className:"flex items-start justify-between mb-2",children:[r.jsx("div",{className:`w-5 h-5 flex-shrink-0 rounded border-2 flex items-center justify-center transition-colors ${pt?"bg-primary border-primary text-primary-foreground":"border-muted-foreground
388/30"}`,children:pt&&r.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsx("span",{className:"flex-1 text-center font-medium px-2",children:ae.name}),r.jsx(Fe,{type:"button",variant:"ghost",size:"icon",className:"h-5 w-5 flex-shrink-0",onClick:ct=>{ct.stopPropagation(),ge(ae.id)},children:r.jsx(bg,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsx("p",{className:"text-sm text-muted-foreground text-center",children:ae.pitch})]},ae.id)})})]}),r.jsx(Q7,{track:P,open:D,onOpenChange:T,memberKey:t,sessionId:n}),r.jsx(Bm,{open:we.open,onOpenChange:ae=>st(Te=>({...Te,open:ae})),children:r.jsxs(Gd,{children:[r.jsxs(Hd,{children:[r.jsx(Vd,{children:"Resign as Track Lead?"}),r.jsx($d,{asChild:!0,children:r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{children:["You are currently a lead for ",r.jsx("strong",{children:we.trackName}),"."]}),r.jsx("p",{children:"To step down as a track lead, please contact the coordinators:"}),r.jsxs("p",{className:"font-medium",children:[r.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})," or ",r.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})})]}),r.jsx(Wd,{children:r.jsx(mu,{children:"OK"})})]})}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"feedback",children:"Feedback (website, officers, anything)"}),r.jsx(zi,{id:"feedback",value:k.feedback||"",onChange:ae=>ft("feedback",ae.target.value),placeholder:"Any suggestions, comments, or feedback you'd like to share with us?",rows:2})]}),r.jsxs("div",{className:"flex flex-col items-end gap-2 pt-4",children:[r.jsx(Fe,{ref:qe,type:"button",onClick:()=>{X(!0),ne()&&Ie()},disabled:C,size:"lg",className:"gap-2","data-testid":"save-profile-button",children:C?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Py,{className:"w-4 h-4"}),"Save Profile"]})}),vt&&r.jsxs(Fe,{type:"button",variant:"outline",onClick:()=>{Dt(!0),Tt(!1),setTimeout(()=>{jt.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},className:"gap-2 border-primary/50 text-primary hover:bg-primary/10",children:[r.jsx(fc,{className:"w-4 h-4"}),"Add Passkey for easier logins"]}),Xe&&xe().length>0&&r.jsxs("div",{className:"text-sm text-red-500 text-right",children:[r.jsx("p",{className:"mb-1",children:"Missing required fields:"}),r.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 justify-end",children:xe().map(ae=>r.jsx("a",{href:`#${ae.id}`,onClick:Te=>{Te.preventDefault();const Qe=document.getElementById(ae.id);Qe&&(Qe.scrollIntoView({behavior:"smooth",block:"center"}),Qe.focus())},className:"underline hover:text-red-700",children:ae.label},ae.id))})]}),r.jsx("div",{className:"mt-6 pt-6 border-t border-border",children:r.jsxs(Fe,{type:"button",variant:"outline",onClick:()=>{he||ze?Ot(!0):(sessionStorage.removeItem("memberSession"),window.location.href="/member")},className:"gap-2 text-muted-foreground hover:text-foreground","data-testid":"end-session-button",children:[r.jsx(rh,{className:"w-4 h-4"}),"End Session (log out)"]})})]})]}),r.jsx(Bm,{open:Lt,onOpenChange:Ot,children:r.jsxs(Gd,{children:[r.jsxs(Hd,{children:[r.jsx(Vd,{children:"Unsaved Changes"}),r.jsx($d,{children:"You have unsaved changes that will be lost if you end your session now. Are you sure you want to logout?"})]}),r.jsxs(Wd,{children:[r.jsx(mu,{onClick:()=>Ot(!1),className:"bg-primary",children:"Keep Editing"}),r.jsx(mu,{onClick:()=>{sessionStorage.removeItem("memberSession"),window.location.href="/member"},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Logout Anyway"})]})]})}),(()=>{const ae=!k.firstName?.trim();if(!((ae||he||ze||vt)&&!It))return null;let Qe;return ae?Qe=r.jsx("span",{className:"text-amber-600 dark:text-amber-400 font-medium",children:"👋 Please complete your profile to finish registration"}):he&&!ze?Qe=r.jsx("span",{className:"text-muted-foreground",children:"Edits made, auto-save pending..."}):ze?Qe=r.jsx("span",{className:"text-muted-foreground",children:"Current changes need you to click the Save button when done →"}):vt&&(Qe=r.jsx("span",{className:"text-green-600 dark:text-green-400 font-medium",children:"✓ Profile saved!"})),r.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 bg-background/95 backdrop-blur border-t border-border shadow-lg",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 flex items-center justify-between gap-4",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:Qe}),(ae||he||ze)&&r.jsx(Fe,{type:"button",onClick:()=>
388{if(X(!0),ne())Ie();else{const ot=xe();if(ot.length>0){const pt=document.getElementById(ot[0].id);pt&&(pt.scrollIntoView({behavior:"smooth",block:"center"}),pt.focus())}}},disabled:C,size:"lg",className:"gap-2",children:C?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Py,{className:"w-4 h-4"}),ae?"Save Profile":"Save Changes"]})}),vt&&r.jsxs(Fe,{type:"button",variant:"outline",onClick:()=>{Dt(!0),Tt(!1),setTimeout(()=>{jt.current?.scrollIntoView({behavior:"smooth",block:"center"})},100)},className:"gap-2 border-primary/50 text-primary hover:bg-primary/10",children:[r.jsx(fc,{className:"w-4 h-4"}),"Add Passkey for easier logins"]})]})})})(),r.jsx("div",{ref:jt,children:r.jsx(pU,{sessionId:n,machineId:c,defaultOpen:Wt,readOnly:a,onPasskeyCountChange:(ae,Te)=>{Nt(Te),Te&&Tt(!1)},onOpenChange:ae=>{ae||Dt(!1)}})}),r.jsx("div",{className:"mt-8 py-10",children:r.jsxs("div",{className:"p-4 bg-yellow-50 dark:bg-yellow-900/20 border-2 border-yellow-200 dark:border-yellow-800 rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("h3",{className:"text-lg font-semibold text-yellow-800 dark:text-yellow-200",children:"Easy Membership Resignation Process"}),He?r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>{Ct(!1),Rt([]),Ut("")},className:"h-8 w-8 p-0 ml-auto",children:r.jsx(gr,{className:"h-4 w-4"})}):r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>Ct(!0),"data-testid":"begin-resignation-button",children:"Begin →"})]}),He&&r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{className:"text-base mb-2 block",children:"Reasons (select all that apply):"}),r.jsx("div",{className:"space-y-2",children:["I don't have any time to help","I'm no longer working in XR","I found the Guild wasn't what I expected","Personal reasons"].map(ae=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:`reason-${ae}`,checked:bt.includes(ae),onCheckedChange:()=>Ke(ae)}),r.jsx(Ht,{htmlFor:`reason-${ae}`,className:"cursor-pointer font-normal",children:ae})]},ae))})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"resignationFeedback",children:"Any feedback?"}),r.jsx(zi,{id:"resignationFeedback",value:zt,onChange:ae=>Ut(ae.target.value),placeholder:"We'd appreciate any feedback you'd like to share...",rows:3,className:"mt-2"})]}),r.jsx("div",{className:"flex justify-end",children:r.jsx(Fe,{variant:"destructive",onClick:ut,disabled:Bt,className:"gap-2","data-testid":"finalize-resignation-button",children:Bt?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 animate-spin"}),"Processing..."]}):"Finalize Resignation"})})]})]})})]}),(rt==="saving"||rt==="error"||!ue)&&r.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50",children:r.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-full shadow-lg text-sm ${rt==="saving"?"bg-primary text-primary-foreground":rt==="error"?"bg-red-600 text-white":ue?"":"bg-muted text-muted-foreground"}`,children:[rt==="saving"&&r.jsxs(r.Fragment,{children:[r.jsx(Rr,{className:"w-4 h-4 animate-spin"}),"Saving..."]}),rt==="error"&&r.jsxs(r.Fragment,{children:[r.jsx(mF,{className:"w-4 h-4"}),"Save failed"]}),!ue&&rt==="idle"&&r.jsxs(r.Fragment,{children:[r.jsx(mF,{className:"w-4 h-4"}),"Offline"]})]})}),(!k.firstName?.trim()||he||ze)&&!It&&r.jsx("div",{className:"h-20","aria-hidden":"true"})]})}function ku({isConnected:t,showImmediately:e=!1}){const[n,a]=x.useState(e&&!t),[i,s]=x.useState(0),o=x.useRef(null),c=x.useRef(null);if(x.useEffect(()=>{let b=null;if(t)o.current=null,s(0),c.current&&(clearInterval(c.current),c.current=null),b=setTimeout(()=>{a(!1)},2e3);else{o.current||(o.current=Date.now());const v=()=>{a(!0),c.current=setInterval(()=>{o.current&&s(Math.floor((Date.now()-o.current)/1e3))},1e3)};e?v():b=setTimeout(v,2e3)}return()=>{b&&clearTimeout(b)}},[t,e]),x.useEffect(()=>()=>{c.current&&clearInterval(c.current)},[]),!n)return null;const d=b=>{const v=Math.floor(b/60),C=b%60;return`${v}:${C.toString().padStart(2,"0")}`},m=i>=30,f=i>=120,p=i>=60;return r.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black",children:[r.jsx(Z1,{className:"absolute inset-0",requireFocus:!1}),r.jsxs("div",{className:"relative text-center p-8 max-w-md text-white select-none pointer-events-none",children:[r.jsx("svg",{width:"736",height:"624",viewBox:"0 0 736 624",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-48 h-48 mx-auto mb-4",style:{mixBlendMode:"plus-lighter"},children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.225 0.815017C17.4105 0.815017 13.9105 3 9.41051 6.5C5.97354 9.1732 2.91051 14 1.91051 19C0.91051 24 0.910511 29.5 3.87402 33.5C6.83753 37.5 68.304 107.926 68.304 107.926C103.741 148.861 132.438 182.836 132.075 183.426C131.501 184.359 15.6264 325.647 11.9099 330.5C8.1934 335.353 1.90962 343 0.909656 347.5C-2.59043 360.5 4.12706 374.757 19.04 37
3887.207C26.9099 378.5 23.809 379.505 68.1 380L112.866 380.5L156.6 327.58C180.654 298.473 200.785 274.536 201.335 274.385C201.885 274.235 221.857 297.712 245.717 326.556L289.099 379L348.217 378.998C380.732 378.996 417.123 378.7 429.085 378.338L450.835 377.681V311.341V245L485.085 245.058C503.922 245.089 521.112 245.431 523.282 245.816L527.229 246.517L559.812 297.008C577.733 324.779 596.9 354.475 602.407 363L612.42 378.5L662.348 378.759C662.348 378.759 692.778 379.019 712.277 379.019C718.412 379.019 723.412 376.5 725.912 373.5C728.412 370.5 730.318 368.894 732.758 363C735.112 357.313 734.145 350.449 732.758 347.825C732.083 346.546 722.489 332.9 711.438 317.5C700.387 302.1 684.267 279.629 675.615 267.565L659.885 245.63L668.11 241.247C679.042 235.423 689.078 227.629 698.555 217.606C735.063 178.994 743.198 121.848 719.066 73.515C700.608 36.546 666.981 10.886 625.836 2.37302C615.839 0.305015 626.136 0.390016 434.335 0.791016L295.335 1.08102L253.335 50.596C230.235 77.83 210.66 100.714 209.835 101.452C208.538 102.61 206.03 100.004 191.335 82.227C181.985 70.916 163.247 48.291 149.696 31.95L125.056 2.23802L87.196 1.59502C66.372 1.24102 44.335 0.850016 38.225 0.726016C32.114 0.602016 26.264 0.642017 25.225 0.815017ZM606.263 108.405C610.331 110.105 614.469 115.041 615.939 119.949C618.255 127.679 614.478 143.905 606.843 147.761L602.367 150.022L481.85 149.35C361.611 148.68 362.91 150.086 356.686 150.738C349.41 151.5 343.41 156.5 341.41 161C339.41 165.5 339.549 170.5 339.549 170.5L340.193 220.973C340.819 266.184 340.787 255.393 338.991 253.473C337.975 252.388 324.178 236.93 308.329 219.122C282.04 189.582 279.624 186.568 280.763 184.743C281.984 182.789 328.218 129.296 342.262 113.589L349.335 105.679L476.216 106.381C577.936 106.943 603.725 107.345 606.263 108.405ZM46.598 413.027C26.606 416.416 10.1 430.581 3.59602 449.928C1.44002 456.343 1.37902 457.846 1.03602 513C0.63702 577.174 0.850016 580.03 6.98602 592.841C14.212 607.93 28.245 618.807 44.835 622.179C54.487 624.141 681.227 624.135 690.836 622.173C712.34 617.783 728.595 601.74 733.566 580C735.07 573.422 735.284 565.858 735.308 518.5C735.339 458.019 735.125 455.484 728.872 442.5C722.433 429.13 711.091 419.464 695.836 414.345C690.539 412.568 678.556 412.495 370.835 412.362C195.11 412.286 49.204 412.586 46.598 413.027ZM124.67 452.297C142.076 458.377 153.942 469.925 156.29 483.071C157.087 487.533 154.474 492.693 149.835 495.818C147.082 497.673 145.414 498.076 142.023 497.704C136.999 497.154 134.261 494.914 128.761 486.86C120.58 474.879 112.435 470.632 97.837 470.735C73.774 470.905 58.711 487.284 57.13 515C55.91 536.375 62.055 553.852 73.828 562.495C81.171 567.885 88.433 570 99.597 570C110.33 570 118.265 568.269 128.085 563.786L134.835 560.704V549.442V538.179L119.406 537.84C105.619 537.536 103.679 537.277 101.178 535.409C95.897 531.462 96.416 522.446 102.123 518.966C105.051 517.18 107.254 517.007 127.065 517.004C152.823 516.999 155.507 517.626 158.79 524.406C160.626 528.2 160.833 530.512 160.813 547.066C160.782 572.87 160.382 573.604 141.459 582.568C126.246 589.775 119.046 591.324 100.335 591.419C81.85 591.513 76.213 590.38 63.057 583.933C46.591 575.862 34.336 559.223 30.331 539.5C26.967 522.932 28.84 500.454 34.727 486.743C41.984 469.843 57.069 457.148 75.88 452.11C86.92 449.153 87.139 449.131 102.835 449.445C115.354 449.695 118.337 450.085 124.67 452.297ZM223.521 450.95C229.391 454.529 229.285 453.687 229.916 502C230.399 538.981 230.768 547.319 232.098 551.347C234.737 559.343 238.115 563.5 244.534 566.652C249.756 569.216 251.333 569.497 260.335 569.47C272.71 569.433 279.424 566.93 283.965 560.661C289.955 552.393 290.15 550.711 290.769 502C291.202 467.933 291.643 456.96 292.649 455.196C294.672 451.649 299.804 449.008 304.681 449.004C309.896 448.999 313.896 451.168 316.449 455.386C318.224 458.316 318.335 461.189 318.335 504C318.335 553.192 318.106 555.682 312.554 566.882C306.851 578.385 294.218 587.414 279.627 590.415C269.164 592.567 252.562 592.433 241.288 590.106C220.87 585.892 210.014 575.885 204.643 556.325C202.649 549.063 202.464 545.591 202.076 508.038C201.846 485.783 201.967 465.098 202.345 462.071C202.916 457.502 203.676 455.923 206.816 452.783C2
38810.16 449.44 211.166 449 215.467 449.004C218.522 449.006 221.522 449.731 223.521 450.95ZM390.795 450.636C392.318 451.535 394.412 453.673 395.449 455.386C397.232 458.33 397.35 461.756 397.615 518.281C397.794 556.459 397.529 579.423 396.881 581.829C395.358 587.486 390.945 591.187 385.047 591.754C378.344 592.398 374.231 590.15 371.718 584.468C369.854 580.254 369.787 577.625 370.055 518.789C370.321 460.558 370.429 457.361 372.228 454.707C373.27 453.171 375.295 451.276 376.728 450.497C380.269 448.572 387.422 448.643 390.795 450.636ZM474.521 450.95C480.478 454.583 480.292 452.777 480.835 512L481.335 566.5L512.836 567C535.506 567.36 544.952 567.853 546.535 568.758C550.023 570.753 551.836 574.115 551.836 578.588C551.836 583.815 549.006 587.581 544.041 588.96C538.903 590.387 468.599 590.333 463.335 588.899C458.057 587.46 455.308 584.774 453.9 579.679C453.071 576.68 452.828 558.988 453.04 517C453.318 461.888 453.443 458.321 455.208 455.407C456.238 453.706 458.263 451.58 459.708 450.684C463.34 448.429 470.601 448.56 474.521 450.95ZM667.255 453.382C686.354 458.804 700.014 473.76 706.071 495.882C709.129 507.052 709.098 534.056 706.014 545.342C699.805 568.062 685.413 583.017 664.836 588.133C660.808 589.134 651.438 589.5 629.836 589.5C596.993 589.5 595.672 589.263 592.103 582.733C590.47 579.746 590.336 575.019 590.336 520.5C590.336 453.717 589.991 456.698 598.152 452.891C602.069 451.064 604.219 450.963 631.836 451.321C655.588 451.628 662.489 452.029 667.255 453.382ZM618.294 474.25C618.03 474.938 617.932 496.193 618.075 521.485L618.336 567.47L635.836 567.232C655.609 566.963 660.179 565.966 666.515 560.542C671.588 556.201 676.539 546.896 678.367 538.27C680.515 528.133 680.27 509.018 677.873 499.643C673.723 483.418 665.314 476.251 647.858 474.062C635.835 472.554 618.903 472.662 618.294 474.25Z",fill:"white"})}),r.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-4 border-white border-t-transparent mx-auto mb-6"}),r.jsx("h2",{className:"text-3xl font-bold mb-3",children:"Please Stand By"}),f?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-white/80 mb-2",children:"Extended outage detected..."}),r.jsx("p",{className:"text-lg font-mono text-orange-400 mb-3",children:d(i)}),r.jsx("p",{className:"text-sm text-white/60 mb-4",children:"The server may be experiencing issues. Try refreshing or contact support if the problem persists."})]}):m?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-white/80 mb-2",children:"Taking longer than expected..."}),r.jsx("p",{className:"text-lg font-mono text-yellow-400 mb-3",children:d(i)}),r.jsx("p",{className:"text-sm text-white/60",children:"This page will resume automatically when the server is ready."})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-white/80 mb-2",children:"Connection to server lost..."}),r.jsx("p",{className:"text-sm text-white/60",children:"This page will resume automatically when the server is ready."})]}),p&&r.jsxs(Fe,{variant:"outline",className:"mt-4 border-white/30 text-white hover:bg-white/10 pointer-events-auto",onClick:()=>window.location.reload(),children:[r.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Refresh Page"]})]})]})}const bU=1e3,wU=3e4;function SU(){const[t,e]=x.useState(!1),n=x.useRef(null),a=x.useRef(0),i=x.useRef(null),s=()=>`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/public`,o=()=>{const d=s();console.log("[PublicWS] Connecting to:",d);try{const m=new WebSocket(d);n.current=m,m.onopen=()=>{console.log("[PublicWS] Connected"),e(!0),a.current=0},m.onclose=()=>{console.log("[PublicWS] Disconnected"),e(!1),n.current=null,c()},m.onerror=f=>{console.error("[PublicWS] Error:",f)}}catch(m){console.error("[PublicWS] Failed to create WebSocket:",m),c()}},c=()=>{i.current&&clearTimeout(i.current);const d=Math.min(bU*Math.pow(2,a.current),wU);console.log(`[PublicWS] Reconnecting in ${d}ms (attempt ${a.current+1})`),i.current=setTimeout(()=>{a.current++,o()},d)};return x.useEffect(()=>(o(),()=>{i.current&&clearTimeout(i.current),n.current&&n.current.close()}),[]),{isConnected:t}}function FU(){const{isConnected:t}=SU();return r.jsx(ku,{isConnected:t})}function CU(){const[t]=G1();_r();const[e,n]=x.useState(!0),[a,i]=x.useState(!1),[s,o]=x.useState(!1),[c,d]=x.useState(""),[m,f]=x.use
388State(""),[p,b]=x.useState(""),[v,C]=x.useState(""),[S,F]=x.useState(""),[w,A]=x.useState(!1),[N,P]=x.useState(null),[z,D]=x.useState(!1),[T,K]=x.useState(!1),[B,k]=x.useState(!1),[O,I]=x.useState(null),j=x.useRef(null),[U,q]=x.useState(null),[Y,W]=x.useState(!1),[H,J]=x.useState(!1),[ie,Q]=x.useState(!1),[ve,pe]=x.useState(!1),Me="xrguild-member-passkey",[We,Ae]=x.useState(!1),[Ce,He]=x.useState(!1),[Ct,bt]=x.useState(null),[Rt,zt]=x.useState(!1);x.useEffect(()=>{const fe=localStorage.getItem(Me);Ae(!!fe)},[]),x.useEffect(()=>{const Se=new URLSearchParams(window.location.search).get("activate");window.location.hash==="#guildEmail"&&(pe(!0),window.history.replaceState({},"",window.location.pathname+window.location.search)),Se?(console.log("[MEMBER-PORTAL] Activation code from email link:",Se.substring(0,8)+"..."),fetch("/api/guild-email/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:Se})}).then(Be=>Be.json()).then(Be=>{Be.success?Be.hasOpenSession?(console.log("[MEMBER-PORTAL] Existing session notified, can close this tab"),J(!0),n(!1)):Be.sessionId&&(console.log("[MEMBER-PORTAL] Got session from activation code"),sessionStorage.setItem("memberSession",Be.sessionId),k(Be.autoActivate||!1),pe(!0)):console.error("[MEMBER-PORTAL] Activation code exchange failed:",Be.message);const Ze=window.location.pathname+window.location.hash;window.history.replaceState({},"",Ze),Q(!0)}).catch(Be=>{console.error("[MEMBER-PORTAL] Error exchanging activation code:",Be);const Ze=window.location.pathname+window.location.hash;window.history.replaceState({},"",Ze),Q(!0)})):Q(!0)},[]);const[Ut,Bt]=x.useState(!1),[re,wt]=x.useState(1),[Nt,vt]=x.useState(""),[Tt,Wt]=x.useState(""),[Dt,jt]=x.useState(!1),[he,ee]=x.useState(""),[ze,Ve]=x.use
388State(""),[lt,qe]=x.useState("");x.useEffect(()=>{if(!ie)return;const fe=async()=>{const Se=Ze=>{Ze.origin===window.location.origin&&Ze.data?.type==="IMPERSONATION_SESSION"&&Ze.data?.sessionId&&(console.log("[MEMBER-PORTAL] Received impersonation session via postMessage"),sessionStorage.setItem("memberSession",Ze.data.sessionId),window.removeEventListener("message",Se),fe())};window.addEventListener("message",Se),window.opener&&(window.opener.postMessage({type:"MEMBER_PORTAL_READY"},window.location.origin),console.log("[MEMBER-PORTAL] Signaled ready to admin window"));let Be=sessionStorage.getItem("memberSession");if(console.log("[MEMBER-PORTAL] Session from sessionStorage:",Be?`${Be.substring(0,20)}...`:"none"),!Be){console.log("[MEMBER-PORTAL] No sessionStorage session, checking for cookie-based session...");try{const Ze=await fetch("/api/validateSession",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(Ze.ok){const ue=await Ze.json();ue.valid&&ue.sessionId&&(console.log("[MEMBER-PORTAL] Found valid cookie session, storing in sessionStorage"),Be=ue.sessionId,sessionStorage.setItem("memberSession",Be))}}catch(Ze){console.log("[MEMBER-PORTAL] Cookie session check failed:",Ze)}}if(!Be){console.log("[MEMBER-PORTAL] No session found, showing email verification"),Bt(!0),n(!1);return}try{console.log("[MEMBER-PORTAL] Calling /api/validateSession with session in header:",Be.substring(0,20)+"...");const Ze=await fetch("/api/validateSession",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":Be}});if(Ze.status>=500||Ze.status===404){console.log("[MEMBER-PORTAL] Server unavailable, showing StandBy"),o(!0),n(!1);return}const ue=await Ze.json();if(console.log("[MEMBER-PORTAL] validateSession response:",{status:Ze.status,ok:Ze.ok,valid:ue.valid,isImpersonation:ue.isImpersonation,bypassEmailVerification:ue.bypassEmailVerification,hasEmail:!!ue.email,hasMemberKey:!!ue.memberKey}),Ze.ok&&ue.valid){const je=new URLSearchParams(window.location.search).get("redirect");if(je&&je.startsWith("/")){console.log("[MEMBER-PORTAL] Already authenticated, redirecting to:",je),window.location.href=je;return}i(!0),d(ue.email||""),f(ue.memberKey),b(Be),D(ue.isImpersonation||!1),K(ue.bypassEmailVerification||!1),I(ue.machineId||null),ue.bypassEmailVerification?console.log("[MEMBER-PORTAL] ✅ Session has bypassEmailVerification flag - will skip email verification screen"):console.log("[MEMBER-PORTAL] ⚠️ Session does NOT have bypassEmailVerification flag");const _t=await fetch("/api/getMemberProfile",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":Be},body:JSON.stringify({memberKey:ue.memberKey})}),Kt=await _t.json();_t.ok&&(Kt.preferredName&&C(Kt.preferredName),Kt.firstName&&F(Kt.firstName),Kt.principlesAcceptance&&P(Kt.principlesAcceptance))}else console.log("[MEMBER-PORTAL] Session validation failed:",ue),sessionStorage.removeItem("memberSession"),Bt(!0)}catch(Ze){console.error("[MEMBER-PORTAL] Network error validating session:",Ze),o(!0)}finally{n(!1)}};fe()},[t,ie]),x.useEffect(()=>{if(!s)return;const Se=setInterval(async()=>{try{(await fetch("/api/health")).ok&&(o(!1),window.location.reload())}catch{}},1e3);return()=>clearInterval(Se)},[s]);const It=(fe,Se,Be=!0)=>{A(!0),P({date:fe,version:Se}),Be&&setTimeout(()=>{j.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)},gt=fe=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(fe).toLowerCase()),Ee=async()=>{if(!gt(Nt)){Ve("Please enter a valid email address");return}jt(!0),Ve(""),ee(""),qe("");try{const fe=await fetch("/api/sendCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Nt.toLowerCase(),source:"login"})}),Se=await fe.json();if(fe.ok&&Se.success){let Be="We've sent a code to your email. Please check your inbox (and spam folder).";Se.warning==="BOUNCE_HISTORY"&&(Be=Se.warningMessage+" "+Be),ee(Be),wt(2)}else if(Se.recoveryHint&&qe(Se.recoveryHint),Se.code==="EMAIL_NOT_FOUND")Ve("We couldn't find an account with this email. If you're an existing member, try another email associated with your account."),qe("To recover your account, email [email protected]");else if(Se.code==="GUILD_EMAIL_NOT_VERIFIED"){const Be=Se.externalEmail?` Try using ${Se.externalEmail.charAt(0)}***@${Se.externalEmail.split("@")[1]}`:"";Ve(Se.message+Be)}else Se.code==="EMAIL_BOUNCED"||Se.code==="RATE_LIMITED"?Ve(Se.message):Ve(Se.message||"Error sending code. Please try again.")}catch(fe){console.error("Error sending code:",fe),Ve("Error sending code. Please try again.")}finally{jt(!1)}},Je=async()=>
388{if(Tt.length===6){jt(!0),Ve("");try{const fe=await fetch("/api/verifyCode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Nt.toLowerCase(),code:Tt.toUpperCase()})}),Se=await fe.json();if(fe.ok&&Se.success&&Se.sessionId){sessionStorage.setItem("memberSession",Se.sessionId);const Ze=new URLSearchParams(window.location.search).get("redirect");Ze&&Ze.startsWith("/")?window.location.href=Ze:window.location.reload()}else Ve(Se.message||"Invalid code. Please try again.")}catch(fe){console.error("Error verifying code:",fe),Ve("Error verifying code. Please try again.")}finally{jt(!1)}}},$e=fe=>{const Se=fe.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6);Wt(Se),ze&&Ve(""),Se.length===6&&setTimeout(()=>Je(),100)},Xe=async()=>{He(!0),bt(null);try{const fe=localStorage.getItem(Me);if(!fe)throw new Error("No passkey found on this device");const Be=await(await fetch("/api/member-auth/passkey/authentication-options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({localStorageKey:fe})})).json();if(!Be.success)throw Be.notFound?new Error("Passkey not recognized. Use email verification below to sign in."):new Error(Be.message||"Failed to get authentication options");const Ze=await jg(Be.options),rt=await(await fetch("/api/member-auth/passkey/verify-authentication",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:Ze,localStorageKey:fe})})).json();if(!rt.success)throw new Error(rt.message||"Authentication failed");sessionStorage.setItem("memberSession",rt.sessionId);const _t=new URLSearchParams(window.location.search).get("redirect");_t&&_t.startsWith("/")?window.location.href=_t:window.location.reload()}catch(fe){fe instanceof Error&&fe.name==="NotAllowedError"?bt("Passkey authentication was cancelled"):fe instanceof Error?bt(fe.message):bt("Passkey authentication failed"),console.error("[MEMBER-PORTAL] Passkey login error:",fe)}finally{He(!1)}},X=()=>{localStorage.removeItem(Me),Ae(!1),zt(!1),bt(null)},[ke,De]=x.useState(!1),[oe,te]=x.useState(!1),ye=async()=>{if(!gt(Nt)){Ve("Please enter a valid email address");return}jt(!0),Ve(""),ee(""),De(!1);try{const fe=await fetch("/api/member-auth/passkey/check-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Nt.toLowerCase()})}),Se=await fe.json();if(!fe.ok){Ve(Se.message||"Error checking email. Please try again.");return}if(!Se.hasPasskey){Ve(Se.message||"No passkey found for this email address.");return}De(!0),ee("Passkey found! Click below to log in.")}catch(fe){console.error("Error finding passkey:",fe),Ve("Error connecting to server. Please try again.")}finally{jt(!1)}},Re=async()=>{He(!0),bt(null),Ve("");try{const Se=await(await fetch("/api/member-auth/passkey/authentication-options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Nt.toLowerCase()})})).json();if(!Se.success)throw new Error(Se.message||"Failed to get authentication options");const Be=await jg(Se.options),ue=await(await fetch("/api/member-auth/passkey/verify-authentication",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:Be,trustDevice:oe})})).json();if(!ue.success)throw new Error(ue.message||"Authentication failed");oe&&ue.localStorageKey&&localStorage.setItem(Me,ue.localStorageKey),sessionStorage.setItem("memberSession",ue.sessionId),window.location.reload()}catch(fe){fe instanceof Error&&fe.name==="NotAllowedError"?Ve("Passkey authentication was cancelled"):fe instanceof Error?Ve(fe.message):Ve("Passkey authentication failed"),console.error("[MEMBER-PORTAL] Recovery login error:",fe)}finally{He(!1)}},Le=()=>{sessionStorage.removeItem("memberSession"),window.location.reload()};return s?r.jsx(ku,{isConnected:!1,showImmediately:!0}):H?r.jsxs(r.Fragment,{children:[r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 flex items-center justify-center pt-20",children:r.jsxs(Ft,{className:"p-12 text-center max-w-md",children:[r.jsx(us,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Activation Started!"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"Your member profile page has been notified to activate your guild email."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"You can close this tab and return to your open member profile."})]})})]}):e?r.jsxs(r.Fragment,{children:[r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 flex items-center justify-center pt-20",children:r.jsxs(Ft,{className:"p-12 text-center",children:[r.jsx(on,{className:"w-12 h-12 text-primary animate-spin mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"Validating your membership..."})]})})]}):Ut&&!T?r.jsxs(r.Fragment,{children:[r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 py-12 px-4 pt-28",children:r.jsxs("div",{className:"container mx-auto max-w-md",children:[r.jsxs("div",{className:"text-center mb-8",children:[r.jsx("h1",{className:"text-3xl font-bold mb-4 text-foreground",children:"Member Portal"}),r.jsx("p",{className:"text-muted-foreground",children:"Welcome back! Please verify your identity to continue."})]}),We&&re===1&&!Rt&&r.jsxs(Ft,{className:"p-8 border-2 mb-4",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(fc,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold mb-2 text-foreground",children:"Qu
388ick Login with Passkey"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Use your saved passkey to sign in instantly"})]}),r.jsxs("div",{className:"space-y-4",children:[Ct&&r.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive",children:Ct}),r.jsx(Fe,{size:"lg",className:"w-full",onClick:Xe,disabled:Ce,children:Ce?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"}),"Authenticating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(fc,{className:"w-4 h-4 mr-2"}),"Sign in with Passkey"]})})]})]}),Ct&&We&&re===1&&r.jsx(Ft,{className:"p-6 border-2 border-amber-500/50 bg-amber-50/50 dark:bg-amber-950/20 mb-4",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h3",{className:"font-semibold text-amber-900 dark:text-amber-100 mb-2",children:"Passkey Not Recognized"}),r.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300 mb-4",children:"This passkey isn't registered with your account. Use email verification below to sign in, then you can register a new passkey."}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:X,children:"Continue with Email"})]})}),We&&re===1&&!Rt&&r.jsxs("div",{className:"relative my-6",children:[r.jsx("div",{className:"absolute inset-0 flex items-center",children:r.jsx("div",{className:"w-full border-t border-muted-foreground/20"})}),r.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:r.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or"})})]}),re===1&&!Rt&&r.jsxs(Ft,{className:"p-8 border-2",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(Cr,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold mb-2 text-foreground",children:We?"Email Verification":"Verify Your Email"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Enter your email address to receive a verification code"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"email",children:"Email Address"}),r.jsx(un,{id:"email",type:"email",autoComplete:"email",placeholder:"[email protected]",value:Nt,onChange:fe=>vt(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&gt(Nt)&&Ee(),className:"mt-2"})]}),he&&r.jsx("div",{className:"p-4 bg-primary/10 border border-primary/20 rounded-lg text-sm",children:he}),ze&&r.jsxs("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm",children:[r.jsx("div",{className:"text-destructive",children:ze}),lt&&r.jsx("div",{className:"mt-2 text-foreground font-medium",children:lt})]}),r.jsx(Fe,{size:"lg",className:"w-full",onClick:Ee,disabled:Dt||!Nt,children:Dt?"Sending...":"Send Verification Code"}),r.jsx("div",{className:"text-center space-y-2",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:["New member?"," ",r.jsx("a",{href:"/join",className:"text-primary hover:underline",children:"Join here"})]})})]})]}),re===1&&!Rt&&!We&&r.jsx("div",{className:"text-center mt-4",children:r.jsx("button",{onClick:()=>zt(!0),className:"text-sm text-primary hover:text-primary/80 hover:underline",children:"Recover passkey for this device"})}),Rt&&re===1&&!We&&r.jsxs(Ft,{className:"p-8 border-2 border-primary/30",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(fc,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold mb-2 text-foreground",children:"Recover Your Passkey"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Enter your email to find your registered passkey"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"recovery-email",children:"Email Address"}),r.jsx(un,{id:"recovery-email",type:"email",autoComplete:"email",placeholder:"[email protected]",value:Nt,onChange:fe=>{vt(fe.target.value),ke&&(De(!1),ee(""))},onKeyDown:fe=>fe.key==="Enter"&&gt(Nt)&&!ke&&ye(),className:"mt-2",disabled:ke})]}),he&&r.jsx("div",{className:"p-4 bg-primary/10 border border-primary/20 rounded-lg text-sm",children:he}),ze&&r.jsx("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive",children:ze}),!ke&&r.jsx(Fe,{size:"lg",className:"w-full",onClick:ye,disabled:Dt||!Nt,children:Dt?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"}),"Checking..."]}):r.jsxs(r.Fragment,{children:[r.jsx(fc,{className:"w-4 h-4 mr-2"}),"Find Passkey"]})}),ke&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center space-x-2 py-2",children:[r.jsx("input",{type:"checkbox",id:"recovery-trust-device",checked:oe,onCh
388ange:fe=>te(fe.target.checked),className:"h-4 w-4 rounded border-gray-300"}),r.jsx("label",{htmlFor:"recovery-trust-device",className:"text-sm font-medium leading-none",children:"Trust this device for quick login"})]}),r.jsx(Fe,{size:"lg",className:"w-full",onClick:Re,disabled:Ce,children:Ce?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"}),"Authenticating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(fc,{className:"w-4 h-4 mr-2"}),"Log In with Passkey"]})})]}),r.jsx("div",{className:"text-center pt-2",children:r.jsx("button",{onClick:()=>{zt(!1),De(!1),ee(""),Ve("")},className:"text-sm text-muted-foreground hover:text-foreground hover:underline",children:"Back to regular login"})})]})]}),re===2&&r.jsxs(Ft,{className:"p-8 border-2",children:[r.jsxs("div",{className:"text-center mb-6",children:[r.jsx("div",{className:"inline-flex p-4 bg-gradient-to-br from-primary/20 to-accent/20 rounded-full mb-4",children:r.jsx(Ra,{className:"w-8 h-8 text-primary"})}),r.jsx("h2",{className:"text-xl font-bold mb-2 text-foreground",children:"Enter Verification Code"}),r.jsx("p",{className:"text-muted-foreground text-sm",children:"Check your email for a 6-character code"}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Sent to: ",r.jsx("strong",{children:Nt})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"code",children:"Verification Code"}),r.jsx(un,{id:"code",type:"text",autoComplete:"one-time-code",inputMode:"text",maxLength:6,placeholder:"ABC123",value:Tt,onChange:$e,onKeyDown:fe=>fe.key==="Enter"&&Tt.length===6&&Je(),className:"mt-2 text-center text-2xl tracking-widest font-mono",autoFocus:!0})]}),he&&r.jsx("div",{className:"p-4 bg-primary/10 border border-primary/20 rounded-lg text-sm",children:he}),ze&&r.jsxs("div",{className:"p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-sm",children:[r.jsx("div",{className:"text-destructive",children:ze}),lt&&r.jsx("div",{className:"mt-2 text-foreground font-medium",children:lt})]}),r.jsx(Fe,{size:"lg",className:`w-full transition-all ${Tt.length===6&&!Dt?"animate-pulse bg-green-600 hover:bg-green-700":""}`,onClick:Je,disabled:Dt||Tt.length!==6,children:Dt?"Verifying...":Tt.length===6?"✓ Ready to Verify":"Verify Code"}),r.jsx(Fe,{variant:"outline",className:"w-full",onClick:()=>wt(1),disabled:Dt,children:"Change Email Address"})]})]})]})})]}):a?r.jsxs(OA,{sessionId:p||null,isAuthenticated:!!p&&!!m,children:[r.jsx(FU,{}),r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 py-2 px-1 pt-24 sm:py-4 sm:px-2 sm:pt-24 md:py-12 md:px-4 md:pt-28",children:r.jsxs("div",{className:"mx-auto max-w-4xl",children:[z&&r.jsxs(Ft,{className:"p-4 mb-6 border-2 border-orange-500 bg-orange-50 dark:bg-orange-950/20",children:[r.jsxs("div",{className:"flex items-center gap-3 text-center justify-center",children:[r.jsx(Ra,{className:"w-5 h-5 text-orange-600 dark:text-orange-400"}),r.jsx("p",{className:"font-semibold text-orange-900 dark:text-orange-100",children:'Admin "View As Member" Mode'}),r.jsx(Ra,{className:"w-5 h-5 text-orange-600 dark:text-orange-400"})]}),r.jsx("p",{className:"text-xs text-orange-700 dark:text-orange-300 text-center mt-1",children:"You are viewing this member's profile as an administrator"})]}),r.jsx(Ft,{className:"p-2 sm:p-4 md:p-8 border-2 mb-4 sm:mb-8",children:r.jsxs("div",{className:"flex flex-col items-center gap-4 md:flex-row md:items-center md:justify-between",children:[r.jsx("div",{className:"hidden md:flex w-48 justify-start",children:!z&&U===!1&&r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>W(!0),className:"text-primary hover:bg-primary/10 border-primary/50",children:[r.jsx(wg,{className:"h-4 w-4 mr-2"}),"Add Passkey"]})}),r.jsxs("div",{className:"text-center md:flex-1",children:[r.jsx("h1",{className:"text-2xl md:text-4xl font-bold mb-2 text-foreground",children:N?`Welcome back${v?`, ${v}`:S?`, ${S}`:""}!`:`Welcome${v?`, ${v}`:S?`, ${S}`:""}!`}),c&&r.jsx("p",{className:"text-base md:text-lg text-muted-foreground break-all",children:r.jsx("strong",{children:c.includes("@")?c:`${c}@xrguild.org`})})]}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-2 md:w-48 md:justify-end",children:[!z&&U===!1&&r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>W(!0),className:"md:hidden text-primary hover:bg-primary/10 border-primary/50",children:[r.jsx(wg,{className:"h-4 w-4 mr-2"}),"Add Passkey"]}),!z&&r.jsxs(Fe,{variant:"outline",size:"sm",onClick:Le,className:"text-muted-foreground hover:text-destructive",children:[r.jsx(rh,{className:"h-4 w-4 mr-2"}),"Log Out"]})]})]})}),r.jsx(aO,{memberKey:m,onAcceptanceComplete:It,existingAcceptance:N,isImpersonation:z}),(w||z)&&p&&m&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mt-8",children:r.jsx(Y7,{sessionId:p})}),r.jsx($7,{sessionId:p,memberKey:m})]}),(w||z)&&r.jsx("div",{ref:j,className:"mt-8",children:r.jsx(yU,{memberKey:m,email:c,sessionId:p,isImpersonation:z,autoActivateGuildEmail:B,onAutoActivateComplete:()=>k(!1),scrollToGuildEmail:ve,machineId:O,onHasDevicePasskeyChange:q,triggerPasskeySetup:Y,onPasskeySetupTriggered:()=>W(!1)})})]})})]}):r.jsxs(r.Fragment,{children:[r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 flex items-center justify-center px-4 pt-20",children:r.jsxs(Ft,{className:"p-12 text-center max-w-md",children:[r.jsx("h1",{className:"text-2xl font-bold mb-4 text-foreground",children:"Invalid Link"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"This member portal link is invali
388d or has expired."}),r.jsx("a",{href:"/join",className:"inline-block px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:opacity-90 transition",children:"Start Registration"})]})})]})}function _U(){const[t]=G1(),e=_r(),[n,a]=x.useState("loading"),[i,s]=x.useState(""),[o,c]=x.useState(null);x.useEffect(()=>{const m=t.get("code");if(!m){a("error"),s("No verification code provided.");return}console.log("[VERIFY] Exchanging verification code:",m.substring(0,8)+"..."),fetch("/api/guild-email/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:m})}).then(f=>f.json()).then(f=>{f.success?f.hasOpenSession?(console.log("[VERIFY] Existing session notified via WebSocket"),a("close-tab"),s(f.message||"Your member profile page has been updated.")):f.alreadyVerified?(console.log("[VERIFY] Already verified"),a("already-verified"),c(f.sessionId),s("Your guild email is already verified.")):f.verified&&f.sessionId?(console.log("[VERIFY] Verification successful"),a("success"),c(f.sessionId),s("Your guild email has been verified!")):(a("error"),s(f.message||"Unexpected response from server.")):(a("error"),s(f.message||"Verification failed."))}).catch(f=>{console.error("[VERIFY] Error:",f),a("error"),s("Error connecting to server. Please try again.")})},[t]);const d=()=>{o&&sessionStorage.setItem("memberSession",o),e("/member#guildEmail")};return r.jsxs(r.Fragment,{children:[r.jsx(Os,{}),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-background to-accent/5 flex items-center justify-center pt-20",children:r.jsxs(Ft,{className:"p-12 text-center max-w-md",children:[n==="loading"&&r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-12 h-12 text-primary animate-spin mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Verifying..."}),r.jsx("p",{className:"text-muted-foreground",children:"Please wait while we verify your guild email."})]}),n==="success"&&r.jsxs(r.Fragment,{children:[r.jsx(us,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Email Verified!"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:i}),r.jsxs(Fe,{onClick:d,className:"gap-2",children:[r.jsx(_i,{className:"w-4 h-4"}),"Open Member Portal"]})]}),n==="already-verified"&&r.jsxs(r.Fragment,{children:[r.jsx(us,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Already Verified"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:i}),r.jsxs(Fe,{onClick:d,className:"gap-2",children:[r.jsx(_i,{className:"w-4 h-4"}),"Open Member Portal"]})]}),n==="close-tab"&&r.jsxs(r.Fragment,{children:[r.jsx(us,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Verification Complete!"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:i}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"You can close this tab and return to your open member profile."})]}),n==="error"&&r.jsxs(r.Fragment,{children:[r.jsx(h3,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-bold mb-2",children:"Verification Failed"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:i}),r.jsx(Fe,{onClick:()=>e("/member"),variant:"outline",children:"Go to Member Portal"})]})]})})]})}var Dv="rovingFocusGroup.onEntryFocus",EU={bubbles:!1,cancelable:!0},af="RovingFocusGroup",[sb,aT,kU]=Vm(af),[AU,iT]=Xa(af,[kU]),[NU,TU]=AU(af),sT=x.forwardRef((t,e)=>r.jsx(sb.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(sb.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(MU,{...t,ref:e})})}));sT.displayName=af;var MU=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:f=!1,...p}=t,b=x.useRef(null),v=Hn(e,b),C=uh(s),[S,F]=ds({prop:o,defaultProp:c??null,onChange:d,caller:af}),[w,A]=x.useState(!1),N=ua(m),P=aT(n),z=x.useRef(!1),[D,T]=x.useState(0);return x.useEffect(()=>{const K=b.current;
vendor: 5,428 bytes, line 388
388if(K)return K.addEventListener(Dv,N),()=>K.removeEventListener(Dv,N)},[N]),r.jsx(NU,{scope:n,orientation:a,dir:C,loop:i,currentTabStopId:S,onItemFocus:x.useCallback(K=>F(K),[F]),onItemShiftTab:x.useCallback(()=>A(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(K=>K+1),[]),onFocusableItemRemove:x.useCallback(()=>T(K=>K-1),[]),children:r.jsx(Tn.div,{tabIndex:w||D===0?-1:0,"data-orientation":a,...p,ref:v,style:{outline:"none",...t.style},onMouseDown:vn(t.onMouseDown,()=>{z.current=!0}),onFocus:vn(t.onFocus,K=>{const B=!z.current;if(K.target===K.currentTarget&&B&&!w){const k=new CustomEvent(Dv,EU);if(K.currentTarget.dispatchEvent(k),!k.defaultPrevented){const O=P().filter(Y=>Y.focusable),I=O.find(Y=>Y.active),j=O.find(Y=>Y.id===S),q=[I,j,...O].filter(Boolean).map(Y=>Y.ref.current);cT(q,f)}}z.current=!1}),onBlur:vn(t.onBlur,()=>A(!1))})})}),oT="RovingFocusGroupItem",lT=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:s,children:o,...c}=t,d=wo(),m=s||d,f=TU(oT,n),p=f.currentTabStopId===m,b=aT(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:S}=f;return x.useEffect(()=>{if(a)return v(),()=>C()},[a,v,C]),r.jsx(sb.ItemSlot,{scope:n,id:m,focusable:a,active:i,children:r.jsx(Tn.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:e,onMouseDown:vn(t.onMouseDown,F=>{a?f.onItemFocus(m):F.preventDefault()}),onFocus:vn(t.onFocus,()=>f.onItemFocus(m)),onKeyDown:vn(t.onKeyDown,F=>{if(F.key==="Tab"&&F.shiftKey){f.onItemShiftTab();return}if(F.target!==F.currentTarget)return;const w=PU(F,f.orientation,f.dir);if(w!==void 0){if(F.metaKey||F.ctrlKey||F.altKey||F.shiftKey)return;F.preventDefault();let N=b().filter(P=>P.focusable).map(P=>P.ref.current);if(w==="last")N.reverse();else if(w==="prev"||w==="next"){w==="prev"&&N.reverse();const P=N.indexOf(F.currentTarget);N=f.loop?jU(N,P+1):N.slice(P+1)}setTimeout(()=>cT(N))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:S!=null}):o})})});lT.displayName=oT;var RU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function DU(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function PU(t,e,n){const a=DU(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return RU[a]}function cT(t,e=!1){const n=document.activeElement;for(const a of t)if(a===n||(a.focus({preventScroll:e}),document.activeElement!==n))return}function jU(t,e){return t.map((n,a)=>t[(e+a)%t.length])}var LU=sT,IU=lT,Fw="Radio",[BU,uT]=Xa(Fw),[OU,UU]=BU(Fw),dT=x.forwardRef((t,e)=>{const{__scopeRadio:n,name:a,checked:i=!1,required:s,disabled:o,value:c="on",onCheck:d,form:m,...f}=t,[p,b]=x.useState(null),v=Hn(e,F=>b(F)),C=x.useRef(!1),S=p?m||!!p.closest("form"):!0;return r.jsxs(OU,{scope:n,checked:i,disabled:o,children:[r.jsx(Tn.button,{type:"button",role:"radio","aria-checked":i,"data-state":pT(i),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:v,onClick:vn(t.onClick,F=>{i||d?.(),S&&(C.current=F.isPropagationStopped(),C.current||F.stopPropagation())})}),S&&r.jsx(fT,{control:p,bubbles:!C.current,name:a,value:c,checked:i,required:s,disabled:o,form:m,style:{transform:"translateX(-100%)"}})]})});dT.displayName=Fw;var hT="RadioIndicator",mT=x.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:a,...i}=t,s=UU(hT,n);return r.jsx(Yi,{present:a||s.checked,children:r.jsx(Tn.span,{"data-state":pT(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:e})})});mT.displayName=hT;var zU="RadioBubbleInput",fT=x.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:a=!0,...i},s)=>{const o=x.useRef(null),c=Hn(o,s),d=xx(n),m=sx(e);return x.useEffect(()=>{const f=o.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&v){const C=new Event("click",{bubbles:a});v.call(f,n),f.dispatchEvent(C)}},[d,n,a]),r.jsx(Tn.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fT.displayName=zU;function pT(t){return t?"checked":"unchecked"}var GU=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ex="RadioGroup",[HU]=Xa(Ex,[iT,uT]),gT=iT(),xT=uT(),[WU,VU]=HU(Ex),vT=x.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:a,defaultValue:i,value:s,required:o=!1,disabled:c=!1,orientation:d,dir:m,loop:f=!0,onValueChange:p,...b}=t,v=gT(n),C=uh(m),[S,F]=ds({prop:s,defaultProp:i??null,onChange:p,caller:Ex});return r.jsx(WU,{scope:n,name:a,required:o,disabled:c,value:S,onValueChange:F,children:r.jsx(LU,{asChild:!0,...v,orientation:d,dir:C,loop:f,children:r.jsx(Tn.div,{role:"radiogroup","aria-required":o,"aria-orientation":d,"data-disabled":c?"":void 0,dir:C,...b,ref:e})})})});vT.displayName=Ex;var yT="RadioGroupItem",bT=x.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:a,...i}=t,s=VU(yT,n),o=s.disabled||a,c=gT(n),d=xT(n),m=x.useRef(null),f=Hn(e,m),p=s.value===i.value,b=x.useRef(!1);return x.useEffect(()=>{const v=S=>{GU.includes(S.key)&&(b.current=!0)},C=()=>b.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",C),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",C)}},[]),r.jsx(IU,{asChild:!0,...c,focusable:!o,active:p,children:r.jsx(dT,{disabled:o,required:s.required,
388checked:p,...d,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:vn(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:vn(i.onFocus,()=>{b.current&&m.current?.click()})})})});bT.displayName=yT;var $U="RadioGroupIndicator",wT=x.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...a}=t,i=xT(n);return r.jsx(mT,{...i,...a,ref:e})});wT.displayName=$U;var ST=vT,FT=bT,KU=wT;const kx=x.forwardRef(({className:t,...e},n)=>r.jsx(ST,{className:ln("grid gap-2",t),...e,ref:n}));kx.displayName=ST.displayName;const xl=x.forwardRef(({className:t,...e},n)=>r.jsx(FT,{ref:n,className:ln("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:r.jsx(KU,{className:"flex items-center justify-center",children:r.jsx(uP,{className:"h-2.5 w-2.5 fill-current text-current"})})}));xl.displayName=FT.displayName;const Cw="181",YU=0,MC=1,qU=2,CT=1,JU=2,ul=3,Ec=0,ki=1,Us=2,vl=0,Dd=1,RC=2,DC=3,PC=4,XU=5,cu=100,ZU=101,QU=102,ez=103,tz=104,nz=200,rz=201,az=202,iz=203,ob=204,lb=205,sz=206,oz=207,lz=208,cz=209,uz=210,dz=211,hz=212,mz=213,fz=214,cb=0,ub=1,db=2,Yd=3,hb=4,mb=5,fb=6,pb=7,_T=0,pz=1,gz=2,Sc=0,xz=1,vz=2,yz=3,bz=4,wz=5,Sz=6,Fz=7,ET=300,qd=301,Jd=302,gb=303,xb=304,Ax=306,vb=1e3,fl=1001,yb=1002,Wi=1003,Cz=1004,kp=1005,Gi=1006,Pv=1007,xc=1008,Cl=1009,kT=1010,AT=1011,Om=1012,_w=1013,Su=1014,pl=1015,hh=1016,Ew=1017,kw=1018,Um=1020,NT=35902,TT=35899,MT=1021,RT=1022,Gs=1023,zm=1026,Gm=1027,DT=1028,Aw=1029,Nw=1030,Tw=1031,Mw=1033,mg=33776,fg=33777,pg=33778,gg=33779,bb=35840,wb=35841,Sb=35842,Fb=35843,Cb=36196,_b=37492,Eb=37496,kb=37808,Ab=37809,Nb=37810,Tb=37811,Mb=37812,Rb=37813,Db=37814,Pb=37815,jb=37816,Lb=37817,Ib=37818,Bb=37819,Ob=37820,Ub=37821,zb=36492,Gb=36494,Hb=36495,Wb=36283,Vb=36284,$b=36285,Kb=36286,_z=3200,Ez=3201,kz=0,Az=1,pc="",Fi="srgb",Xd="srgb-linear",Lg="linear",br="srgb",ld=7680,jC=519,Nz=512,Tz=513,Mz=514,PT=515,Rz=516,Dz=517,Pz=518,jz=519,LC=35044,IC="300 es",yo=2e3,Ig=2001;function jT(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Hm(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Lz(){const t=Hm("canvas");return t.style.display="block",t}const BC={};function OC(...t){const e="THREE."+t.shift();console.log(e,...t)}function Yn(...t){const e="THREE."+t.shift();console.warn(e,...t)}function Wr(...t){const e="THREE."+t.shift();console.error(e,...t)}function Wm(...t){const e=t.join(" ");e in BC||(BC[e]=!0,Yn(...t))}function Iz(t,e,n){return new Promise(function(a,i){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:a()}}setTimeout(s,n)})}class mh{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const a=this._listeners;a[e]===void 0&&(a[e]=[]),a[e].indexOf(n)===-1&&a[e].push(n)}hasEventListener(e,n){const a=this._listeners;return a===void 0?!1:a[e]!==void 0&&a[e].indexOf(n)!==-1}removeEventListener(e,n){const a=this._listeners;if(a===void 0)return;const i=a[e];if(i!==void 0){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const a=n[e.type];if(a!==void 0){e.target=this;const i=a.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}const $a=["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"],jv=Math.PI/180,Yb=180/Math.PI;function sf(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,a=Math.random()*4294967295|0;return($a[t&255]+$a[t>>8&255]+$a[t>>16&255]+$a[t>>24&255]+"-"+$a[e&255]+$a[e>>8&255]+"-"+$a[e>>16&15|64]+$a[e>>24&255]+"-"+$a[n&63|128]+$a[n>>8&255]+"-"+$a[n>>16&255]+$a[n>>24&255]+$a[a&255]+$a[a>>8&255]+$a[a>>16&255]+$a[a>>24&255]).toLowerCase()}function rr(t,e,n){return Math.max(e,Math.min(n,t))}function Bz(t,e){return(t%e+e)%e}function Lv(t,e,n){return(1-n)*t+n*e}function Qh(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 bi(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.")}}class vr{constructor(e=0,n=0){vr.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}
vendor: 11,433 bytes, line 388
388sub(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,a=this.y,i=e.elements;return this.x=i[0]*n+i[3]*a+i[6],this.y=i[1]*n+i[4]*a+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=rr(this.x,e.x,n.x),this.y=rr(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=rr(this.x,e,n),this.y=rr(this.y,e,n),this}clampLength(e,n){const a=this.length();return this.divideScalar(a||1).multiplyScalar(rr(a,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const a=this.dot(e)/n;return Math.acos(rr(a,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,a=this.y-e.y;return n*n+a*a}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,a){return this.x=e.x+(n.x-e.x)*a,this.y=e.y+(n.y-e.y)*a,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 a=Math.cos(n),i=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*a-o*i+e.x,this.y=s*i+o*a+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class of{constructor(e=0,n=0,a=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=a,this._w=i}static slerpFlat(e,n,a,i,s,o,c){let d=a[i+0],m=a[i+1],f=a[i+2],p=a[i+3],b=s[o+0],v=s[o+1],C=s[o+2],S=s[o+3];if(c<=0){e[n+0]=d,e[n+1]=m,e[n+2]=f,e[n+3]=p;return}if(c>=1){e[n+0]=b,e[n+1]=v,e[n+2]=C,e[n+3]=S;return}if(p!==S||d!==b||m!==v||f!==C){let F=d*b+m*v+f*C+p*S;F<0&&(b=-b,v=-v,C=-C,S=-S,F=-F);let w=1-c;if(F<.9995){const A=Math.acos(F),N=Math.sin(A);w=Math.sin(w*A)/N,c=Math.sin(c*A)/N,d=d*w+b*c,m=m*w+v*c,f=f*w+C*c,p=p*w+S*c}else{d=d*w+b*c,m=m*w+v*c,f=f*w+C*c,p=p*w+S*c;const A=1/Math.sqrt(d*d+m*m+f*f+p*p);d*=A,m*=A,f*=A,p*=A}}e[n]=d,e[n+1]=m,e[n+2]=f,e[n+3]=p}static multiplyQuaternionsFlat(e,n,a,i,s,o){const c=a[i],d=a[i+1],m=a[i+2],f=a[i+3],p=s[o],b=s[o+1],v=s[o+2],C=s[o+3];return e[n]=c*C+f*p+d*v-m*b,e[n+1]=d*C+f*b+m*p-c*v,e[n+2]=m*C+f*v+c*b-d*p,e[n+3]=f*C-c*p-d*b-m*v,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,a,i){return this._x=e,this._y=n,this._z=a,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 a=e._x,i=e._y,s=e._z,o=e._order,c=Math.cos,d=Math.sin,m=c(a/2),f=c(i/2),p=c(s/2),b=d(a/2),v=d(i/2),C=d(s/2);switch(o){case"XYZ":this._x=b*f*p+m*v*C,this._y=m*v*p-b*f*C,this._z=m*f*C+b*v*p,this._w=m*f*p-b*v*C;break;case"YXZ":this._x=b*f*p+m*v*C,this._y=m*v*p-b*f*C,this._z=m*f*C-b*v*p,this._w=m*f*p+b*v*C;break;case"ZXY":this._x=b*f*p-m*v*C,this._y=m*v*p+b*f*C,this._z=m*f*C+b*v*p,this._w=m*f*p-b*v*C;break;case"ZYX":this._x=b*f*p-m*v*C,this._y=m*v*p+b*f*C,this._z=m*f*C-b*v*p,this._w=m*f*p+b*v*C;break;case"YZX":this._x=b*f*p+m*v*C,this._y=m*v*p+b*f*C,this._z=m*f*C-b*v*p,this._w=m*f*p-b*v*C;break;case"XZY":this._x=b*f*p-m*v*C,this._y=m*v*p-b*f*C,this._z=m*f*C+b*v*p,this._w=m*f*p+b*v*C;break;default:Yn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const a=n/2,i=Math.sin(a);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(a),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,a=n[0],i=n[4],s=n[8],o=n[1],c=n[5],d=n[9],m=n[2],f=n[6],p=n[10],b=a+c+p;if(b>0){const v=.5/Math.sqrt(b+1);this._w=.25/v,this._x=(f-d)*v,this._y=(s-m)*v,this._z=(o-i)*v}else if(a>c&&a>p){const v=2*Math.sqrt(1+a-c-p);this._w=(f-d)/v,this._x=.25*v,this._y=(i+o)/v,this._z=(s+m)/v}else if(c>p){const v=2*Math.sqrt(1+c-a-p);this._w=(s-m)/v,this._x=(i+o)/v,this._y=.25*v,this._z=(d+f)/v}else{const v=2*Math.sqrt(1+p-a-c);this._w=(o-i)/v,this._x=(s+m)/v,this._y=(d+f)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let a=e.dot(n)+1;return a<1e-8?(a=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=a):(this._x=0,this._y=-e.z,this._z=e.y,this._w=a)):(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=a),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(rr(this.dot(e),-1,1)))}rotateTowards(e,n){const a=this.angleTo(e);if(a===0)return this;const i=Math.min(1,n/a);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const a=e._x,i=e._y,s=e._z,o=e._w,c=n._x,d=n._y,m=n._z,f=n._w;return this._x=a*f+o*c+i*m-s*d,this._y=i*f+o*d+s*c-a*m,this._z=s*f+o*m+a*d-i*c,this._w=o*f-a*c-i*d-s*m,this._onChangeCallback(),this}slerp(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let a=e._x,i=e._y,s=e._z,o=e._w,c=this.dot(e);c<0&&(a=-a,i=-i,s=-s,o=-o,c=-c);let d=1-n;if(c<.9995){const m=Math.acos(c),f=Math.sin(m);d=Math.sin(d*m)/f,n=Math.sin(n*m)/f,this._x=this._x*d+a*n,this._y=this._y*d+i*n,this._z=this._z*d+s*n,this._w=this._w*d+o*n,this._onChangeCallback()}else this._x=this._x*d+a*n,this._y=this._y*d+i*n,this._z=this._z*d+s*n,this._w=this._w*d+o*n,this.normalize();return this}slerpQuaternions(e,n,a){return this.copy(e).slerp(n,a)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),a=Math.random(),i=Math.sqrt(1-a),s=Math.sqrt(a);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Pt{constructor(e=0,n=0,a=0){Pt.prototype.isVector3=!0,this.x=e,this.y=n,this.z=a}set(e,n,a){return a===void 0&&(a=this.z),this.x=e,this.y=n,this.z=a,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(UC.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(UC.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,a=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[3]*a+s[6]*i,this.y=s[1]*n+s[4]*a+s[7]*i,this.z=s[2]*n+s[5]*a+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,a=this.y,i=this.z,s=e.elements,o=1/(s[3]*n+s[7]*a+s[11]*i+s[15]);return this.x=(s[0]*n+s[4]*a+s[8]*i+s[12])*o,this.y=(s[1]*n+s[5]*a+s[9]*i+s[13])*o,this.z=(s[2]*n+s[6]*a+s[10]*i+s[14])*o,this}applyQuaternion(e){const n=this.x,a=this.y,i=this.z,s=e.x,o=e.y,c=e.z,d=e.w,m=2*(o*i-c*a),f=2*(c*n-s*i),p=2*(s*a-o*n);return this.x=n+d*m+o*p-c*f,this.y=a+d*f+c*m-s*p,this.z=i+d*p+s*f-o*m,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,a=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[4]*a+s[8]*i,this.y=s[1]*n+s[5]*a+s[9]*i,this.z=s[2]*n+s[6]*a+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=rr(this.x,e.x,n.x),this.y=rr(this.y,e.y,n.y),this.z=rr(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=rr(this.x,e,n),this.y=rr(this.y,e,n),this.z=rr(this.z,e,n),this}clampLength(e,n){const a=this.length();return this.divideScalar(a||1).multiplyScalar(rr(a,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}
vendor: 4,235 bytes, line 388
388round(){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,a){return this.x=e.x+(n.x-e.x)*a,this.y=e.y+(n.y-e.y)*a,this.z=e.z+(n.z-e.z)*a,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const a=e.x,i=e.y,s=e.z,o=n.x,c=n.y,d=n.z;return this.x=i*d-s*c,this.y=s*o-a*d,this.z=a*c-i*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const a=e.dot(this)/n;return this.copy(e).multiplyScalar(a)}projectOnPlane(e){return Iv.copy(this).projectOnVector(e),this.sub(Iv)}reflect(e){return this.sub(Iv.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 a=this.dot(e)/n;return Math.acos(rr(a,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,a=this.y-e.y,i=this.z-e.z;return n*n+a*a+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,a){const i=Math.sin(n)*e;return this.x=i*Math.sin(a),this.y=Math.cos(n)*e,this.z=i*Math.cos(a),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,a){return this.x=e*Math.sin(n),this.y=a,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(),a=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=a,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,a=Math.sqrt(1-n*n);return this.x=a*Math.cos(e),this.y=n,this.z=a*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Iv=new Pt,UC=new of;class Zn{constructor(e,n,a,i,s,o,c,d,m){Zn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,a,i,s,o,c,d,m)}set(e,n,a,i,s,o,c,d,m){const f=this.elements;return f[0]=e,f[1]=i,f[2]=c,f[3]=n,f[4]=s,f[5]=d,f[6]=a,f[7]=o,f[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,a=e.elements;return n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=a[3],n[4]=a[4],n[5]=a[5],n[6]=a[6],n[7]=a[7],n[8]=a[8],this}extractBasis(e,n,a){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),a.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 a=e.elements,i=n.elements,s=this.elements,o=a[0],c=a[3],d=a[6],m=a[1],f=a[4],p=a[7],b=a[2],v=a[5],C=a[8],S=i[0],F=i[3],w=i[6],A=i[1],N=i[4],P=i[7],z=i[2],D=i[5],T=i[8];return s[0]=o*S+c*A+d*z,s[3]=o*F+c*N+d*D,s[6]=o*w+c*P+d*T,s[1]=m*S+f*A+p*z,s[4]=m*F+f*N+p*D,s[7]=m*w+f*P
vendor: 29,595 bytes, line 388
388+p*T,s[2]=b*S+v*A+C*z,s[5]=b*F+v*N+C*D,s[8]=b*w+v*P+C*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],d=e[6],m=e[7],f=e[8];return n*o*f-n*c*m-a*s*f+a*c*d+i*s*m-i*o*d}invert(){const e=this.elements,n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],d=e[6],m=e[7],f=e[8],p=f*o-c*m,b=c*d-f*s,v=m*s-o*d,C=n*p+a*b+i*v;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/C;return e[0]=p*S,e[1]=(i*m-f*a)*S,e[2]=(c*a-i*o)*S,e[3]=b*S,e[4]=(f*n-i*d)*S,e[5]=(i*s-c*n)*S,e[6]=v*S,e[7]=(a*d-m*n)*S,e[8]=(o*n-a*s)*S,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,a,i,s,o,c){const d=Math.cos(s),m=Math.sin(s);return this.set(a*d,a*m,-a*(d*o+m*c)+o+e,-i*m,i*d,-i*(-m*o+d*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(Bv.makeScale(e,n)),this}rotate(e){return this.premultiply(Bv.makeRotation(-e)),this}translate(e,n){return this.premultiply(Bv.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),a=Math.sin(e);return this.set(n,-a,0,a,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,a=e.elements;for(let i=0;i<9;i++)if(n[i]!==a[i])return!1;return!0}fromArray(e,n=0){for(let a=0;a<9;a++)this.elements[a]=e[a+n];return this}toArray(e=[],n=0){const a=this.elements;return e[n]=a[0],e[n+1]=a[1],e[n+2]=a[2],e[n+3]=a[3],e[n+4]=a[4],e[n+5]=a[5],e[n+6]=a[6],e[n+7]=a[7],e[n+8]=a[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Bv=new Zn,zC=new Zn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),GC=new Zn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Oz(){const t={enabled:!0,workingColorSpace:Xd,spaces:{},convert:function(i,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===br&&(i.r=yl(i.r),i.g=yl(i.g),i.b=yl(i.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===br&&(i.r=Pd(i.r),i.g=Pd(i.g),i.b=Pd(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===pc?Lg:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,o){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return Wm("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return Wm("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],a=[.3127,.329];return t.define({[Xd]:{primaries:e,whitePoint:a,transfer:Lg,toXYZ:zC,fromXYZ:GC,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Fi},outputColorSpaceConfig:{drawingBufferColorSpace:Fi}},[Fi]:{primaries:e,whitePoint:a,transfer:br,toXYZ:zC,fromXYZ:GC,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Fi}}}),t}const ur=Oz();function yl(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Pd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let cd;class Uz{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let a;if(e instanceof HTMLCanvasElement)a=e;else{cd===void 0&&(cd=Hm("canvas")),cd.width=e.width,cd.height=e.height;const i=cd.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),a=cd}return a.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Hm("canvas");n.width=e.width,n.height=e.height;const a=n.getContext("2d");a.drawImage(e,0,0,e.width,e.height);const i=a.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=yl(s[o]/255)*255;return a.putImageData(i,0,0),n}else if(e.data){const n=e.data.slice(0);for(let a=0;a<n.length;a++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[a]=Math.floor(yl(n[a]/255)*255):n[a]=yl(n[a]);return{data:n,width:e.width,height:e.height}}else return Yn("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zz=0;class Rw{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zz++}),this.uuid=sf(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const a={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,c=i.length;o<c;o++)i[o].isDataTexture?s.push(Ov(i[o].image)):s.push(Ov(i[o]))}else s=Ov(i);a.url=s}return n||(e.images[this.uuid]=a),a}}function Ov(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}:(Yn("Texture: Unable to serialize Texture."),{})}let Gz=0;const Uv=new Pt;class Da extends mh{constructor(e=Da.DEFAULT_IMAGE,n=Da.DEFAULT_MAPPING,a=fl,i=fl,s=Gi,o=xc,c=Gs,d=Cl,m=Da.DEFAULT_ANISOTROPY,f=pc){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Gz++}),this.uuid=sf(),this.name="",this.source=new Rw(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=a,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=m,this.format=c,this.internalFormat=null,this.type=d,this.offset=new vr(0,0),this.repeat=new vr(1,1),this.center=new vr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Zn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=f,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Uv).x}get height(){return this.source.getSize(Uv).y}get depth(){return this.source.getSize(Uv).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const a=e[n];if(a===void 0){Yn(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){Yn(`Texture.setValues(): property '${n}' does not exist.`);continue}i&&a&&i.isVector2&&a.isVector2||i&&a&&i.isVector3&&a.isVector3||i&&a&&i.isMatrix3&&a.isMatrix3?i.copy(a):this[n]=a}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const a={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(a.userData=this.userData),n||(e.textures[this.uuid]=a),a}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ET)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case vb:e.x=e.x-Math.floor(e.x);break;case fl:e.x=e.x<0?0:1;break;case yb: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 vb:e.y=e.y-Math.floor(e.y);break;case fl:e.y=e.y<0?0:1;break;case yb:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Da.DEFAULT_IMAGE=null;Da.DEFAULT_MAPPING=ET;Da.DEFAULT_ANISOTROPY=1;class $r{constructor(e=0,n=0,a=0,i=1){$r.prototype.isVector4=!0,this.x=e,this.y=n,this.z=a,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,a,i){return this.x=e,this.y=n,this.z=a,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,a=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*a+o[8]*i+o[12]*s,this.y=o[1]*n+o[5]*a+o[9]*i+o[13]*s,this.z=o[2]*n+o[6]*a+o[10]*i+o[14]*s,this.w=o[3]*n+o[7]*a+o[11]*i+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,a,i,s;const d=e.elements,m=d[0],f=d[4],p=d[8],b=d[1],v=d[5],C=d[9],S=d[2],F=d[6],w=d[10];if(Math.abs(f-b)<.01&&Math.abs(p-S)<.01&&Math.abs(C-F)<.01){if(Math.abs(f+b)<.1&&Math.abs(p+S)<.1&&Math.abs(C+F)<.1&&Math.abs(m+v+w-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const N=(m+1)/2,P=(v+1)/2,z=(w+1)/2,D=(f+b)/4,T=(p+S)/4,K=(C+F)/4;return N>P&&N>z?N<.01?(a=0,i=.707106781,s=.707106781):(a=Math.sqrt(N),i=D/a,s=T/a):P>z?P<.01?(a=.707106781,i=0,s=.707106781):(i=Math.sqrt(P),a=D/i,s=K/i):z<.01?(a=.707106781,i=.707106781,s=0):(s=Math.sqrt(z),a=T/s,i=K/s),this.set(a,i,s,n),this}let A=Math.sqrt((F-C)*(F-C)+(p-S)*(p-S)+(b-f)*(b-f));return Math.abs(A)<.001&&(A=1),this.x=(F-C)/A,this.y=(p-S)/A,this.z=(b-f)/A,this.w=Math.acos((m+v+w-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=rr(this.x,e.x,n.x),this.y=rr(this.y,e.y,n.y),this.z=rr(this.z,e.z,n.z),this.w=rr(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=rr(this.x,e,n),this.y=rr(this.y,e,n),this.z=rr(this.z,e,n),this.w=rr(this.w,e,n),this}clampLength(e,n){const a=this.length();return this.divideScalar(a||1).multiplyScalar(rr(a,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,a){return this.x=e.x+(n.x-e.x)*a,this.y=e.y+(n.y-e.y)*a,this.z=e.z+(n.z-e.z)*a,this.w=e.w+(n.w-e.w)*a,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 Hz extends mh{constructor(e=1,n=1,a={}){super(),a=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Gi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},a),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=a.depth,this.scissor=new $r(0,0,e,n),this.scissorTest=!1,this.viewport=new $r(0,0,e,n);const i={width:e,height:n,depth:a.depth},s=new Da(i);this.textures=[];const o=a.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].renderTarget=this;this._setTextureOptions(a),this.depthBuffer=a.depthBuffer,this.stencilBuffer=a.stencilBuffer,this.resolveDepthBuffer=a.resolveDepthBuffer,this.resolveStencilBuffer=a.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=a.depthTexture,this.samples=a.samples,this.multiview=a.multiview}_setTextureOptions(e={}){const n={minFilter:Gi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let a=0;a<this.textures.length;a++)this.textures[a].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,a=1){if(this.width!==e||this.height!==n||this.depth!==a){this.width=e,this.height=n,this.depth=a;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=n,this.textures[i].image.depth=a,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,a=e.textures.length;n<a;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const i=Object.assign({},e.textures[n].image);this.textures[n].source=new Rw(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fu extends Hz{constructor(e=1,n=1,a={}){super(e,n,a),this.isWebGLRenderTarget=!0}}class LT extends Da{constructor(e=null,n=1,a=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:a,depth:i},this.magFilter=Wi,this.minFilter=Wi,this.wrapR=fl,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Wz extends Da{constructor(e=null,n=1,a=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:a,depth:i},this.magFilter=Wi,this.minFilter=Wi,this.wrapR=fl,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class lf{constructor(e=new Pt(1/0,1/0,1/0),n=new Pt(-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,a=e.length;n<a;n+=3)this.expandByPoint(ks.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,a=e.count;n<a;n++)this.expandByPoint(ks.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,a=e.length;n<a;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const a=ks.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(a),this.max.copy(e).add(a),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 a=e.geometry;if(a!==void 0){const s=a.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,ks):ks.fromBufferAttribute(s,o),ks.applyMatrix4(e.matrixWorld),this.expandByPoint(ks);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ap.copy(e.boundingBox)):(a.boundingBox===null&&a.computeBoundingBox(),Ap.copy(a.boundingBox)),Ap.applyMatrix4(e.matrixWorld),this.union(Ap)}const i=e.children;for(let s=0,o=i.length;s<o;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,ks),ks.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,a;return e.normal.x>0?(n=e.normal.x*this.min.x,a=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,a=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,a+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,a+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,a+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,a+=e.normal.z*this.min.z),n<=-e.constant&&a>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(em),Np.subVectors(this.max,em),ud.subVectors(e.a,em),dd.subVectors(e.b,em),hd.subVectors(e.c,em),nc.subVectors(dd,ud),rc.subVectors(hd,dd),Qc.subVectors(ud,hd);let n=[0,-nc.z,nc.y,0,-rc.z,rc.y,0,-Qc.z,Qc.y,nc.z,0,-nc.x,rc.z,0,-rc.x,Qc.z,0,-Qc.x,-nc.y,nc.x,0,-rc.y,rc.x,0,-Qc.y,Qc.x,0];return!zv(n,ud,dd,hd,Np)||(n=[1,0,0,0,1,0,0,0,1],!zv(n,ud,dd,hd,Np))?!1:(Tp.crossVectors(nc,rc),n=[Tp.x,Tp.y,Tp.z],zv(n,ud,dd,hd,Np))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ks).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ks).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:(rl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rl),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const rl=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],ks=new Pt,Ap=new lf,ud=new Pt,dd=new Pt,hd=new Pt,nc=new Pt,rc=new Pt,Qc=new Pt,em=new Pt,Np=new Pt,Tp=new Pt,eu=new Pt;function zv(t,e,n,a,i){for(let s=0,o=t.length-3;s<=o;s+=3){eu.fromArray(t,s);const c=i.x*Math.abs(eu.x)+i.y*Math.abs(eu.y)+i.z*Math.abs(eu.z),d=e.dot(eu),m=n.dot(eu),f=a.dot(eu);if(Math.max(-Math.max(d,m,f),Math.min(d,m,f))>c)return!1}return!0}const Vz=new lf,tm=new Pt,Gv=new Pt;class Dw{constructor(e=new Pt,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 a=this.center;n!==void 0?a.copy(n):Vz.setFromPoints(e).getCenter(a);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,a.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 a=this.center.distanceToSquared(e);return n.copy(e),a>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;tm.subVectors(e,this.center);const n=tm.lengthSq();if(n>this.radius*this.radius){const a=Math.sqrt(n),i=(a-this.radius)*.5;this.center.addScaledVector(tm,i/a),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):(Gv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(tm.copy(e.center).add(Gv)),this.expandByPoint(tm.copy(e.center).sub(Gv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const al=new Pt,Hv=new Pt,Mp=new Pt,ac=new Pt,Wv=new Pt,Rp=new Pt,Vv=new Pt;class IT{constructor(e=new Pt,n=new Pt(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,al)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const a=n.dot(this.direction);return a<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,a)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=al.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(al.copy(this.origin).addScaledVector(this.direction,n),al.distanceToSquared(e))}distanceSqToSegment(e,n,a,i){Hv.copy(e).add(n).multiplyScalar(.5),Mp.copy(n).sub(e).normalize(),ac.copy(this.origin).sub(Hv);const s=e.distanceTo(n)*.5,o=-this.direction.dot(Mp),c=ac.dot(this.direction),d=-ac.dot(Mp),m=ac.lengthSq(),f=Math.abs(1-o*o);let p,b,v,C;if(f>0)if(p=o*d-c,b=o*c-d,C=s*f,p>=0)if(b>=-C)if(b<=C){const S=1/f;p*=S,b*=S,v=p*(p+o*b+2*c)+b*(o*p+b+2*d)+m}else b=s,p=Math.max(0,-(o*b+c)),v=-p*p+b*(b+2*d)+m;else b=-s,p=Math.max(0,-(o*b+c)),v=-p*p+b*(b+2*d)+m;else b<=-C?(p=Math.max(0,-(-o*s+c)),b=p>0?-s:Math.min(Math.max(-s,-d),s),v=-p*p+b*(b+2*d)+m):b<=C?(p=0,b=Math.min(Math.max(-s,-d),s),v=b*(b+2*d)+m):(p=Math.max(0,-(o*s+c)),b=p>0?s:Math.min(Math.max(-s,-d),s),v=-p*p+b*(b+2*d)+m);else b=o>0?-s:s,p=Math.max(0,-(o*b+c)),v=-p*p+b*(b+2*d)+m;return a&&a.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(Hv).addScaledVector(Mp,b),v}intersectSphere(e,n){al.subVectors(e.center,this.origin);const a=al.dot(this.direction),i=al.dot(al)-a*a,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=a-o,d=a+o;return d<0?null:c<0?this.at(d,n):this.at(c,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radiu
vendor: 6,625 bytes, line 388
388s}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const a=-(this.origin.dot(e.normal)+e.constant)/n;return a>=0?a:null}intersectPlane(e,n){const a=this.distanceToPlane(e);return a===null?null:this.at(a,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let a,i,s,o,c,d;const m=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,b=this.origin;return m>=0?(a=(e.min.x-b.x)*m,i=(e.max.x-b.x)*m):(a=(e.max.x-b.x)*m,i=(e.min.x-b.x)*m),f>=0?(s=(e.min.y-b.y)*f,o=(e.max.y-b.y)*f):(s=(e.max.y-b.y)*f,o=(e.min.y-b.y)*f),a>o||s>i||((s>a||isNaN(a))&&(a=s),(o<i||isNaN(i))&&(i=o),p>=0?(c=(e.min.z-b.z)*p,d=(e.max.z-b.z)*p):(c=(e.max.z-b.z)*p,d=(e.min.z-b.z)*p),a>d||c>i)||((c>a||a!==a)&&(a=c),(d<i||i!==i)&&(i=d),i<0)?null:this.at(a>=0?a:i,n)}intersectsBox(e){return this.intersectBox(e,al)!==null}intersectTriangle(e,n,a,i,s){Wv.subVectors(n,e),Rp.subVectors(a,e),Vv.crossVectors(Wv,Rp);let o=this.direction.dot(Vv),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;ac.subVectors(this.origin,e);const d=c*this.direction.dot(Rp.crossVectors(ac,Rp));if(d<0)return null;const m=c*this.direction.dot(Wv.cross(ac));if(m<0||d+m>o)return null;const f=-c*ac.dot(Vv);return f<0?null:this.at(f/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ra{constructor(e,n,a,i,s,o,c,d,m,f,p,b,v,C,S,F){ra.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,a,i,s,o,c,d,m,f,p,b,v,C,S,F)}set(e,n,a,i,s,o,c,d,m,f,p,b,v,C,S,F){const w=this.elements;return w[0]=e,w[4]=n,w[8]=a,w[12]=i,w[1]=s,w[5]=o,w[9]=c,w[13]=d,w[2]=m,w[6]=f,w[10]=p,w[14]=b,w[3]=v,w[7]=C,w[11]=S,w[15]=F,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 ra().fromArray(this.elements)}copy(e){const n=this.elements,a=e.elements;return n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=a[3],n[4]=a[4],n[5]=a[5],n[6]=a[6],n[7]=a[7],n[8]=a[8],n[9]=a[9],n[10]=a[10],n[11]=a[11],n[12]=a[12],n[13]=a[13],n[14]=a[14],n[15]=a[15],this}copyPosition(e){const n=this.elements,a=e.elements;return n[12]=a[12],n[13]=a[13],n[14]=a[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,a){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),a.setFromMatrixColumn(this,2),this}makeBasis(e,n,a){return this.set(e.x,n.x,a.x,0,e.y,n.y,a.y,0,e.z,n.z,a.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,a=e.elements,i=1/md.setFromMatrixColumn(e,0).length(),s=1/md.setFromMatrixColumn(e,1).length(),o=1/md.setFromMatrixColumn(e,2).length();return n[0]=a[0]*i,n[1]=a[1]*i,n[2]=a[2]*i,n[3]=0,n[4]=a[4]*s,n[5]=a[5]*s,n[6]=a[6]*s,n[7]=0,n[8]=a[8]*o,n[9]=a[9]*o,n[10]=a[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,a=e.x,i=e.y,s=e.z,o=Math.cos(a),c=Math.sin(a),d=Math.cos(i),m=Math.sin(i),f=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const b=o*f,v=o*p,C=c*f,S=c*p;n[0]=d*f,n[4]=-d*p,n[8]=m,n[1]=v+C*m,n[5]=b-S*m,n[9]=-c*d,n[2]=S-b*m,n[6]=C+v*m,n[10]=o*d}else if(e.order==="YXZ"){const b=d*f,v=d*p,C=m*f,S=m*p;n[0]=b+S*c,n[4]=C*c-v,n[8]=o*m,n[1]=o*p,n[5]=o*f,n[9]=-c,n[2]=v*c-C,n[6]=S+b*c,n[10]=o*d}else if(e.order==="ZXY"){const b=d*f,v=d*p,C=m*f,S=m*p;n[0]=b-S*c,n[4]=-o*p,n[8]=C+v*c,n[1]=v+C*c,n[5]=o*f,n[9]=S-b*c,n[2]=-o*m,n[6]=c,n[10]=o*d}else if(e.order==="ZYX"){const b=o*f,v=o*p,C=c*f,S=c*p;n[0]=d*f,n[4]=C*m-v,n[8]=b*m+S,n[1]=d*p,n[5]=S*m+b,n[9]=v*m-C,n[2]=-m,n[6]=c*d,n[10]=o*d}else if(e.order==="YZX"){const b=o*d,v=o*m,C=c*d,S=c*m;n[0]=d*f,n[4]=S-b*p,n[8]=C*p+v,n[1]=p,n[5]=o*f,n[9]=-c*f,n[2]=-m*f,n[6]=v*p+C,n[10]=b-S*p}else if(e.order==="XZY"){const b=o*d,v=o*m,C=c*d,S=c*m;n[0]=d*f,n[4]=-p,n[8]=m*f,n[1]=b*p+S,n[5]=o*f,n[9]=v*p-C,n[2]=C*p-v,n[6]=c*f,n[10]=S*p+b}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($z,e,Kz)}lookAt(e,n,a){const i=this.elements;return Li.subVectors(e,n),Li.lengthSq()===0&&(Li.z=1),Li.normalize(),ic.crossVectors(a,Li),ic.lengthSq()===0&&(Math.abs(a.z)===1?Li.x+=1e-4:Li.z+=1e-4,Li.normalize(),ic.crossVectors(a,Li)),ic.normalize(),Dp.crossVectors(Li,ic),i[0]=ic.x,i[4]=Dp.x,i[8]=Li.x,i[1]=ic.y,i[5]=Dp.y,i[9]=Li.y,i[2]=ic.z,i[6]=Dp.z,i[10]=Li.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const a=e.elements,i=n.elements,s=this.elements,o=a[0],c=a[4],d=a[8],m=a[12],f=a[1],p=a[5],b=a[9],v=a[13],C=a[2],S=a[6],F=a[10],w=a[14],A=a[3],N=a[7],P=a[11],z=a[15],D=i[0],T=i[4],K=i[8],B=i[12],k=i[1],O=i[5],I=i[9],j=i[13],U=i[2],q=i[6],Y=i[10],W=i[14],H=i[3],J=i[7],ie=i[11],Q=i[15];return s[0]=o*D+c*k+d*U+m*H,s[4]=o*T+c*O+d*q+m*J,s[8]=o*K+c*I+d*Y+m*ie,s[12]=o*B+c*j+d*W+m*Q,s[1]=f*D+p*k+b*U+v*H,s[5]=f*T+p*O+b*q+v*J,s[9]=f*K+p*I+b*Y+v*ie,s[13]=f*B+p*j+b*W+v*Q,s[2]=C*D+S*k+F*U+w*H,s[6]=C*T+S*O+F*q+w*J,s[10]=C*K+S*I+F*Y+w*ie,s[14]=C*B+S*j+F*W+w*Q,s[3]=A*D+N*k+P*U+z*H,s[7]=A*T+N*O+P*q+z*J,s[11]=A*K+N*I+P*Y+z*ie,s[15]=A*B+N*j+P*W+z*Q,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],a=e[4],i=e[8],s=e[12],o=e[1],c=e[5],d=e[9],m=e[13],f=e[2],p=e[6],b=e[10],v=e[14],C=e[3],S=e[7],F=e[11],w=e[15];return C*(+s*d*p-i*m*p-s*c*b+a*m*b+i*c*v-a*d*v)+S*(+n*d*v-n*m*b+s*o*b-i*o*v+i*m*f-s*d*f)+F*(+n*m*p-n*c*v-s*o*p+a*o*v+s*c*f-a*m*f)+w*(-i*c*f-n*d*p+n*c*b+i*o*p-a*o*b+a*d*f)}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,a){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]=a),this}invert(){const e=this.elements,n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],d=e[6],m=e[7],f=e[8],p=e[9],b=e[10],v=e[11],C=e[12],S=e[13],F=e[14],w=e[15],A=p*F*m-S*b*m+S*d*v-c*F*v-p*d*w+c*b*w,N=C*b*m-f*F*m-C*d*v+o*F*v+f*d*w-o*b*w,P=f*S*m-C*p*m+C*c*v-o*S*v-f*c*w+o*p*w,z=C*p*d-f*S*d-C*c*b+o*S*b+f*c*F-o*p*F,D=n*A+a*N+i*P+s*z;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/D;return e[0]=A*T,e[1]=(S*b*s-p*F*s-S*i*v+a*F*v+p*i*w-a*b*w)*T,e[2]=(c*F
vendor: 10,877 bytes, line 388
388*s-S*d*s+S*i*m-a*F*m-c*i*w+a*d*w)*T,e[3]=(p*d*s-c*b*s-p*i*m+a*b*m+c*i*v-a*d*v)*T,e[4]=N*T,e[5]=(f*F*s-C*b*s+C*i*v-n*F*v-f*i*w+n*b*w)*T,e[6]=(C*d*s-o*F*s-C*i*m+n*F*m+o*i*w-n*d*w)*T,e[7]=(o*b*s-f*d*s+f*i*m-n*b*m-o*i*v+n*d*v)*T,e[8]=P*T,e[9]=(C*p*s-f*S*s-C*a*v+n*S*v+f*a*w-n*p*w)*T,e[10]=(o*S*s-C*c*s+C*a*m-n*S*m-o*a*w+n*c*w)*T,e[11]=(f*c*s-o*p*s-f*a*m+n*p*m+o*a*v-n*c*v)*T,e[12]=z*T,e[13]=(f*S*i-C*p*i+C*a*b-n*S*b-f*a*F+n*p*F)*T,e[14]=(C*c*i-o*S*i-C*a*d+n*S*d+o*a*F-n*c*F)*T,e[15]=(o*p*i-f*c*i+f*a*d-n*p*d-o*a*b+n*c*b)*T,this}scale(e){const n=this.elements,a=e.x,i=e.y,s=e.z;return n[0]*=a,n[4]*=i,n[8]*=s,n[1]*=a,n[5]*=i,n[9]*=s,n[2]*=a,n[6]*=i,n[10]*=s,n[3]*=a,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],a=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,a,i))}makeTranslation(e,n,a){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,a,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),a=Math.sin(e);return this.set(1,0,0,0,0,n,-a,0,0,a,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),a=Math.sin(e);return this.set(n,0,a,0,0,1,0,0,-a,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),a=Math.sin(e);return this.set(n,-a,0,0,a,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const a=Math.cos(n),i=Math.sin(n),s=1-a,o=e.x,c=e.y,d=e.z,m=s*o,f=s*c;return this.set(m*o+a,m*c-i*d,m*d+i*c,0,m*c+i*d,f*c+a,f*d-i*o,0,m*d-i*c,f*d+i*o,s*d*d+a,0,0,0,0,1),this}makeScale(e,n,a){return this.set(e,0,0,0,0,n,0,0,0,0,a,0,0,0,0,1),this}makeShear(e,n,a,i,s,o){return this.set(1,a,s,0,e,1,o,0,n,i,1,0,0,0,0,1),this}compose(e,n,a){const i=this.elements,s=n._x,o=n._y,c=n._z,d=n._w,m=s+s,f=o+o,p=c+c,b=s*m,v=s*f,C=s*p,S=o*f,F=o*p,w=c*p,A=d*m,N=d*f,P=d*p,z=a.x,D=a.y,T=a.z;return i[0]=(1-(S+w))*z,i[1]=(v+P)*z,i[2]=(C-N)*z,i[3]=0,i[4]=(v-P)*D,i[5]=(1-(b+w))*D,i[6]=(F+A)*D,i[7]=0,i[8]=(C+N)*T,i[9]=(F-A)*T,i[10]=(1-(b+S))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,a){const i=this.elements;let s=md.set(i[0],i[1],i[2]).length();const o=md.set(i[4],i[5],i[6]).length(),c=md.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],As.copy(this);const m=1/s,f=1/o,p=1/c;return As.elements[0]*=m,As.elements[1]*=m,As.elements[2]*=m,As.elements[4]*=f,As.elements[5]*=f,As.elements[6]*=f,As.elements[8]*=p,As.elements[9]*=p,As.elements[10]*=p,n.setFromRotationMatrix(As),a.x=s,a.y=o,a.z=c,this}makePerspective(e,n,a,i,s,o,c=yo,d=!1){const m=this.elements,f=2*s/(n-e),p=2*s/(a-i),b=(n+e)/(n-e),v=(a+i)/(a-i);let C,S;if(d)C=s/(o-s),S=o*s/(o-s);else if(c===yo)C=-(o+s)/(o-s),S=-2*o*s/(o-s);else if(c===Ig)C=-o/(o-s),S=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return m[0]=f,m[4]=0,m[8]=b,m[12]=0,m[1]=0,m[5]=p,m[9]=v,m[13]=0,m[2]=0,m[6]=0,m[10]=C,m[14]=S,m[3]=0,m[7]=0,m[11]=-1,m[15]=0,this}makeOrthographic(e,n,a,i,s,o,c=yo,d=!1){const m=this.elements,f=2/(n-e),p=2/(a-i),b=-(n+e)/(n-e),v=-(a+i)/(a-i);let C,S;if(d)C=1/(o-s),S=o/(o-s);else if(c===yo)C=-2/(o-s),S=-(o+s)/(o-s);else if(c===Ig)C=-1/(o-s),S=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return m[0]=f,m[4]=0,m[8]=0,m[12]=b,m[1]=0,m[5]=p,m[9]=0,m[13]=v,m[2]=0,m[6]=0,m[10]=C,m[14]=S,m[3]=0,m[7]=0,m[11]=0,m[15]=1,this}equals(e){const n=this.elements,a=e.elements;for(let i=0;i<16;i++)if(n[i]!==a[i])return!1;return!0}fromArray(e,n=0){for(let a=0;a<16;a++)this.elements[a]=e[a+n];return this}toArray(e=[],n=0){const a=this.elements;return e[n]=a[0],e[n+1]=a[1],e[n+2]=a[2],e[n+3]=a[3],e[n+4]=a[4],e[n+5]=a[5],e[n+6]=a[6],e[n+7]=a[7],e[n+8]=a[8],e[n+9]=a[9],e[n+10]=a[10],e[n+11]=a[11],e[n+12]=a[12],e[n+13]=a[13],e[n+14]=a[14],e[n+15]=a[15],e}}const md=new Pt,As=new ra,$z=new Pt(0,0,0),Kz=new Pt(1,1,1),ic=new Pt,Dp=new Pt,Li=new Pt,HC=new ra,WC=new of;class _l{constructor(e=0,n=0,a=0,i=_l.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=a,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,a,i=this._order){return this._x=e,this._y=n,this._z=a,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,a=!0){const i=e.elements,s=i[0],o=i[4],c=i[8],d=i[1],m=i[5],f=i[9],p=i[2],b=i[6],v=i[10];switch(n){case"XYZ":this._y=Math.asin(rr(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(b,m),this._z=0);break;case"YXZ":this._x=Math.asin(-rr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(d,m)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(rr(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,m)):(this._y=0,this._z=Math.atan2(d,s));break;case"ZYX":this._y=Math.asin(-rr(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(b,v),this._z=Math.atan2(d,s)):(this._x=0,this._z=Math.atan2(-o,m));break;case"YZX":this._z=Math.asin(rr(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-f,m),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-rr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(b,m),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-f,v),this._y=0);break;default:Yn("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,a===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,a){return HC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(HC,n,a)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return WC.setFromEuler(this),this.setFromQuaternion(WC,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}}_l.DEFAULT_ORDER="XYZ";class Pw{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 Yz=0;const VC=new Pt,fd=new of,il=new ra,Pp=new Pt,nm=new Pt,qz=new Pt,Jz=new of,$C=new Pt(1,0,0),KC=new Pt(0,1,0),YC=new Pt(0,0,1),qC={type:"added"},Xz={type:"removed"},pd={type:"childadded",child:null},$v={type:"childremoved",child:null};class Vi extends mh{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Yz++}),this.uuid=sf(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Vi.DEFAULT_UP.clone();const e=new Pt,n=new _l,a=new of,i=new Pt(1,1,1);function s(){a.setFromEuler(n,!1)}function o(){n.setFromQuaternion(a,void 0,!1)}n._onChange(s),a._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:a},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new ra},normalMatrix:{value:new Zn}}),this.matrix=new ra,this.matrixWorld=new ra,this.matrixAutoUpdate=Vi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Vi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Pw,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,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 fd.setFromAxisAngle(e,n),this.quaternion.multiply(fd),this}rotateOnWorldAxis(e,n){return fd.setFromAxisAngle(e,n),this.quaternion.premultiply(fd),this}rotateX(e){return this.rotateOnAxis($C,e)}rotateY(e){return this.rotateOnAxis(KC,e)}rotateZ(e){return this.rotateOnAxis(YC,e)}translateOnAxis(e,n){return VC.copy(e).applyQuaternion(this.quaternion),this.position.add(VC.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis($C,e)}translateY(e){return this.translateOnAxis(KC,e)}translateZ(e){return this.translateOnAxis(YC,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(il.copy(this.matrixWorld).invert())}lookAt(e,n,a){e.isVector3?Pp.copy(e):Pp.set(e,n,a);const i=this.parent;this.updateWorldMatrix(!0,!1),nm.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?il.lookAt(nm,Pp,this.up):il.lookAt(Pp,nm,this.up),this.quaternion.setFromRotationMatrix(il),i&&(il.extractRotation(i.matrixWorld),fd.setFromRotationMatrix(il),this.quaternion.premultiply(fd.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(Wr("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(qC),pd.child=e,this.dispatchEvent(pd),pd.child=null):Wr("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let a=0;a<arguments.length;a++)this.remove(arguments[a]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Xz),$v.child=e,this.dispatchEvent($v),$v.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),il.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),il.multiply(e.parent.matrixWorld)),e.applyMatrix4(il),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(qC),pd.child=e,this.dispatchEvent(pd
vendor: 2,295 bytes, line 388
388),pd.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let a=0,i=this.children.length;a<i;a++){const o=this.children[a].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,a=[]){this[e]===n&&a.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,n,a);return a}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nm,e,qz),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(nm,Jz,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 a=0,i=n.length;a<i;a++)n[a].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let a=0,i=n.length;a<i;a++)n[a].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.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let a=0,i=n.length;a<i;a++)n[a].updateMatrixWorld(e)}updateWorldMatrix(e,n){const a=this.parent;if(e===!0&&a!==null&&a.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(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,o=i.length;s<o;s++)i[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",a={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},a.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};
vendor: 17,258 bytes, line 388
388i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(c=>({...c})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(c,d){return c[d.uuid]===void 0&&(c[d.uuid]=d.toJSON(e)),d.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 c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const d=c.shapes;if(Array.isArray(d))for(let m=0,f=d.length;m<f;m++){const p=d[m];s(e.shapes,p)}else s(e.shapes,d)}}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 c=[];for(let d=0,m=this.material.length;d<m;d++)c.push(s(e.materials,this.material[d]));i.material=c}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){const d=this.animations[c];i.animations.push(s(e.animations,d))}}if(n){const c=o(e.geometries),d=o(e.materials),m=o(e.textures),f=o(e.images),p=o(e.shapes),b=o(e.skeletons),v=o(e.animations),C=o(e.nodes);c.length>0&&(a.geometries=c),d.length>0&&(a.materials=d),m.length>0&&(a.textures=m),f.length>0&&(a.images=f),p.length>0&&(a.shapes=p),b.length>0&&(a.skeletons=b),v.length>0&&(a.animations=v),C.length>0&&(a.nodes=C)}return a.object=i,a;function o(c){const d=[];for(const m in c){const f=c[m];delete f.metadata,d.push(f)}return d}}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 a=0;a<e.children.length;a++){const i=e.children[a];this.add(i.clone())}return this}}Vi.DEFAULT_UP=new Pt(0,1,0);Vi.DEFAULT_MATRIX_AUTO_UPDATE=!0;Vi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ns=new Pt,sl=new Pt,Kv=new Pt,ol=new Pt,gd=new Pt,xd=new Pt,JC=new Pt,Yv=new Pt,qv=new Pt,Jv=new Pt,Xv=new $r,Zv=new $r,Qv=new $r;class zs{constructor(e=new Pt,n=new Pt,a=new Pt){this.a=e,this.b=n,this.c=a}static getNormal(e,n,a,i){i.subVectors(a,n),Ns.subVectors(e,n),i.cross(Ns);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,n,a,i,s){Ns.subVectors(i,n),sl.subVectors(a,n),Kv.subVectors(e,n);const o=Ns.dot(Ns),c=Ns.dot(sl),d=Ns.dot(Kv),m=sl.dot(sl),f=sl.dot(Kv),p=o*m-c*c;if(p===0)return s.set(0,0,0),null;const b=1/p,v=(m*d-c*f)*b,C=(o*f-c*d)*b;return s.set(1-v-C,C,v)}static containsPoint(e,n,a,i){return this.getBarycoord(e,n,a,i,ol)===null?!1:ol.x>=0&&ol.y>=0&&ol.x+ol.y<=1}static getInterpolation(e,n,a,i,s,o,c,d){return this.getBarycoord(e,n,a,i,ol)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(s,ol.x),d.addScaledVector(o,ol.y),d.addScaledVector(c,ol.z),d)}static getInterpolatedAttribute(e,n,a,i,s,o){return Xv.setScalar(0),Zv.setScalar(0),Qv.setScalar(0),Xv.fromBufferAttribute(e,n),Zv.fromBufferAttribute(e,a),Qv.fromBufferAttribute(e,i),o.setScalar(0),o.addScaledVector(Xv,s.x),o.addScaledVector(Zv,s.y),o.addScaledVector(Qv,s.z),o}static isFrontFacing(e,n,a,i){return Ns.subVectors(a,n),sl.subVectors(e,n),Ns.cross(sl).dot(i)<0}set(e,n,a){return this.a.copy(e),this.b.copy(n),this.c.copy(a),this}setFromPointsAndIndices(e,n,a,i){return this.a.copy(e[n]),this.b.copy(e[a]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,a,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,a),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 Ns.subVectors(this.c,this.b),sl.subVectors(this.a,this.b),Ns.cross(sl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return zs.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,a,i,s){return zs.getInterpolation(e,this.a,this.b,this.c,n,a,i,s)}containsPoint(e){return zs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const a=this.a,i=this.b,s=this.c;let o,c;gd.subVectors(i,a),xd.subVectors(s,a),Yv.subVectors(e,a);const d=gd.dot(Yv),m=xd.dot(Yv);if(d<=0&&m<=0)return n.copy(a);qv.subVectors(e,i);const f=gd.dot(qv),p=xd.dot(qv);if(f>=0&&p<=f)return n.copy(i);const b=d*p-f*m;if(b<=0&&d>=0&&f<=0)return o=d/(d-f),n.copy(a).addScaledVector(gd,o);Jv.subVectors(e,s);const v=gd.dot(Jv),C=xd.dot(Jv);if(C>=0&&v<=C)return n.copy(s);const S=v*m-d*C;if(S<=0&&m>=0&&C<=0)return c=m/(m-C),n.copy(a).addScaledVector(xd,c);const F=f*C-v*p;if(F<=0&&p-f>=0&&v-C>=0)return JC.subVectors(s,i),c=(p-f)/(p-f+(v-C)),n.copy(i).addScaledVector(JC,c);const w=1/(F+S+b);return o=S*w,c=b*w,n.copy(a).addScaledVector(gd,o).addScaledVector(xd,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const BT={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},sc={h:0,s:0,l:0},jp={h:0,s:0,l:0};function ey(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 wr{constructor(e,n,a){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,a)}set(e,n,a){if(n===void 0&&a===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,a);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Fi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ur.colorSpaceToWorking(this,n),this}setRGB(e,n,a,i=ur.workingColorSpace){return this.r=e,this.g=n,this.b=a,ur.colorSpaceToWorking(this,i),this}setHSL(e,n,a,i=ur.workingColorSpace){if(e=Bz(e,1),n=rr(n,0,1),a=rr(a,0,1),n===0)this.r=this.g=this.b=a;else{const s=a<=.5?a*(1+n):a+n-a*n,o=2*a-s;this.r=ey(o,s,e+1/3),this.g=ey(o,s,e),this.b=ey(o,s,e-1/3)}return ur.colorSpaceToWorking(this,i),this}setStyle(e,n=Fi){function a(s){s!==void 0&&parseFloat(s)<1&&Yn("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return a(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(c))return a(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(c))return a(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Yn("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);Yn("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Fi){const a=BT[e.toLowerCase()];return a!==void 0?this.setHex(a,n):Yn("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=yl(e.r),this.g=yl(e.g),this.b=yl(e.b),this}copyLinearToSRGB(e){return this.r=Pd(e.r),this.g=Pd(e.g),this.b=Pd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fi){return ur.workingToColorSpace(Ka.copy(this),e),Math.round(rr(Ka.r*255,0,255))*65536+Math.round(rr(Ka.g*255,0,255))*256+Math.round(rr(Ka.b*255,0,255))}getHexString(e=Fi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=ur.workingColorSpace){ur.workingToColorSpace(Ka.copy(this),n);const a=Ka.r,i=Ka.g,s=Ka.b,o=Math.max(a,i,s),c=Math.min(a,i,s);let d,m;const f=(c+o)/2;if(c===o)d=0,m=0;else{const p=o-c;switch(m=f<=.5?p/(o+c):p/(2-o-c),o){case a:d=(i-s)/p+(i<s?6:0);break;case i:d=(s-a)/p+2;break;case s:d=(a-i)/p+4;break}d/=6}return e.h=d,e.s=m,e.l=f,e}getRGB(e,n=ur.workingColorSpace){return ur.workingToColorSpace(Ka.copy(this),n),e.r=Ka.r,e.g=Ka.g,e.b=Ka.b,e}getStyle(e=Fi){ur.workingToColorSpace(Ka.copy(this),e);const n=Ka.r,a=Ka.g,i=Ka.b;return e!==Fi?`color(${e} ${n.toFixed(3)} ${a.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(a*255)},${Math.round(i*255)})`}offsetHSL(e,n,a){return this.getHSL(sc),this.setHSL(sc.h+e,sc.s+n,sc.l+a)}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,a){return this.r=e.r+(n.r-e.r)*a,this.g=e.g+(n.g-e.g)*a,this.b=e.b+(n.b-e.b)*a,this}lerpHSL(e,n){this.getHSL(sc),e.getHSL(jp);const a=Lv(sc.h,jp.h,n),i=Lv(sc.s,jp.s,n),s=Lv(sc.l,jp.l,n);return this.setHSL(a,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,a=this.g,i=this.b,s=e.elements;return this.r=s[0]*n+s[3]*a+s[6]*i,this.g=s[1]*n+s[4]*a+s[7]*i,this.b=s[2]*n+s[5]*a+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 Ka=new wr;wr.NAMES=BT;let Zz=0;class js extends mh{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Zz++}),this.uuid=sf(),this.name="",this.type="Material",this.blending=Dd,this.side=Ec,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=ob,this.blendDst=lb,this.blendEquation=cu,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new wr(0,0,0),this.blendAlpha=0,this.depthFunc=Yd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=jC,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ld,this.stencilZFail=ld,this.stencilZPass=ld,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const a=e[n];if(a===void 0){Yn(`Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){Yn(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(a):i&&i.isVector3&&a&&a.isVector3?i.copy(a):this[n]=a}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const a={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 6,683 bytes, line 388
388a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.color&&this.color.isColor&&(a.color=this.color.getHex()),this.roughness!==void 0&&(a.roughness=this.roughness),this.metalness!==void 0&&(a.metalness=this.metalness),this.sheen!==void 0&&(a.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(a.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(a.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(a.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(a.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(a.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(a.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(a.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(a.shininess=this.shininess),this.clearcoat!==void 0&&(a.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(a.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(a.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(a.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(a.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,a.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(a.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(a.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(a.dispersion=this.dispersion),this.iridescence!==void 0&&(a.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(a.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(a.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(a.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(a.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(a.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(a.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(a.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(a.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(a.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(a.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(a.lightMap=this.lightMap.toJSON(e).uuid,a.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(a.aoMap=this.aoMap.toJSON(e).uuid,a.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(a.bumpMap=this.bumpMap.toJSON(e).uuid,a.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(a.normalMap=this.normalMap.toJSON(e).uuid,a.normalMapType=this.normalMapType,a.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(a.displacementMap=this.displacementMap.toJSON(e).uuid,a.displacementScale=this.displacementScale,a.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(a.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(a.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(a.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(a.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(a.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(a.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(a.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(a.combine=this.combine)),this.envMapRotation!==void 0&&(a.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(a.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(a.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(a.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(a.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(a.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(a.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(a.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(a.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(a.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(a.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(a.size=this.size),this.shadowSide!==null&&(a.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(a.sizeAttenuation=this.sizeAttenuation),this.blending!==Dd&&(a.blending=this.blending),this.side!==Ec&&(a.side=this.side),this.vertexColors===!0&&(a.vertexColors=!0),this.opacity<1&&(a.opacity=this.opacity),this.transparent===!0&&(a.transparent=!0),this.blendSrc!==ob&&(a.blendSrc=this.blendSrc),this.blendDst!==lb&&(a.blendDst=this.blendDst),this.blendEquation!==cu&&(a.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(a.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(a.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(a.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(a.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(a.blendAlpha=this.blendAlpha),this.depthFunc!==Yd&&(a.depthFunc=this.depthFunc),this.depthTest===!1&&(a.depthTest=this.depthTest),this.depthWrite===!1&&(a.depthWrite=this.depthWrite),this.colorWrite===!1&&(a.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(a.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==jC&&(a.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(a.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(a.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ld&&(a.stencilFail=this.stencilFail),this.stencilZFail!==ld&&(a.stencilZFail=this.stencilZFail),this.stencilZPass!==ld&&(a.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(a.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(a.rotation=this.rotation),this.polygonOffset===!0&&(a.pol
vendor: 4,927 bytes, line 388
388ygonOffset=!0),this.polygonOffsetFactor!==0&&(a.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(a.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(a.linewidth=this.linewidth),this.dashSize!==void 0&&(a.dashSize=this.dashSize),this.gapSize!==void 0&&(a.gapSize=this.gapSize),this.scale!==void 0&&(a.scale=this.scale),this.dithering===!0&&(a.dithering=!0),this.alphaTest>0&&(a.alphaTest=this.alphaTest),this.alphaHash===!0&&(a.alphaHash=!0),this.alphaToCoverage===!0&&(a.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(a.premultipliedAlpha=!0),this.forceSinglePass===!0&&(a.forceSinglePass=!0),this.wireframe===!0&&(a.wireframe=!0),this.wireframeLinewidth>1&&(a.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(a.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(a.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(a.flatShading=!0),this.visible===!1&&(a.visible=!1),this.toneMapped===!1&&(a.toneMapped=!1),this.fog===!1&&(a.fog=!1),Object.keys(this.userData).length>0&&(a.userData=this.userData);function i(s){const o=[];for(const c in s){const d=s[c];delete d.metadata,o.push(d)}return o}if(n){const s=i(e.textures),o=i(e.images);s.length>0&&(a.textures=s),o.length>0&&(a.images=o)}return a}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 a=null;if(n!==null){const i=n.length;a=new Array(i);for(let s=0;s!==i;++s)a[s]=n[s].clone()}return this.clippingPlanes=a,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class uu extends js{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new wr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _l,this.combine=_T,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ea=new Pt,Lp=new vr;let Qz=0;class Eo{constructor(e,n,a=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Qz++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=a,this.usage=LC,this.updateRanges=[],this.gpuType=pl,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,a){e*=this.itemSize,a*=n.itemSize;
vendor: 27,009 bytes, lines 388-392
388for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=n.array[a+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,a=this.count;n<a;n++)Lp.fromBufferAttribute(this,n),Lp.applyMatrix3(e),this.setXY(n,Lp.x,Lp.y);else if(this.itemSize===3)for(let n=0,a=this.count;n<a;n++)ea.fromBufferAttribute(this,n),ea.applyMatrix3(e),this.setXYZ(n,ea.x,ea.y,ea.z);return this}applyMatrix4(e){for(let n=0,a=this.count;n<a;n++)ea.fromBufferAttribute(this,n),ea.applyMatrix4(e),this.setXYZ(n,ea.x,ea.y,ea.z);return this}applyNormalMatrix(e){for(let n=0,a=this.count;n<a;n++)ea.fromBufferAttribute(this,n),ea.applyNormalMatrix(e),this.setXYZ(n,ea.x,ea.y,ea.z);return this}transformDirection(e){for(let n=0,a=this.count;n<a;n++)ea.fromBufferAttribute(this,n),ea.transformDirection(e),this.setXYZ(n,ea.x,ea.y,ea.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let a=this.array[e*this.itemSize+n];return this.normalized&&(a=Qh(a,this.array)),a}setComponent(e,n,a){return this.normalized&&(a=bi(a,this.array)),this.array[e*this.itemSize+n]=a,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Qh(n,this.array)),n}setX(e,n){return this.normalized&&(n=bi(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Qh(n,this.array)),n}setY(e,n){return this.normalized&&(n=bi(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=Qh(n,this.array)),n}setZ(e,n){return this.normalized&&(n=bi(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=Qh(n,this.array)),n}setW(e,n){return this.normalized&&(n=bi(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,a){return e*=this.itemSize,this.normalized&&(n=bi(n,this.array),a=bi(a,this.array)),this.array[e+0]=n,this.array[e+1]=a,this}setXYZ(e,n,a,i){return e*=this.itemSize,this.normalized&&(n=bi(n,this.array),a=bi(a,this.array),i=bi(i,this.array)),this.array[e+0]=n,this.array[e+1]=a,this.array[e+2]=i,this}setXYZW(e,n,a,i,s){return e*=this.itemSize,this.normalized&&(n=bi(n,this.array),a=bi(a,this.array),i=bi(i,this.array),s=bi(s,this.array)),this.array[e+0]=n,this.array[e+1]=a,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!==LC&&(e.usage=this.usage),e}}class OT extends Eo{constructor(e,n,a){super(new Uint16Array(e),n,a)}}class UT extends Eo{constructor(e,n,a){super(new Uint32Array(e),n,a)}}class fu extends Eo{constructor(e,n,a){super(new Float32Array(e),n,a)}}let eG=0;const ls=new ra,ty=new Vi,vd=new Pt,Ii=new lf,rm=new lf,ba=new Pt;class Rc extends mh{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:eG++}),this.uuid=sf(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(jT(e)?UT:OT)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,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,a=0){this.groups.push({start:e,count:n,materialIndex:a})}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 a=this.attributes.normal;if(a!==void 0){const s=new Zn().getNormalMatrix(e);a.applyNormalMatrix(s),a.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 ls.makeRotationFromQuaternion(e),this.applyMatrix4(ls),this}rotateX(e){return ls.makeRotationX(e),this.applyMatrix4(ls),this}rotateY(e){return ls.makeRotationY(e),this.applyMatrix4(ls),this}rotateZ(e){return ls.makeRotationZ(e),this.applyMatrix4(ls),this}translate(e,n,a){return ls.makeTranslation(e,n,a),this.applyMatrix4(ls),this}scale(e,n,a){return ls.makeScale(e,n,a),this.applyMatrix4(ls),this}lookAt(e){return ty.lookAt(e),ty.updateMatrix(),this.applyMatrix4(ty.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vd).negate(),this.translate(vd.x,vd.y,vd.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const a=[];for(let i=0,s=e.length;i<s;i++){const o=e[i];a.push(o.x,o.y,o.z||0)}this.setAttribute("position",new fu(a,3))}else{const a=Math.min(e.length,n.count);for(let i=0;i<a;i++){const s=e[i];n.setXYZ(i,s.x,s.y,s.z||0)}e.length>n.count&&Yn("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new lf);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Wr("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Pt(-1/0,-1/0,-1/0),new Pt(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let a=0,i=n.length;a<i;a++){const s=n[a];Ii.setFromBufferAttribute(s),this.morphTargetsRelative?(ba.addVectors(this.boundingBox.min,Ii.min),this.boundingBox.expandByPoint(ba),ba.addVectors(this.boundingBox.max,Ii.max),this.boundingBox.expandByPoint(ba)):(this.boundingBox.expandByPoint(Ii.min),this.boundingBox.expandByPoint(Ii.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Wr('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 Dw);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Wr("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Pt,1/0);return}if(e){const a=this.boundingSphere.center;if(Ii.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const c=n[s];rm.setFromBufferAttribute(c),this.morphTargetsRelative?(ba.addVectors(Ii.min,rm.min),Ii.expandByPoint(ba),ba.addVectors(Ii.max,rm.max),Ii.expandByPoint(ba)):(Ii.expandByPoint(rm.min),Ii.expandByPoint(rm.max))}Ii.getCenter(a);let i=0;for(let s=0,o=e.count;s<o;s++)ba.fromBufferAttribute(e,s),i=Math.max(i,a.distanceToSquared(ba));if(n)for(let s=0,o=n.length;s<o;s++){const c=n[s],d=this.morphTargetsRelative;for(let m=0,f=c.count;m<f;m++)ba.fromBufferAttribute(c,m),d&&(vd.fromBufferAttribute(e,m),ba.add(vd)),i=Math.max(i,a.distanceToSquared(ba))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&Wr('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){Wr("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const a=n.position,i=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Eo(new Float32Array(4*a.count),4));const o=this.getAttribute("tangent"),c=[],d=[];for(let K=0;K<a.count;K++)c[K]=new Pt,d[K]=new Pt;const m=new Pt,f=new Pt,p=new Pt,b=new vr,v=new vr,C=new vr,S=new Pt,F=new Pt;function w(K,B,k){m.fromBufferAttribute(a,K),f.fromBufferAttribute(a,B),p.fromBufferAttribute(a,k),b.fromBufferAttribute(s,K),v.fromBufferAttribute(s,B),C.fromBufferAttribute(s,k),f.sub(m),p.sub(m),v.sub(b),C.sub(b);const O=1/(v.x*C.y-C.x*v.y);isFinite(O)&&(S.copy(f).multiplyScalar(C.y).addScaledVector(p,-v.y).multiplyScalar(O),F.copy(p).multiplyScalar(v.x).addScaledVector(f,-C.x).multiplyScalar(O),c[K].add(S),c[B].add(S),c[k].add(S),d[K].add(F),d[B].add(F),d[k].add(F))}let A=this.groups;A.length===0&&(A=[{start:0,count:e.count}]);for(let K=0,B=A.length;K<B;++K){const k=A[K],O=k.start,I=k.count;for(let j=O,U=O+I;j<U;j+=3)w(e.getX(j+0),e.getX(j+1),e.getX(j+2))}const N=new Pt,P=new Pt,z=new Pt,D=new Pt;function T(K){z.fromBufferAttribute(i,K),D.copy(z);const B=c[K];N.copy(B),N.sub(z.multiplyScalar(z.dot(B))).normalize(),P.crossVectors(D,B);const O=P.dot(d[K])<0?-1:1;o.setXYZW(K,N.x,N.y,N.z,O)}for(let K=0,B=A.length;K<B;++K){const k=A[K],O=k.start,I=k.count;for(let j=O,U=O+I;j<U;j+=3)T(e.getX(j+0)),T(e.getX(j+1)),T(e.getX(j+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let a=this.getAttribute("normal");if(a===void 0)a=new Eo(new Float32Array(n.count*3),3),this.setAttribute("normal",a);else for(let b=0,v=a.count;b<v;b++)a.setXYZ(b,0,0,0);const i=new Pt,s=new Pt,o=new Pt,c=new Pt,d=new Pt,m=new Pt,f=new Pt,p=new Pt;if(e)for(let b=0,v=e.count;b<v;b+=3){const C=e.getX(b+0),S=e.getX(b+1),F=e.getX(b+2);i.fromBufferAttribute(n,C),s.fromBufferAttribute(n,S),o.fromBufferAttribute(n,F),f.subVectors(o,s),p.subVectors(i,s),f.cross(p),c.fromBufferAttribute(a,C),d.fromBufferAttribute(a,S),m.fromBufferAttribute(a,F),c.add(f),d.add(f),m.add(f),a.setXYZ(C,c.x,c.y,c.z),a.setXYZ(S,d.x,d.y,d.z),a.setXYZ(F,m.x,m.y,m.z)}else for(let b=0,v=n.count;b<v;b+=3)i.fromBufferAttribute(n,b+0),s.fromBufferAttribute(n,b+1),o.fromBufferAttribute(n,b+2),f.subVectors(o,s),p.subVectors(i,s),f.cross(p),a.setXYZ(b+0,f.x,f.y,f.z),a.setXYZ(b+1,f.x,f.y,f.z),a.setXYZ(b+2,f.x,f.y,f.z);this.normalizeNormals(),a.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,a=e.count;n<a;n++)ba.fromBufferAttribute(e,n),ba.normalize(),e.setXYZ(n,ba.x,ba.y,ba.z)}toNonIndexed(){function e(c,d){const m=c.array,f=c.itemSize,p=c.normalized,b=new m.constructor(d.length*f);let v=0,C=0;for(let S=0,F=d.length;S<F;S++){c.isInterleavedBufferAttribute?v=d[S]*c.data.stride+c.offset:v=d[S]*f;for(let w=0;w<f;w++)b[C++]=m[v++]}return new Eo(b,f,p)}if(this.index===null)return Yn("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new Rc,a=this.index.array,i=this.attributes;for(const c in i){const d=i[c],m=e(d,a);n.setAttribute(c,m)}const s=this.morphAttributes;for(const c in s){const d=[],m=s[c];for(let f=0,p=m.length;f<p;f++){const b=m[f],v=e(b,a);d.push(v)}n.morphAttributes[c]=d}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,d=o.length;c<d;c++){const m=o[c];n.addGroup(m.start,m.count,m.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(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 d=this.parameters;for(const m in d)d[m]!==void 0&&(e[m]=d[m]);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 a=this.attributes;for(const d in a){const m=a[d];e.data.attributes[d]=m.toJSON(e.data)}const i={};let s=!1;for(const d in this.morphAttributes){const m=this.morphAttributes[d],f=[];for(let p=0,b=m.length;p<b;p++){const v=m[p];f.push(v.toJSON(e.data))}f.length>0&&(i[d]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const a=e.index;a!==null&&this.setIndex(a.clone());const i=e.attributes;for(const m in i){const f=i[m];this.setAttribute(m,f.clone(n))}const s=e.morphAttributes;for(const m in s){const f=[],p=s[m];for(let b=0,v=p.length;b<v;b++)f.push(p[b].clone(n));this.morphAttributes[m]=f}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let m=0,f=o.length;m<f;m++){const p=o[m];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const XC=new ra,tu=new IT,Ip=new Dw,ZC=new Pt,Bp=new Pt,Op=new Pt,Up=new Pt,ny=new Pt,zp=new Pt,QC=new Pt,Gp=new Pt;class Hs extends Vi{constructor(e=new Rc,n=new uu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,a=Object.keys(n);if(a.length>0){const i=n[a[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const c=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,n){const a=this.geometry,i=a.attributes.position,s=a.morphAttributes.position,o=a.morphTargetsRelative;n.fromBufferAttribute(i,e);const c=this.morphTargetInfluences;if(s&&c){zp.set(0,0,0);for(let d=0,m=s.length;d<m;d++){const f=c[d],p=s[d];f!==0&&(ny.fromBufferAttribute(p,e),o?zp.addScaledVector(ny,f):zp.addScaledVector(ny.sub(n),f))}n.add(zp)}return n}raycast(e,n){const a=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(a.boundingSphere===null&&a.computeBoundingSphere(),Ip.copy(a.boundingSphere),Ip.applyMatrix4(s),tu.copy(e.ray).recast(e.near),!(Ip.containsPoint(tu.origin)===!1&&(tu.intersectSphere(Ip,ZC)===null||tu.origin.distanceToSquared(ZC)>(e.far-e.near)**2))&&(XC.copy(s).invert(),tu.copy(e.ray).applyMatrix4(XC),!(a.boundingBox!==null&&tu.intersectsBox(a.boundingBox)===!1)&&this._computeIntersections(e,n,tu)))}_computeIntersections(e,n,a){let i;const s=this.geometry,o=this.material,c=s.index,d=s.attributes.position,m=s.attributes.uv,f=s.attributes.uv1,p=s.attributes.normal,b=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let C=0,S=b.length;C<S;C++){const F=b[C],w=o[F.materialIndex],A=Math.max(F.start,v.start),N=Math.min(c.count,Math.min(F.start+F.count,v.start+v.count));for(let P=A,z=N;P<z;P+=3){const D=c.getX(P),T=c.getX(P+1),K=c.getX(P+2);i=Hp(this,w,e,a,m,f,p,D,T,K),i&&(i.faceIndex=Math.floor(P/3),i.face.materialIndex=F.materialIndex,n.push(i))}}else{const C=Math.max(0,v.start),S=Math.min(c.count,v.start+v.count);for(let F=C,w=S;F<w;F+=3){const A=c.getX(F),N=c.getX(F+1),P=c.getX(F+2);i=Hp(this,o,e,a,m,f,p,A,N,P),i&&(i.faceIndex=Math.floor(F/3),n.push(i))}}else if(d!==void 0)if(Array.isArray(o))for(let C=0,S=b.length;C<S;C++){const F=b[C],w=o[F.materialIndex],A=Math.max(F.start,v.start),N=Math.min(d.count,Math.min(F.start+F.count,v.start+v.count));for(let P=A,z=N;P<z;P+=3){const D=P,T=P+1,K=P+2;i=Hp(this,w,e,a,m,f,p,D,T,K),i&&(i.faceIndex=Math.floor(P/3),i.face.materialIndex=F.materialIndex,n.push(i))}}else{const C=Math.max(0,v.start),S=Math.min(d.count,v.start+v.count);for(let F=C,w=S;F<w;F+=3){const A=F,N=F+1,P=F+2;i=Hp(this,o,e,a,m,f,p,A,N,P),i&&(i.faceIndex=Math.floor(F/3),n.push(i))}}}}function tG(t,e,n,a,i,s,o,c){let d;if(e.side===ki?d=a.intersectTriangle(o,s,i,!0,c):d=a.intersectTriangle(i,s,o,e.side===Ec,c),d===null)return null;Gp.copy(c),Gp.applyMatrix4(t.matrixWorld);const m=n.ray.origin.distanceTo(Gp);return m<n.near||m>n.far?null:{distance:m,point:Gp.clone(),object:t}}function Hp(t,e,n,a,i,s,o,c,d,m){t.getVertexPosition(c,Bp),t.getVertexPosition(d,Op),t.getVertexPosition(m,Up);const f=tG(t,e,n,a,Bp,Op,Up,QC);if(f){const p=new Pt;zs.getBarycoord(QC,Bp,Op,Up,p),i&&(f.uv=zs.getInterpolatedAttribute(i,c,d,m,p,new vr)),s&&(f.uv1=zs.getInterpolatedAttribute(s,c,d,m,p,new vr)),o&&(f.normal=zs.getInterpolatedAttribute(o,c,d,m,p,new Pt),f.normal.dot(a.direction)>0&&f.normal.multiplyScalar(-1));const b={a:c,b:d,c:m,normal:new Pt,materialIndex:0};zs.getNormal(Bp,Op,Up,b.normal),f.face=b,f.barycoord=p}return f}class cf extends Rc{constructor(e=1,n=1,a=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:a,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const d=[],m=[],f=[],p=[];let b=0,v=0;C("z","y","x",-1,-1,a,n,e,o,s,0),C("z","y","x",1,-1,a,n,-e,o,s,1),C("x","z","y",1,1,e,a,n,i,o,2),C("x","z","y",1,-1,e,a,-n,i,o,3),C("x","y","z",1,-1,e,n,a,i,s,4),C("x","y","z",-1,-1,e,n,-a,i,s,5),this.setIndex(d),this.setAttribute("position",new fu(m,3)),this.setAttribute("normal",new fu(f,3)),this.setAttribute("uv",new fu(p,2));function C(S,F,w,A,N,P,z,D,T,K,B){const k=P/T,O=z/K,I=P/2,j=z/2,U=D/2,q=T+1,Y=K+1;let W=0,H=0;const J=new Pt;for(let ie=0;ie<Y;ie++){const Q=ie*O-j;for(let ve=0;ve<q;ve++){const pe=ve*k-I;J[S]=pe*A,J[F]=Q*N,J[w]=U,m.push(J.x,J.y,J.z),J[S]=0,J[F]=0,J[w]=D>0?1:-1,f.push(J.x,J.y,J.z),p.push(ve/T),p.push(1-ie/K),W+=1}}for(let ie=0;ie<K;ie++)for(let Q=0;Q<T;Q++){const ve=b+Q+q*ie,pe=b+Q+q*(ie+1),Me=b+(Q+1)+q*(ie+1),We=b+(Q+1)+q*ie;d.push(ve,pe,We),d.push(pe,Me,We),H+=6}c.addGroup(v,H,B),v+=H,b+=W}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new cf(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Zd(t){const e={};for(const n in t){e[n]={};for(const a in t[n]){const i=t[n][a];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(Yn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][a]=null):e[n][a]=i.clone():Array.isArray(i)?e[n][a]=i.slice():e[n][a]=i}}return e}function ri(t){const e={};for(let n=0;n<t.length;n++){const a=Zd(t[n]);for(const i in a)e[i]=a[i]}return e}function nG(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function zT(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:ur.workingColorSpace}const rG={clone:Zd,merge:ri};var aG=`void main() {
389	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
390}`,iG=`void main() {
391	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
392}`;class El extends js{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=aG,this.fragmentShader=iG,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Zd(e.uniforms),this.uniformsGroups=nG(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 o=this.uniforms[i].value;o&&o.isTexture?n.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?n.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?n.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?n.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?n.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?n.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?n.uniforms[i]={type:"m4",value:o.toArray()}:n.uniforms[i]={value:o}}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 a={};for(const i in this.extensions)this.extensions[i]===!0&&(a[i]=!0);return Object.keys(a).length>0&&(n.extensions=a),n}}class GT extends Vi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ra,this.projectionMatrix=new ra,this.projectionMatrixInverse=new ra,this.coordinateSystem=yo,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const oc=new Pt,e_=new vr,t_=new vr;class cs extends GT{constructor(e=50,n=1,a=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=a,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=Yb*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(jv*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Yb*2*Math.atan(Math.tan(jv*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,a){oc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(oc.x,oc.y).multiplyScalar(-e/oc.z),oc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),a.set(oc.x,oc.y).multiplyScalar(-e/oc.z)}getViewSize(e,n){return this.getViewBounds(e,e_,t_),n.subVectors(t_,e_)}setViewOffset(e,n,a,i,s,o){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=a,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(jv*.5*this.fov)/this.zoom,a=2*n,i=this.aspect*a,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const d=o.fullWidth,m=o.fullHeight;s+=o.offsetX*i/d,n-=o.offsetY*a/m,i*=o.width/d,a*=o.height/m}const c=this.filmOffset;c!==0&&(s+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,n,n-a,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const yd=-90,bd=1;class sG extends Vi{constructor(e,n,a){super(),this.type="CubeCamera",this.renderTarget=a,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new cs(yd,bd,e,n);i.layers=this.layers,this.add(i);const s=new cs(yd,bd,e,n);s.layers=this.layers,this.add(s);const o=new cs(yd,bd,e,n);o.layers=this.layers,this.add(o);const c=new cs(yd,bd,e,n);c.layers=this.layers,this.add(c);const d=new cs(yd,bd,e,n);d.layers=this.layers,this.add(d);const m=new cs(yd,bd,e,n);m.layers=this.layers,this.add(m)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[a,i,s,o,c,d]=n;for(const m of n)this.remove(m);if(e===yo)a.up.set(0,1,0),a.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),d.up.set(0,1,0),d.lookAt(0,0,-1);else if(e===Ig)a.up.set(0,-1,0),a.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),d.up.set(0,-1,0),d.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const m of n)this.add(m),m.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:a,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,c,d,m,f]=this.children,p=e.getRenderTarget(),b=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),C=e.xr.enabled;e.xr.enabled=!1;const S=a.texture.generateMipmaps;a.texture.generateMipmaps=!1,e.setRenderTarget(a,0,i),e.render(n,s),e.setRenderTarget(a,1,i),e.render(n,o),e.setRenderTarget(a,2,i),e.render(n,c),e.setRenderTarget(a,3,i),e.render(n,d),e.setRenderTarget(a,4,i),e.render(n,m),a.texture.generateMipmaps=S,e.setRenderTarget(a,5,i),e.render(n,f),e.setRenderTarget(p,b,v),e.xr.enabled=C,a.texture.needsPMREMUpdate=!0}}class HT extends Da{constructor(e=[],n=qd,a,i,s,o,c,d,m,f){super(e,n,a,i,s,o,c,d,m,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class oG extends Fu{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const a={width:e,height:e,depth:1},i=[a,a,a,a,a,a];this.texture=new HT(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace
vendor: 6,788 bytes, lines 392-427
392=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const a={uniforms:{tEquirect:{value:null}},vertexShader:`
393
394				varying vec3 vWorldDirection;
395
396				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
397
398					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
399
400				}
401
402				void main() {
403
404					vWorldDirection = transformDirection( position, modelMatrix );
405
406					#include <begin_vertex>
407					#include <project_vertex>
408
409				}
410			`,fragmentShader:`
411
412				uniform sampler2D tEquirect;
413
414				varying vec3 vWorldDirection;
415
416				#include <common>
417
418				void main() {
419
420					vec3 direction = normalize( vWorldDirection );
421
422					vec2 sampleUV = equirectUv( direction );
423
424					gl_FragColor = texture2D( tEquirect, sampleUV );
425
426				}
427			`},i=new cf(5,5,5),s=new El({name:"CubemapFromEquirect",uniforms:Zd(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,side:ki,blending:vl});s.uniforms.tEquirect.value=n;const o=new Hs(i,s),c=n.minFilter;return n.minFilter===xc&&(n.minFilter=Gi),new sG(1,10,this).update(e,o),n.minFilter=c,o.geometry.dispose(),o.material.dispose(),this}clear(e,n=!0,a=!0,i=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,a,i);e.setRenderTarget(s)}}class Wp extends Vi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const lG={type:"move"};class ry{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Wp,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 Wp,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Pt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Pt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Wp,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Pt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Pt),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 a of e.hand.values())this._getHandJoint(n,a)}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,a){let i=null,s=null,o=null;const c=this._targetRay,d=this._grip,m=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(m&&e.hand){o=!0;for(const S of e.hand.values()){const F=n.getJointPose(S,a),w=this._getHandJoint(m,S);F!==null&&(w.matrix.fromArray(F.transform.matrix),w.matrix.decompose(w.position,w.rotation,w.scale),w.matrixWorldNeedsUpdate=!0,w.jointRadius=F.radius),w.visible=F!==null}const f=m.joints["index-finger-tip"],p=m.joints["thumb-tip"],b=f.position.distanceTo(p.position),v=.02,C=.005;m.inputState.pinching&&b>v+C?(m.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!m.inputState.pinching&&b<=v-C&&(m.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else d!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,a),s!==null&&(d.matrix.fromArray(s.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,s.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(s.linearVelocity)):d.hasLinearVelocity=!1,s.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(s.angularVelocity)):d.hasAngularVelocity=!1));c!==null&&(i=n.getPose(e.targetRaySpace,a),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(lG)))}return c!==null&&(c.visible=i!==null),d!==null&&(d.visible=s!==null),m!==null&&(m.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const a=new Wp;a.matrixAutoUpdate=!1,a.visible=!1,e.joints[n.jointName]=a,e.add(a)}return e.joints[n.jointName]}}class cG extends Vi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _l,this.environmentIntensity=1,this.environmentRotation=new _l,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class uG extends Da{constructor(e=null,n=1,a=1,i,s,o,c,d,m=Wi,f=Wi,p,b){super(null,o,c,d,m,f,i,s,p,b),this.isDataTexture=!0,this.image={data:e,width:n,height:a},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ay=new Pt,dG=new Pt,hG=new Zn;class ou{constructor(e=new Pt(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,a,i){return this.normal.set(e,n,a),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,a){const i=ay.subVectors(a,n).cross(dG.
vendor: 9,381 bytes, line 427
427subVectors(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 a=e.delta(ay),i=this.normal.dot(a);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(a,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),a=this.distanceToPoint(e.end);return n<0&&a>0||a<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 a=n||hG.getNormalMatrix(e),i=this.coplanarPoint(ay).applyMatrix4(e),s=this.normal.applyMatrix3(a).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 nu=new Dw,mG=new vr(.5,.5),Vp=new Pt;class WT{constructor(e=new ou,n=new ou,a=new ou,i=new ou,s=new ou,o=new ou){this.planes=[e,n,a,i,s,o]}set(e,n,a,i,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(n),c[2].copy(a),c[3].copy(i),c[4].copy(s),c[5].copy(o),this}copy(e){const n=this.planes;for(let a=0;a<6;a++)n[a].copy(e.planes[a]);return this}setFromProjectionMatrix(e,n=yo,a=!1){const i=this.planes,s=e.elements,o=s[0],c=s[1],d=s[2],m=s[3],f=s[4],p=s[5],b=s[6],v=s[7],C=s[8],S=s[9],F=s[10],w=s[11],A=s[12],N=s[13],P=s[14],z=s[15];if(i[0].setComponents(m-o,v-f,w-C,z-A).normalize(),i[1].setComponents(m+o,v+f,w+C,z+A).normalize(),i[2].setComponents(m+c,v+p,w+S,z+N).normalize(),i[3].setComponents(m-c,v-p,w-S,z-N).normalize(),a)i[4].setComponents(d,b,F,P).normalize(),i[5].setComponents(m-d,v-b,w-F,z-P).normalize();else if(i[4].setComponents(m-d,v-b,w-F,z-P).normalize(),n===yo)i[5].setComponents(m+d,v+b,w+F,z+P).normalize();else if(n===Ig)i[5].setComponents(d,b,F,P).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(),nu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),nu.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(nu)}intersectsSprite(e){nu.center.set(0,0,0);const n=mG.distanceTo(e.center);return nu.radius=.7071067811865476+n,nu.applyMatrix4(e.matrixWorld),this.intersectsSphere(nu)}intersectsSphere(e){const n=this.planes,a=e.center,i=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(a)<i)return!1;return!0}intersectsBox(e){const n=this.planes;for(let a=0;a<6;a++){const i=n[a];if(Vp.x=i.normal.x>0?e.max.x:e.min.x,Vp.y=i.normal.y>0?e.max.y:e.min.y,Vp.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Vp)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let a=0;a<6;a++)if(n[a].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class VT extends Da{constructor(e,n,a,i,s,o,c,d,m){super(e,n,a,i,s,o,c,d,m),this.isCanvasTexture=!0,this.needsUpdate=!0}}class $T extends Da{constructor(e,n,a=Su,i,s,o,c=Wi,d=Wi,m,f=zm,p=1){if(f!==zm&&f!==Gm)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const b={width:e,height:n,depth:p};super(b,i,s,o,c,d,f,a,m),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Rw(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class KT extends Da{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Qd extends Rc{constructor(e=1,n=1,a=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:a,heightSegments:i};const s=e/2,o=n/2,c=Math.floor(a),d=Math.floor(i),m=c+1,f=d+1,p=e/c,b=n/d,v=[],C=[],S=[],F=[];for(let w=0;w<f;w++){const A=w*b-o;for(let N=0;N<m;N++){const P=N*p-s;C.push(P,-A,0),S.push(0,0,1),F.push(N/c),F.push(1-w/d)}}for(let w=0;w<d;w++)for(let A=0;A<c;A++){const N=A+m*w,P=A+m*(w+1),z=A+1+m*(w+1),D=A+1+m*w;v.push(N,P,D),v.push(P,z,D)}this.setIndex(v),this.setAttribute("position",new fu(C,3)),this.setAttribute("normal",new fu(S,3)),this.setAttribute("uv",new fu(F,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Qd(e.width,e.height,e.widthSegments,e.heightSegments)}}class fG extends js{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_z,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 pG extends js{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 iy={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 gG{constructor(e,n,a){const i=this;let s=!1,o=0,c=0,d;const m=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=a,this._abortController=null,this.itemStart=function(f){c++,s===!1&&i.onStart!==void 0&&i.onStart(f,o,c),s=!0},this.itemEnd=function(f){o++,i.onProgress!==void 0&&i.onProgress(f,o,c),o===c&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(f){i.onError!==void 0&&i.onError(f)},this.resolveURL=function(f){return d?d(f):f},this.setURLModifier=function(f){return d=f,this},this.addHandler=function(f,p){return m.push(f,p),this},this.removeHandler=function(f){const p=m.indexOf(f);return p!==-1&&m.splice(p,2),this},this.getHandler=function(f){for(let p=0,b=m.length;p<b;p+=2){const v=m[p],C=m[p+1];if(v.global&&(v.lastIndex=0),v.test(f))return C}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const xG=new gG;class jw{constructor(e){this.manager=e!==void 0?e:xG,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const a=this;return new Promise(function(i,s){a.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}abort(){return this}}jw.DEFAULT_MATERIAL_NAME="__DEFAULT";const wd=new WeakMap;class vG extends jw{constructor(e){super(e)}load(e,n,a,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=iy.get(`image:${e}`);if(o!==void 0){if(o.complete===!0)s.manager.itemStart(e),setTimeout(function(){n&&n(o),s.manager.itemEnd(e)},0);else{let p=wd.get(o);p===void 0&&(p=[],wd.set(o,p)),p.push({onLoad:n,onError:i})}return o}const c=Hm("img");function d(){f(),n&&n(this);const p=wd.get(this)||[];for(let b=0;b<p.length;b++){const v=p[b];v.onLoad&&v.onLoad(this)}wd.delete(this),s.manager.itemEnd(e)}function m(p){f(),i&&i(p),iy.remove(`image:${e}`);const b=wd.get(this)||[];for(let v=0;v<b.length;v++){const C=b[v];C.onError&&C.onError(p)}wd.delete(this),s.manager.itemError(e),s.manager.itemEnd(e)}function f(){c.removeEventListener("load",d,!1),c.removeEventListener("error",m,!1)}return c.addEventListener("load",d,!1),c.addEventListener("error",m,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),iy.add(`image:${e}`,c),s.manager.itemStart(e),c.src=e,c}}class yG extends jw{constructor(e){super(e)}load(e,n,a,i){const s=new Da,o=new vG(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,n!==void 0&&n(s)},a,i),s}}class bG extends GT{constructor(e=-1,n=1,a=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
427phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=a,this.bottom=i,this.near=s,this.far=o,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,a,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=a,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),a=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=a-e,o=a+e,c=i+n,d=i-n;if(this.view!==null&&this.view.enabled){const m=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=m*this.view.offsetX,o=s+m*this.view.width,c-=f*this.view.offsetY,d=c-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,d,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class wG extends cs{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const n_=new ra;class SG{constructor(e,n,a=0,i=1/0){this.ray=new IT(e,n),this.near=a,this.far=i,this.camera=null,this.layers=new Pw,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):Wr("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return n_.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(n_),this}intersectObject(e,n=!0,a=[]){return qb(e,this,a,n),a.sort(r_),a}intersectObjects(e,n=!0,a=[]){for(let i=0,s=e.length;i<s;i++)qb(e[i],this,a,n);return a.sort(r_),a}}function r_(t,e){return t.distance-e.distance}function qb(t,e,n,a){let i=!0;if(t.layers.test(e.layers)&&t.raycast(e,n)===!1&&(i=!1),i===!0&&a===!0){const s=t.children;for(let o=0,c=s.length;o<c;o++)qb(s[o],e,n,!0)}}function a_(t,e,n,a){const i=FG(a);switch(n){case MT:return t*e;case DT:return t*e/i.components*i.byteLength;case Aw:return t*e/i.components*i.byteLength;case Nw:return t*e*2/i.components*i.byteLength;case Tw:return t*e*2/i.components*i.byteLength;case RT:return t*e*3/i.components*i.byteLength;case Gs:return t*e*4/i.components*i.byteLength;case Mw:return t*e*4/i.components*i.byteLength;case mg:case fg:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case pg:case gg:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case wb:case Fb:return Math.max(t,16)*Math.max(e,8)/4;case bb:case Sb:return Math.max(t,8)*Math.max(e,8)/2;case Cb:case _b:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Eb:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case kb:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Ab:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Nb:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Tb:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case Mb:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Rb:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case Db:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case Pb:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case jb:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case Lb:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case Ib:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case Bb:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case Ob:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case Ub:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case zb:case Gb:case Hb:return Math.ceil(t/4)*Math.ceil(e/4)*16;case Wb:case Vb:return Math.ceil(t/4)*Math.ceil(e/4)*8;case $b:case Kb:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function FG(t){switch(t){case Cl:case kT:return{byteLength:1,components:1};case Om:case AT:case hh:return{byteLength:2,components:1};case Ew:case kw:return{byteLength:2,components:4};case Su:case _w:case pl:return{byteLength:4,components:1};case NT:case TT:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Cw}}));typeof window<"u"&&(window.__THREE__?Yn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Cw);
vendor: 4,490 bytes, lines 427-486
427function YT(){let t=null,e=!1,n=null,a=null;function i(s,o){n(s,o),a=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(a=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(a),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function CG(t){const e=new WeakMap;function n(c,d){const m=c.array,f=c.usage,p=m.byteLength,b=t.createBuffer();t.bindBuffer(d,b),t.bufferData(d,m,f),c.onUploadCallback();let v;if(m instanceof Float32Array)v=t.FLOAT;else if(typeof Float16Array<"u"&&m instanceof Float16Array)v=t.HALF_FLOAT;else if(m instanceof Uint16Array)c.isFloat16BufferAttribute?v=t.HALF_FLOAT:v=t.UNSIGNED_SHORT;else if(m instanceof Int16Array)v=t.SHORT;else if(m instanceof Uint32Array)v=t.UNSIGNED_INT;else if(m instanceof Int32Array)v=t.INT;else if(m instanceof Int8Array)v=t.BYTE;else if(m instanceof Uint8Array)v=t.UNSIGNED_BYTE;else if(m instanceof Uint8ClampedArray)v=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+m);return{buffer:b,type:v,bytesPerElement:m.BYTES_PER_ELEMENT,version:c.version,size:p}}function a(c,d,m){const f=d.array,p=d.updateRanges;if(t.bindBuffer(m,c),p.length===0)t.bufferSubData(m,0,f);else{p.sort((v,C)=>v.start-C.start);let b=0;for(let v=1;v<p.length;v++){const C=p[b],S=p[v];S.start<=C.start+C.count+1?C.count=Math.max(C.count,S.start+S.count-C.start):(++b,p[b]=S)}p.length=b+1;for(let v=0,C=p.length;v<C;v++){const S=p[v];t.bufferSubData(m,S.start*f.BYTES_PER_ELEMENT,f,S.start,S.count)}d.clearUpdateRanges()}d.onUploadCallback()}function i(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const d=e.get(c);d&&(t.deleteBuffer(d.buffer),e.delete(c))}function o(c,d){if(c.isInterleavedBufferAttribute&&(c=c.data),c.isGLBufferAttribute){const f=e.get(c);(!f||f.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}const m=e.get(c);if(m===void 0)e.set(c,n(c,d));else if(m.version<c.version){if(m.size!==c.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.");a(m.buffer,c,d),m.version=c.version}}return{get:i,remove:s,update:o}}var _G=`#ifdef USE_ALPHAHASH
428	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
429#endif`,EG=`#ifdef USE_ALPHAHASH
430	const float ALPHA_HASH_SCALE = 0.05;
431	float hash2D( vec2 value ) {
432		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
433	}
434	float hash3D( vec3 value ) {
435		return hash2D( vec2( hash2D( value.xy ), value.z ) );
436	}
437	float getAlphaHashThreshold( vec3 position ) {
438		float maxDeriv = max(
439			length( dFdx( position.xyz ) ),
440			length( dFdy( position.xyz ) )
441		);
442		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
443		vec2 pixScales = vec2(
444			exp2( floor( log2( pixScale ) ) ),
445			exp2( ceil( log2( pixScale ) ) )
446		);
447		vec2 alpha = vec2(
448			hash3D( floor( pixScales.x * position.xyz ) ),
449			hash3D( floor( pixScales.y * position.xyz ) )
450		);
451		float lerpFactor = fract( log2( pixScale ) );
452		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
453		float a = min( lerpFactor, 1.0 - lerpFactor );
454		vec3 cases = vec3(
455			x * x / ( 2.0 * a * ( 1.0 - a ) ),
456			( x - 0.5 * a ) / ( 1.0 - a ),
457			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
458		);
459		float threshold = ( x < ( 1.0 - a ) )
460			? ( ( x < a ) ? cases.x : cases.y )
461			: cases.z;
462		return clamp( threshold , 1.0e-6, 1.0 );
463	}
464#endif`,kG=`#ifdef USE_ALPHAMAP
465	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
466#endif`,AG=`#ifdef USE_ALPHAMAP
467	uniform sampler2D alphaMap;
468#endif`,NG=`#ifdef USE_ALPHATEST
469	#ifdef ALPHA_TO_COVERAGE
470	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
471	if ( diffuseColor.a == 0.0 ) discard;
472	#else
473	if ( diffuseColor.a < alphaTest ) discard;
474	#endif
475#endif`,TG=`#ifdef USE_ALPHATEST
476	uniform float alphaTest;
477#endif`,MG=`#ifdef USE_AOMAP
478	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
479	reflectedLight.indirectDiffuse *= ambientOcclusion;
480	#if defined( USE_CLEARCOAT ) 
481		clearcoatSpecularIndirect *= ambientOcclusion;
482	#endif
483	#if defined( USE_SHEEN ) 
484		sheenSpecularIndirect *= ambientOcclusion;
485	#endif
486	#if defined( USE_ENVMAP ) && defined( STANDARD )
487		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
488		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
489	#endif
490#endif`,RG=`#ifdef USE_AOMAP
491	uniform sampler2D aoMap;
492	uniform float aoMapIntensity;
493#endif`,DG=`#ifdef USE_BATCHING
494	#if ! defined( GL_ANGLE_multi_draw )
495	#define gl_DrawID _gl_DrawID
496	uniform int _gl_DrawID;
497	#endif
498	uniform highp sampler2D batchingTexture;
499	uniform highp usampler2D batchingIdTexture;
500	mat4 getBatchingMatrix( const in float i ) {
501		int size = textureSize( batchingTexture, 0 ).x;
502		int j = int( i ) * 4;
503		int x = j % size;
504		int y = j / size;
505		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
506		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
507		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
508		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
509		return mat4( v1, v2, v3, v4 );
510	}
511	float getIndirectIndex( const in int i ) {
512		int size = textureSize( batchingIdTexture, 0 ).x;
513		int x = i % size;
514		int y = i / size;
515		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
516	}
517#endif
518#ifdef USE_BATCHING_COLOR
519	uniform sampler2D batchingColorTexture;
520	vec3 getBatchingColor( const in float i ) {
521		int size = textureSize( batchingColorTexture, 0 ).x;
522		int j = int( i );
523		int x = j % size;
524		int y = j / size;
525		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
526	}
527#endif`,PG=`#ifdef USE_BATCHING
528	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
529#endif`,jG=`vec3 transformed = vec3( position );
530#ifdef USE_ALPHAHASH
531	vPosition = vec3( position );
532#endif`,LG=`vec3 objectNormal = vec3( normal );
533#ifdef USE_TANGENT
534	vec3 objectTangent = vec3( tangent.xyz );
535#endif`,IG=`float G_BlinnPhong_Implicit( ) {
536	return 0.25;
537}
538float D_BlinnPhong( const in float shininess, const in float dotNH ) {
539	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
540}
541vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
542	vec3 halfDir = normalize( lightDir + viewDir );
543	float dotNH = saturate( dot( normal, halfDir ) );
544	float dotVH = saturate( dot( viewDir, halfDir ) );
545	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
546	float G = G_BlinnPhong_Implicit( );
547	float D = D_BlinnPhong( shininess, dotNH );
548	return F * ( G * D );
549} // validated`,BG=`#ifdef USE_IRIDESCENCE
550	const mat3 XYZ_TO_REC709 = mat3(
551		 3.2404542, -0.9692660,  0.0556434,
552		-1.5371385,  1.8760108, -0.2040259,
553		-0.4985314,  0.0415560,  1.0572252
554	);
555	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
556		vec3 sqrtF0 = sqrt( fresnel0 );
557		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
558	}
559	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
560		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
561	}
562	float IorToFresnel0( float transmittedIor, float incidentIor ) {
563		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
564	}
565	vec3 evalSensitivity( float OPD, vec3 shift ) {
566		float phase = 2.0 * PI * OPD * 1.0e-9;
567		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
568		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
569		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
570		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
571		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 ) );
572		xyz /= 1.0685e-7;
573		vec3 rgb = XYZ_TO_REC709 * xyz;
574		return rgb;
575	}
576	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
577		vec3 I;
578		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
579		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
580		float cosTheta2Sq = 1.0 - sinTheta2Sq;
581		if ( cosTheta2Sq < 0.0 ) {
582			return vec3( 1.0 );
583		}
584		float cosTheta2 = sqrt( cosTheta2Sq );
585		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
586		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
587		float T121 = 1.0 - R12;
588		float phi12 = 0.0;
589		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
590		float phi21 = PI - phi12;
591		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
592		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
593		vec3 phi23 = vec3( 0.0 );
594		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
595		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
596		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
597		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
598		vec3 phi = vec3( phi21 ) + phi23;
599		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
600		vec3 r123 = sqrt( R123 );
601		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
602		vec3 C0 = R12 + Rs;
603		I = C0;
604		vec3 Cm = Rs - T121;
605		for ( int m = 1; m <= 2; ++ m ) {
606			Cm *= r123;
607			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
608			I += Cm * Sm;
609		}
610		return max( I, vec3( 0.0 ) );
611	}
612#endif`,OG=`#ifdef USE_BUMPMAP
613	uniform sampler2D bumpMap;
614	uniform float bumpScale;
615	vec2 dHdxy_fwd() {
616		vec2 dSTdx = dFdx( vBumpMapUv );
617		vec2 dSTdy = dFdy( vBumpMapUv );
618		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
619		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
620		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
621		return vec2( dBx, dBy );
622	}
623	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
624		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
625		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
626		vec3 vN = surf_norm;
627		vec3 R1 = cross( vSigmaY, vN );
628		vec3 R2 = cross( vN, vSigmaX );
629		float fDet = dot( vSigmaX, R1 ) * faceDirection;
630		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
631		return normalize( abs( fDet ) * surf_norm - vGrad );
632	}
633#endif`,UG=`#if NUM_CLIPPING_PLANES > 0
634	vec4 plane;
635	#ifdef ALPHA_TO_COVERAGE
636		float distanceToPlane, distanceGradient;
637		float clipOpacity = 1.0;
638		#pragma unroll_loop_start
639		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
640			plane = clippingPlanes[ i ];
641			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
642			distanceGradient = fwidth( distanceToPlane ) / 2.0;
643			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
644			if ( clipOpacity == 0.0 ) discard;
645		}
646		#pragma unroll_loop_end
647		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
648			float unionClipOpacity = 1.0;
649			#pragma unroll_loop_start
650			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
651				plane = clippingPlanes[ i ];
652				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
653				distanceGradient = fwidth( distanceToPlane ) / 2.0;
654				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
655			}
656			#pragma unroll_loop_end
657			clipOpacity *= 1.0 - unionClipOpacity;
658		#endif
659		diffuseColor.a *= clipOpacity;
660		if ( diffuseColor.a == 0.0 ) discard;
661	#else
662		#pragma unroll_loop_start
663		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
664			plane = clippingPlanes[ i ];
665			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
666		}
667		#pragma unroll_loop_end
668		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
669			bool clipped = true;
670			#pragma unroll_loop_start
671			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
672				plane = clippingPlanes[ i ];
673				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
674			}
675			#pragma unroll_loop_end
676			if ( clipped ) discard;
677		#endif
678	#endif
679#endif`,zG=`#if NUM_CLIPPING_PLANES > 0
680	varying vec3 vClipPosition;
681	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
682#endif`,GG=`#if NUM_CLIPPING_PLANES > 0
683	varying vec3 vClipPosition;
684#endif`,HG=`#if NUM_CLIPPING_PLANES > 0
685	vClipPosition = - mvPosition.xyz;
686#endif`,WG=`#if defined( USE_COLOR_ALPHA )
687	diffuseColor *= vColor;
688#elif defined( USE_COLOR )
689	diffuseColor.rgb *= vColor;
690#endif`,VG=`#if defined( USE_COLOR_ALPHA )
691	varying vec4 vColor;
692#elif defined( USE_COLOR )
693	varying vec3 vColor;
694#endif`,$G=`#if defined( USE_COLOR_ALPHA )
695	varying vec4 vColor;
696#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
697	varying vec3 vColor;
698#endif`,KG=`#if defined( USE_COLOR_ALPHA )
699	vColor = vec4( 1.0 );
700#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
701	vColor = vec3( 1.0 );
702#endif
703#ifdef USE_COLOR
704	vColor *= color;
705#endif
706#ifdef USE_INSTANCING_COLOR
707	vColor.xyz *= instanceColor.xyz;
708#endif
709#ifdef USE_BATCHING_COLOR
710	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
711	vColor.xyz *= batchingColor.xyz;
712#endif`,YG=`#define PI 3.141592653589793
713#define PI2 6.283185307179586
714#define PI_HALF 1.5707963267948966
715#define RECIPROCAL_PI 0.3183098861837907
716#define RECIPROCAL_PI2 0.15915494309189535
717#define EPSILON 1e-6
718#ifndef saturate
719#define saturate( a ) clamp( a, 0.0, 1.0 )
720#endif
721#define whiteComplement( a ) ( 1.0 - saturate( a ) )
722float pow2( const in float x ) { return x*x; }
723vec3 pow2( const in vec3 x ) { return x*x; }
724float pow3( const in float x ) { return x*x*x; }
725float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
726float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
727float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
728highp float rand( const in vec2 uv ) {
729	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
730	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
731	return fract( sin( sn ) * c );
732}
733#ifdef HIGH_PRECISION
734	float precisionSafeLength( vec3 v ) { return length( v ); }
735#else
736	float precisionSafeLength( vec3 v ) {
737		float maxComponent = max3( abs( v ) );
738		return length( v / maxComponent ) * maxComponent;
739	}
740#endif
741struct IncidentLight {
742	vec3 color;
743	vec3 direction;
744	bool visible;
745};
746struct ReflectedLight {
747	vec3 directDiffuse;
748	vec3 directSpecular;
749	vec3 indirectDiffuse;
750	vec3 indirectSpecular;
751};
752#ifdef USE_ALPHAHASH
753	varying vec3 vPosition;
754#endif
755vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
756	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
757}
758vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
759	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
760}
761bool isPerspectiveMatrix( mat4 m ) {
762	return m[ 2 ][ 3 ] == - 1.0;
763}
764vec2 equirectUv( in vec3 dir ) {
765	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
766	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
767	return vec2( u, v );
768}
769vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
770	return RECIPROCAL_PI * diffuseColor;
771}
772vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
773	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
774	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
775}
776float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
777	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
778	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
779} // validated`,qG=`#ifdef ENVMAP_TYPE_CUBE_UV
780	#define cubeUV_minMipLevel 4.0
781	#define cubeUV_minTileSize 16.0
782	float getFace( vec3 direction ) {
783		vec3 absDirection = abs( direction );
784		float face = - 1.0;
785		if ( absDirection.x > absDirection.z ) {
786			if ( absDirection.x > absDirection.y )
787				face = direction.x > 0.0 ? 0.0 : 3.0;
788			else
789				face = direction.y > 0.0 ? 1.0 : 4.0;
790		} else {
791			if ( absDirection.z > absDirection.y )
792				face = direction.z > 0.0 ? 2.0 : 5.0;
793			else
794				face = direction.y > 0.0 ? 1.0 : 4.0;
795		}
796		return face;
797	}
798	vec2 getUV( vec3 direction, float face ) {
799		vec2 uv;
800		if ( face == 0.0 ) {
801			uv = vec2( direction.z, direction.y ) / abs( direction.x );
802		} else if ( face == 1.0 ) {
803			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
804		} else if ( face == 2.0 ) {
805			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
806		} else if ( face == 3.0 ) {
807			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
808		} else if ( face == 4.0 ) {
809			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
810		} else {
811			uv = vec2( direction.x, direction.y ) / abs( direction.z );
812		}
813		return 0.5 * ( uv + 1.0 );
814	}
815	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
816		float face = getFace( direction );
817		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
818		mipInt = max( mipInt, cubeUV_minMipLevel );
819		float faceSize = exp2( mipInt );
820		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
821		if ( face > 2.0 ) {
822			uv.y += faceSize;
823			face -= 3.0;
824		}
825		uv.x += face * faceSize;
826		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
827		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
828		uv.x *= CUBEUV_TEXEL_WIDTH;
829		uv.y *= CUBEUV_TEXEL_HEIGHT;
830		#ifdef texture2DGradEXT
831			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
832		#else
833			return texture2D( envMap, uv ).rgb;
834		#endif
835	}
836	#define cubeUV_r0 1.0
837	#define cubeUV_m0 - 2.0
838	#define cubeUV_r1 0.8
839	#define cubeUV_m1 - 1.0
840	#define cubeUV_r4 0.4
841	#define cubeUV_m4 2.0
842	#define cubeUV_r5 0.305
843	#define cubeUV_m5 3.0
844	#define cubeUV_r6 0.21
845	#define cubeUV_m6 4.0
846	float roughnessToMip( float roughness ) {
847		float mip = 0.0;
848		if ( roughness >= cubeUV_r1 ) {
849			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
850		} else if ( roughness >= cubeUV_r4 ) {
851			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
852		} else if ( roughness >= cubeUV_r5 ) {
853			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
854		} else if ( roughness >= cubeUV_r6 ) {
855			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
856		} else {
857			mip = - 2.0 * log2( 1.16 * roughness );		}
858		return mip;
859	}
860	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
861		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
862		float mipF = fract( mip );
863		float mipInt = floor( mip );
864		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
865		if ( mipF == 0.0 ) {
866			return vec4( color0, 1.0 );
867		} else {
868			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
869			return vec4( mix( color0, color1, mipF ), 1.0 );
870		}
871	}
872#endif`,JG=`vec3 transformedNormal = objectNormal;
873#ifdef USE_TANGENT
874	vec3 transformedTangent = objectTangent;
875#endif
876#ifdef USE_BATCHING
877	mat3 bm = mat3( batchingMatrix );
878	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
879	transformedNormal = bm * transformedNormal;
880	#ifdef USE_TANGENT
881		transformedTangent = bm * transformedTangent;
882	#endif
883#endif
884#ifdef USE_INSTANCING
885	mat3 im = mat3( instanceMatrix );
886	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
887	transformedNormal = im * transformedNormal;
888	#ifdef USE_TANGENT
889		transformedTangent = im * transformedTangent;
890	#endif
891#endif
892transformedNormal = normalMatrix * transformedNormal;
893#ifdef FLIP_SIDED
894	transformedNormal = - transformedNormal;
895#endif
896#ifdef USE_TANGENT
897	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
898	#ifdef FLIP_SIDED
899		transformedTangent = - transformedTangent;
900	#endif
901#endif`,XG=`#ifdef USE_DISPLACEMENTMAP
902	uniform sampler2D displacementMap;
903	uniform float displacementScale;
904	uniform float displacementBias;
905#endif`,ZG=`#ifdef USE_DISPLACEMENTMAP
906	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
906placementBias );
907#endif`,QG=`#ifdef USE_EMISSIVEMAP
908	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
909	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
910		emissiveColor = sRGBTransferEOTF( emissiveColor );
911	#endif
912	totalEmissiveRadiance *= emissiveColor.rgb;
913#endif`,eH=`#ifdef USE_EMISSIVEMAP
914	uniform sampler2D emissiveMap;
915#endif`,tH="gl_FragColor = linearToOutputTexel( gl_FragColor );",nH=`vec4 LinearTransferOETF( in vec4 value ) {
916	return value;
917}
918vec4 sRGBTransferEOTF( in vec4 value ) {
919	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
920}
921vec4 sRGBTransferOETF( in vec4 value ) {
922	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 );
923}`,rH=`#ifdef USE_ENVMAP
924	#ifdef ENV_WORLDPOS
925		vec3 cameraToFrag;
926		if ( isOrthographic ) {
927			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
928		} else {
929			cameraToFrag = normalize( vWorldPosition - cameraPosition );
930		}
931		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
932		#ifdef ENVMAP_MODE_REFLECTION
933			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
934		#else
935			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
936		#endif
937	#else
938		vec3 reflectVec = vReflect;
939	#endif
940	#ifdef ENVMAP_TYPE_CUBE
941		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
942	#else
943		vec4 envColor = vec4( 0.0 );
944	#endif
945	#ifdef ENVMAP_BLENDING_MULTIPLY
946		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
947	#elif defined( ENVMAP_BLENDING_MIX )
948		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
949	#elif defined( ENVMAP_BLENDING_ADD )
950		outgoingLight += envColor.xyz * specularStrength * reflectivity;
951	#endif
952#endif`,aH=`#ifdef USE_ENVMAP
953	uniform float envMapIntensity;
954	uniform float flipEnvMap;
955	uniform mat3 envMapRotation;
956	#ifdef ENVMAP_TYPE_CUBE
957		uniform samplerCube envMap;
958	#else
959		uniform sampler2D envMap;
960	#endif
961#endif`,iH=`#ifdef USE_ENVMAP
962	uniform float reflectivity;
963	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
964		#define ENV_WORLDPOS
965	#endif
966	#ifdef ENV_WORLDPOS
967		varying vec3 vWorldPosition;
968		uniform float refractionRatio;
969	#else
970		varying vec3 vReflect;
971	#endif
972#endif`,sH=`#ifdef USE_ENVMAP
973	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
974		#define ENV_WORLDPOS
975	#endif
976	#ifdef ENV_WORLDPOS
977		
978		varying vec3 vWorldPosition;
979	#else
980		varying vec3 vReflect;
981		uniform float refractionRatio;
982	#endif
983#endif`,oH=`#ifdef USE_ENVMAP
984	#ifdef ENV_WORLDPOS
985		vWorldPosition = worldPosition.xyz;
986	#else
987		vec3 cameraToVertex;
988		if ( isOrthographic ) {
989			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
990		} else {
991			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
992		}
993		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
994		#ifdef ENVMAP_MODE_REFLECTION
995			vReflect = reflect( cameraToVertex, worldNormal );
996		#else
997			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
998		#endif
999	#endif
1000#endif`,lH=`#ifdef USE_FOG
1001	vFogDepth = - mvPosition.z;
1002#endif`,cH=`#ifdef USE_FOG
1003	varying float vFogDepth;
1004#endif`,uH=`#ifdef USE_FOG
1005	#ifdef FOG_EXP2
1006		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
1007	#else
1008		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
1009	#endif
1010	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
1011#endif`,dH=`#ifdef USE_FOG
1012	uniform vec3 fogColor;
1013	varying float vFogDepth;
1014	#ifdef FOG_EXP2
1015		uniform float fogDensity;
1016	#else
1017		uniform float fogNear;
1018		uniform float fogFar;
1019	#endif
1020#endif`,hH=`#ifdef USE_GRADIENTMAP
1021	uniform sampler2D gradientMap;
1022#endif
1023vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
1024	float dotNL = dot( normal, lightDirection );
1025	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
1026	#ifdef USE_GRADIENTMAP
1027		return vec3( texture2D( gradientMap, coord ).r );
1028	#else
1029		vec2 fw = fwidth( coord ) * 0.5;
1030		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
1031	#endif
1032}`,mH=`#ifdef USE_LIGHTMAP
1033	uniform sampler2D lightMap;
1034	uniform float lightMapIntensity;
1035#endif`,fH=`LambertMaterial material;
1036material.diffuseColor = diffuseColor.rgb;
1037material.specularStrength = specularStrength;`,pH=`varying vec3 vViewPosition;
1038struct LambertMaterial {
1039	vec3 diffuseColor;
1040	float specularStrength;
1041};
1042void 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 ) {
1043	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1044	vec3 irradiance = dotNL * directLight.color;
1045	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1046}
1047void 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 ) {
1048	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1049}
1050#define RE_Direct				RE_Direct_Lambert
1051#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,gH=`uniform bool receiveShadow;
1052uniform vec3 ambientLightColor;
1053#if defined( USE_LIGHT_PROBES )
1054	uniform vec3 lightProbe[ 9 ];
1055#endif
1056vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
1057	float x = normal.x, y = normal.y, z = normal.z;
1058	vec3 result = shCoefficients[ 0 ] * 0.886227;
1059	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
1060	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
1061	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
1062	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
1063	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
1064	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
1065	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
1066	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
1067	return result;
1068}
1069vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
1070	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
1071	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
1072	return irradiance;
1073}
1074vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
1075	vec3 irradiance = ambientLightColor;
1076	return irradiance;
1077}
1078float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
1079	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
1080	if ( cutoffDistance > 0.0 ) {
1081		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
1082	}
1083	return distanceFalloff;
1084}
1085float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
1086	return smoothstep( coneCosine, penumbraCosine, angleCosine );
1087}
1088#if NUM_DIR_LIGHTS > 0
1089	struct DirectionalLight {
1090		vec3 direction;
1091		vec3 color;
1092	};
1093	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
1094	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
1095		light.color = directionalLight.color;
1096		light.direction = directionalLight.direction;
1097		light.visible = true;
1098	}
1099#endif
1100#if NUM_POINT_LIGHTS > 0
1101	struct PointLight {
1102		vec3 position;
1103		vec3 color;
1104		float distance;
1105		float decay;
1106	};
1107	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
1108	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
1109		vec3 lVector = pointLight.position - geometryPosition;
1110		light.direction = normalize( lVector );
1111		float lightDistance = length( lVector );
1112		light.color = pointLight.color;
1113		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
1114		light.visible = ( light.color != vec3( 0.0 ) );
1115	}
1116#endif
1117#if NUM_SPOT_LIGHTS > 0
1118	struct SpotLight {
1119		vec3 position;
1120		vec3 direction;
1121		vec3 color;
1122		float distance;
1123		float decay;
1124		float coneCos;
1125		float penumbraCos;
1126	};
1127	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
1128	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
1129		vec3 lVector = spotLight.position - geometryPosition;
1130		light.direction = normalize( lVector );
1131		float angleCos = dot( light.direction, spotLight.direction );
1132		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
1133		if ( spotAttenuation > 0.0 ) {
1134			float lightDistance = length( lVector );
1135			light.color = spotLight.color * spotAttenuation;
1136			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
1137			light.visible = ( light.color != vec3( 0.0 ) );
1138		} else {
1139			light.color = vec3( 0.0 );
1140			light.visible = false;
1141		}
1142	}
1143#endif
1144#if NUM_RECT_AREA_LIGHTS > 0
1145	struct RectAreaLight {
1146		vec3 color;
1147		vec3 position;
1148		vec3 halfWidth;
1149		vec3 halfHeight;
1150	};
1151	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
1152	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
1153#endif
1154#if NUM_HEMI_LIGHTS > 0
1155	struct HemisphereLight {
1156		vec3 direction;
1157		vec3 skyColor;
1158		vec3 groundColor;
1159	};
1160	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
1161	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
1162		float dotNL = dot( normal, hemiLight.direction );
1163		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
1164		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
1165		return irradiance;
1166	}
1167#endif`,xH=`#ifdef USE_ENVMAP
1168	vec3 getIBLIrradiance( const in vec3 normal ) {
1169		#ifdef ENVMAP_TYPE_CUBE_UV
1170			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
1171			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
1172			return PI * envMapColor.rgb * envMapIntensity;
1173		#else
1174			return vec3( 0.0 );
1175		#endif
1176	}
1177	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
1178		#ifdef ENVMAP_TYPE_CUBE_UV
1179			vec3 reflectVec = reflect( - viewDir, normal );
1180			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
1181			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
1182			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
1183			return envMapColor.rgb * envMapIntensity;
1184		#else
1185			return vec3( 0.0 );
1186		#endif
1187	}
1188	#ifdef USE_ANISOTROPY
1189		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
1190			#ifdef ENVMAP_TYPE_CUBE_UV
1191				vec3 bentNormal = cross( bitangent, viewDir );
1192				bentNormal = normalize( cross( bentNormal, bitangent ) );
1193				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
1194				return getIBLRadiance( viewDir, bentNormal, roughness );
1195			#else
1196				return vec3( 0.0 );
1197			#endif
1198		}
1199	#endif
1200#endif`,vH=`ToonMaterial material;
1201material.diffuseColor = diffuseColor.rgb;`,yH=`varying vec3 vViewPosition;
1202struct ToonMaterial {
1203	vec3 diffuseColor;
1204};
1205void 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 ) {
1206	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
1207	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1208}
1209void 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 ) {
1210	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1211}
1212#define RE_Direct				RE_Direct_Toon
1213#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,bH=`BlinnPhongMaterial material;
1214material.diffuseColor = diffuseColor.rgb;
1215material.specularColor = specular;
1216material.specularShininess = shininess;
1217material.specularStrength = specularStrength;`,wH=`varying vec3 vViewPosition;
1218struct BlinnPhongMaterial {
1219	vec3 diffuseColor;
1220	vec3 specularColor;
1221	float specularShininess;
1222	float specularStrength;
1223};
1224void 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 ) {
1225	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1226	vec3 irradiance = dotNL * directLight.color;
1227	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1228	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
1229}
1230void 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 ) {
1231	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1232}
1233#define RE_Direct				RE_Direct_BlinnPhong
1234#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,SH=`PhysicalMaterial material;
1235material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
1236vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
1237float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
1238material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
1239material.roughness = min( material.roughness, 1.0 );
1240#ifdef IOR
1241	material.ior = ior;
1242	#ifdef USE_SPECULAR
1243		float specularIntensityFactor = specularIntensity;
1244		vec3 specularColorFactor = specularColor;
1245		#ifdef USE_SPECULAR_COLORMAP
1246			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
1247		#endif
1248		#ifdef USE_SPECULAR_INTENSITYMAP
1249			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
1250		#endif
1251		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
1252	#else
1253		float specularIntensityFactor = 1.0;
1254		vec3 specularColorFactor = vec3( 1.0 );
1255		material.specularF90 = 1.0;
1256	#endif
1257	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
1258#else
1259	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
1260	material.specularF90 = 1.0;
1261#endif
1262#ifdef USE_CLEARCOAT
1263	material.clearcoat = clearcoat;
1264	material.clearcoatRoughness = clearcoatRoughness;
1265	material.clearcoatF0 = vec3( 0.04 );
1266	material.clearcoatF90 = 1.0;
1267	#ifdef USE_CLEARCOATMAP
1268		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
1269	#endif
1270	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1271		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
1272	#endif
1273	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
1274	material.clearcoatRoughness += geometryRoughness;
1275	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
1276#endif
1277#ifdef USE_DISPERSION
1278	material.dispersion = dispersion;
1279#endif
1280#ifdef USE_IRIDESCENCE
1281	material.iridescence = iridescence;
1282	material.iridescenceIOR = iridescenceIOR;
1283	#ifdef USE_IRIDESCENCEMAP
1284		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
1285	#endif
1286	#ifdef USE_IRIDESCENCE_THICKNESSMAP
1287		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
1288	#else
1289		material.iridescenceThickness = iridescenceThicknessMaximum;
1290	#endif
1291#endif
1292#ifdef USE_SHEEN
1293	material.sheenColor = sheenColor;
1294	#ifdef USE_SHEEN_COLORMAP
1295		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
1296	#endif
1297	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
1298	#ifdef USE_SHEEN_ROUGHNESSMAP
1299		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
1300	#endif
1301#endif
1302#ifdef USE_ANISOTROPY
1303	#ifdef USE_ANISOTROPYMAP
1304		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
1305		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
1306		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
1307	#else
1308		vec2 anisotropyV = anisotropyVector;
1309	#endif
1310	material.anisotropy = length( anisotropyV );
1311	if( material.anisotropy == 0.0 ) {
1312		anisotropyV = vec2( 1.0, 0.0 );
1313	} else {
1314		anisotropyV /= material.anisotropy;
1315		material.anisotropy = saturate( material.anisotropy );
1316	}
1317	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1318	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
1319	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
1320#endif`,FH=`uniform sampler2D dfgLUT;
1321struct PhysicalMaterial {
1322	vec3 diffuseColor;
1323	float roughness;
1324	vec3 specularColor;
1325	float specularF90;
1326	float dispersion;
1327	#ifdef USE_CLEARCOAT
1328		float clearcoat;
1329		float clearcoatRoughness;
1330		vec3 clearcoatF0;
1331		float clearcoatF90;
1332	#endif
1333	#ifdef USE_IRIDESCENCE
1334		float iridescence;
1335		float iridescenceIOR;
1336		float iridescenceThickness;
1337		vec3 iridescenceFresnel;
1338		vec3 iridescenceF0;
1339	#endif
1340	#ifdef USE_SHEEN
1341		vec3 sheenColor;
1342		float sheenRoughness;
1343	#endif
1344	#ifdef IOR
1345		float ior;
1346	#endif
1347	#ifdef USE_TRANSMISSION
1348		float transmission;
1349		float transmissionAlpha;
1350		float thickness;
1351		float attenuationDistance;
1352		vec3 attenuationColor;
1353	#endif
1354	#ifdef USE_ANISOTROPY
1355		float anisotropy;
1356		float alphaT;
1357		vec3 anisotropyT;
1358		vec3 anisotropyB;
1359	#endif
1360};
1361vec3 clearcoatSpecularDirect = vec3( 0.0 );
1362vec3 clearcoatSpecularIndirect = vec3( 0.0 );
1363vec3 sheenSpecularDirect = vec3( 0.0 );
1364vec3 sheenSpecularIndirect = vec3(0.0 );
1365vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
1366    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
1367    float x2 = x * x;
1368    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
1369    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
1370}
1371float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
1372	float a2 = pow2( alpha );
1373	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1374	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1375	return 0.5 / max( gv + gl, EPSILON );
1376}
1377float D_GGX( const in float alpha, const in float dotNH ) {
1378	float a2 = pow2( alpha );
1379	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1380	return RECIPROCAL_PI * a2 / pow2( denom );
1381}
1382#ifdef USE_ANISOTROPY
1383	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 ) {
1384		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1385		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1386		float v = 0.5 / ( gv + gl );
1387		return saturate(v);
1388	}
1389	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1390		float a2 = alphaT * alphaB;
1391		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1392		highp float v2 = dot( v, v );
1393		float w2 = a2 / v2;
1394		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1395	}
1396#endif
1397#ifdef USE_CLEARCOAT
1398	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1399		vec3 f0 = material.clearcoatF0;
1400		float f90 = material.clearcoatF90;
1401		float roughness = material.clearcoatRoughness;
1402		float alpha = pow2( roughness );
1403		vec3 halfDir = normalize( lightDir + viewDir );
1404		float dotNL = saturate( dot( normal, lightDir ) );
1405		float dotNV = saturate( dot( normal, viewDir ) );
1406		float dotNH = saturate( dot( normal, halfDir ) );
1407		float dotVH = saturate( dot( viewDir, halfDir ) );
1408		vec3 F = F_Schlick( f0, f90, dotVH );
1409		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1410		float D = D_GGX( alpha, dotNH );
1411		return F * ( V * D );
1412	}
1413#endif
1414vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1415	vec3 f0 = material.specularColor;
1416	float f90 = material.specularF90;
1417	float roughness = material.roughness;
1418	float alpha = pow2( roughness );
1419	vec3 halfDir = normalize( lightDir + viewDir );
1420	float dotNL = saturate( dot( normal, lightDir ) );
1421	float dotNV = saturate( dot( normal, viewDir ) );
1422	float dotNH = saturate( dot( normal, halfDir ) );
1423	float dotVH = saturate( dot( viewDir, halfDir ) );
1424	vec3 F = F_Schlick( f0, f90, dotVH );
1425	#ifdef USE_IRIDESCENCE
1426		F = mix( F, material.iridescenceFresnel, material.iridescence );
1427	#endif
1428	#ifdef USE_ANISOTROPY
1429		float dotTL = dot( material.anisotropyT, lightDir );
1430		float dotTV = dot( material.anisotropyT, viewDir );
1431		float dotTH = dot( material.anisotropyT, halfDir );
1432		float dotBL = dot( material.anisotropyB, lightDir );
1433		float dotBV = dot( material.anisotropyB, viewDir );
1434		float dotBH = dot( material.anisotropyB, halfDir );
1435		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1436		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1437	#else
1438		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1439		float D = D_GGX( alpha, dotNH );
1440	#endif
1441	return F * ( V * D );
1442}
1443vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1444	const float LUT_SIZE = 64.0;
1445	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1446	const float LUT_BIAS = 0.5 / LUT_SIZE;
1447	float dotNV = saturate( dot( N, V ) );
1448	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1449	uv = uv * LUT_SCALE + LUT_BIAS;
1450	return uv;
1451}
1452float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1453	float l = length( f );
1454	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1455}
1456vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1457	float x = dot( v1, v2 );
1458	float y = abs( x );
1459	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1460	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1461	float v = a / b;
1462	float theta_sintheta = ( x >
1462 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1463	return cross( v1, v2 ) * theta_sintheta;
1464}
1465vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1466	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1467	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1468	vec3 lightNormal = cross( v1, v2 );
1469	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1470	vec3 T1, T2;
1471	T1 = normalize( V - N * dot( V, N ) );
1472	T2 = - cross( N, T1 );
1473	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1474	vec3 coords[ 4 ];
1475	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1476	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1477	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1478	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1479	coords[ 0 ] = normalize( coords[ 0 ] );
1480	coords[ 1 ] = normalize( coords[ 1 ] );
1481	coords[ 2 ] = normalize( coords[ 2 ] );
1482	coords[ 3 ] = normalize( coords[ 3 ] );
1483	vec3 vectorFormFactor = vec3( 0.0 );
1484	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1485	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1486	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1487	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1488	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1489	return vec3( result );
1490}
1491#if defined( USE_SHEEN )
1492float D_Charlie( float roughness, float dotNH ) {
1493	float alpha = pow2( roughness );
1494	float invAlpha = 1.0 / alpha;
1495	float cos2h = dotNH * dotNH;
1496	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1497	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1498}
1499float V_Neubelt( float dotNV, float dotNL ) {
1500	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1501}
1502vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1503	vec3 halfDir = normalize( lightDir + viewDir );
1504	float dotNL = saturate( dot( normal, lightDir ) );
1505	float dotNV = saturate( dot( normal, viewDir ) );
1506	float dotNH = saturate( dot( normal, halfDir ) );
1507	float D = D_Charlie( sheenRoughness, dotNH );
1508	float V = V_Neubelt( dotNV, dotNL );
1509	return sheenColor * ( D * V );
1510}
1511#endif
1512float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1513	float dotNV = saturate( dot( normal, viewDir ) );
1514	float r2 = roughness * roughness;
1515	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
1516	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
1517	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
1518	return saturate( DG * RECIPROCAL_PI );
1519}
1520vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1521	float dotNV = saturate( dot( normal, viewDir ) );
1522	vec2 uv = vec2( roughness, dotNV );
1523	return texture2D( dfgLUT, uv ).rg;
1524}
1525vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1526	vec2 fab = DFGApprox( normal, viewDir, roughness );
1527	return specularColor * fab.x + specularF90 * fab.y;
1528}
1529#ifdef USE_IRIDESCENCE
1530void 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 ) {
1531#else
1532void 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 ) {
1533#endif
1534	vec2 fab = DFGApprox( normal, viewDir, roughness );
1535	#ifdef USE_IRIDESCENCE
1536		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1537	#else
1538		vec3 Fr = specularColor;
1539	#endif
1540	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1541	float Ess = fab.x + fab.y;
1542	float Ems = 1.0 - Ess;
1543	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1544	singleScatter += FssEss;
1545	multiScatter += Fms * Ems;
1546}
1547vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1548	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
1549	float dotNL = saturate( dot( normal, lightDir ) );
1550	float dotNV = saturate( dot( normal, viewDir ) );
1551	vec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness );
1552	vec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness );
1553	vec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y;
1554	vec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y;
1555	float Ess_V = dfgV.x + dfgV.y;
1556	float Ess_L = dfgL.x + dfgL.y;
1557	float Ems_V = 1.0 - Ess_V;
1558	float Ems_L = 1.0 - Ess_L;
1559	vec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619;
1560	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON );
1561	float compensationFactor = Ems_V * Ems_L;
1562	vec3 multiScatter = Fms * compensationFactor;
1563	return singleScatter + multiScatter;
1564}
1565#if NUM_RECT_AREA_LIGHTS > 0
1566	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 ) {
1567		vec3 normal = geometryNormal;
1568		vec3 viewDir = geometryViewDir;
1569		vec3 position = geometryPosition;
1570		vec3 lightPos = rectAreaLight.position;
1571		vec3 halfWidth = rectAreaLight.halfWidth;
1572		vec3 halfHeight = rectAreaLight.halfHeight;
1573		vec3 lightColor = rectAreaLight.color;
1574		float roughness = material.roughness;
1575		vec3 rectCoords[ 4 ];
1576		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1577		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1578		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1579		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1580		vec4 t1 = texture2D( ltc_1, uv );
1581		vec4 t2 = texture2D( ltc_2, uv );
1582		mat3 mInv = mat3(
1583			vec3( t1.x, 0, t1.y ),
1584			vec3(    0, 1,    0 ),
1585			vec3( t1.z, 0, t1.w )
1586		);
1587		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
1588		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1589		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1590	}
1591#endif
1592void 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 ) {
1593	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1594	vec3 irradiance = dotNL * directLight.color;
1595	#ifdef USE_CLEARCOAT
1596		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1597		vec3 ccIrradiance = dotNLcc * directLight.color;
1598		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1599	#endif
1600	#ifdef USE_SHEEN
1601		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1602	#endif
1603	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1604	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1605}
1606void 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 ) {
1607	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1608}
1609void 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) {
1610	#ifdef USE_CLEARCOAT
1611		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1612	#endif
1613	#ifdef USE_SHEEN
1614		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1615	#endif
1616	vec3 singleScattering = vec3( 0.0 );
1617	vec3 multiScattering = vec3( 0.0 );
1618	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1619	#ifdef USE_IRIDESCENCE
1620		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
1621	#else
1622		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
1623	#endif
1624	vec3 totalScattering = singleScattering + multiScattering;
1625	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
1626	reflectedLight.indirectSpecular += radiance * singleScattering;
1627	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
1628	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
1629}
1630#define RE_Direct				RE_Direct_Physical
1631#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1632#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1633#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1634float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1635	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1636}`,CH=`
1637vec3 geometryPosition = - vViewPosition;
1638vec3 geometryNormal = normal;
1639vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1640vec3 geometryClearcoatNormal = vec3( 0.0 );
1641#ifdef USE_CLEARCOAT
1642	geometryClearcoatNormal = clearcoatNormal;
1643#endif
1644#ifdef USE_IRIDESCENCE
1645	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1646	if ( material.iridescenceThickness == 0.0 ) {
1647		material.iridescence = 0.0;
1648	} else {
1649		material.iridescence = saturate( material.iridescence );
1650	}
1651	if ( material.iridescence > 0.0 ) {
1652		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1653		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1654	}
1655#endif
1656IncidentLight directLight;
1657#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1658	PointLight pointLight;
1659	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1660	PointLightShadow pointLightShadow;
1661	#endif
1662	#pragma unroll_loop_start
1663	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1664		pointLight = pointLights[ i ];
1665		getPointLightInfo( pointLight, geometryPosition, directLight );
1666		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
1667		pointLightShadow = pointLightShadows[ i ];
1668		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1669		#endif
1670		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1671	}
1672	#pragma unroll_loop_end
1673#endif
1674#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1675	SpotLight spotLight;
1676	vec4 spotColor;
1677	vec3 spotLightCoord;
1678	bool inSpotLightMap;
1679	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1680	SpotLightShadow spotLightShadow;
1681	#endif
1682	#pragma unroll_loop_start
1683	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1684		spotLight = spotLights[ i ];
1685		getSpotLightInfo( spotLight, geometryPosition, directLight );
1686		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1687		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1688		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1689		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1690		#else
1691		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1692		#endif
1693		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1694			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1695			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1696			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1697			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1698		#endif
1699		#undef SPOT_LIGHT_MAP_INDEX
1700		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
1700IGHT_SHADOWS )
1701		spotLightShadow = spotLightShadows[ i ];
1702		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1703		#endif
1704		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1705	}
1706	#pragma unroll_loop_end
1707#endif
1708#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1709	DirectionalLight directionalLight;
1710	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1711	DirectionalLightShadow directionalLightShadow;
1712	#endif
1713	#pragma unroll_loop_start
1714	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1715		directionalLight = directionalLights[ i ];
1716		getDirectionalLightInfo( directionalLight, directLight );
1717		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1718		directionalLightShadow = directionalLightShadows[ i ];
1719		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1720		#endif
1721		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1722	}
1723	#pragma unroll_loop_end
1724#endif
1725#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1726	RectAreaLight rectAreaLight;
1727	#pragma unroll_loop_start
1728	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1729		rectAreaLight = rectAreaLights[ i ];
1730		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1731	}
1732	#pragma unroll_loop_end
1733#endif
1734#if defined( RE_IndirectDiffuse )
1735	vec3 iblIrradiance = vec3( 0.0 );
1736	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1737	#if defined( USE_LIGHT_PROBES )
1738		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1739	#endif
1740	#if ( NUM_HEMI_LIGHTS > 0 )
1741		#pragma unroll_loop_start
1742		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1743			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1744		}
1745		#pragma unroll_loop_end
1746	#endif
1747#endif
1748#if defined( RE_IndirectSpecular )
1749	vec3 radiance = vec3( 0.0 );
1750	vec3 clearcoatRadiance = vec3( 0.0 );
1751#endif`,_H=`#if defined( RE_IndirectDiffuse )
1752	#ifdef USE_LIGHTMAP
1753		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1754		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1755		irradiance += lightMapIrradiance;
1756	#endif
1757	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
1758		iblIrradiance += getIBLIrradiance( geometryNormal );
1759	#endif
1760#endif
1761#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1762	#ifdef USE_ANISOTROPY
1763		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1764	#else
1765		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1766	#endif
1767	#ifdef USE_CLEARCOAT
1768		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1769	#endif
1770#endif`,EH=`#if defined( RE_IndirectDiffuse )
1771	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1772#endif
1773#if defined( RE_IndirectSpecular )
1774	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1775#endif`,kH=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1776	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1777#endif`,AH=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1778	uniform float logDepthBufFC;
1779	varying float vFragDepth;
1780	varying float vIsPerspective;
1781#endif`,NH=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1782	varying float vFragDepth;
1783	varying float vIsPerspective;
1784#endif`,TH=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1785	vFragDepth = 1.0 + gl_Position.w;
1786	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1787#endif`,MH=`#ifdef USE_MAP
1788	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1789	#ifdef DECODE_VIDEO_TEXTURE
1790		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1791	#endif
1792	diffuseColor *= sampledDiffuseColor;
1793#endif`,RH=`#ifdef USE_MAP
1794	uniform sampler2D map;
1795#endif`,DH=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1796	#if defined( USE_POINTS_UV )
1797		vec2 uv = vUv;
1798	#else
1799		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1800	#endif
1801#endif
1802#ifdef USE_MAP
1803	diffuseColor *= texture2D( map, uv );
1804#endif
1805#ifdef USE_ALPHAMAP
1806	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1807#endif`,PH=`#if defined( USE_POINTS_UV )
1808	varying vec2 vUv;
1809#else
1810	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1811		uniform mat3 uvTransform;
1812	#endif
1813#endif
1814#ifdef USE_MAP
1815	uniform sampler2D map;
1816#endif
1817#ifdef USE_ALPHAMAP
1818	uniform sampler2D alphaMap;
1819#endif`,jH=`float metalnessFactor = metalness;
1820#ifdef USE_METALNESSMAP
1821	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1822	metalnessFactor *= texelMetalness.b;
1823#endif`,LH=`#ifdef USE_METALNESSMAP
1824	uniform sampler2D metalnessMap;
1825#endif`,IH=`#ifdef USE_INSTANCING_MORPH
1826	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1827	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1828	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1829		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1830	}
1831#endif`,BH=`#if defined( USE_MORPHCOLORS )
1832	vColor *= morphTargetBaseInfluence;
1833	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1834		#if defined( USE_COLOR_ALPHA )
1835			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1836		#elif defined( USE_COLOR )
1837			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1838		#endif
1839	}
1840#endif`,OH=`#ifdef USE_MORPHNORMALS
1841	objectNormal *= morphTargetBaseInfluence;
1842	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1843		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1844	}
1845#endif`,UH=`#ifdef USE_MORPHTARGETS
1846	#ifndef USE_INSTANCING_MORPH
1847		uniform float morphTargetBaseInfluence;
1848		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1849	#endif
1850	uniform sampler2DArray morphTargetsTexture;
1851	uniform ivec2 morphTargetsTextureSize;
1852	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1853		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1854		int y = texelIndex / morphTargetsTextureSize.x;
1855		int x = texelIndex - y * morphTargetsTextureSize.x;
1856		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1857		return texelFetch( morphTargetsTexture, morphUV, 0 );
1858	}
1859#endif`,zH=`#ifdef USE_MORPHTARGETS
1860	transformed *= morphTargetBaseInfluence;
1861	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1862		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1863	}
1864#endif`,GH=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1865#ifdef FLAT_SHADED
1866	vec3 fdx = dFdx( vViewPosition );
1867	vec3 fdy = dFdy( vViewPosition );
1868	vec3 normal = normalize( cross( fdx, fdy ) );
1869#else
1870	vec3 normal = normalize( vNormal );
1871	#ifdef DOUBLE_SIDED
1872		normal *= faceDirection;
1873	#endif
1874#endif
1875#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1876	#ifdef USE_TANGENT
1877		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1878	#else
1879		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1880		#if defined( USE_NORMALMAP )
1881			vNormalMapUv
1882		#elif defined( USE_CLEARCOAT_NORMALMAP )
1883			vClearcoatNormalMapUv
1884		#else
1885			vUv
1886		#endif
1887		);
1888	#endif
1889	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1890		tbn[0] *= faceDirection;
1891		tbn[1] *= faceDirection;
1892	#endif
1893#endif
1894#ifdef USE_CLEARCOAT_NORMALMAP
1895	#ifdef USE_TANGENT
1896		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1897	#else
1898		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1899	#endif
1900	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1901		tbn2[0] *= faceDirection;
1902		tbn2[1] *= faceDirection;
1903	#endif
1904#endif
1905vec3 nonPerturbedNormal = normal;`,HH=`#ifdef USE_NORMALMAP_OBJECTSPACE
1906	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1907	#ifdef FLIP_SIDED
1908		normal = - normal;
1909	#endif
1910	#ifdef DOUBLE_SIDED
1911		normal = normal * faceDirection;
1912	#endif
1913	normal = normalize( normalMatrix * normal );
1914#elif defined( USE_NORMALMAP_TANGENTSPACE )
1915	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1916	mapN.xy *= normalScale;
1917	normal = normalize( tbn * mapN );
1918#elif defined( USE_BUMPMAP )
1919	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1920#endif`,WH=`#ifndef FLAT_SHADED
1921	varying vec3 vNormal;
1922	#ifdef USE_TANGENT
1923		varying vec3 vTangent;
1924		varying vec3 vBitangent;
1925	#endif
1926#endif`,VH=`#ifndef FLAT_SHADED
1927	varying vec3 vNormal;
1928	#ifdef USE_TANGENT
1929		varying vec3 vTangent;
1930		varying vec3 vBitangent;
1931	#endif
1932#endif`,$H=`#ifndef FLAT_SHADED
1933	vNormal = normalize( transformedNormal );
1934	#ifdef USE_TANGENT
1935		vTangent = normalize( transformedTangent );
1936		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1937	#endif
1938#endif`,KH=`#ifdef USE_NORMALMAP
1939	uniform sampler2D normalMap;
1940	uniform vec2 normalScale;
1941#endif
1942#ifdef USE_NORMALMAP_OBJECTSPACE
1943	uniform mat3 normalMatrix;
1944#endif
1945#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1946	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1947		vec3 q0 = dFdx( eye_pos.xyz );
1948		vec3 q1 = dFdy( eye_pos.xyz );
1949		vec2 st0 = dFdx( uv.st );
1950		vec2 st1 = dFdy( uv.st );
1951		vec3 N = surf_norm;
1952		vec3 q1perp = cross( q1, N );
1953		vec3 q0perp = cross( N, q0 );
1954		vec3 T = q1perp * st0.x + q0perp * st1.x;
1955		vec3 B = q1perp * st0.y + q0perp * st1.y;
1956		float det = max( dot( T, T ), dot( B, B ) );
1957		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1958		return mat3( T * scale, B * scale, N );
1959	}
1960#endif`,YH=`#ifdef USE_CLEARCOAT
1961	vec3 clearcoatNormal = nonPerturbedNormal;
1962#endif`,qH=`#ifdef USE_CLEARCOAT_NORMALMAP
1963	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1964	clearcoatMapN.xy *= clearcoatNormalScale;
1965	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1966#endif`,JH=`#ifdef USE_CLEARCOATMAP
1967	uniform sampler2D clearcoatMap;
1968#endif
1969#ifdef USE_CLEARCOAT_NORMALMAP
1970	uniform sampler2D clearcoatNormalMap;
1971	uniform vec2 clearcoatNormalScale;
1972#endif
1973#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1974	uniform sampler2D clearcoatRoughnessMap;
1975#endif`,XH=`#ifdef USE_IRIDESCENCEMAP
1976	uniform sampler2D iridescenceMap;
1977#endif
1978#ifdef USE_IRIDESCENCE_THICKNESSMAP
1979	uniform sampler2D iridescenceThicknessMap;
1980#endif`,ZH=`#ifdef OPAQUE
1981diffuseColor.a = 1.0;
1982#endif
1983#ifdef USE_TRANSMISSION
1984diffuseColor.a *= material.transmissionAlpha;
1985#endif
1986gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,QH=`vec3 packNormalToRGB( const in vec3 normal ) {
1987	return normalize( normal ) * 0.5 + 0.5;
1988}
1989vec3 unpackRGBToNormal( const in vec3 rgb ) {
1990	return 2.0 * rgb.xyz - 1.0;
1991}
1992const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1993const float Inv255 = 1. / 255.;
1994const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1995const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1996const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1997const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1998vec4 packDepthToRGBA( const in float v ) {
1999	if( v <= 0.0 )
2000		return vec4( 0., 0., 0., 0. );
2001	if( v >= 1.0 )
2002		return vec4( 1., 1., 1., 1. );
2003	float vuf;
2004	float af = modf( v * PackFactors.a, vuf );
2005	float bf = modf( vuf * ShiftRight8, vuf );
2006	float gf = modf( vuf * ShiftRight8, vuf );
2007	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
2008}
2009vec3 packDepthToRGB( const in float v ) {
2010	if( v <= 0.0 )
2011		return vec3( 0., 0., 0. );
2012	if( v >= 1.0 )
2013		return vec3( 1., 1., 1. );
2014	float vuf;
2015	float bf = modf( v * PackFactors.b, vuf );
2016	float gf = modf( vuf * ShiftRight8, vuf );
2017	return vec3( vuf * Inv255, gf * PackUpscale, bf );
2018}
2019vec2 packDepthToRG( const in float v ) {
2020	if( v <= 0.0 )
2021		return vec2( 0., 0. );
2022	if( v >= 1.0 )
2023		return vec2( 1., 1. );
2024	float vuf;
2025	float gf = modf( v * 256., vuf );
2026	return vec2( vuf * Inv255, gf );
2027}
2028float unpackRGBAToDepth( const in vec4 v ) {
2029	return dot( v, UnpackFactors4 );
2030}
2031float unpackRGBToDepth( const in vec3 v ) {
2032	return dot( v, UnpackFactors3 );
2033}
2034float unpackRGToDepth( const in vec2 v ) {
2035	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
2036}
2037vec4 pack2HalfToRGBA( const in vec2 v ) {
2038	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
2039	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
2040}
2041vec2 unpackRGBATo2Half( const in vec4 v ) {
2042	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
2043}
2044float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
2045	return ( viewZ + near ) / ( near - far );
2046}
2047float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
2048	return depth * ( near - far ) - near;
2049}
2050float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
2051	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
2052}
2053float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
2054	return ( near * far ) / ( ( far - near ) * depth - far );
2055}`,eW=`#ifdef PREMULTIPLIED_ALPHA
2056	gl_FragColor.rgb *= gl_FragColor.a;
2057#endif`,tW=`vec4 mvPosition = vec4( transformed, 1.0 );
2058#ifdef USE_BATCHING
2059	mvPosition = batchingMatrix * mvPosition;
2060#endif
2061#ifdef USE_INSTANCING
2062	mvPosition = instanceMatrix * mvPosition;
2063#endif
2064mvPosition = modelViewMatrix * mvPosition;
2065gl_Position = projectionMatrix * mvPosition;`,nW=`#ifdef DITHERING
2066	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
2067#endif`,rW=`#ifdef DITHERING
2068	vec3 dithering( vec3 color ) {
2069		float grid_position = rand( gl_FragCoord.xy );
2070		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
2071		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
2072		return color + dither_shift_RGB;
2073	}
2074#endif`,aW=`float roughnessFactor = roughness;
2075#ifdef USE_ROUGHNESSMAP
2076	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
2077	roughnessFactor *= texelRoughness.g;
2078#endif`,iW=`#ifdef USE_ROUGHNESSMAP
2079	uniform sampler2D roughnessMap;
2080#endif`,sW=`#if NUM_SPOT_LIGHT_COORDS > 0
2081	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2082#endif
2083#if NUM_SPOT_LIGHT_MAPS > 0
2084	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
2085#endif
2086#ifdef USE_SHADOWMAP
2087	#if NUM_DIR_LIGHT_SHADOWS > 0
2088		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
2089		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2090		struct DirectionalLightShadow {
2091			float shadowIntensity;
2092			float shadowBias;
2093			float shadowNormalBias;
2094			float shadowRadius;
2095			vec2 shadowMapSize;
2096		};
2097		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2098	#endif
2099	#if NUM_SPOT_LIGHT_SHADOWS > 0
2100		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
2101		struct SpotLightShadow {
2102			float shadowIntensity;
2103			float shadowBias;
2104			float shadowNormalBias;
2105			float shadowRadius;
2106			vec2 shadowMapSize;
2107		};
2108		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2109	#endif
2110	#if NUM_POINT_LIGHT_SHADOWS > 0
2111		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
2112		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2113		struct PointLightShadow {
2114			float shadowIntensity;
2115			float shadowBias;
2116			float shadowNormalBias;
2117			float shadowRadius;
2118			vec2 shadowMapSize;
2119			float shadowCameraNear;
2120			float shadowCameraFar;
2121		};
2122		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2123	#endif
2124	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
2125		float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
2126		#ifdef USE_REVERSED_DEPTH_BUFFER
2127			return step( depth, compare );
2128		#else
2129			return step( compare, depth );
2130		#endif
2131	}
2132	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
2133		return unpackRGBATo2Half( texture2D( shadow, uv ) );
2134	}
2135	float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
2136		float occlusion = 1.0;
2137		vec2 distribution = texture2DDistribution( shadow, uv );
2138		#ifdef USE_REVERSED_DEPTH_BUFFER
2139			float hard_shadow = step( distribution.x, compare );
2140		#else
2141			float hard_shadow = step( compare, distribution.x );
2142		#endif
2143		if ( hard_shadow != 1.0 ) {
2144			float distance = compare - distribution.x
vendor: 6,963 bytes, lines 2144-2275
2144;
2145			float variance = max( 0.00000, distribution.y * distribution.y );
2146			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 );
2147		}
2148		return occlusion;
2149	}
2150	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
2151		float shadow = 1.0;
2152		shadowCoord.xyz /= shadowCoord.w;
2153		shadowCoord.z += shadowBias;
2154		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
2155		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
2156		if ( frustumTest ) {
2157		#if defined( SHADOWMAP_TYPE_PCF )
2158			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
2159			float dx0 = - texelSize.x * shadowRadius;
2160			float dy0 = - texelSize.y * shadowRadius;
2161			float dx1 = + texelSize.x * shadowRadius;
2162			float dy1 = + texelSize.y * shadowRadius;
2163			float dx2 = dx0 / 2.0;
2164			float dy2 = dy0 / 2.0;
2165			float dx3 = dx1 / 2.0;
2166			float dy3 = dy1 / 2.0;
2167			shadow = (
2168				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
2169				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
2170				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
2171				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
2172				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
2173				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
2174				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
2175				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
2176				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
2177				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
2178				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
2179				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
2180				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
2181				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
2182				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
2183				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
2184				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
2185			) * ( 1.0 / 17.0 );
2186		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
2187			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
2188			float dx = texelSize.x;
2189			float dy = texelSize.y;
2190			vec2 uv = shadowCoord.xy;
2191			vec2 f = fract( uv * shadowMapSize + 0.5 );
2192			uv -= f * texelSize;
2193			shadow = (
2194				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
2195				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
2196				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
2197				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
2198				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
2199					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
2200					 f.x ) +
2201				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
2202					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
2203					 f.x ) +
2204				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
2205					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
2206					 f.y ) +
2207				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
2208					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
2209					 f.y ) +
2210				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
2211						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
2212						  f.x ),
2213					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
2214						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
2215						  f.x ),
2216					 f.y )
2217			) * ( 1.0 / 9.0 );
2218		#elif defined( SHADOWMAP_TYPE_VSM )
2219			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
2220		#else
2221			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
2222		#endif
2223		}
2224		return mix( 1.0, shadow, shadowIntensity );
2225	}
2226	vec2 cubeToUV( vec3 v, float texelSizeY ) {
2227		vec3 absV = abs( v );
2228		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
2229		absV *= scaleToCube;
2230		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
2231		vec2 planar = v.xy;
2232		float almostATexel = 1.5 * texelSizeY;
2233		float almostOne = 1.0 - almostATexel;
2234		if ( absV.z >= almostOne ) {
2235			if ( v.z > 0.0 )
2236				planar.x = 4.0 - v.x;
2237		} else if ( absV.x >= almostOne ) {
2238			float signX = sign( v.x );
2239			planar.x = v.z * signX + 2.0 * signX;
2240		} else if ( absV.y >= almostOne ) {
2241			float signY = sign( v.y );
2242			planar.x = v.x + 2.0 * signY + 2.0;
2243			planar.y = v.z * signY - 2.0;
2244		}
2245		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
2246	}
2247	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
2248		float shadow = 1.0;
2249		vec3 lightToPosition = shadowCoord.xyz;
2250		
2251		float lightToPositionLength = length( lightToPosition );
2252		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
2253			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
2254			vec3 bd3D = normalize( lightToPosition );
2255			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
2256			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
2257				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
2258				shadow = (
2259					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
2260					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
2261					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
2262					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
2263					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
2264					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
2265					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
2266					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
2267					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
2268				) * ( 1.0 / 9.0 );
2269			#else
2270				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
2271			#endif
2272		}
2273		return mix( 1.0, shadow, shadowIntensity );
2274	}
2275#endif`,
2275oW=`#if NUM_SPOT_LIGHT_COORDS > 0
2276	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
2277	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
2278#endif
2279#ifdef USE_SHADOWMAP
2280	#if NUM_DIR_LIGHT_SHADOWS > 0
2281		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
2282		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
2283		struct DirectionalLightShadow {
2284			float shadowIntensity;
2285			float shadowBias;
2286			float shadowNormalBias;
2287			float shadowRadius;
2288			vec2 shadowMapSize;
2289		};
2290		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
2291	#endif
2292	#if NUM_SPOT_LIGHT_SHADOWS > 0
2293		struct SpotLightShadow {
2294			float shadowIntensity;
2295			float shadowBias;
2296			float shadowNormalBias;
2297			float shadowRadius;
2298			vec2 shadowMapSize;
2299		};
2300		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
2301	#endif
2302	#if NUM_POINT_LIGHT_SHADOWS > 0
2303		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
2304		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
2305		struct PointLightShadow {
2306			float shadowIntensity;
2307			float shadowBias;
2308			float shadowNormalBias;
2309			float shadowRadius;
2310			vec2 shadowMapSize;
2311			float shadowCameraNear;
2312			float shadowCameraFar;
2313		};
2314		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
2315	#endif
2316#endif`,lW=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
2317	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
2318	vec4 shadowWorldPosition;
2319#endif
2320#if defined( USE_SHADOWMAP )
2321	#if NUM_DIR_LIGHT_SHADOWS > 0
2322		#pragma unroll_loop_start
2323		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2324			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2325			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2326		}
2327		#pragma unroll_loop_end
2328	#endif
2329	#if NUM_POINT_LIGHT_SHADOWS > 0
2330		#pragma unroll_loop_start
2331		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2332			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2333			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2334		}
2335		#pragma unroll_loop_end
2336	#endif
2337#endif
2338#if NUM_SPOT_LIGHT_COORDS > 0
2339	#pragma unroll_loop_start
2340	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2341		shadowWorldPosition = worldPosition;
2342		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2343			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2344		#endif
2345		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2346	}
2347	#pragma unroll_loop_end
2348#endif`,cW=`float getShadowMask() {
2349	float shadow = 1.0;
2350	#ifdef USE_SHADOWMAP
2351	#if NUM_DIR_LIGHT_SHADOWS > 0
2352	DirectionalLightShadow directionalLight;
2353	#pragma unroll_loop_start
2354	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2355		directionalLight = directionalLightShadows[ i ];
2356		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2357	}
2358	#pragma unroll_loop_end
2359	#endif
2360	#if NUM_SPOT_LIGHT_SHADOWS > 0
2361	SpotLightShadow spotLight;
2362	#pragma unroll_loop_start
2363	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2364		spotLight = spotLightShadows[ i ];
2365		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2366	}
2367	#pragma unroll_loop_end
2368	#endif
2369	#if NUM_POINT_LIGHT_SHADOWS > 0
2370	PointLightShadow pointLight;
2371	#pragma unroll_loop_start
2372	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2373		pointLight = pointLightShadows[ i ];
2374		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2375	}
2376	#pragma unroll_loop_end
2377	#endif
2378	#endif
2379	return shadow;
2380}`,uW=`#ifdef USE_SKINNING
2381	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2382	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2383	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2384	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2385#endif`,dW=`#ifdef USE_SKINNING
2386	uniform mat4 bindMatrix;
2387	uniform mat4 bindMatrixInverse;
2388	uniform highp sampler2D boneTexture;
2389	mat4 getBoneMatrix( const in float i ) {
2390		int size = textureSize( boneTexture, 0 ).x;
2391		int j = int( i ) * 4;
2392		int x = j % size;
2393		int y = j / size;
2394		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2395		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2396		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2397		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2398		return mat4( v1, v2, v3, v4 );
2399	}
2400#endif`,hW=`#ifdef USE_SKINNING
2401	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2402	vec4 skinned = vec4( 0.0 );
2403	skinned += boneMatX * skinVertex * skinWeight.x;
2404	skinned += boneMatY * skinVertex * skinWeight.y;
2405	skinned += boneMatZ * skinVertex * skinWeight.z;
2406	skinned += boneMatW * skinVertex * skinWeight.w;
2407	transformed = ( bindMatrixInverse * skinned ).xyz;
2408#endif`,mW=`#ifdef USE_SKINNING
2409	mat4 skinMatrix = mat4( 0.0 );
2410	skinMatrix += skinWeight.x * boneMatX;
2411	skinMatrix += skinWeight.y * boneMatY;
2412	skinMatrix += skinWeight.z * boneMatZ;
2413	skinMatrix += skinWeight.w * boneMatW;
2414	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2415	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2416	#ifdef USE_TANGENT
2417		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2418	#endif
2419#endif`,fW=`float specularStrength;
2420#ifdef USE_SPECULARMAP
2421	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2422	specularStrength = texelSpecular.r;
2423#else
2424	specularStrength = 1.0;
2425#endif`,pW=`#ifdef USE_SPECULARMAP
2426	uniform sampler2D specularMap;
2427#endif`,gW=`#if defined( TONE_MAPPING )
2428	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2429#endif`,xW=`#ifndef saturate
2430#define saturate( a ) clamp( a, 0.0, 1.0 )
2431#endif
2432uniform float toneMappingExposure;
2433vec3 LinearToneMapping( vec3 color ) {
2434	return saturate( toneMappingExposure * color );
2435}
2436vec3 ReinhardToneMapping( vec3 color ) {
2437	color *= toneMappingExposure;
2438	return saturate( color / ( vec3( 1.0 ) + color ) );
2439}
2440vec3 CineonToneMapping( vec3 color ) {
2441	color *= toneMappingExposure;
2442	color = max( vec3( 0.0 ), color - 0.004 );
2443	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2444}
2445vec3 RRTAndODTFit( vec3 v ) {
2446	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2447	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2448	return a / b;
2449}
2450vec3 ACESFilmicToneMapping( vec3 color ) {
2451	const mat3 ACESInputMat = mat3(
2452		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2453		vec3( 0.04823, 0.01566, 0.83777 )
2454	);
2455	const mat3 ACESOutputMat = mat3(
2456		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2457		vec3( -0.07367, -0.00605,  1.07602 )
2458	);
2459	color *= toneMappingExposure / 0.6;
2460	color = ACESInputMat * color;
2461	color = RRTAndODTFit( color );
2462	color = ACESOutputMat * color;
2463	return saturate( color );
2464}
2465const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2466	vec3( 1.6605, - 0.1246, - 0.0182 ),
2467	vec3( - 0.5876, 1.1329, - 0.1006 ),
2468	vec3( - 0.0728, - 0.0083, 1.1187 )
2469);
2470const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2471	vec3( 0.6274, 0.0691, 0.0164 ),
2472	vec3( 0.3293, 0.9195, 0.0880 ),
2473	vec3( 0.0433, 0.0113, 0.8956 )
2474);
2475vec3 agxDefaultContrastApprox( vec3 x ) {
2476	vec3 x2 = x * x;
2477	vec3 x4 = x2 * x2;
2478	return + 15.5 * x4 * x2
2479		- 40.14 * x4 * x
2480		+ 31.96 * x4
2481		- 6.868 * x2 * x
2482		+ 0.4298 * x2
2483		+ 0.1191 * x
2484		- 0.00232;
2485}
2486vec3 AgXToneMapping( vec3 color ) {
2487	const mat3 AgXInsetMatrix = mat3(
2488		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2489		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2490		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2491	);
2492	const mat3 AgXOutsetMatrix = mat3(
2493		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2494		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2495		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2496	);
2497	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2498	color *= toneMappingExposure;
2499	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2500	color = AgXInsetMatrix * color;
2501	color = max( color, 1e-10 );	color = log2( color );
2502	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2503	color = clamp( color, 0.0, 1.0 );
2504	color = agxDefaultContrastApprox( color );
2505	color = AgXOutsetMatrix * color;
2506	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2507	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2508	color = clamp( color, 0.0, 1.0 );
2509	return color;
2510}
2511vec3 NeutralToneMapping( vec3 color ) {
2512	const float StartCompression = 0.8 - 0.04;
2513	const float Desaturation = 0.15;
2514	color *= toneMappingExposure;
2515	float x = min( color.r, min( color.g, color.b ) );
2516	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2517	color -= offset;
2518	float peak = max( color.r, max( color.g, color.b ) );
2519	if ( peak < StartCompression ) return color;
2520	float d = 1. - StartCompression;
2521	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2522	color *= newPeak / peak;
2523	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2524	return mix( color, vec3( newPeak ), g );
2525}
2526vec3 CustomToneMapping( vec3 color ) { return color; }`,vW=`#ifdef USE_TRANSMISSION
2527	material.transmission = transmission;
2528	material.transmissionAlpha = 1.0;
2529	material.thickness = thickness;
2530	material.attenuationDistance = attenuationDistance;
2531	material.attenuationColor = attenuationColor;
2532	#ifdef USE_TRANSMISSIONMAP
2533		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2534	#endif
2535	#ifdef USE_THICKNESSMAP
2536		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2537	#endif
2538	vec3 pos = vWorldPosition;
2539	vec3 v = normalize( cameraPosition - pos );
2540	vec3 n = inverseTransformDirection( normal, viewMatrix );
2541	vec4 transmitted = getIBLVolumeRefraction(
2542		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
2543		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2544		material.attenuationColor, material.attenuationDistance );
2545	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2546	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2547#endif`,yW=`#ifdef USE_TRANSMISSION
2548	uniform float transmission;
2549	uniform float thickness;
2550	uniform float attenuationDistance;
2551	uniform vec3 attenuationColor;
2552	#ifdef USE_TRANSMISSIONMAP
2553		uniform sampler2D transmissionMap;
2554	#endif
2555	#ifdef USE_THICKNESSMAP
2556		uniform sampler2D thicknessMap;
2557	#endif
2558	uniform vec2 transmissionSamplerSize;
2559	uniform sampler2D transmissionSamplerMap;
2560	uniform mat4 modelMatrix;
2561	uniform mat4 projectionMatrix;
2562	varying vec3 vWorldPosition;
2563	float w0( float a ) {
2564		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2565	}
2566	float w1( float a ) {
2567		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2568	}
2569	float w2( float a ){
2570		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2571	}
2572	float w3( float a ) {
2573		return ( 1.0 / 6.0 ) * ( a * a * a );
2574	}
2575	float g0( float a ) {
2576		return w0( a ) + w1( a );
2577	}
2578	float g1( float a ) {
2579		return w2( a ) + w3( a );
2580	}
2581	float h0( float a ) {
2582		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2583	}
2584	float h1( float a ) {
2585		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2586	}
2587	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2588		uv = uv * texelSize.zw + 0.5;
2589		vec2 iuv = floor( uv );
2590		vec2 fuv = fract( uv );
2591		float g0x = g0( fuv.x );
2592		float g1x = g1( fuv.x );
2593		float h0x = h0( fuv.x );
2594		float h1x = h1( fuv.x );
2595		float h0y = h0( fuv.y );
2596		float h1y = h1( fuv.y );
2597		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2598		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2599		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2600		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2601		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2602			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2603	}
2604	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2605		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2606		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2607		vec2 fLodSizeInv = 1.0 / fLodSize;
2608		vec2 cLodSizeInv = 1.0 / cLodSize;
2609		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2610		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2611		return mix( fSample, cSample, fract( lod ) );
2612	}
2613	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2614		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2615		vec3 modelScale;
2616		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2617		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2618		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2619		return normalize( refractionVector ) * thickness * modelScale;
2620	}
2621	float applyIorToRoughness( const in float roughness, const in float ior ) {
2622		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2623	}
2624	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2625		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2626		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2627	}
2628	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2629		if ( isinf( attenuationDistance ) ) {
2630			return vec3( 1.0 );
2631		} else {
2632			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2633			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2634		}
2635	}
2636	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2637		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2638		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2639		const in vec3 attenuationColor, const in float attenuationDistance ) {
2640		vec4 transmittedLight;
2641		vec3 transmittance;
2642		#ifdef USE_DISPERSION
2643			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2644			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2645			for ( int i = 0; i < 3; i ++ ) {
2646				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2647				vec3 refractedRayExit = position + transmissionRay;
2648				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2649				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2650				refractionCoords += 1.0;
2651				refractionCoords /= 2.0;
2652				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2653				transmittedLight[ i ] = transmissionSample[ i ];
2654				transmittedLight.a += transmissionSample.a;
2655				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2656			}
2657			transmittedLight.a /= 3.0;
2658		#else
2659			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2660			vec3 refractedRayExit = position + transmissionRay;
2661			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2662			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2663			refractionCoords += 1.0;
2664			refractionCoords /= 2.0;
2665			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2666			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2667		#endif
2668		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2669		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2670		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2671		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2672	}
2673#endif`,bW=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2674	varying vec2 vUv;
2675#endif
2676#ifdef USE_MAP
2677	varying vec2 vMapUv;
2678#endif
2679#ifdef USE_ALPHAMAP
2680	varying vec2 vAlphaMapUv;
2681#endif
2682#ifdef USE_LIGHTMAP
2683	varying vec2 vLightMapUv;
2684#endif
2685#ifdef USE_AOMAP
2686	varying vec2 vAoMapUv;
2687#endif
2688#ifdef USE_BUMPMAP
2689	varying vec2 vBumpMapUv;
2690#endif
2691#ifdef USE_NORMALMAP
2692	varying vec2 vNormalMapUv;
2693#endif
2694#ifdef USE_EMISSIVEMAP
2695	varying vec2 vEmissiveMapUv;
2696#endif
2697#ifdef USE_METALNESSMAP
2698	varying vec2 vMetalnessMapUv;
2699#endif
2700#ifdef USE_ROUGHNESSMAP
2701	varying vec2 vRoughnessMapUv;
2702#endif
2703#ifdef USE_ANISOTROPYMAP
2704	varying vec2 vAnisotropyMapUv;
2705#endif
2706#ifdef USE_CLEARCOATMAP
2707	varying vec2 vClearcoatMapUv;
2708#endif
2709#ifdef USE_CLEARCOAT_NORMALMAP
2710	varying vec2 vClearcoatNormalMapUv;
2711#endif
2712#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2713	varying vec2 vClearcoatRoughnessMapUv;
2714#endif
2715#ifdef USE_IRIDESCENCEMAP
2716	varying vec2 vIridescenceMapUv;
2717#endif
2718#ifdef USE_IRIDESCENCE_THICKNESSMAP
2719	varying vec2 vIridescenceThicknessMapUv;
2720#endif
2721#ifdef USE_SHEEN_COLORMAP
2722	varying vec2 vSheenColorMapUv;
2723#endif
2724#ifdef USE_SHEEN_ROUGHNESSMAP
2725	varying vec2 vSheenRoughnessMapUv;
2726#endif
2727#ifdef USE_SPECULARMAP
2728	varying vec2 vSpecularMapUv;
2729#endif
2730#ifdef USE_SPECULAR_COLORMAP
2731	varying vec2 vSpecularColorMapUv;
2732#endif
2733#ifdef USE_SPECULAR_INTENSITYMAP
2734	varying vec2 vSpecularIntensityMapUv;
2735#endif
2736#ifdef USE_TRANSMISSIONMAP
2737	uniform mat3 transmissionMapTransform;
2738	varying vec2 vTransmissionMapUv;
2739#endif
2740#ifdef USE_THICKNESSMAP
2741	uniform mat3 thicknessMapTransform;
2742	varying vec2 vThicknessMapUv;
2743#endif`,wW=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2744	varying vec2 vUv;
2745#endif
2746#ifdef USE_MAP
2747	uniform mat3 mapTransform;
2748	varying vec2 vMapUv;
2749#endif
2750#ifdef USE_ALPHAMAP
2751	uniform mat3 alphaMapTransform;
2752	varying vec2 vAlphaMapUv;
2753#endif
2754#ifdef USE_LIGHTMAP
2755	uniform mat3 lightMapTransform;
2756	varying vec2 vLightMapUv;
2757#endif
2758#ifdef USE_AOMAP
2759	uniform mat3 aoMapTransform;
2760	varying vec2 vAoMapUv;
2761#endif
2762#ifdef USE_BUMPMAP
2763	uniform mat3 bumpMapTransform;
2764	varying vec2 vBumpMapUv;
2765#endif
2766#ifdef USE_NORMALMAP
2767	uniform mat3 normalMapTransform;
2768	varying vec2 vNormalMapUv;
2769#endif
2770#ifdef USE_DISPLACEMENTMAP
2771	uniform mat3 displacementMapTransform;
2772	varying vec2 vDisplacementMapUv;
2773#endif
2774#ifdef USE_EMISSIVEMAP
2775	uniform mat3 emissiveMapTransform;
2776	varying vec2 vEmissiveMapUv;
2777#endif
2778#ifdef USE_METALNESSMAP
2779	uniform mat3 metalnessMapTransform;
2780	varying vec2 vMetalnessMapUv;
2781#endif
2782#ifdef USE_ROUGHNESSMAP
2783	uniform mat3 roughnessMapTransform;
2784	varying vec2 vRoughnessMapUv;
2785#endif
2786#ifdef USE_ANISOTROPYMAP
2787	uniform mat3 anisotropyMapTransform;
2788	varying vec2 vAnisotropyMapUv;
2789#endif
2790#ifdef USE_CLEARCOATMAP
2791	uniform mat3 clearcoatMapTransform;
2792	varying vec2 vClearcoatMapUv;
2793#endif
2794#ifdef USE_CLEARCOAT_NORMALMAP
2795	uniform mat3 clearcoatNormalMapTransform;
2796	varying vec2 vClearcoatNormalMapUv;
2797#endif
2798#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2799	uniform mat3 clearcoatRoughnessMapTransform;
2800	varying vec2 vClearcoatRoughnessMapUv;
2801#endif
2802#ifdef USE_SHEEN_COLORMAP
2803	uniform mat3 sheenColorMapTransform;
2804	varying vec2 vSheenColorMapUv;
2805#endif
2806#ifdef USE_SHEEN_ROUGHNESSMAP
2807	uniform mat3 sheenRoughnessMapTransform;
2808	varying vec2 vSheenRoughnessMapUv;
2809#endif
2810#ifdef USE_IRIDESCENCEMAP
2811	uniform mat3 iridescenceMapTransform;
2812	varying vec2 vIridescenceMapUv;
2813#endif
2814#ifdef USE_IRIDESCENCE_THICKNESSMAP
2815	uniform mat3 iridescenceThicknessMapTransform;
2816	varying vec2 vIridescenceThicknessMapUv;
2817#endif
2818#ifdef USE_SPECULARMAP
2819	uniform mat3 specularMapTransform;
2820	varying vec2 vSpecularMapUv;
2821#endif
2822#ifdef USE_SPECULAR_COLORMAP
2823	uniform mat3 specularColorMapTransform;
2824	varying vec2 vSpecularColorMapUv;
2825#endif
2826#ifdef USE_SPECULAR_INTENSITYMAP
2827	uniform mat3 specularIntensityMapTransform;
2828	varying vec2 vSpecularIntensityMapUv;
2829#endif
2830#ifdef USE_TRANSMISSIONMAP
2831	uniform mat3 transmissionMapTransform;
2832	varying vec2 vTransmissionMapUv;
2833#endif
2834#ifdef USE_THICKNESSMAP
2835	uniform mat3 thicknessMapTransform;
2836	varying vec2 vThicknessMapUv;
2837#endif`,SW=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2838	vUv = vec3( uv, 1 ).xy;
2839#endif
2840#ifdef USE_MAP
2841	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2842#endif
2843#ifdef USE_ALPHAMAP
2844	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2845#endif
2846#ifdef USE_LIGHTMAP
2847	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2848#endif
2849#ifdef USE_AOMAP
2850	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2851#endif
2852#ifdef USE_BUMPMAP
2853	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2854#endif
2855#ifdef USE_NORMALMAP
2856	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2857#endif
2858#ifdef USE_DISPLACEMENTMAP
2859	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2860#endif
2861#ifdef USE_EMISSIVEMAP
2862	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2863#endif
2864#ifdef USE_METALNESSMAP
2865	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2866#endif
2867#ifdef USE_ROUGHNESSMAP
2868	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2869#endif
2870#ifdef USE_ANISOTROPYMAP
2871	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2872#endif
2873#ifdef USE_CLEARCOATMAP
2874	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2875#endif
2876#ifdef USE_CLEARCOAT_NORMALMAP
2877	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2878#endif
2879#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2880	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2881#endif
2882#ifdef USE_IRIDESCENCEMAP
2883	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2884#endif
2885#ifdef USE_IRIDESCENCE_THICKNESSMAP
2886	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2887#endif
2888#ifdef USE_SHEEN_COLORMAP
2889	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2890#endif
2891#ifdef USE_SHEEN_ROUGHNESSMAP
2892	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2893#endif
2894#ifdef USE_SPECULARMAP
2895	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2896#endif
2897#ifdef USE_SPECULAR_COLORMAP
2898	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2899#endif
2900#ifdef USE_SPECULAR_INTENSITYMAP
2901	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2902#endif
2903#ifdef USE_TRANSMISSIONMAP
2904	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2905#endif
2906#ifdef USE_THICKNESSMAP
2907	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2908#endif`,FW=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2909	vec4 worldPosition = vec4( transformed, 1.0 );
2910	#ifdef USE_BATCHING
2911		worldPosition = batchingMatrix * worldPosition;
2912	#endif
2913	#ifdef USE_INSTANCING
2914		worldPosition = instanceMatrix * worldPosition;
2915	#endif
2916	worldPosition = modelMatrix * worldPosition;
2917#endif`;const CW=`varying vec2 vUv;
2918uniform mat3 uvTransform;
2919void main() {
2920	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2921	gl_Position = vec4( position.xy, 1.0, 1.0 );
2922}`,_W=`uniform sampler2D t2D;
2923uniform float backgroundIntensity;
2924varying vec2 vUv;
2925void main() {
2926	vec4 texColor = texture2D( t2D, vUv );
2927	#ifdef DECODE_VIDEO_TEXTURE
2928		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 );
2929	#endif
2930	texColor.rgb *= backgroundIntensity;
2931	gl_FragColor = texColor;
2932	#include <tonemapping_fragment>
2933	#include <colorspace_fragment>
2934}`,EW=`varying vec3 vWorldDirection;
2935#include <common>
2936void main() {
2937	vWorldDirection = transformDirection( position, modelMatrix );
2938	#include <begin_vertex>
2939	#include <project_vertex>
2940	gl_Position.z = gl_Position.w;
2941}`,kW=`#ifdef ENVMAP_TYPE_CUBE
2942	uniform samplerCube envMap;
2943#elif defined( ENVMAP_TYPE_CUBE_UV )
2944	uniform sampler2D envMap;
2945#endif
2946uniform float flipEnvMap;
2947uniform float backgroundBlurriness;
2948uniform float backgroundIntensity;
2949uniform mat3 backgroundRotation;
2950varying vec3 vWorldDirection;
2951#include <cube_uv_reflection_fragment>
2952void main() {
2953	#ifdef ENVMAP_TYPE_CUBE
2954		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2955	#elif defined( ENVMAP_TYPE_CUBE_UV )
2956		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2957	#else
2958		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2959	#endif
2960	texColor.rgb *= backgroundIntensity;
2961	gl_FragColor = texColor;
2962	#include <tonemapping_fragment>
2963	#include <colorspace_fragment>
2964}`,AW=`varying vec3 vWorldDirection;
2965#include <common>
2966void main() {
2967	vWorldDirection = transformDirection( position, modelMatrix );
2968	#include <begin_vertex>
2969	#include <project_vertex>
2970	gl_Position.z = gl_Position.w;
2971}`,NW=`uniform samplerCube tCube;
2972uniform float tFlip;
2973uniform float opacity;
2974varying vec3 vWorldDirection;
2975void main() {
2976	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2977	gl_FragColor = texColor;
2978	gl_FragColor.a *= opacity;
2979	#include <tonemapping_fragment>
2980	#include <colorspace_fragment>
2981}`,TW=`#include <common>
2982#include <batching_pars_vertex>
2983#include <uv_pars_vertex>
2984#include <displacementmap_pars_vertex>
2985#include <morphtarget_pars_vertex>
2986#include <skinning_pars_vertex>
2987#include <logdepthbuf_pars_vertex>
2988#include <clipping_planes_pars_vertex>
2989varying vec2 vHighPrecisionZW;
2990void main() {
2991	#include <uv_vertex>
2992	#include <batching_vertex>
2993	#include <skinbase_vertex>
2994	#include <morphinstance_vertex>
2995	#ifdef USE_DISPLACEMENTMAP
2996		#include <beginnormal_vertex>
2997		#include <morphnormal_vertex>
2998		#include <skinnormal_vertex>
2999	#endif
3000	#include <begin_vertex>
3001	#include <morphtarget_vertex>
3002	#include <skinning_vertex>
3003	#include <displacementmap_vertex>
3004	#include <project_vertex>
3005	#include <logdepthbuf_vertex>
3006	#include <clipping_planes_vertex>
3007	vHighPrecisionZW = gl_Position.zw;
3008}`,MW=`#if DEPTH_PACKING == 3200
3009	uniform float opacity;
3010#endif
3011#include <common>
3012#include <packing>
3013#include <uv_pars_fragment>
3014#include <map_pars_fragment>
3015#include <alphamap_pars_fragment>
3016#include <alphatest_pars_fragment>
3017#include <alphahash_pars_fragment>
3018#include <logdepthbuf_pars_fragment>
3019#include <clipping_planes_pars_fragment>
3020varying vec2 vHighPrecisionZW;
3021void main() {
3022	vec4 diffuseColor = vec4( 1.0 );
3023	#include <clipping_planes_fragment>
3024	#if DEPTH_PACKING == 3200
3025		diffuseColor.a = opacity;
3026	#endif
3027	#include <map_fragment>
3028	#include <alphamap_fragment>
3029	#include <alphatest_fragment>
3030	#include <alphahash_fragment>
3031	#include <logdepthbuf_fragment>
3032	#ifdef USE_REVERSED_DEPTH_BUFFER
3033		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
3034	#else
3035		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
3036	#endif
3037	#if DEPTH_PACKING == 3200
3038		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
3039	#elif DEPTH_PACKING == 3201
3040		gl_FragColor = packDepthToRGBA( fragCoordZ );
3041	#elif DEPTH_PACKING == 3202
3042		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
3043	#elif DEPTH_PACKING == 3203
3044		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
3045	#endif
3046}`,RW=`#define DISTANCE
3047varying vec3 vWorldPosition;
3048#include <common>
3049#include <batching_pars_vertex>
3050#include <uv_pars_vertex>
3051#include <displacementmap_pars_vertex>
3052#include <morphtarget_pars_vertex>
3053#include <skinning_pars_vertex>
3054#include <clipping_planes_pars_vertex>
3055void main() {
3056	#include <uv_vertex>
3057	#include <batching_vertex>
3058	#include <skinbase_vertex>
3059	#include <morphinstance_vertex>
3060	#ifdef USE_DISPLACEMENTMAP
3061		#include <beginnormal_vertex>
3062		#include <morphnormal_vertex>
3063		#include <skinnormal_vertex>
3064	#endif
3065	#include <begin_vertex>
3066	#include <morphtarget_vertex>
3067	#include <skinning_vertex>
3068	#include <displacementmap_vertex>
3069	#include <project_vertex>
3070	#include <worldpos_vertex>
3071	#include <clipping_planes_vertex>
3072	vWorldPosition = worldPosition.xyz;
3073}`,DW=`#define DISTANCE
3074uniform vec3 referencePosition;
3075uniform float nearDistance;
3076uniform float farDistance;
3077varying vec3 vWorldPosition;
3078#include <common>
3079#include <packing>
3080#include <uv_pars_fragment>
3081#include <map_pars_fragment>
3082#include <alphamap_pars_fragment>
3083#include <alphatest_pars_fragment>
3084#include <alphahash_pars_fragment>
3085#include <clipping_planes_pars_fragment>
3086void main () {
3087	vec4 diffuseColor = vec4( 1.0 );
3088	#include <clipping_planes_fragment>
3089	#include <map_fragment>
3090	#include <alphamap_fragment>
3091	#include <alphatest_fragment>
3092	#include <alphahash_fragment>
3093	float dist = length( vWorldPosition - referencePosition );
3094	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
3095	dist = saturate( dist );
3096	gl_FragColor = packDepthToRGBA( dist );
3097}`,PW=`varying vec3 vWorldDirection;
3098#include <common>
3099void main() {
3100	vWorldDirection = transformDirection( position, modelMatrix );
3101	#include <begin_vertex>
3102	#include <project_vertex>
3103}`,jW=`uniform sampler2D tEquirect;
3104varying vec3 vWorldDirection;
3105#include <common>
3106void main() {
3107	vec3 direction = normalize( vWorldDirection );
3108	vec2 sampleUV = equirectUv( direction );
3109	gl_FragColor = texture2D( tEquirect, sampleUV );
3110	#include <tonemapping_fragment>
3111	#include <colorspace_fragment>
3112}`,LW=`uniform float scale;
3113attribute float lineDistance;
3114varying float vLineDistance;
3115#include <common>
3116#include <uv_pars_vertex>
3117#include <color_pars_vertex>
3118#include <fog_pars_vertex>
3119#include <morphtarget_pars_vertex>
3120#include <logdepthbuf_pars_vertex>
3121#include <clipping_planes_pars_vertex>
3122void main() {
3123	vLineDistance = scale * lineDistance;
3124	#include <uv_vertex>
3125	#include <color_vertex>
3126	#include <morphinstance_vertex>
3127	#include <morphcolor_vertex>
3128	#include <begin_vertex>
3129	#include <morphtarget_vertex>
3130	#include <project_vertex>
3131	#include <logdepthbuf_vertex>
3132	#include <clipping_planes_vertex>
3133	#include <fog_vertex>
3134}`,IW=`uniform vec3 diffuse;
3135uniform float opacity;
3136uniform float dashSize;
3137uniform float totalSize;
3138varying float vLineDistance;
3139#include <common>
3140#include <color_pars_fragment>
3141#include <uv_pars_fragment>
3142#include <map_pars_fragment>
3143#include <fog_pars_fragment>
3144#include <logdepthbuf_pars_fragment>
3145#include <clipping_planes_pars_fragment>
3146void main() {
3147	vec4 diffuseColor = vec4( diffuse, opacity );
3148	#include <clipping_planes_fragment>
3149	if ( mod( vLineDistance, totalSize ) > dashSize ) {
3150		discard;
3151	}
3152	vec3 outgoingLight = vec3( 0.0 );
3153	#include <logdepthbuf_fragment>
3154	#include <map_fragment>
3155	#include <color_fragment>
3156	outgoingLight = diffuseColor.rgb;
3157	#include <opaque_fragment>
3158	#include <tonemapping_fragment>
3159	#include <colorspace_fragment>
3160	#include <fog_fragment>
3161	#include <premultiplied_alpha_fragment>
3162}`,BW=`#include <common>
3163#include <batching_pars_vertex>
3164#include <uv_pars_vertex>
3165#include <envmap_pars_vertex>
3166#include <color_pars_vertex>
3167#include <fog_pars_vertex>
3168#include <morphtarget_pars_vertex>
3169#include <skinning_pars_vertex>
3170#include <logdepthbuf_pars_vertex>
3171#include <clipping_planes_pars_vertex>
3172void main() {
3173	#include <uv_vertex>
3174	#include <color_vertex>
3175	#include <morphinstance_vertex>
3176	#include <morphcolor_vertex>
3177	#include <batching_vertex>
3178	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
3179		#include <beginnormal_vertex>
3180		#include <morphnormal_vertex>
3181		#include <skinbase_vertex>
3182		#include <skinnormal_vertex>
3183		#include <defaultnormal_vertex>
3184	#endif
3185	#include <begin_vertex>
3186	#include <morphtarget_vertex>
3187	#include <skinning_vertex>
3188	#include <project_vertex>
3189	#include <logdepthbuf_vertex>
3190	#include <clipping_planes_vertex>
3191	#include <worldpos_vertex>
3192	#include <envmap_vertex>
3193	#include <fog_vertex>
3194}`,OW=`uniform vec3 diffuse;
3195uniform float opacity;
3196#ifndef FLAT_SHADED
3197	varying vec3 vNormal;
3198#endif
3199#include <common>
3200#include <dithering_pars_fragment>
3201#include <color_pars_fragment>
3202#include <uv_pars_fragment>
3203#include <map_pars_fragment>
3204#include <alphamap_pars_fragment>
3205#include <alphatest_pars_fragment>
3206#include <alphahash_pars_fragment>
3207#include <aomap_pars_fragment>
3208#include <lightmap_pars_fragment>
3209#include <envmap_common_pars_fragment>
3210#include <envmap_pars_fragment>
3211#include <fog_pars_fragment>
3212#include <specularmap_pars_fragment>
3213#include <logdepthbuf_pars_fragment>
3214#include <clipping_planes_pars_fragment>
3215void main() {
3216	vec4 diffuseColor = vec4( diffuse, opacity );
3217	#include <clipping_planes_fragment>
3218	#include <logdepthbuf_fragment>
3219	#include <map_fragment>
3220	#include <color_fragment>
3221	#include <alphamap_fragment>
3222	#include <alphatest_fragment>
3223	#include <alphahash_fragment>
3224	#include <specularmap_fragment>
3225	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3226	#ifdef USE_LIGHTMAP
3227		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
3228		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
3229	#else
3230		reflectedLight.indirectDiffuse += vec3( 1.0 );
3231	#endif
3232	#include <aomap_fragment>
3233	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
3234	vec3 outgoingLight = reflectedLight.indirectDiffuse;
3235	#include <envmap_fragment>
3236	#include <opaque_fragment>
3237	#include <tonemapping_fragment>
3238	#include <colorspace_fragment>
3239	#include <fog_fragment>
3240	#include <premultiplied_alpha_fragment>
3241	#include <dithering_fragment>
3242}`,UW=`#define LAMBERT
3243varying vec3 vViewPosition;
3244#include <common>
3245#include <batching_pars_vertex>
3246#include <uv_pars_vertex>
3247#include <displacementmap_pars_vertex>
3248#include <envmap_pars_vertex>
3249#include <color_pars_vertex>
3250#include <fog_pars_vertex>
3251#include <normal_pars_vertex>
3252#include <morphtarget_pars_vertex>
3253#include <skinning_pars_vertex>
3254#include <shadowmap_pars_vertex>
3255#include <logdepthbuf_pars_vertex>
3256#include <clipping_planes_pars_vertex>
3257void main() {
3258	#include <uv_vertex>
3259	#include <color_vertex>
3260	#include <morphinstance_vertex>
3261	#include <morphcolor_vertex>
3262	#include <batching_vertex>
3263	#include <beginnormal_vertex>
3264	#include <morphnormal_vertex>
3265	#include <skinbase_vertex>
3266	#include <skinnormal_vertex>
3267	#include <defaultnormal_vertex>
3268	#include <normal_vertex>
3269	#include <begin_vertex>
3270	#include <morphtarget_vertex>
3271	#include <skinning_vertex>
3272	#include <displacementmap_vertex>
3273	#include <project_vertex>
3274	#include <logdepthbuf_vertex>
3275	#include <clipping_planes_vertex>
3276	vViewPosition = - mvPosition.xyz;
3277	#include <worldpos_vertex>
3278	#include <envmap_vertex>
3279	#include <shadowmap_vertex>
3280	#include <fog_vertex>
3281}`,zW=`#define LAMBERT
3282uniform vec3 diffuse;
3283uniform vec3 emissive;
3284uniform float opacity;
3285#include <common>
3286#include <packing>
3287#include <dithering_pars_fragment>
3288#include <color_pars_fragment>
3289#include <uv_pars_fragment>
3290#include <map_pars_fragment>
3291#include <alphamap_pars_fragment>
3292#include <alphatest_pars_fragment>
3293#include <alphahash_pars_fragment>
3294#include <aomap_pars_fragment>
3295#include <lightmap_pars_fragment>
3296#include <emissivemap_pars_fragment>
3297#include <envmap_common_pars_fragment>
3298#include <envmap_pars_fragment>
3299#include <fog_pars_fragment>
3300#include <bsdfs>
3301#include <lights_pars_begin>
3302#include <normal_pars_fragment>
3303#include <lights_lambert_pars_fragment>
3304#include <shadowmap_pars_fragment>
3305#include <bumpmap_pars_fragment>
3306#include <normalmap_pars_fragment>
3307#include <specularmap_pars_fragment>
3308#include <logdepthbuf_pars_fragment>
3309#include <clipping_planes_pars_fragment>
3310void main() {
3311	vec4 diffuseColor = vec4( diffuse, opacity );
3312	#include <clipping_planes_fragment>
3313	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3314	vec3 totalEmissiveRadiance = emissive;
3315	#include <logdepthbuf_fragment>
3316	#include <map_fragment>
3317	#include <color_fragment>
3318	#include <alphamap_fragment>
3319	#include <alphatest_fragment>
3320	#include <alphahash_fragment>
3321	#include <specularmap_fragment>
3322	#include <normal_fragment_begin>
3323	#include <normal_fragment_maps>
3324	#include <emissivemap_fragment>
3325	#include <lights_lambert_fragment>
3326	#include <lights_fragment_begin>
3327	#include <lights_fragment_maps>
3328	#include <lights_fragment_end>
3329	#include <aomap_fragment>
3330	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3331	#include <envmap_fragment>
3332	#include <opaque_fragment>
3333	#include <tonemapping_fragment>
3334	#include <colorspace_fragment>
3335	#include <fog_fragment>
3336	#include <premultiplied_alpha_fragment>
3337	#include <dithering_fragment>
3338}`,GW=`#define MATCAP
3339varying vec3 vViewPosition;
3340#include <common>
3341#include <batching_pars_vertex>
3342#include <uv_pars_vertex>
3343#include <color_pars_vertex>
3344#include <displacementmap_pars_vertex>
3345#include <fog_pars_vertex>
3346#include <normal_pars_vertex>
3347#include <morphtarget_pars_vertex>
3348#include <skinning_pars_vertex>
3349#include <logdepthbuf_pars_vertex>
3350#include <clipping_planes_pars_vertex>
3351void main() {
3352	#include <uv_vertex>
3353	#include <color_vertex>
3354	#include <morphinstance_vertex>
3355	#include <morphcolor_vertex>
3356	#include <batching_vertex>
3357	#include <beginnormal_vertex>
3358	#include <morphnormal_vertex>
3359	#include <skinbase_vertex>
3360	#include <skinnormal_vertex>
3361	#include <defaultnormal_vertex>
3362	#include <normal_vertex>
3363	#include <begin_vertex>
3364	#include <morphtarget_vertex>
3365	#include <skinning_vertex>
3366	#include <displacementmap_vertex>
3367	#include <project_vertex>
3368	#include <logdepthbuf_vertex>
3369	#include <clipping_planes_vertex>
3370	#include <fog_vertex>
3371	vViewPosition = - mvPosition.xyz;
3372}`,HW=`#define MATCAP
3373uniform vec3 diffuse;
3374uniform float opacity;
3375uniform sampler2D matcap;
3376varying vec3 vViewPosition;
3377#include <common>
3378#include <dithering_pars_fragment>
3379#include <color_pars_fragment>
3380#include <uv_pars_fragment>
3381#include <map_pars_fragment>
3382#include <alphamap_pars_fragment>
3383#include <alphatest_pars_fragment>
3384#include <alphahash_pars_fragment>
3385#include <fog_pars_fragment>
3386#include <normal_pars_fragment>
3387#include <bumpmap_pars_fragment>
3388#include
3388 <normalmap_pars_fragment>
3389#include <logdepthbuf_pars_fragment>
3390#include <clipping_planes_pars_fragment>
3391void main() {
3392	vec4 diffuseColor = vec4( diffuse, opacity );
3393	#include <clipping_planes_fragment>
3394	#include <logdepthbuf_fragment>
3395	#include <map_fragment>
3396	#include <color_fragment>
3397	#include <alphamap_fragment>
3398	#include <alphatest_fragment>
3399	#include <alphahash_fragment>
3400	#include <normal_fragment_begin>
3401	#include <normal_fragment_maps>
3402	vec3 viewDir = normalize( vViewPosition );
3403	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3404	vec3 y = cross( viewDir, x );
3405	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3406	#ifdef USE_MATCAP
3407		vec4 matcapColor = texture2D( matcap, uv );
3408	#else
3409		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3410	#endif
3411	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3412	#include <opaque_fragment>
3413	#include <tonemapping_fragment>
3414	#include <colorspace_fragment>
3415	#include <fog_fragment>
3416	#include <premultiplied_alpha_fragment>
3417	#include <dithering_fragment>
3418}`,WW=`#define NORMAL
3419#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3420	varying vec3 vViewPosition;
3421#endif
3422#include <common>
3423#include <batching_pars_vertex>
3424#include <uv_pars_vertex>
3425#include <displacementmap_pars_vertex>
3426#include <normal_pars_vertex>
3427#include <morphtarget_pars_vertex>
3428#include <skinning_pars_vertex>
3429#include <logdepthbuf_pars_vertex>
3430#include <clipping_planes_pars_vertex>
3431void main() {
3432	#include <uv_vertex>
3433	#include <batching_vertex>
3434	#include <beginnormal_vertex>
3435	#include <morphinstance_vertex>
3436	#include <morphnormal_vertex>
3437	#include <skinbase_vertex>
3438	#include <skinnormal_vertex>
3439	#include <defaultnormal_vertex>
3440	#include <normal_vertex>
3441	#include <begin_vertex>
3442	#include <morphtarget_vertex>
3443	#include <skinning_vertex>
3444	#include <displacementmap_vertex>
3445	#include <project_vertex>
3446	#include <logdepthbuf_vertex>
3447	#include <clipping_planes_vertex>
3448#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3449	vViewPosition = - mvPosition.xyz;
3450#endif
3451}`,VW=`#define NORMAL
3452uniform float opacity;
3453#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3454	varying vec3 vViewPosition;
3455#endif
3456#include <packing>
3457#include <uv_pars_fragment>
3458#include <normal_pars_fragment>
3459#include <bumpmap_pars_fragment>
3460#include <normalmap_pars_fragment>
3461#include <logdepthbuf_pars_fragment>
3462#include <clipping_planes_pars_fragment>
3463void main() {
3464	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3465	#include <clipping_planes_fragment>
3466	#include <logdepthbuf_fragment>
3467	#include <normal_fragment_begin>
3468	#include <normal_fragment_maps>
3469	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
3470	#ifdef OPAQUE
3471		gl_FragColor.a = 1.0;
3472	#endif
3473}`,$W=`#define PHONG
3474varying vec3 vViewPosition;
3475#include <common>
3476#include <batching_pars_vertex>
3477#include <uv_pars_vertex>
3478#include <displacementmap_pars_vertex>
3479#include <envmap_pars_vertex>
3480#include <color_pars_vertex>
3481#include <fog_pars_vertex>
3482#include <normal_pars_vertex>
3483#include <morphtarget_pars_vertex>
3484#include <skinning_pars_vertex>
3485#include <shadowmap_pars_vertex>
3486#include <logdepthbuf_pars_vertex>
3487#include <clipping_planes_pars_vertex>
3488void main() {
3489	#include <uv_vertex>
3490	#include <color_vertex>
3491	#include <morphcolor_vertex>
3492	#include <batching_vertex>
3493	#include <beginnormal_vertex>
3494	#include <morphinstance_vertex>
3495	#include <morphnormal_vertex>
3496	#include <skinbase_vertex>
3497	#include <skinnormal_vertex>
3498	#include <defaultnormal_vertex>
3499	#include <normal_vertex>
3500	#include <begin_vertex>
3501	#include <morphtarget_vertex>
3502	#include <skinning_vertex>
3503	#include <displacementmap_vertex>
3504	#include <project_vertex>
3505	#include <logdepthbuf_vertex>
3506	#include <clipping_planes_vertex>
3507	vViewPosition = - mvPosition.xyz;
3508	#include <worldpos_vertex>
3509	#include <envmap_vertex>
3510	#include <shadowmap_vertex>
3511	#include <fog_vertex>
3512}`,KW=`#define PHONG
3513uniform vec3 diffuse;
3514uniform vec3 emissive;
3515uniform vec3 specular;
3516uniform float shininess;
3517uniform float opacity;
3518#include <common>
3519#include <packing>
3520#include <dithering_pars_fragment>
3521#include <color_pars_fragment>
3522#include <uv_pars_fragment>
3523#include <map_pars_fragment>
3524#include <alphamap_pars_fragment>
3525#include <alphatest_pars_fragment>
3526#include <alphahash_pars_fragment>
3527#include <aomap_pars_fragment>
3528#include <lightmap_pars_fragment>
3529#include <emissivemap_pars_fragment>
3530#include <envmap_common_pars_fragment>
3531#include <envmap_pars_fragment>
3532#include <fog_pars_fragment>
3533#include <bsdfs>
3534#include <lights_pars_begin>
3535#include <normal_pars_fragment>
3536#include <lights_phong_pars_fragment>
3537#include <shadowmap_pars_fragment>
3538#include <bumpmap_pars_fragment>
3539#include <normalmap_pars_fragment>
3540#include <specularmap_pars_fragment>
3541#include <logdepthbuf_pars_fragment>
3542#include <clipping_planes_pars_fragment>
3543void main() {
3544	vec4 diffuseColor = vec4( diffuse, opacity );
3545	#include <clipping_planes_fragment>
3546	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3547	vec3 totalEmissiveRadiance = emissive;
3548	#include <logdepthbuf_fragment>
3549	#include <map_fragment>
3550	#include <color_fragment>
3551	#include <alphamap_fragment>
3552	#include <alphatest_fragment>
3553	#include <alphahash_fragment>
3554	#include <specularmap_fragment>
3555	#include <normal_fragment_begin>
3556	#include <normal_fragment_maps>
3557	#include <emissivemap_fragment>
3558	#include <lights_phong_fragment>
3559	#include <lights_fragment_begin>
3560	#include <lights_fragment_maps>
3561	#include <lights_fragment_end>
3562	#include <aomap_fragment>
3563	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3564	#include <envmap_fragment>
3565	#include <opaque_fragment>
3566	#include <tonemapping_fragment>
3567	#include <colorspace_fragment>
3568	#include <fog_fragment>
3569	#include <premultiplied_alpha_fragment>
3570	#include <dithering_fragment>
3571}`,YW=`#define STANDARD
3572varying vec3 vViewPosition;
3573#ifdef USE_TRANSMISSION
3574	varying vec3 vWorldPosition;
3575#endif
3576#include <common>
3577#include <batching_pars_vertex>
3578#include <uv_pars_vertex>
3579#include <displacementmap_pars_vertex>
3580#include <color_pars_vertex>
3581#include <fog_pars_vertex>
3582#include <normal_pars_vertex>
3583#include <morphtarget_pars_vertex>
3584#include <skinning_pars_vertex>
3585#include <shadowmap_pars_vertex>
3586#include <logdepthbuf_pars_vertex>
3587#include <clipping_planes_pars_vertex>
3588void main() {
3589	#include <uv_vertex>
3590	#include <color_vertex>
3591	#include <morphinstance_vertex>
3592	#include <morphcolor_vertex>
3593	#include <batching_vertex>
3594	#include <beginnormal_vertex>
3595	#include <morphnormal_vertex>
3596	#include <skinbase_vertex>
3597	#include <skinnormal_vertex>
3598	#include <defaultnormal_vertex>
3599	#include <normal_vertex>
3600	#include <begin_vertex>
3601	#include <morphtarget_vertex>
3602	#include <skinning_vertex>
3603	#include <displacementmap_vertex>
3604	#include <project_vertex>
3605	#include <logdepthbuf_vertex>
3606	#include <clipping_planes_vertex>
3607	vViewPosition = - mvPosition.xyz;
3608	#include <worldpos_vertex>
3609	#include <shadowmap_vertex>
3610	#include <fog_vertex>
3611#ifdef USE_TRANSMISSION
3612	vWorldPosition = worldPosition.xyz;
3613#endif
3614}`,qW=`#define STANDARD
3615#ifdef PHYSICAL
3616	#define IOR
3617	#define USE_SPECULAR
3618#endif
3619uniform vec3 diffuse;
3620uniform vec3 emissive;
3621uniform float roughness;
3622uniform float metalness;
3623uniform float opacity;
3624#ifdef IOR
3625	uniform float ior;
3626#endif
3627#ifdef USE_SPECULAR
3628	uniform float specularIntensity;
3629	uniform vec3 specularColor;
3630	#ifdef USE_SPECULAR_COLORMAP
3631		uniform sampler2D specularColorMap;
3632	#endif
3633	#ifdef USE_SPECULAR_INTENSITYMAP
3634		uniform sampler2D specularIntensityMap;
3635	#endif
3636#endif
3637#ifdef USE_CLEARCOAT
3638	uniform float clearcoat;
3639	uniform float clearcoatRoughness;
3640#endif
3641#ifdef USE_DISPERSION
3642	uniform float dispersion;
3643#endif
3644#ifdef USE_IRIDESCENCE
3645	uniform float iridescence;
3646	uniform float iridescenceIOR;
3647	uniform float iridescenceThicknessMinimum;
3648	uniform float iridescenceThicknessMaximum;
3649#endif
3650#ifdef USE_SHEEN
3651	uniform vec3 sheenColor;
3652	uniform float sheenRoughness;
3653	#ifdef USE_SHEEN_COLORMAP
3654		uniform sampler2D sheenColorMap;
3655	#endif
3656	#ifdef USE_SHEEN_ROUGHNESSMAP
3657		uniform sampler2D sheenRoughnessMap;
3658	#endif
3659#endif
3660#ifdef USE_ANISOTROPY
3661	uniform vec2 anisotropyVector;
3662	#ifdef USE_ANISOTROPYMAP
3663		uniform sampler2D anisotropyMap;
3664	#endif
3665#endif
3666varying vec3 vViewPosition;
3667#include <common>
3668#include <packing>
3669#include <dithering_pars_fragment>
3670#include <color_pars_fragment>
3671#include <uv_pars_fragment>
3672#include <map_pars_fragment>
3673#include <alphamap_pars_fragment>
3674#include <alphatest_pars_fragment>
3675#include <alphahash_pars_fragment>
3676#include <aomap_pars_fragment>
3677#include <lightmap_pars_fragment>
3678#include <emissivemap_pars_fragment>
3679#include <iridescence_fragment>
3680#include <cube_uv_reflection_fragment>
3681#include <envmap_common_pars_fragment>
3682#include <envmap_physical_pars_fragment>
3683#include <fog_pars_fragment>
3684#include <lights_pars_begin>
3685#include <normal_pars_fragment>
3686#include <lights_physical_pars_fragment>
3687#include <transmission_pars_fragment>
3688#include <shadowmap_pars_fragment>
3689#include <bumpmap_pars_fragment>
3690#include <normalmap_pars_fragment>
3691#include <clearcoat_pars_fragment>
3692#include <iridescence_pars_fragment>
3693#include <roughnessmap_pars_fragment>
3694#include <metalnessmap_pars_fragment>
3695#include <logdepthbuf_pars_fragment>
3696#include <clipping_planes_pars_fragment>
3697void main() {
3698	vec4 diffuseColor = vec4( diffuse, opacity );
3699	#include <clipping_planes_fragment>
3700	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3701	vec3 totalEmissiveRadiance = emissive;
3702	#include <logdepthbuf_fragment>
3703	#include <map_fragment>
3704	#include <color_fragment>
3705	#include <alphamap_fragment>
3706	#include <alphatest_fragment>
3707	#include <alphahash_fragment>
3708	#include <roughnessmap_fragment>
3709	#include <metalnessmap_fragment>
3710	#include <normal_fragment_begin>
3711	#include <normal_fragment_maps>
3712	#include <clearcoat_normal_fragment_begin>
3713	#include <clearcoat_normal_fragment_maps>
3714	#include <emissivemap_fragment>
3715	#include <lights_physical_fragment>
3716	#include <lights_fragment_begin>
3717	#include <lights_fragment_maps>
3718	#include <lights_fragment_end>
3719	#include <aomap_fragment>
3720	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3721	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3722	#include <transmission_fragment>
3723	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3724	#ifdef USE_SHEEN
3725		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
3726		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
3727	#endif
3728	#ifdef USE_CLEARCOAT
3729		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3730		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3731		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3732	#endif
3733	#include <opaque_fragment>
3734	#include <tonemapping_fragment>
3735	#include <colorspace_fragment>
3736	#include <fog_fragment>
3737	#include <premultiplied_alpha_fragment>
3738	#include <dithering_fragment>
3739}`,JW=`#define TOON
3740varying vec3 vViewPosition;
3741#include <common>
3742#include <batching_pars_vertex>
3743#include <uv_pars_vertex>
3744#include <displacementmap_pars_vertex>
3745#include <color_pars_vertex>
3746#include <fog_pars_vertex>
3747#include <normal_pars_vertex>
3748#include <morphtarget_pars_vertex>
3749#include <skinning_pars_vertex>
3750#include <shadowmap_pars_vertex>
3751#include <logdepthbuf_pars_vertex>
3752#include <clipping_planes_pars_vertex>
3753void main() {
3754	#include <uv_vertex>
3755	#include <color_vertex>
3756	#include <morphinstance_vertex>
3757	#include <morphcolor_vertex>
3758	#include <batching_vertex>
3759	#include <beginnormal_vertex>
3760	#include <morphnormal_vertex>
3761	#include <skinbase_vertex>
3762	#include <skinnormal_vertex>
3763	#include <defaultnormal_vertex>
3764	#include <normal_vertex>
3765	#include <begin_vertex>
3766	#include <morphtarget_vertex>
3767	#include <skinning_vertex>
3768	#include <displacementmap_vertex>
3769	#include <project_vertex>
3770	#include <logdepthbuf_vertex>
3771	#include <clipping_planes_vertex>
3772	vViewPosition = - mvPosition.xyz;
3773	#include <worldpos_vertex>
3774	#include <shadowmap_vertex>
3775	#include <fog_vertex>
3776}`,XW=`#define TOON
3777uniform vec3 diffuse;
3778uniform vec3 emissive;
3779uniform float opacity;
3780#include <common>
3781#include <packing>
3782#include <dithering_pars_fragment>
3783#include <color_pars_fragment>
3784#include <uv_pars_fragment>
3785#include <map_pars_fragment>
3786#include <alphamap_pars_fragment>
3787#include <alphatest_pars_fragment>
3788#include <alphahash_pars_fragment>
3789#include <aomap_pars_fragment>
3790#include <lightmap_pars_fragment>
3791#include <emissivemap_pars_fragment>
3792#include <gradientmap_pars_fragment>
3793#include <fog_pars_fragment>
3794#include <bsdfs>
3795#include <lights_pars_begin>
3796#include <normal_pars_fragment>
3797#include <lights_toon_pars_fragment>
3798#include <shadowmap_pars_fragment>
3799#include <bumpmap_pars_fragment>
3800#include <normalmap_pars_fragment>
3801#include <logdepthbuf_pars_fragment>
3802#include <clipping_planes_pars_fragment>
3803void main() {
3804	vec4 diffuseColor = vec4( diffuse, opacity );
3805	#include <clipping_planes_fragment>
3806	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3807	vec3 totalEmissiveRadiance = emissive;
3808	#include <logdepthbuf_fragment>
3809	#include <map_fragment>
3810	#include <color_fragment>
3811	#include <alphamap_fragment>
3812	#include <alphatest_fragment>
3813	#include <alphahash_fragment>
3814	#include <normal_fragment_begin>
3815	#include <normal_fragment_maps>
3816	#include <emissivemap_fragment>
3817	#include <lights_toon_fragment>
3818	#include <lights_fragment_begin>
3819	#include <lights_fragment_maps>
3820	#include <lights_fragment_end>
3821	#include <aomap_fragment>
3822	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3823	#include <opaque_fragment>
3824	#include <tonemapping_fragment>
3825	#include <colorspace_fragment>
3826	#include <fog_fragment>
3827	#include <premultiplied_alpha_fragment>
3828	#include <dithering_fragment>
3829}`,ZW=`uniform float size;
3830uniform float scale;
3831#include <common>
3832#include <color_pars_vertex>
3833#include <fog_pars_vertex>
3834#include <morphtarget_pars_vertex>
3835#include <logdepthbuf_pars_vertex>
3836#include <clipping_planes_pars_vertex>
3837#ifdef USE_POINTS_UV
3838	varying vec2 vUv;
3839	uniform mat3 uvTransform;
3840#endif
3841void main() {
3842	#ifdef USE_POINTS_UV
3843		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3844	#endif
3845	#include <color_vertex>
3846	#include <morphinstance_vertex>
3847	#include <morphcolor_vertex>
3848	#include <begin_vertex>
3849	#include <morphtarget_vertex>
3850	#include <project_vertex>
3851	gl_PointSize = size;
3852	#ifdef USE_SIZEATTENUATION
3853		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3854		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3855	#endif
3856	#include <logdepthbuf_vertex>
3857	#include <clipping_planes_vertex>
3858	#include <worldpos_vertex>
3859	#include <fog_vertex>
3860}`,QW=`uniform vec3 diffuse;
3861uniform float opacity;
3862#include <common>
3863#include <color_pars_fragment>
3864#include <map_particle_pars_fragment>
3865#include <alphatest_pars_fragment>
3866#include <alphahash_pars_fragment>
3867#include <fog_pars_fragment>
3868#include <logdepthbuf_pars_fragment>
3869#include <clipping_planes_pars_fragment>
3870void main() {
3871	vec4 diffuseColor = vec4( diffuse, opacity );
3872	#include <clipping_planes_fragment>
3873	vec3 outgoingLight = vec3( 0.0 );
3874	#include <logdepthbuf_fragment>
3875	#include <map_particle_fragment>
3876	#include <color_fragment>
3877	#include <alphatest_fragment>
3878	#include <alphahash_fragment>
3879	outgoingLight = diffuseColor.rgb;
3880	#include <opaque_fragment>
3881	#include <tonemapping_fragment>
3882	#include <colorspace_fragment>
3883	#include <fog_fragment>
3884	#include <premultiplied_alpha_fragment>
3885}`,eV=`#include <common>
3886#include <batching_pars_vertex>
3887#include <fog_pars_vertex>
3888#include <morphtarget_pars_vertex>
3889#include <skinning_pars_vertex>
3890#include <logdepthbuf_pars_vertex>
3891#include <shadowmap_pars_vertex>
3892void main() {
3893	#include <batching_vertex>
3894	#include <beginnormal_vertex>
3895	#include <morphinstance_vertex>
3896	#include <morphnormal_vertex>
3897	#include <skinbase_vertex>
3898	#include <skinnormal_vertex>
3899	#include <defaultnormal_vertex>
3900	#include <begin_vertex>
3901	#include <morphtarget_vertex>
3902	#include <skinning_vertex>
3903	#include <project_vertex>
3904	#include <logdepthbuf_vertex>
3905	#include <worldpos_vertex>
3906	#include <shadowmap_vertex>
3907	#include <fog_vertex>
3908}`,tV=`uniform vec3 color;
3909uniform float opacity;
3910#include <common>
3911#include <packing>
3912#include <fog_pars_fragment>
3913#include <bsdfs>
3914#include <lights_pars_begin>
3915#include <logdepthbuf_pars_fragment>
3916#include <shadowmap_pars_fragment>
3917#include <shadowmask_pars_fragment>
3918void main() {
3919	#include <logdepthbuf_fragment>
3920	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3921	#include <tonemapping_fragment>
3922	#include <colorspace_fragment>
3923	#include <fog_fragment>
3924}`,nV=`uniform float rotation;
3925uniform vec2 center;
3926#include <common>
3927#include <uv_pars_vertex>
3928#include <fog_pars_vertex>
3929#include <logdepthbuf_pars_vertex>
3930#include <clipping_planes_pars_vertex>
3931void main() {
3932	#include <uv_vertex>
3933	vec4 mvPosition = modelViewMatrix[ 3 ];
3934	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3935	#ifndef USE_SIZEATTENUATION
3936		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3937		if ( isPerspective ) scale *= - mvPosition.z;
3938	#endif
3939	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3940	vec2 rotatedPosition;
3941	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3942	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3943	mvPosition.xy += rotatedPosition;
3944	gl_Position = projectionMatrix * mvPosition;
3945	#include <logdepthbuf_vertex>
3946	#include <clipping_planes_vertex>
3947	#include <fog_vertex>
3948}`,rV=`uniform vec3 diffuse;
3949uniform float opacity;
3950#include <common>
3951#include <uv_pars_fragment>
3952#include <map_pars_fragment>
3953#include <alphamap_pars_fragment>
3954#include <alphatest_pars_fragment>
3955#include <alphahash_pars_fragment>
3956#include <fog_pars_fragment>
3957#include <logdepthbuf_pars_fragment>
3958#include <clipping_planes_pars_fragment>
3959void main() {
3960	vec4 diffuseColor = vec4( diffuse, opacity );
3961	#include <clipping_planes_fragment>
3962	vec3 outgoingLight = vec3( 0.0 );
3963	#include <logdepthbuf_fragment>
3964	#include <map_fragment>
3965	#include <alphamap_fragment>
3966	#include <alphatest_fragment>
3967	#include <alphahash_fragment>
3968	outgoingLight = diffuseColor.rgb;
3969	#include <opaque_fragment>
3970	#include <tonemapping_fragment>
3971	#include <colorspace_fragment>
3972	#include <fog_fragment>
3973}`,Qn={alphahash_fragment:_G,alphahash_pars_fragment:EG,alphamap_fragment:kG,alphamap_pars_fragment:AG,alphatest_fragment:NG,alphatest_pars_fragment:TG,aomap_fragment:MG,aomap_pars_fragment:RG,batching_pars_vertex:DG,batching_vertex:PG,begin_vertex:jG,beginnormal_vertex:LG,bsdfs:IG,iridescence_fragment:BG,bumpmap_pars_fragment:OG,clipping_planes_fragment:UG,clipping_planes_pars_fragment:zG,clipping_planes_pars_vertex:GG,clipping_planes_vertex:HG,color_fragment:WG,color_pars_fragment:VG,color_pars_vertex:$G,color_vertex:KG,common:YG,cube_uv_reflection_fragment:qG,defaultnormal_vertex:JG,displacementmap_pars_vertex:XG,displacementmap_vertex:ZG,emissivemap_fragment:QG,emissivemap_pars_fragment:eH,colorspace_fragment:tH,colorspace_pars_fragment:nH,envmap_fragment:rH,envmap_common_pars_fragment:aH,envmap_pars_fragment:iH,envmap_pars_vertex:sH,envmap_physical_pars_fragment:xH,envmap_vertex:oH,fog_vertex:lH,fog_pars_vertex:cH,fog_fragment:uH,fog_pars_fragment:dH,gradientmap_pars_fragment:hH,lightmap_pars_fragment:mH,lights_lambert_fragment:fH,lights_lambert_pars_fragment:pH,lights_pars_begin:gH,lights_toon_fragment:vH,lights_toon_pars_fragment:yH,lights_phong_fragment:bH,lights_phong_pars_fragment:wH,lights_physical_fragment:SH,lights_physical_pars_fragment:FH,lights_fragment_begin:CH,lights_fragment_maps:_H,lights_fragment_end:EH,logdepthbuf_fragment:kH,logdepthbuf_pars_fragment:AH,logdepthbuf_pars_vertex:NH,logdepthbuf_vertex:TH,map_fragment:MH,map_pars_fragment:RH,map_particle_fragment:DH,map_particle_pars_fragment:PH,metalnessmap_fragment:jH,metalnessmap_pars_fragment:LH,morphinstance_vertex:IH,morphcolor_vertex:BH,morphnormal_vertex:OH,morphtarget_pars_vertex:UH,morphtarget_vertex:zH,normal_fragment_begin:GH,normal_fragment_maps:
vendor: 5,669 bytes, line 3973
3973HH,normal_pars_fragment:WH,normal_pars_vertex:VH,normal_vertex:$H,normalmap_pars_fragment:KH,clearcoat_normal_fragment_begin:YH,clearcoat_normal_fragment_maps:qH,clearcoat_pars_fragment:JH,iridescence_pars_fragment:XH,opaque_fragment:ZH,packing:QH,premultiplied_alpha_fragment:eW,project_vertex:tW,dithering_fragment:nW,dithering_pars_fragment:rW,roughnessmap_fragment:aW,roughnessmap_pars_fragment:iW,shadowmap_pars_fragment:sW,shadowmap_pars_vertex:oW,shadowmap_vertex:lW,shadowmask_pars_fragment:cW,skinbase_vertex:uW,skinning_pars_vertex:dW,skinning_vertex:hW,skinnormal_vertex:mW,specularmap_fragment:fW,specularmap_pars_fragment:pW,tonemapping_fragment:gW,tonemapping_pars_fragment:xW,transmission_fragment:vW,transmission_pars_fragment:yW,uv_pars_fragment:bW,uv_pars_vertex:wW,uv_vertex:SW,worldpos_vertex:FW,background_vert:CW,background_frag:_W,backgroundCube_vert:EW,backgroundCube_frag:kW,cube_vert:AW,cube_frag:NW,depth_vert:TW,depth_frag:MW,distanceRGBA_vert:RW,distanceRGBA_frag:DW,equirect_vert:PW,equirect_frag:jW,linedashed_vert:LW,linedashed_frag:IW,meshbasic_vert:BW,meshbasic_frag:OW,meshlambert_vert:UW,meshlambert_frag:zW,meshmatcap_vert:GW,meshmatcap_frag:HW,meshnormal_vert:WW,meshnormal_frag:VW,meshphong_vert:$W,meshphong_frag:KW,meshphysical_vert:YW,meshphysical_frag:qW,meshtoon_vert:JW,meshtoon_frag:XW,points_vert:ZW,points_frag:QW,shadow_vert:eV,shadow_frag:tV,sprite_vert:nV,sprite_frag:rV},dn={common:{diffuse:{value:new wr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Zn},alphaMap:{value:null},alphaMapTransform:{value:new Zn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Zn}},envmap:{envMap:{value:null},envMapRotation:{value:new Zn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Zn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Zn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Zn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Zn},normalScale:{value:new vr(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Zn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Zn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Zn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Zn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new wr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new wr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Zn},alphaTest:{value:0},uvTransform:{value:new Zn}},sprite:{diffuse:{value:new wr(16777215)},opacity:{value:1},center:{value:new vr(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Zn},alphaMap:{value:null},alphaMapTransform:{value:new Zn},alphaTest:{value:0}}},ho={basic:{uniforms:ri([dn.common,dn.specularmap,dn.envmap,dn.aomap,dn.lightmap,dn.fog]),vertexShader:Qn.meshbasic_vert,fragmentShader:Qn.meshbasic_frag},lambert:{uniforms:ri([dn.common,dn.specularmap,dn.envmap,dn.aomap,dn.lightmap,dn.emissivemap,dn.bumpmap,dn.normalmap,dn.displacementmap,dn.fog,dn.lights,{emissive:{value:new wr(0)}}]),vertexShader:Qn.meshlambert_vert,fragmentShader:Qn.meshlambert_frag},phong:{uniforms:ri([dn.common,dn.specularmap,dn.envmap,dn.aomap,dn.lightmap,dn.emissivemap,dn.bumpmap,dn.normalmap,dn.displacementmap,dn.fog,dn.lights,{emissive:{value:new wr(0)},specular:{value:new wr(1118481)},shininess:{value:30}}]),vertexShader:Qn.meshphong_vert,fragmentShader:Qn.meshphong_frag},standard:{uniforms:ri([dn.common,dn.envmap,dn.aomap,dn.lightmap,dn.emissivemap,dn.bumpmap,dn.normalmap,dn.displacementmap,dn.roughnessmap,dn.metalnessmap,dn.fog,dn.lights,{emissive:{value:new wr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qn.meshphysical_vert,fragmentShader:Qn.meshphysical_frag},toon:{uniforms:ri([dn.common,dn.aomap,dn.lightmap,dn.emissivemap,dn.bumpmap,dn.normalmap,dn.displacementmap,dn.gradientmap,dn.fog,dn.lights,{emissive:{value:new wr(0)}}]),vertexShader:Qn.meshtoon_vert,fragmentShader:Qn.meshtoon_frag},matcap:{uniforms:ri([dn.common,dn.bumpmap,dn.normalmap,dn.displacementmap,dn.fog,{matc
vendor: 5,281 bytes, line 3973
3973ap:{value:null}}]),vertexShader:Qn.meshmatcap_vert,fragmentShader:Qn.meshmatcap_frag},points:{uniforms:ri([dn.points,dn.fog]),vertexShader:Qn.points_vert,fragmentShader:Qn.points_frag},dashed:{uniforms:ri([dn.common,dn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qn.linedashed_vert,fragmentShader:Qn.linedashed_frag},depth:{uniforms:ri([dn.common,dn.displacementmap]),vertexShader:Qn.depth_vert,fragmentShader:Qn.depth_frag},normal:{uniforms:ri([dn.common,dn.bumpmap,dn.normalmap,dn.displacementmap,{opacity:{value:1}}]),vertexShader:Qn.meshnormal_vert,fragmentShader:Qn.meshnormal_frag},sprite:{uniforms:ri([dn.sprite,dn.fog]),vertexShader:Qn.sprite_vert,fragmentShader:Qn.sprite_frag},background:{uniforms:{uvTransform:{value:new Zn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Qn.background_vert,fragmentShader:Qn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Zn}},vertexShader:Qn.backgroundCube_vert,fragmentShader:Qn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qn.cube_vert,fragmentShader:Qn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qn.equirect_vert,fragmentShader:Qn.equirect_frag},distanceRGBA:{uniforms:ri([dn.common,dn.displacementmap,{referencePosition:{value:new Pt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qn.distanceRGBA_vert,fragmentShader:Qn.distanceRGBA_frag},shadow:{uniforms:ri([dn.lights,dn.fog,{color:{value:new wr(0)},opacity:{value:1}}]),vertexShader:Qn.shadow_vert,fragmentShader:Qn.shadow_frag}};ho.physical={uniforms:ri([ho.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Zn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Zn},clearcoatNormalScale:{value:new vr(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Zn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Zn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Zn},sheen:{value:0},sheenColor:{value:new wr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Zn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Zn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Zn},transmissionSamplerSize:{value:new vr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Zn},attenuationDistance:{value:0},attenuationColor:{value:new wr(0)},specularColor:{value:new wr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Zn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Zn},anisotropyVector:{value:new vr},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Zn}}]),vertexShader:Qn.meshphysical_vert,fragmentShader:Qn.meshphysical_frag};const $p={r:0,b:0,g:0},ru=new _l,aV=new ra;function iV(t,e,n,a,i,s,o){const c=new wr(0);let d=s===!0?0:1,m,f,p=null,b=0,v=null;function C(N){let P=N.isScene===!0?N.background:null;return P&&P.isTexture&&(P=(N.backgroundBlurriness>0?n:e).get(P)),P}function S(N){let P=!1;const z=C(N);z===null?w(c,d):z&&z.isColor&&(w(z,1),P=!0);const D=t.xr.getEnvironmentBlendMode();D==="additive"?a.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&a.buffers.color.setClear(0,0,0,0,o),(t.autoClear||P)&&(a.buffers.depth.setTest(!0),a.buffers.depth.setMask(!0),a.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function F(N,P){const z=C(P);z&&(z.isCubeTexture||z.mapping===Ax)?(f===void 0&&(f=new Hs(new cf(1,1,1),new El({name:"BackgroundCubeMaterial",uniforms:Zd(ho.backgroundCube.uniforms),vertexShader:ho.backgroundCube.vertexShader,fragmentShader:ho.backgroundCube.fragmentShader,side:ki,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(D,T,K){this.matrixWorld.copyPosition(K.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),ru.copy(P.backgroundRotation),ru.x*=-1,ru.y*=-1,ru.z*=-1,z.isCubeTexture&&z.isRenderTargetTexture===!1&&(ru.y*=-1,ru.z*=-1),f.material.uniforms.envMap.value=z,f.material.uniforms.flipEnvMap.value=z.isCubeTexture&&z.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=P.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(aV.makeRotationFromEuler(ru)),f.material.toneMapped=ur.getTransfer(z.colorSpace)!==br,(p!==z||b!==z.version||v!==t.toneMapping)&&(f.material.needsUpdate=!0,p=z,b=z.version,v=t.toneMapping),f.layers.enableAll(),N.unshift(f,f.geometry,f.material,0,0,null)):z&&z.isTexture&&(m===void 0&&(m=new Hs(new Qd(2,2),new El({name:"Backgroun
3973dMaterial",uniforms:Zd(ho.background.uniforms),vertexShader:ho.background.vertexShader,fragmentShader:ho.background.fragmentShader,side:Ec,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(m)),m.material.uniforms.t2D.value=z,m.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,m.material.toneMapped=ur.getTransfer(z.colorSpace)!==br,z.matrixAutoUpdate===!0&&z.updateMatrix(),m.material.uniforms.uvTransform.value.copy(z.matrix),(p!==z||b!==z.version||v!==t.toneMapping)&&(m.material.needsUpdate=!0,p=z,b=z.version,v=t.toneMapping),m.layers.enableAll(),N.unshift(m,m.geometry,m.material,0,0,null))}function w(N,P){N.getRGB($p,zT(t)),a.buffers.color.setClear($p.r,$p.g,$p.b,P,o)}function A(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return c},setClearColor:function(N,P=1){c.set(N),d=P,w(c,d)},getClearAlpha:function(){return d},setClearAlpha:function(N){d=N,w(c,d)},render:S,addToRenderList:F,dispose:A}}function sV(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),a={},i=b(null);let s=i,o=!1;function c(k,O,I,j,U){let q=!1;const Y=p(j,I,O);s!==Y&&(s=Y,m(s.object)),q=v(k,j,I,U),q&&C(k,j,I,U),U!==null&&e.update(U,t.ELEMENT_ARRAY_BUFFER),(q||o)&&(o=!1,P(k,O,I,j),U!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(U).buffer))}function d(){return t.createVertexArray()}function m(k){return t.bindVertexArray(k)}function f(k){return t.deleteVertexArray(k)}function p(k,O,I){const j=I.wireframe===!0;let U=a[k.id];U===void 0&&(U={},a[k.id]=U);let q=U[O.id];q===void 0&&(q={},U[O.id]=q);let Y=q[j];return Y===void 0&&(Y=b(d()),q[j]=Y),Y}function b(k){const O=[],I=[],j=[];for(let U=0;U<n;U++)O[U]=0,I[U]=0,j[U]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:O,enabledAttributes:I,attributeDivisors:j,object:k,attributes:{},index:null}}function v(k,O,I,j){const U=s.attributes,q=O.attributes;let Y=0;const W=I.getAttributes();for(const H in W)if(W[H].location>=0){const ie=U[H];let Q=q[H];if(Q===void 0&&(H==="instanceMatrix"&&k.instanceMatrix&&(Q=k.instanceMatrix),H==="instanceColor"&&k.instanceColor&&(Q=k.instanceColor)),ie===void 0||ie.attribute!==Q||Q&&ie.data!==Q.data)return!0;Y++}return s.attributesNum!==Y||s.index!==j}function C(k,O,I,j){const U={},q=O.attributes;let Y=0;const W=I.getAttributes();for(const H in W)if(W[H].location>=0){let ie=q[H];ie===void 0&&(H==="instanceMatrix"&&k.instanceMatrix&&(ie=k.instanceMatrix),H==="instanceColor"&&k.instanceColor&&(ie=k.instanceColor));const Q={};Q.attribute=ie,ie&&ie.data&&(Q.data=ie.data),U[H]=Q,Y++}s.attributes=U,s.attributesNum=Y,s.index=j}function S(){const k=s.newAttributes;for(let O=0,I=k.length;O<I;O++)k[O]=0}function F(k){w(k,0)}function w(k,O){const I=s.newAttributes,j=s.enabledAttributes,U=s.attributeDivisors;I[k]=1,j[k]===0&&(t.enableVertexAttribArray(k),j[k]=1),U[k]!==O&&(t.vertexAttribDivisor(k,O),U[k]=O)}function A(){const k=s.newAttributes,O=s.enabledAttributes;for(let I=0,j=O.length;I<j;I++)O[I]!==k[I]&&(t.disableVertexAttribArray(I),O[I]=0)}function N(k,O,I,j,U,q,Y){Y===!0?t.vertexAttribIPointer(k,O,I,U,q):t.vertexAttribPointer(k,O,I,j,U,q)}function P(k,O,I,j){S();const U=j.attributes,q=I.getAttributes(),Y=O.defaultAttributeValues;for(const W in q){const H=q[W];if(H.location>=0){let J=U[W];if(J===void 0&&(W==="instanceMatrix"&&k.instanceMatrix&&(J=k.instanceMatrix),W==="instanceColor"&&k.instanceColor&&(J=k.instanceColor)),J!==void 0){const ie=J.normalized,Q=J.itemSize,ve=e.get(J);if(ve===void 0)continue;const pe=ve.buffer,Me=ve.type,We=ve.bytesPerElement,Ae=Me===t.INT||Me===t.UNSIGNED_INT||J.gpuType===_w;if(J.isInterleavedBufferAttribute){const Ce=J.data,He=Ce.stride,Ct=J.offset;if(Ce.isInstancedInterleavedBuffer){for(let bt=0;bt<H.locationSize;bt++)w(H.location+bt,Ce.meshPerAttribute);k.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=Ce.meshPerAttribute*Ce.count)}else for(let bt=0;bt<H.locationSize;bt++)F(H.location+bt);t.bindBuffer(t.ARRAY_BUFFER,pe);for(let bt=0;bt<H.locationSize;bt++)N(H.location+bt,Q/H.locationSize,Me,ie,He*We,(Ct+Q/H.locationSize*bt)*We,Ae)}else{if(J.isInstancedBufferAttribute){for(let Ce=0;Ce<H.locationSize;Ce++)w(H.location+Ce,J.meshPerAttribute);k.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let Ce=0;Ce<H.locationSize;Ce++)F(H.location+Ce);t.bindBuffer(t.ARRAY_BUFFER,pe);for(let Ce=0;Ce<H.locationSize;Ce++)N(H.location+Ce,Q/H.locationSize,Me,ie,Q*We,Q/H.locationSize*Ce*We,Ae)}}else if(Y!==void 0){const ie=Y[W];if(ie!==void 0)switch(ie.length){case 2:t.vertexAttrib2fv(H.location,ie);break;case 3:t.vertexAttrib3fv(H.location,ie);break;case 4:t.vertexAttrib4fv(H.location,ie);break;default:t.vertexAttrib1fv(H.location,ie)}}}}A()}function z(){K();for(const k in a){const O=a[k];for(const I in O){const j=O[I];for(const U in j)f(j[U].object),delete j[U];delete O[I]}delete a[k]}}function D(k){if(a[k.id]===void 0)return;const O=a[k.id];for(const I in O){const j=O[I];for(const U in j)f(j[U].object),delete j[U];delete O[I]}delete a[k.id]}function T(k){for(const O in a){const I=a[O];if(I[k.id]===void 0)continue;const j=I[k.id];for(const U in j)f(j[U].object),delete j[U];delete I[k.id]}}function K(){B(),o=!0,s!==i&&(s=i,m(s.object))}function B(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:c,reset:K,resetDefaultState:B,dispose:z,releaseStatesOfGeometry:D,releaseStatesOfProgram:T,initAttributes:S,enableAttribute:F,disableUnusedAttributes:A}}function oV(t,e,n){let a;function i(m){a=m}function s(m,f){t.drawArrays(a,m,f),n.update(f,a,1)}function o(m,f,p){p!==0&&(t.drawArraysInstanced(a,m,f,p),n.update(f,a,p))}function c(m,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(a,m,0,f,0,p);let v=0;for(let C=0;C<p;C++)v+=f[C];n.update(v,a,1)}function d(m,f,p,b){if(p===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let C=0;C<m.length;C++)o(m[C],f[C],b[C]);
vendor: 7,207 bytes, line 3973
3973else{v.multiDrawArraysInstancedWEBGL(a,m,0,f,0,b,0,p);let C=0;for(let S=0;S<p;S++)C+=f[S]*b[S];n.update(C,a,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=c,this.renderMultiDrawInstances=d}function lV(t,e,n,a){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(T){return!(T!==Gs&&a.convert(T)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function c(T){const K=T===hh&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==Cl&&a.convert(T)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==pl&&!K)}function d(T){if(T==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let m=n.precision!==void 0?n.precision:"highp";const f=d(m);f!==m&&(Yn("WebGLRenderer:",m,"not supported, using",f,"instead."),m=f);const p=n.logarithmicDepthBuffer===!0,b=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),v=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),C=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=t.getParameter(t.MAX_TEXTURE_SIZE),F=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),w=t.getParameter(t.MAX_VERTEX_ATTRIBS),A=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),N=t.getParameter(t.MAX_VARYING_VECTORS),P=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),z=C>0,D=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:d,textureFormatReadable:o,textureTypeReadable:c,precision:m,logarithmicDepthBuffer:p,reversedDepthBuffer:b,maxTextures:v,maxVertexTextures:C,maxTextureSize:S,maxCubemapSize:F,maxAttributes:w,maxVertexUniforms:A,maxVaryings:N,maxFragmentUniforms:P,vertexTextures:z,maxSamples:D}}function cV(t){const e=this;let n=null,a=0,i=!1,s=!1;const o=new ou,c=new Zn,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(p,b){const v=p.length!==0||b||a!==0||i;return i=b,a=p.length,v},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,b){n=f(p,b,0)},this.setState=function(p,b,v){const C=p.clippingPlanes,S=p.clipIntersection,F=p.clipShadows,w=t.get(p);if(!i||C===null||C.length===0||s&&!F)s?f(null):m();else{const A=s?0:a,N=A*4;let P=w.clippingState||null;d.value=P,P=f(C,b,N,v);for(let z=0;z!==N;++z)P[z]=n[z];w.clippingState=P,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=A}};function m(){d.value!==n&&(d.value=n,d.needsUpdate=a>0),e.numPlanes=a,e.numIntersection=0}function f(p,b,v,C){const S=p!==null?p.length:0;let F=null;if(S!==0){if(F=d.value,C!==!0||F===null){const w=v+S*4,A=b.matrixWorldInverse;c.getNormalMatrix(A),(F===null||F.length<w)&&(F=new Float32Array(w));for(let N=0,P=v;N!==S;++N,P+=4)o.copy(p[N]).applyMatrix4(A,c),o.normal.toArray(F,P),F[P+3]=o.constant}d.value=F,d.needsUpdate=!0}return e.numPlanes=S,e.numIntersection=0,F}}function uV(t){let e=new WeakMap;function n(o,c){return c===gb?o.mapping=qd:c===xb&&(o.mapping=Jd),o}function a(o){if(o&&o.isTexture){const c=o.mapping;if(c===gb||c===xb)if(e.has(o)){const d=e.get(o).texture;return n(d,o.mapping)}else{const d=o.image;if(d&&d.height>0){const m=new oG(d.height);return m.fromEquirectangularTexture(t,o),e.set(o,m),o.addEventListener("dispose",i),n(m.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const d=e.get(c);d!==void 0&&(e.delete(c),d.dispose())}function s(){e=new WeakMap}return{get:a,dispose:s}}const vc=4,i_=[.125,.215,.35,.446,.526,.582],du=20,dV=512,am=new bG,s_=new wr;let sy=null,oy=0,ly=0,cy=!1;const hV=new Pt;class o_{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,a=.1,i=100,s={}){const{size:o=256,position:c=hV}=s;sy=this._renderer.getRenderTarget(),oy=this._renderer.getActiveCubeFace(),ly=this._renderer.getActiveMipmapLevel(),cy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const d=this._allocateTargets();return d.depthBuffer=!0,this._sceneToCubeUV(e,a,i,d,c),n>0&&this._blur(d,0,0,n),this._applyPMREM(d),this._cleanup(d),d}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=u_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=c_(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(sy,oy,ly),this._renderer.xr.enabled=cy,e.scissorTest=!1,Sd(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===qd||e.mapping===Jd?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),sy=this._renderer.getRenderTarget(),oy=this._renderer.getActiveCubeFace(),ly=this._renderer.getActiveMipmapLevel(),cy=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const a=n||this._allocateTargets();return this._textureToCubeUV(e,a),this._applyPMREM(a),this._cleanup(a),a}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,a={magFilter:Gi,minFilter:Gi,generateMipmaps:!1,type:hh,format:Gs,colorSpace:Xd,depthBuffer:!1},i=l_(e,n,a);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=l_(e,n,a);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=mV(s)),this._blurMaterial=pV(s,e,n)}return i}_compileMaterial(e){const n=new Hs(new Rc,e);this._renderer.compile(n,am)}_sceneToCubeUV(e,n,a,i,s){const d=new cs(90,1,n,a),m=[1,-1,1,1,1,1],f=[1,1,1,-1,-1,-1],p=this._renderer,b=p.autoClear,v=p.toneMapping;p.getClearColor(s_),p.toneMapping=Sc,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(i),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Hs(new cf,new uu({name:"PMREM.Backgroun
3973d",side:ki,depthWrite:!1,depthTest:!1})));const S=this._backgroundBox,F=S.material;let w=!1;const A=e.background;A?A.isColor&&(F.color.copy(A),e.background=null,w=!0):(F.color.copy(s_),w=!0);for(let N=0;N<6;N++){const P=N%3;P===0?(d.up.set(0,m[N],0),d.position.set(s.x,s.y,s.z),d.lookAt(s.x+f[N],s.y,s.z)):P===1?(d.up.set(0,0,m[N]),d.position.set(s.x,s.y,s.z),d.lookAt(s.x,s.y+f[N],s.z)):(d.up.set(0,m[N],0),d.position.set(s.x,s.y,s.z),d.lookAt(s.x,s.y,s.z+f[N]));const z=this._cubeSize;Sd(i,P*z,N>2?z:0,z,z),p.setRenderTarget(i),w&&p.render(S,d),p.render(e,d)}p.toneMapping=v,p.autoClear=b,e.background=A}_textureToCubeUV(e,n){const a=this._renderer,i=e.mapping===qd||e.mapping===Jd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=u_()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=c_());const s=i?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const c=s.uniforms;c.envMap.value=e;const d=this._cubeSize;Sd(n,0,0,3*d,2*d),a.setRenderTarget(n),a.render(o,am)}_applyPMREM(e){const n=this._renderer,a=n.autoClear;n.autoClear=!1;const i=this._lodMeshes.length;for(let s=1;s<i;s++)this._applyGGXFilter(e,s-1,s);n.autoClear=a}_applyGGXFilter(e,n,a){const i=this._renderer,s=this._pingPongRenderTarget;if(this._ggxMaterial===null){const A=3*Math.max(this._cubeSize,16),N=4*this._cubeSize;this._ggxMaterial=fV(this._lodMax,A,N)}const o=this._ggxMaterial,c=this._lodMeshes[a];c.material=o;const d=o.uniforms,m=a/(this._lodMeshes.length-1),f=n/(this._lodMeshes.length-1),p=Math.sqrt(m*m-f*f),b=.05+m*.95,v=p*b,{_lodMax:C}=this,S=this._sizeLods[a],F=3*S*(a>C-vc?a-C+vc:0),w=4*(this._cubeSize-S);d.envMap.value=e.texture,d.roughness.value=v,d.mipInt.value=C-n,Sd(s,F,w,3*S,2*S),i.setRenderTarget(s),i.render(c,am),d.envMap.value=s.texture,d.roughness.value=0,d.mipInt.value=C-a,Sd(e,F,w,3*S,2*S),i.setRenderTarget(e),i.render(c,am)}_blur(e,n,a,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,a,i,"latitudinal",s),this._halfBlur(o,e,a,a,i,"longitudinal",s)}_halfBlur(e,n,a,i,s,o,c){const d=this._renderer,m=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&Wr("blur direction must be either latitudinal or longitudinal!");const f=3,p=this._lodMeshes[i];p.material=m;const b=m.uniforms,v=this._sizeLods[a]-1,C=isFinite(s)?Math.PI/(2*v):2*Math.PI/(2*du-1),S=s/C,F=isFinite(s)?1+Math.floor(f*S):du;F>du&&Yn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${F} samples when the maximum is set to ${du}`);const w=[];let A=0;for(let T=0;T<du;++T){const K=T/S,B=Math.exp(-K*K/2);w.push(B),T===0?A+=B:T<F&&(A+=2*B)}for(let T=0;T<w.length;T++)w[T]=w[T]/A;b.envMap.value=e.texture,b.samples.value=F,b.weights.value=w,b.latitudinal.value=o==="latitudinal",c&&(b.poleAxis.value=c);const{_lodMax:N}=this;b.dTheta.value=C,b.mipInt.value=N-a;const P=this._sizeLods[i],z=3*P*(i>N-vc?i-N+vc:0),D=4*(this._cubeSize-P);Sd(n,z,D,3*P,2*P),d.setRenderTarget(n),d.render(p,am)}}function mV(t){const e=[],n=[],a=[];let i=t;const s=t-vc+1+i_.length;for(let o=0;o<s;o++){const c=Math.pow(2,i);e.push(c);let d=1/c;o>t-vc?d=i_[o-t+vc-1]:o===0&&(d=0),n.push(d);const m=1/(c-2),f=-m,p=1+m,b=[f,f,p,f,p,p,f,f,p,p,f,p],v=6,C=6,S=3,F=2,w=1,A=new Float32Array(S*C*v),N=new Float32Array(F*C*v),P=new Float32Array(w*C*v);for(let D=0;D<v;D++){const T=D%3*2/3-1,K=D>2?0:-1,B=[T,K,0,T+2/3,K,0,T+2/3,K+1,0,T,K,0,T+2/3,K+1,0,T,K+1,0];A.set(B,S*C*D),N.set(b,F*C*D);const k=[D,D,D,D,D,D];P.set(k,w*C*D)}const z=new Rc;z.setAttribute("position",new Eo(A,S)),z.setAttribute("uv",new Eo(N,F)),z.setAttribute("faceIndex",new Eo(P,w)),a.push(new Hs(z,null)),i>vc&&i--}return{lodMeshes:a,sizeLods:e,sigmas:n}}function l_(t,e,n){const a=new Fu(t,e,n);return a.texture.mapping=Ax,a.texture.name="PMREM.cubeUv",a.scissorTest=!0,a}function Sd(t,e,n,a,i){t.viewport.set(e,n,a,i),t.scissor.set(e,n,a,i)}function fV(t,e,n){return new El({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:dV,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Nx(),fragmentShader:`
3974
3975			precision mediump float;
3976			precision mediump int;
3977
3978			varying vec3 vOutputDirection;
3979
3980			uniform sampler2D envMap;
3981			uniform float roughness;
3982			uniform float mipInt;
3983
3984			#define ENVMAP_TYPE_CUBE_UV
3985			#include <cube_uv_reflection_fragment>
3986
3987			#define PI 3.14159265359
3988
3989			// Van der Corput radical inverse
3990			float radicalInverse_VdC(uint bits) {
3991				bits = (bits << 16u) | (bits >> 16u);
3992				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3993				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3994				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3995				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3996				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3997			}
3998
3999			// Hammersley sequence
4000			vec2 hammersley(uint i, uint N) {
4001				return vec2(float(i) / float(N), radicalInverse_VdC(i));
4002			}
4003
4004			// GGX VNDF importance sampling (Eric Heitz 2018)
4005			// "Sampling the GGX Distribution of Visible Normals"
4006			// https://jcgt.org/published/0007/04/01/
4007			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
4008				float alpha = roughness * roughness;
4009
4010				// Section 3.2: Transform view direction to hemisphere configuration
4011				vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
4012
4013				// Section 4.1: Orthonormal basis
4014				float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
4015				vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
4016				vec3 T2 = cross(Vh, T1);
4017
4018				// Section 4.2: Parameterization of projected area
4019				float r = sqrt(Xi.x);
4020				float phi = 2.0 * PI * Xi.y;
4021				float t1 = r * cos(phi);
4022				float t2 = r * sin(phi);
4023				float s = 0.5 * (1.0 + Vh.z);
4024				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
4025
4026				// Section 4.3: Reprojection onto hemisphere
4027				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
4028
4029				// Section 3.4: Transform back to ellipsoid configuration
4030				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
4031			}
4032
4033			void main() {
4034				vec3 N = normalize(vOutputDirection);
4035				vec3 V = N; // Assume view direction equals normal for pre-filtering
4036
4037				vec3 prefilteredColor = vec3(0.0);
4038				float totalWeight = 0.0;
4039
4040				// For very low roughness, just sample the environment directly
4041				if (roughness < 0.001) {
4042					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
4043					return;
4044				}
4045
4046				// Tangent space basis for VNDF sampling
4047				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
4048				vec3 tangent = normalize(cross(up, N));
4049				vec3 bitangent = cross(N, tangent);
4050
4051				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
4052					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
4053
4054					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
4055					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
4056
4057					// Transform H back to world space
4058					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
4059					vec3 L = normalize(2.0 * dot(V, H) * H - V);
4060
4061					float NdotL = max(dot(N, L), 0.0);
4062
4063					if(NdotL > 0.0) {
4064						// Sample environment at fixed mip level
4065						// VNDF importance sampling handles the distribution filtering
4066						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
4067
4068						// Weight by NdotL for the split-sum approximation
4069						// VNDF PDF naturally accounts for the visible microfacet distribution
4070						prefilteredColor += sampleColor * NdotL;
4071						totalWeight += NdotL;
4072					}
4073				}
4074
4075				if (totalWeight > 0.0) {
4076					prefilteredColor = prefilteredColor / totalWeight;
4077				}
4078
4079				gl_FragColor = vec4(prefilteredColor, 1.0);
4080			}
4081		`,blending:vl,depthTest:!1,depthWrite:!1})}function pV(t,e,n){const a=new Float32Array(du),i=new Pt(0,1,0);return new El({name:"SphericalGaussianBlur",defines:{n:du,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:a},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Nx(),fragmentShader:`
4082
4083			precision mediump float;
4084			precision mediump int;
4085
4086			varying vec3 vOutputDirection;
4087
4088			uniform sampler2D envMap;
4089			uniform int samples;
4090			uniform float weights[ n ];
4091			uniform bool latitudinal;
4092			uniform float dTheta;
4093			uniform float mipInt;
4094			uniform vec3 poleAxis;
4095
4096			#define ENVMAP_TYPE_CUBE_UV
4097			#include <cube_uv_reflection_fragment>
4098
4099			vec3 getSample( float theta, vec3 axis ) {
4100
4101				float cosTheta = cos( theta );
4102				// Rodrigues' axis-angle rotation
4103				vec3 sampleDirection = vOutputDirection * cosTheta
4104					+ cross( axis, vOutputDirection ) * sin( theta )
4105					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
4106
4107				return bilinearCubeUV( envMap, sampleDirection, mipInt );
4108
4109			}
4110
4111			void main() {
4112
4113				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
4114
4115				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
4116
4117					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
4118
4119				}
4120
4121				axis = normalize( axis );
4122
4123				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
4124				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
4125
4126				for ( int i = 1; i < n; i++ ) {
4127
4128					if ( i >= samples ) {
4129
4130						break;
4131
4132					}
4133
4134					float theta = dTheta * float( i );
4135					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
4136					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
4137
4138				}
4139
4140			}
4141		`,blending:vl,depthTest:!1,depthWrite:!1})}function c_(){return new El({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Nx(),fragmentShader:`
4142
4143			precision mediump float;
4144			precision mediump int;
4145
4146			varying vec3 vOutputDirection;
4147
4148			uniform sampler2D envMap;
4149
4150			#include <common>
4151
4152			void main() {
4153
4154				vec3 outputDirection = normalize( vOutputDirection );
4155				vec2 uv = equirectUv( outputDirection );
4156
4157				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
4158
4159			}
4160		`,blending:vl,depthTest:!1,depthWrite:!1})}function u_(){return new El({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Nx(),fragmentShader:`
4161
4162			precision mediump float;
4163			precision mediump int;
4164
4165			uniform float flipEnvMap;
4166
4167			varying vec3 vOutputDirection;
4168
4169			uniform samplerCube envMap;
4170
4171			void main() {
4172
4173				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
4174
4175			}
4176		`,blending:vl,depthTest:!1,depthWrite:!1})}function Nx(){return`
4177
4178		precision mediump float;
4179		precision mediump int;
4180
4181		attribute float faceIndex;
4182
4183		varying vec3 vOutputDirection;
4184
4185		// RH coordinate system; PMREM face-indexing convention
4186		vec3 getDirection( vec2 uv, float face ) {
4187
4188			uv = 2.0 * uv - 1.0;
4189
4190			vec3 direction = vec3( uv, 1.0 );
4191
4192			if ( face == 0.0 ) {
4193
4194				direction = direction.zyx; // ( 1, v, u ) pos x
4195
4196			} else if ( face == 1.0 ) {
4197
4198				direction = direction.xzy;
4199				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
4200
4201			} else if ( face == 2.0 ) {
4202
4203				direction.x *= -1.0; // ( -u, v, 1 ) pos z
4204
4205			} else if ( face == 3.0 ) {
4206
4207				direction = direction.zyx;
4208				direction.xz *= -1.0; // ( -1, v, -u ) neg x
4209
4210			} else if ( face == 4.0 ) {
4211
4212				direction = direction.xzy;
4213				direction.xy *= -1.0; // ( -u, -1, v ) neg y
4214
4215			} else if ( face == 5.0 ) {
4216
4217				direction.z *= -1.0; // ( u, v, -1 ) neg z
4218
4219			}
4220
4221			return direction;
4222
4223		}
4224
4225		void main() {
4226
4227			vOutputDirection = getDirection( uv, faceIndex );
4228			gl_Position = vec4( position, 1.0 );
4229
4230		}
4231	`}function gV(t){let e=new WeakMap,n=null;function a(c){if(c&&c.isTexture){const d=c.mapping,m=d===gb||d===xb,f=d===qd||d===Jd;if(m||f){let p=e.get(c);const b=p!==void 0?p.texture.pmremVersion:0;if(c.isRenderTargetTexture&&c.pmremVersion!==b)return n===null&&(n=new o_(t)),p=m?n.fromEquirectangular(c,p):n.fromCubemap(c,p),p.texture.pmremVersion=c.pmremVersion,e.set(c,p),p.texture;if(p!==void 0)return p.texture;{const v=c.image;return m&&v&&v.height>0||f&&v&&i(v)?(n===null&&(n=new o_(t)),p=m?n.fromEquirectangular(c):n.fromCubemap(c),p.texture.pmremVersion=c.pmremVersion,e.set(c,p),c.addEventListener("dispose",s),p.texture):null}}}return c}function i(c){let d=0;const m=6;for(let f=0;f<m;f++)c[f]!==void 0&&d++;return d===m}function s(c){const d=c.target;d.removeEventListener("dispose",s);const m=e.get(d);m!==void 0&&(e.delete(d),m.dispose())}function o(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:a,dispose:o}}function xV(t){const e={};function n(a){if(e[a]!==void 0)return e[a];const i=t.getExtension(a);return e[a]=i,i}return{has:function(a){return n(a)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(a){const i=n(a);return i===null&&Wm("WebGLRenderer: "+a+" extension not supported."),i}}}function vV(t,e,n,a){const i={},s=new WeakMap;function o(p){const b=p.target;b.index!==null&&e.remove(b.index);for(const C in b.attributes)e.remove(b.attributes[C]);b.removeEventListener("dispose",o),delete i[b.id];const v=s.get(b);v&&(e.remove(v),s.delete(b)),a.releaseStatesOfGeometry(b),b.isInstancedBufferGeometry===!0&&delete b._maxInstanceCount,n.memory.geometries--}function c(p,b){return i[b.id]===!0||(b.addEventListener("dispose",o),i[b.id]=!0,n.memory.geometries++),b}function d(p){const b=p.attributes;for(const v in b)e.update(b[v],t.ARRAY_BUFFER)}function m(p){const b=[],v=p.index,C=p.attributes.position;let S=0;if(v!==null){const A=v.array;S=v.version;for(let N=0,P=A.length;N<P;N+=3){const z=A[N+0],D=A[N+1],T=A[N+2];b.push(z,D,D,T,T,z)}}else if(C!==void 0){const A=C.array;S=C.version;for(let N=0,P=A.length/3-1;N<P;N+=3){const z=N+0,D=N+1,T=N+2;b.push(z,D,D,T,T,z)}}else return;const F=new(jT(b)?UT:OT)(b,1);F.version=S;const w=s.get(p);w&&e.remove(w),s.set(p,F)}function f(p){const b=s.get(p);if(b){const v=p.index;v!==null&&b.version<v.version&&m(p)}else m(p);return s.get(p)}return{get:c,update:d,getWireframeAttribute:f}}function yV(t,e,n){let a;function i(b){a=b}let s,o;function c(b){s=b.type,o=b.bytesPerElement}function d(b,v){t.drawElements(a,v,s,b*o),n.update(v,a,1)}function m(b,v,C){C!==0&&(t.drawElementsInstanced(a,v,s,b*o,C),n.update(v,a,C))}function f(b,v,C){if(C===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(a,v,0,s,b,0,C);let F=0;for(let w=0;w<C;w++)F+=v[w];n.update(F,a,1)}function p(b,v,C,S){if(C===0)return;const F=e.get("WEBGL_multi_draw");if(F===null)for(let w=0;w<b.length;w++)m(b[w]/o,v[w],S[w]);
vendor: 5,334 bytes, line 4231
4231else{F.multiDrawElementsInstancedWEBGL(a,v,0,s,b,0,S,0,C);let w=0;for(let A=0;A<C;A++)w+=v[A]*S[A];n.update(w,a,1)}}this.setMode=i,this.setIndex=c,this.render=d,this.renderInstances=m,this.renderMultiDraw=f,this.renderMultiDrawInstances=p}function bV(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function a(s,o,c){switch(n.calls++,o){case t.TRIANGLES:n.triangles+=c*(s/3);break;case t.LINES:n.lines+=c*(s/2);break;case t.LINE_STRIP:n.lines+=c*(s-1);break;case t.LINE_LOOP:n.lines+=c*s;break;case t.POINTS:n.points+=c*s;break;default:Wr("WebGLInfo: Unknown draw mode:",o);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:a}}function wV(t,e,n){const a=new WeakMap,i=new $r;function s(o,c,d){const m=o.morphTargetInfluences,f=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,p=f!==void 0?f.length:0;let b=a.get(c);if(b===void 0||b.count!==p){let B=function(){T.dispose(),a.delete(c),c.removeEventListener("dispose",B)};b!==void 0&&b.texture.dispose();const v=c.morphAttributes.position!==void 0,C=c.morphAttributes.normal!==void 0,S=c.morphAttributes.color!==void 0,F=c.morphAttributes.position||[],w=c.morphAttributes.normal||[],A=c.morphAttributes.color||[];let N=0;v===!0&&(N=1),C===!0&&(N=2),S===!0&&(N=3);let P=c.attributes.position.count*N,z=1;P>e.maxTextureSize&&(z=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const D=new Float32Array(P*z*4*p),T=new LT(D,P,z,p);T.type=pl,T.needsUpdate=!0;const K=N*4;for(let k=0;k<p;k++){const O=F[k],I=w[k],j=A[k],U=P*z*4*k;for(let q=0;q<O.count;q++){const Y=q*K;v===!0&&(i.fromBufferAttribute(O,q),D[U+Y+0]=i.x,D[U+Y+1]=i.y,D[U+Y+2]=i.z,D[U+Y+3]=0),C===!0&&(i.fromBufferAttribute(I,q),D[U+Y+4]=i.x,D[U+Y+5]=i.y,D[U+Y+6]=i.z,D[U+Y+7]=0),S===!0&&(i.fromBufferAttribute(j,q),D[U+Y+8]=i.x,D[U+Y+9]=i.y,D[U+Y+10]=i.z,D[U+Y+11]=j.itemSize===4?i.w:1)}}b={count:p,texture:T,size:new vr(P,z)},a.set(c,b),c.addEventListener("dispose",B)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)d.getUniforms().setValue(t,"morphTexture",o.morphTexture,n);else{let v=0;for(let S=0;S<m.length;S++)v+=m[S];const C=c.morphTargetsRelative?1:1-v;d.getUniforms().setValue(t,"morphTargetBaseInfluence",C),d.getUniforms().setValue(t,"morphTargetInfluences",m)}d.getUniforms().setValue(t,"morphTargetsTexture",b.texture,n),d.getUniforms().setValue(t,"morphTargetsTextureSize",b.size)}return{update:s}}function SV(t,e,n,a){let i=new WeakMap;function s(d){const m=a.render.frame,f=d.geometry,p=e.get(d,f);if(i.get(p)!==m&&(e.update(p),i.set(p,m)),d.isInstancedMesh&&(d.hasEventListener("dispose",c)===!1&&d.addEventListener("dispose",c),i.get(d)!==m&&(n.update(d.instanceMatrix,t.ARRAY_BUFFER),d.instanceColor!==null&&n.update(d.instanceColor,t.ARRAY_BUFFER),i.set(d,m))),d.isSkinnedMesh){const b=d.skeleton;i.get(b)!==m&&(b.update(),i.set(b,m))}return p}function o(){i=new WeakMap}function c(d){const m=d.target;m.removeEventListener("dispose",c),n.remove(m.instanceMatrix),m.instanceColor!==null&&n.remove(m.instanceColor)}return{update:s,dispose:o}}const qT=new Da,d_=new $T(1,1),JT=new LT,XT=new Wz,ZT=new HT,h_=[],m_=[],f_=new Float32Array(16),p_=new Float32Array(9),g_=new Float32Array(4);function fh(t,e,n){const a=t[0];if(a<=0||a>0)return t;const i=e*n;let s=h_[i];if(s===void 0&&(s=new Float32Array(i),h_[i]=s),e!==0){a.toArray(s,0);for(let o=1,c=0;o!==e;++o)c+=n,t[o].toArray(s,c)}return s}function pa(t,e){if(t.length!==e.length)return!1;for(let n=0,a=t.length;n<a;n++)if(t[n]!==e[n])return!1;return!0}function ga(t,e){for(let n=0,a=e.length;n<a;n++)t[n]=e[n]}function Tx(t,e){let n=m_[e];n===void 0&&(n=new Int32Array(e),m_[e]=n);for(let a=0;a!==e;++a)n[a]=t.allocateTextureUnit();return n}function FV(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function CV(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(pa(n,e))return;t.uniform2fv(this.addr,e),ga(n,e)}}function _V(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(pa(n,e))return;t.uniform3fv(this.addr,e),ga(n,e)}}function EV(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(pa(n,e))return;t.uniform4fv(this.addr,e),ga(n,e)}}function kV(t,e){const n=this.cache,a=e.elements;if(a===void 0){if(pa(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ga(n,e)}else{if(pa(n,a))return;g_.set(a),t.uniformMatrix2fv(this.addr,!1,g_),ga(n,a)}}function AV(t,e){const n=this.cache,a=e.elements;if(a===void 0){if(pa(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ga(n,e)}else{if(pa(n,a))return;p_.set(a),t.uniformMatrix3fv(this.addr,!1,p_),ga(n,a)}}function NV(t,e){const n=this.cache,a=e.elements;if(a===void 0){if(pa(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ga(n,e)}else{if(pa(n,a))return;f_.set(a),t.uniformMatrix4fv(this.addr,!1,f_),ga(n,a)}}function TV(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function MV(t,e){const n=this.cache;
vendor: 12,006 bytes, lines 4231-4266
4231if(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(pa(n,e))return;t.uniform2iv(this.addr,e),ga(n,e)}}function RV(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(pa(n,e))return;t.uniform3iv(this.addr,e),ga(n,e)}}function DV(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(pa(n,e))return;t.uniform4iv(this.addr,e),ga(n,e)}}function PV(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function jV(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(pa(n,e))return;t.uniform2uiv(this.addr,e),ga(n,e)}}function LV(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(pa(n,e))return;t.uniform3uiv(this.addr,e),ga(n,e)}}function IV(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(pa(n,e))return;t.uniform4uiv(this.addr,e),ga(n,e)}}function BV(t,e,n){const a=this.cache,i=n.allocateTextureUnit();a[0]!==i&&(t.uniform1i(this.addr,i),a[0]=i);let s;this.type===t.SAMPLER_2D_SHADOW?(d_.compareFunction=PT,s=d_):s=qT,n.setTexture2D(e||s,i)}function OV(t,e,n){const a=this.cache,i=n.allocateTextureUnit();a[0]!==i&&(t.uniform1i(this.addr,i),a[0]=i),n.setTexture3D(e||XT,i)}function UV(t,e,n){const a=this.cache,i=n.allocateTextureUnit();a[0]!==i&&(t.uniform1i(this.addr,i),a[0]=i),n.setTextureCube(e||ZT,i)}function zV(t,e,n){const a=this.cache,i=n.allocateTextureUnit();a[0]!==i&&(t.uniform1i(this.addr,i),a[0]=i),n.setTexture2DArray(e||JT,i)}function GV(t){switch(t){case 5126:return FV;case 35664:return CV;case 35665:return _V;case 35666:return EV;case 35674:return kV;case 35675:return AV;case 35676:return NV;case 5124:case 35670:return TV;case 35667:case 35671:return MV;case 35668:case 35672:return RV;case 35669:case 35673:return DV;case 5125:return PV;case 36294:return jV;case 36295:return LV;case 36296:return IV;case 35678:case 36198:case 36298:case 36306:case 35682:return BV;case 35679:case 36299:case 36307:return OV;case 35680:case 36300:case 36308:case 36293:return UV;case 36289:case 36303:case 36311:case 36292:return zV}}function HV(t,e){t.uniform1fv(this.addr,e)}function WV(t,e){const n=fh(e,this.size,2);t.uniform2fv(this.addr,n)}function VV(t,e){const n=fh(e,this.size,3);t.uniform3fv(this.addr,n)}function $V(t,e){const n=fh(e,this.size,4);t.uniform4fv(this.addr,n)}function KV(t,e){const n=fh(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function YV(t,e){const n=fh(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function qV(t,e){const n=fh(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function JV(t,e){t.uniform1iv(this.addr,e)}function XV(t,e){t.uniform2iv(this.addr,e)}function ZV(t,e){t.uniform3iv(this.addr,e)}function QV(t,e){t.uniform4iv(this.addr,e)}function e$(t,e){t.uniform1uiv(this.addr,e)}function t$(t,e){t.uniform2uiv(this.addr,e)}function n$(t,e){t.uniform3uiv(this.addr,e)}function r$(t,e){t.uniform4uiv(this.addr,e)}function a$(t,e,n){const a=this.cache,i=e.length,s=Tx(n,i);pa(a,s)||(t.uniform1iv(this.addr,s),ga(a,s));for(let o=0;o!==i;++o)n.setTexture2D(e[o]||qT,s[o])}function i$(t,e,n){const a=this.cache,i=e.length,s=Tx(n,i);pa(a,s)||(t.uniform1iv(this.addr,s),ga(a,s));for(let o=0;o!==i;++o)n.setTexture3D(e[o]||XT,s[o])}function s$(t,e,n){const a=this.cache,i=e.length,s=Tx(n,i);pa(a,s)||(t.uniform1iv(this.addr,s),ga(a,s));for(let o=0;o!==i;++o)n.setTextureCube(e[o]||ZT,s[o])}function o$(t,e,n){const a=this.cache,i=e.length,s=Tx(n,i);pa(a,s)||(t.uniform1iv(this.addr,s),ga(a,s));for(let o=0;o!==i;++o)n.setTexture2DArray(e[o]||JT,s[o])}function l$(t){switch(t){case 5126:return HV;case 35664:return WV;case 35665:return VV;case 35666:return $V;case 35674:return KV;case 35675:return YV;case 35676:return qV;case 5124:case 35670:return JV;case 35667:case 35671:return XV;case 35668:case 35672:return ZV;case 35669:case 35673:return QV;case 5125:return e$;case 36294:return t$;case 36295:return n$;case 36296:return r$;case 35678:case 36198:case 36298:case 36306:case 35682:return a$;case 35679:case 36299:case 36307:return i$;case 35680:case 36300:case 36308:case 36293:return s$;case 36289:case 36303:case 36311:case 36292:return o$}}class c${constructor(e,n,a){this.id=e,this.addr=a,this.cache=[],this.type=n.type,this.setValue=GV(n.type)}}class u${constructor(e,n,a){this.id=e,this.addr=a,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=l$(n.type)}}class d${constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,a){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const c=i[s];c.setValue(e,n[c.id],a)}}}const uy=/(\w+)(\])?(\[|\.)?/g;function x_(t,e){t.seq.push(e),t.map[e.id]=e}function h$(t,e,n){const a=t.name,i=a.length;for(uy.lastIndex=0;;){const s=uy.exec(a),o=uy.lastIndex;let c=s[1];const d=s[2]==="]",m=s[3];if(d&&(c=c|0),m===void 0||m==="["&&o+2===i){x_(n,m===void 0?new c$(c,t,e):new u$(c,t,e));break}else{let p=n.map[c];p===void 0&&(p=new d$(c),x_(n,p)),n=p}}}class xg{constructor(e,n){this.seq=[],this.map={};const a=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let i=0;i<a;++i){const s=e.getActiveUniform(n,i),o=e.getUniformLocation(n,s.name);h$(s,o,this)}}setValue(e,n,a,i){const s=this.map[n];s!==void 0&&s.setValue(e,a,i)}setOptional(e,n,a){const i=n[a];i!==void 0&&this.setValue(e,a,i)}static upload(e,n,a,i){for(let s=0,o=n.length;s!==o;++s){const c=n[s],d=a[c.id];d.needsUpdate!==!1&&c.setValue(e,d.value,i)}}static seqWithValue(e,n){const a=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in n&&a.push(o)}return a}}function v_(t,e,n){const a=t.createShader(e);return t.shaderSource(a,n),t.compileShader(a),a}const m$=37297;let f$=0;function p$(t,e){const n=t.split(`
4232`),a=[],i=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let o=i;o<s;o++){const c=o+1;a.push(`${c===e?">":" "} ${c}: ${n[o]}`)}return a.join(`
4233`)}const y_=new Zn;function g$(t){ur._getMatrix(y_,ur.workingColorSpace,t);const e=`mat3( ${y_.elements.map(n=>n.toFixed(4))} )`;switch(ur.getTransfer(t)){case Lg:return[e,"LinearTransferOETF"];case br:return[e,"sRGBTransferOETF"];default:return Yn("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function b_(t,e,n){const a=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(a&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const c=parseInt(o[1]);return n.toUpperCase()+`
4234
4235`+s+`
4236
4237`+p$(t.getShaderSource(e),c)}else return s}function x$(t,e){const n=g$(e);return[`vec4 ${t}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
4238`)}function v$(t,e){let n;switch(e){case xz:n="Linear";break;case vz:n="Reinhard";break;case yz:n="Cineon";break;case bz:n="ACESFilmic";break;case Sz:n="AgX";break;case Fz:n="Neutral";break;case wz:n="Custom";break;default:Yn("WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Kp=new Pt;function y$(){ur.getLuminanceCoefficients(Kp);const t=Kp.x.toFixed(4),e=Kp.y.toFixed(4),n=Kp.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${t}, ${e}, ${n} );`,"	return dot( weights, rgb );","}"].join(`
4239`)}function b$(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(xm).join(`
4240`)}function w$(t){const e=[];for(const n in t){const a=t[n];a!==!1&&e.push("#define "+n+" "+a)}return e.join(`
4241`)}function S$(t,e){const n={},a=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<a;i++){const s=t.getActiveAttrib(e,i),o=s.name;let c=1;s.type===t.FLOAT_MAT2&&(c=2),s.type===t.FLOAT_MAT3&&(c=3),s.type===t.FLOAT_MAT4&&(c=4),n[o]={type:s.type,location:t.getAttribLocation(e,o),locationSize:c}}return n}function xm(t){return t!==""}function w_(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 S_(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const F$=/^[ \t]*#include +<([\w\d./]+)>/gm;function Jb(t){return t.replace(F$,_$)}const C$=new Map;function _$(t,e){let n=Qn[e];if(n===void 0){const a=C$.get(e);if(a!==void 0)n=Qn[a],Yn('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,a);else throw new Error("Can not resolve #include <"+e+">")}return Jb(n)}const E$=/#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 F_(t){return t.replace(E$,k$)}function k$(t,e,n,a){let i="";for(let s=parseInt(e);s<parseInt(n);s++)i+=a.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function C_(t){let e=`precision ${t.precision} float;
4242	precision ${t.precision} int;
4243	precision ${t.precision} sampler2D;
4244	precision ${t.precision} samplerCube;
4245	precision ${t.precision} sampler3D;
4246	precision ${t.precision} sampler2DArray;
4247	precision ${t.precision} sampler2DShadow;
4248	precision ${t.precision} samplerCubeShadow;
4249	precision ${t.precision} sampler2DArrayShadow;
4250	precision ${t.precision} isampler2D;
4251	precision ${t.precision} isampler3D;
4252	precision ${t.precision} isamplerCube;
4253	precision ${t.precision} isampler2DArray;
4254	precision ${t.precision} usampler2D;
4255	precision ${t.precision} usampler3D;
4256	precision ${t.precision} usamplerCube;
4257	precision ${t.precision} usampler2DArray;
4258	`;return t.precision==="highp"?e+=`
4259#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
4260#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
4261#define LOW_PRECISION`),e}function A$(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===CT?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===JU?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===ul&&(e="SHADOWMAP_TYPE_VSM"),e}function N$(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case qd:case Jd:e="ENVMAP_TYPE_CUBE";break;case Ax:e="ENVMAP_TYPE_CUBE_UV";break}return e}function T$(t){let e="ENVMAP_MODE_REFLECTION";return t.envMap&&t.envMapMode===Jd&&(e="ENVMAP_MODE_REFRACTION"),e}function M$(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case _T:e="ENVMAP_BLENDING_MULTIPLY";break;case pz:e="ENVMAP_BLENDING_MIX";break;case gz:e="ENVMAP_BLENDING_ADD";break}return e}function R$(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,a=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:a,maxMip:n}}function D$(t,e,n,a){const i=t.getContext(),s=n.defines;let o=n.vertexShader,c=n.fragmentShader;const d=A$(n),m=N$(n),f=T$(n),p=M$(n),b=R$(n),v=b$(n),C=w$(s),S=i.createProgram();let F,w,A=n.glslVersion?"#version "+n.glslVersion+`
4262`:"";n.isRawShaderMaterial?(F=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,C].filter(xm).join(`
4263`),F.length>0&&(F+=`
4264`),w=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,C].filter(xm).join(`
4265`),w.length>0&&(w+=`
4266`)):(F=[C_(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,C,n.extensionCl
vendor: 5,445 bytes, lines 4266-4268
4266ipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
4267`].filter(xm).join(`
4268`),w=[C_(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,C,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
vendor: 4,229 bytes, lines 4268-4275
4268aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+m:"",n.envMap?"#define "+f:"",n.envMap?"#define "+p:"",b?"#define CUBEUV_TEXEL_WIDTH "+b.texelWidth:"",b?"#define CUBEUV_TEXEL_HEIGHT "+b.texelHeight:"",b?"#define CUBEUV_MAX_MIP "+b.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Sc?"#define TONE_MAPPING":"",n.toneMapping!==Sc?Qn.tonemapping_pars_fragment:"",n.toneMapping!==Sc?v$("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Qn.colorspace_pars_fragment,x$("linearToOutputTexel",n.outputColorSpace),y$(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
4269`].filter(xm).join(`
4270`)),o=Jb(o),o=w_(o,n),o=S_(o,n),c=Jb(c),c=w_(c,n),c=S_(c,n),o=F_(o),c=F_(c),n.isRawShaderMaterial!==!0&&(A=`#version 300 es
4271`,F=[v,"#define attribute in","#define varying out","#define texture2D texture"].join(`
4272`)+`
4273`+F,w=["#define varying in",n.glslVersion===IC?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===IC?"":"#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(`
4274`)+`
4275`+w);const N=A+F+o,P=A+w+c,z=v_(i,i.VERTEX_SHADER,N),D=v_(i,i.FRAGMENT_SHADER,P);i.attachShader(S,z),i.attachShader(S,D),n.index0AttributeName!==void 0?i.bindAttribLocation(S,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(S,0,"position"),i.linkProgram(S);
vendor: 5,126 bytes, lines 4275-4282
4275function T(O){if(t.debug.checkShaderErrors){const I=i.getProgramInfoLog(S)||"",j=i.getShaderInfoLog(z)||"",U=i.getShaderInfoLog(D)||"",q=I.trim(),Y=j.trim(),W=U.trim();let H=!0,J=!0;if(i.getProgramParameter(S,i.LINK_STATUS)===!1)if(H=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,S,z,D);else{const ie=b_(i,z,"vertex"),Q=b_(i,D,"fragment");Wr("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(S,i.VALIDATE_STATUS)+`
4276
4277Material Name: `+O.name+`
4278Material Type: `+O.type+`
4279
4280Program Info Log: `+q+`
4281`+ie+`
4282`+Q)}else q!==""?Yn("WebGLProgram: Program Info Log:",q):(Y===""||W==="")&&(J=!1);J&&(O.diagnostics={runnable:H,programLog:q,vertexShader:{log:Y,prefix:F},fragmentShader:{log:W,prefix:w}})}i.deleteShader(z),i.deleteShader(D),K=new xg(i,S),B=S$(i,S)}let K;this.getUniforms=function(){return K===void 0&&T(this),K};let B;this.getAttributes=function(){return B===void 0&&T(this),B};let k=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return k===!1&&(k=i.getProgramParameter(S,m$)),k},this.destroy=function(){a.releaseStatesOfProgram(this),i.deleteProgram(S),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=f$++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=z,this.fragmentShader=D,this}let P$=0;class j${constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,a=e.fragmentShader,i=this._getShaderStage(n),s=this._getShaderStage(a),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const a of n)a.usedTimes--,a.usedTimes===0&&this.shaderCache.delete(a.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 a=n.get(e);return a===void 0&&(a=new Set,n.set(e,a)),a}_getShaderStage(e){const n=this.shaderCache;let a=n.get(e);return a===void 0&&(a=new L$(e),n.set(e,a)),a}}class L${constructor(e){this.id=P$++,this.code=e,this.usedTimes=0}}function I$(t,e,n,a,i,s,o){const c=new Pw,d=new j$,m=new Set,f=[],p=i.logarithmicDepthBuffer,b=i.vertexTextures;let v=i.precision;const C={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 S(B){return m.add(B),B===0?"uv":`uv${B}`}function F(B,k,O,I,j){const U=I.fog,q=j.geometry,Y=B.isMeshStandardMaterial?I.environment:null,W=(B.isMeshStandardMaterial?n:e).get(B.envMap||Y),H=W&&W.mapping===Ax?W.image.height:null,J=C[B.type];B.precision!==null&&(v=i.getMaxPrecision(B.precision),v!==B.precision&&Yn("WebGLProgram.getParameters:",B.precision,"not supported, using",v,"instead."));const ie=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,Q=ie!==void 0?ie.length:0;let ve=0;q.morphAttributes.position!==void 0&&(ve=1),q.morphAttributes.normal!==void 0&&(ve=2),q.morphAttributes.color!==void 0&&(ve=3);let pe,Me,We,Ae;if(J){const rt=ho[J];pe=rt.vertexShader,Me=rt.fragmentShader}else pe=B.vertexShader,Me=B.fragmentShader,d.update(B),We=d.getVertexShaderID(B),Ae=d.getFragmentShaderID(B);const Ce=t.getRenderTarget(),He=t.state.buffers.depth.getReversed(),Ct=j.isInstancedMesh===!0,bt=j.isBatchedMesh===!0,Rt=!!B.map,zt=!!B.matcap,Ut=!!W,Bt=!!B.aoMap,re=!!B.lightMap,wt=!!B.bumpMap,Nt=!!B.normalMap,vt=!!B.displacementMap,Tt=!!B.emissiveMap,Wt=!!B.metalnessMap,Dt=!!B.roughnessMap,jt=B.anisotropy>0,he=B.clearcoat>0,ee=B.dispersion>0,ze=B.iridescence>0,Ve=B.sheen>0,lt=B.transmission>0,qe=jt&&!!B.anisotropyMap,It=he&&!!B.clearcoatMap,gt=he&&!!B.clearcoatNormalMap,Ee=he&&!!B.clearcoatRoughnessMap,Je=ze&&!!B.iridescenceMap,$e=ze&&!!B.iridescenceThicknessMap,Xe=Ve&&!!B.sheenColorMap,X=Ve&&!!B.sheenRoughnessMap,ke=!!B.specularMap,De=!!B.specularColorMap,oe=!!B.specularIntensityMap,te=lt&&!!B.transmissionMap,ye=lt&&!!B.thicknessMap,Re=!!B.gradientMap,Le=!!B.alphaMap,fe=B.alphaTest>0,Se=!!B.alphaHash,Be=!!B.extensions;let Ze=Sc;B.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(Ze=t.toneMapping);const ue={shaderID:J,shaderType:B.type,shaderName:B.name,vertexShader:pe,fragmentShader:Me,defines:B.defines,customVertexShaderID:We,customFragmentShaderID:Ae,isRawShaderMaterial:B.isRawShaderMaterial===!0,glslVersion:B.glslVersion,precision:v,batching:bt,batchingColor:bt&&j._colorsTexture!==null,instancing:Ct,instancingColor:Ct&&j.instanceColor!==null,instancingMorph:Ct&&j.morphTexture!==null,supportsVertexTextures:b,outputColorSpace:Ce===null?t.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:Xd,alph
vendor: 18,705 bytes, lines 4282-4310
4282aToCoverage:!!B.alphaToCoverage,map:Rt,matcap:zt,envMap:Ut,envMapMode:Ut&&W.mapping,envMapCubeUVHeight:H,aoMap:Bt,lightMap:re,bumpMap:wt,normalMap:Nt,displacementMap:b&&vt,emissiveMap:Tt,normalMapObjectSpace:Nt&&B.normalMapType===Az,normalMapTangentSpace:Nt&&B.normalMapType===kz,metalnessMap:Wt,roughnessMap:Dt,anisotropy:jt,anisotropyMap:qe,clearcoat:he,clearcoatMap:It,clearcoatNormalMap:gt,clearcoatRoughnessMap:Ee,dispersion:ee,iridescence:ze,iridescenceMap:Je,iridescenceThicknessMap:$e,sheen:Ve,sheenColorMap:Xe,sheenRoughnessMap:X,specularMap:ke,specularColorMap:De,specularIntensityMap:oe,transmission:lt,transmissionMap:te,thicknessMap:ye,gradientMap:Re,opaque:B.transparent===!1&&B.blending===Dd&&B.alphaToCoverage===!1,alphaMap:Le,alphaTest:fe,alphaHash:Se,combine:B.combine,mapUv:Rt&&S(B.map.channel),aoMapUv:Bt&&S(B.aoMap.channel),lightMapUv:re&&S(B.lightMap.channel),bumpMapUv:wt&&S(B.bumpMap.channel),normalMapUv:Nt&&S(B.normalMap.channel),displacementMapUv:vt&&S(B.displacementMap.channel),emissiveMapUv:Tt&&S(B.emissiveMap.channel),metalnessMapUv:Wt&&S(B.metalnessMap.channel),roughnessMapUv:Dt&&S(B.roughnessMap.channel),anisotropyMapUv:qe&&S(B.anisotropyMap.channel),clearcoatMapUv:It&&S(B.clearcoatMap.channel),clearcoatNormalMapUv:gt&&S(B.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ee&&S(B.clearcoatRoughnessMap.channel),iridescenceMapUv:Je&&S(B.iridescenceMap.channel),iridescenceThicknessMapUv:$e&&S(B.iridescenceThicknessMap.channel),sheenColorMapUv:Xe&&S(B.sheenColorMap.channel),sheenRoughnessMapUv:X&&S(B.sheenRoughnessMap.channel),specularMapUv:ke&&S(B.specularMap.channel),specularColorMapUv:De&&S(B.specularColorMap.channel),specularIntensityMapUv:oe&&S(B.specularIntensityMap.channel),transmissionMapUv:te&&S(B.transmissionMap.channel),thicknessMapUv:ye&&S(B.thicknessMap.channel),alphaMapUv:Le&&S(B.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(Nt||jt),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:j.isPoints===!0&&!!q.attributes.uv&&(Rt||Le),fog:!!U,useFog:B.fog===!0,fogExp2:!!U&&U.isFogExp2,flatShading:B.flatShading===!0&&B.wireframe===!1,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:p,reversedDepthBuffer:He,skinning:j.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:Q,morphTextureStride:ve,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numLightProbes:k.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:B.dithering,shadowMapEnabled:t.shadowMap.enabled&&O.length>0,shadowMapType:t.shadowMap.type,toneMapping:Ze,decodeVideoTexture:Rt&&B.map.isVideoTexture===!0&&ur.getTransfer(B.map.colorSpace)===br,decodeVideoTextureEmissive:Tt&&B.emissiveMap.isVideoTexture===!0&&ur.getTransfer(B.emissiveMap.colorSpace)===br,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===Us,flipSided:B.side===ki,useDepthPacking:B.depthPacking>=0,depthPacking:B.depthPacking||0,index0AttributeName:B.index0AttributeName,extensionClipCullDistance:Be&&B.extensions.clipCullDistance===!0&&a.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Be&&B.extensions.multiDraw===!0||bt)&&a.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:a.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return ue.vertexUv1s=m.has(1),ue.vertexUv2s=m.has(2),ue.vertexUv3s=m.has(3),m.clear(),ue}function w(B){const k=[];if(B.shaderID?k.push(B.shaderID):(k.push(B.customVertexShaderID),k.push(B.customFragmentShaderID)),B.defines!==void 0)for(const O in B.defines)k.push(O),k.push(B.defines[O]);return B.isRawShaderMaterial===!1&&(A(k,B),N(k,B),k.push(t.outputColorSpace)),k.push(B.customProgramCacheKey),k.join()}function A(B,k){B.push(k.precision),B.push(k.outputColorSpace),B.push(k.envMapMode),B.push(k.envMapCubeUVHeight),B.push(k.mapUv),B.push(k.alphaMapUv),B.push(k.lightMapUv),B.push(k.aoMapUv),B.push(k.bumpMapUv),B.push(k.normalMapUv),B.push(k.displacementMapUv),B.push(k.emissiveMapUv),B.push(k.metalnessMapUv),B.push(k.roughnessMapUv),B.push(k.anisotropyMapUv),B.push(k.clearcoatMapUv),B.push(k.clearcoatNormalMapUv),B.push(k.clearcoatRoughnessMapUv),B.push(k.iridescenceMapUv),B.push(k.iridescenceThicknessMapUv),B.push(k.sheenColorMapUv),B.push(k.sheenRoughnessMapUv),B.push(k.specularMapUv),B.push(k.specularColorMapUv),B.push(k.specularIntensityMapUv),B.push(k.transmissionMapUv),B.push(k.thicknessMapUv),B.push(k.combine),B.push(k.fogExp2),B.push(k.sizeAttenuation),B.push(k.morphTargetsCount),B.push(k.morphAttributeCount),B.push(k.numDirLights),B.push(k.numPointLights),B.push(k.numSpotLights),B.push(k.numSpotLightMaps),B.push(k.numHemiLights),B.push(k.numRectAreaLights),B.push(k.numDirLightShadows),B.push(k.numPointLightShadows),B.push(k.numSpotLightShadows),B.push(k.numSpotLightShadowsWithMaps),B.push(k.numLightProbes),B.push(k.shadowMapType),B.push(k.toneMapping),B.push(k.numClippingPlanes),B.push(k.numClipIntersection),B.push(k.depthPacking)}function N(B,k){c.disableAll(),k.supportsVertexTextures&&c.enable(0),k.instancing&&c.enable(1),k.instancingColor&&c.enable(2),k.instancingMorph&&c.enable(3),k.matcap&&c.enable(4),k.envMap&&c.enable(5),k.normalMapObjectSpace&&c.enable(6),k.normalMapTangentSpace&&c.enable(7),k.clearcoat&&c.enable(8),k.iridescence&&c.enable(9),k.alphaTest&&c.enable(10),k.vertexColors&&c.enable(11),k.vertexAlphas&&c.enable(12),k.vertexUv1s&&c.enable(13),k.vertexUv2s&&c.enable(14),k.vertexUv3s&&c.enable(15),k.vertexTangents&&c.enable(16),k.anisotropy&&c.enable(17),k.alphaHash&&c.enable(18),k.batching&&c.enable(19),k.dispersion&&c.enable(20),k.batchingColor&&c.enable(21),k.gradientMap&&c.enable(22),B.push(c.mask),c.disableAll(),k.fog&&c.enable(0),k.useFog&&c.enable(1),k.flatShading&&c.enable(2),k.logarithmicDepthBuffer&&c.enable(3),k.reversedDepthBuffer&&c.enable(4),k.skinning&&c.enable(5),k.morphTargets&&c.enable(6),k.morphNormals&&c.enable(7),k.morphColors&&c.enable(8),k.premultipliedAlpha&&c.enable(9),k.shadowMapEnabled&&c.enable(10),k.doubleSided&&c.enable(11),k.flipSided&&c.enable(12),k.useDepthPacking&&c.enable(13),k.dithering&&c.enable(14),k.transmission&&c.enable(15),k.sheen&&c.enable(16),k.opaque&&c.enable(17),k.pointsUvs&&c.enable(18),k.decodeVideoTexture&&c.enable(19),k.decodeVideoTextureEmissive&&c.enable(20),k.alphaToCoverage&&c.enable(21),B.push(c.mask)}function P(B){const k=C[B.type];let O;if(k){const I=ho[k];O=rG.clone(I.uniforms)}else O=B.uniforms;return O}function z(B,k){let O;for(let I=0,j=f.length;I<j;I++){const U=f[I];if(U.cacheKey===k){O=U,++O.usedTimes;break}}return O===void 0&&(O=new D$(t,k,B,s),f.push(O)),O}function D(B){if(--B.usedTimes===0){const k=f.indexOf(B);f[k]=f[f.length-1],f.pop(),B.destroy()}}function T(B){d.remove(B)}function K(){d.dispose()}return{getParameters:F,getProgramCacheKey:w,getUniforms:P,acquireProgram:z,releaseProgram:D,releaseShaderCache:T,programs:f,dispose:K}}function B$(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let c=t.get(o);return c===void 0&&(c={},t.set(o,c)),c}function a(o){t.delete(o)}function i(o,c,d){t.get(o)[c]=d}function s(){t=new WeakMap}return{has:e,get:n,remove:a,update:i,dispose:s}}function O$(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 __(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 E_(){const t=[];let e=0;const n=[],a=[],i=[];function s(){e=0,n.length=0,a.length=0,i.length=0}function o(p,b,v,C,S,F){let w=t[e];return w===void 0?(w={id:p.id,object:p,geometry:b,material:v,groupOrder:C,renderOrder:p.renderOrder,z:S,group:F},t[e]=w):(w.id=p.id,w.object=p,w.geometry=b,w.material=v,w.groupOrder=C,w.renderOrder=p.renderOrder,w.z=S,w.group=F),e++,w}function c(p,b,v,C,S,F){const w=o(p,b,v,C,S,F);v.transmission>0?a.push(w):v.transparent===!0?i.push(w):n.push(w)}function d(p,b,v,C,S,F){const w=o(p,b,v,C,S,F);v.transmission>0?a.unshift(w):v.transparent===!0?i.unshift(w):n.unshift(w)}function m(p,b){n.length>1&&n.sort(p||O$),a.length>1&&a.sort(b||__),i.length>1&&i.sort(b||__)}function f(){for(let p=e,b=t.length;p<b;p++){const v=t[p];if(v.id===null)break;v.id=null,v.object=null,v.geometry=null,v.material=null,v.group=null}}return{opaque:n,transmissive:a,transparent:i,init:s,push:c,unshift:d,finish:f,sort:m}}function U$(){let t=new WeakMap;function e(a,i){const s=t.get(a);let o;return s===void 0?(o=new E_,t.set(a,[o])):i>=s.length?(o=new E_,s.push(o)):o=s[i],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function z$(){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 Pt,color:new wr};break;case"SpotLight":n={position:new Pt,direction:new Pt,color:new wr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Pt,color:new wr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Pt,skyColor:new wr,groundColor:new wr};break;case"RectAreaLight":n={color:new wr,position:new Pt,halfWidth:new Pt,halfHeight:new Pt};break}return t[e.id]=n,n}}}function G$(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vr};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vr};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new vr,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let H$=0;function W$(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function V$(t){const e=new z$,n=G$(),a={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 m=0;m<9;m++)a.probe.push(new Pt);const i=new Pt,s=new ra,o=new ra;function c(m){let f=0,p=0,b=0;for(let B=0;B<9;B++)a.probe[B].set(0,0,0);let v=0,C=0,S=0,F=0,w=0,A=0,N=0,P=0,z=0,D=0,T=0;m.sort(W$);for(let B=0,k=m.length;B<k;B++){const O=m[B],I=O.color,j=O.intensity,U=O.distance,q=O.shadow&&O.shadow.map?O.shadow.map.texture:null;if(O.isAmbientLight)f+=I.r*j,p+=I.g*j,b+=I.b*j;else if(O.isLightProbe){for(let Y=0;Y<9;Y++)a.probe[Y].addScaledVector(O.sh.coefficients[Y],j);T++}else if(O.isDirectionalLight){const Y=e.get(O);if(Y.color.copy(O.color).multiplyScalar(O.intensity),O.castShadow){const W=O.shadow,H=n.get(O);H.shadowIntensity=W.intensity,H.shadowBias=W.bias,H.shadowNormalBias=W.normalBias,H.shadowRadius=W.radius,H.shadowMapSize=W.mapSize,a.directionalShadow[v]=H,a.directionalShadowMap[v]=q,a.directionalShadowMatrix[v]=O.shadow.matrix,A++}a.directional[v]=Y,v++}else if(O.isSpotLight){const Y=e.get(O);Y.position.setFromMatrixPosition(O.matrixWorld),Y.color.copy(I).multiplyScalar(j),Y.distance=U,Y.coneCos=Math.cos(O.angle),Y.penumbraCos=Math.cos(O.angle*(1-O.penumbra)),Y.decay=O.decay,a.spot[S]=Y;const W=O.shadow;if(O.map&&(a.spotLightMap[z]=O.map,z++,W.updateMatrices(O),O.castShadow&&D++),a.spotLightMatrix[S]=W.matrix,O.castShadow){const H=n.get(O);H.shadowIntensity=W.intensity,H.shadowBias=W.bias,H.shadowNormalBias=W.normalBias,H.shadowRadius=W.radius,H.shadowMapSize=W.mapSize,a.spotShadow[S]=H,a.spotShadowMap[S]=q,P++}S++}else if(O.isRectAreaLight){const Y=e.get(O);Y.color.copy(I).multiplyScalar(j),Y.halfWidth.set(O.width*.5,0,0),Y.halfHeight.set(0,O.height*.5,0),a.rectArea[F]=Y,F++}else if(O.isPointLight){const Y=e.get(O);if(Y.color.copy(O.color).multiplyScalar(O.intensity),Y.distance=O.distance,Y.decay=O.decay,O.castShadow){const W=O.shadow,H=n.get(O);H.shadowIntensity=W.intensity,H.shadowBias=W.bias,H.shadowNormalBias=W.normalBias,H.shadowRadius=W.radius,H.shadowMapSize=W.mapSize,H.shadowCameraNear=W.camera.near,H.shadowCameraFar=W.camera.far,a.pointShadow[C]=H,a.pointShadowMap[C]=q,a.pointShadowMatrix[C]=O.shadow.matrix,N++}a.point[C]=Y,C++}else if(O.isHemisphereLight){const Y=e.get(O);Y.skyColor.copy(O.color).multiplyScalar(j),Y.groundColor.copy(O.groundColor).multiplyScalar(j),a.hemi[w]=Y,w++}}F>0&&(t.has("OES_texture_float_linear")===!0?(a.rectAreaLTC1=dn.LTC_FLOAT_1,a.rectAreaLTC2=dn.LTC_FLOAT_2):(a.rectAreaLTC1=dn.LTC_HALF_1,a.rectAreaLTC2=dn.LTC_HALF_2)),a.ambient[0]=f,a.ambient[1]=p,a.ambient[2]=b;const K=a.hash;(K.directionalLength!==v||K.pointLength!==C||K.spotLength!==S||K.rectAreaLength!==F||K.hemiLength!==w||K.numDirectionalShadows!==A||K.numPointShadows!==N||K.numSpotShadows!==P||K.numSpotMaps!==z||K.numLightProbes!==T)&&(a.directional.length=v,a.spot.length=S,a.rectArea.length=F,a.point.length=C,a.hemi.length=w,a.directionalShadow.length=A,a.directionalShadowMap.length=A,a.pointShadow.length=N,a.pointShadowMap.length=N,a.spotShadow.length=P,a.spotShadowMap.length=P,a.directionalShadowMatrix.length=A,a.pointShadowMatrix.length=N,a.spotLightMatrix.length=P+z-D,a.spotLightMap.length=z,a.numSpotLightShadowsWithMaps=D,a.numLightProbes=T,K.directionalLength=v,K.pointLength=C,K.spotLength=S,K.rectAreaLength=F,K.hemiLength=w,K.numDirectionalShadows=A,K.numPointShadows=N,K.numSpotShadows=P,K.numSpotMaps=z,K.numLightProbes=T,a.version=H$++)}function d(m,f){let p=0,b=0,v=0,C=0,S=0;const F=f.matrixWorldInverse;for(let w=0,A=m.length;w<A;w++){const N=m[w];if(N.isDirectionalLight){const P=a.directional[p];P.direction.setFromMatrixPosition(N.matrixWorld),i.setFromMatrixPosition(N.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(F),p++}else if(N.isSpotLight){const P=a.spot[v];P.position.setFromMatrixPosition(N.matrixWorld),P.position.applyMatrix4(F),P.direction.setFromMatrixPosition(N.matrixWorld),i.setFromMatrixPosition(N.target.matrixWorld),P.direction.sub(i),P.direction.transformDirection(F),v++}else if(N.isRectAreaLight){const P=a.rectArea[C];P.position.setFromMatrixPosition(N.matrixWorld),P.position.applyMatrix4(F),o.identity(),s.copy(N.matrixWorld),s.premultiply(F),o.extractRotation(s),P.halfWidth.set(N.width*.5,0,0),P.halfHeight.set(0,N.height*.5,0),P.halfWidth.applyMatrix4(o),P.halfHeight.applyMatrix4(o),C++}else if(N.isPointLight){const P=a.point[b];P.position.setFromMatrixPosition(N.matrixWorld),P.position.applyMatrix4(F),b++}else if(N.isHemisphereLight){const P=a.hemi[S];P.direction.setFromMatrixPosition(N.matrixWorld),P.direction.transformDirection(F),S++}}}return{setup:c,setupView:d,state:a}}function k_(t){const e=new V$(t),n=[],a=[];function i(f){m.camera=f,n.length=0,a.length=0}function s(f){n.push(f)}function o(f){a.push(f)}function c(){e.setup(n)}function d(f){e.setupView(n,f)}const m={lightsArray:n,shadowsArray:a,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:m,setupLights:c,setupLightsView:d,pushLight:s,pushShadow:o}}function $$(t){let e=new WeakMap;function n(i,s=0){const o=e.get(i);let c;return o===void 0?(c=new k_(t),e.set(i,[c])):s>=o.length?(c=new k_(t),o.push(c)):c=o[s],c}function a(){e=new WeakMap}return{get:n,dispose:a}}const K$=`void main() {
4283	gl_Position = vec4( position, 1.0 );
4284}`,Y$=`uniform sampler2D shadow_pass;
4285uniform vec2 resolution;
4286uniform float radius;
4287#include <packing>
4288void main() {
4289	const float samples = float( VSM_SAMPLES );
4290	float mean = 0.0;
4291	float squared_mean = 0.0;
4292	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4293	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4294	for ( float i = 0.0; i < samples; i ++ ) {
4295		float uvOffset = uvStart + i * uvStride;
4296		#ifdef HORIZONTAL_PASS
4297			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
4298			mean += distribution.x;
4299			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4300		#else
4301			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
4302			mean += depth;
4303			squared_mean += depth * depth;
4304		#endif
4305	}
4306	mean = mean / samples;
4307	squared_mean = squared_mean / samples;
4308	float std_dev = sqrt( squared_mean - mean * mean );
4309	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
4310}`;function q$(t,e,n){let a=new WT;const i=new vr,s=new vr,o=new $r,c=new fG({depthPacking:Ez}),d=new pG,m={},f=n.maxTextureSize,p={[Ec]:ki,[ki]:Ec,[Us]:Us},b=new El({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new vr},radius:{value:4}},vertexShader:K$,fragmentShader:Y$}),v=b.clone();v.defines.HORIZONTAL_PASS=1;const C=new Rc;C.setAttribute("position",new Eo(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new Hs(C,b),F=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=CT;let w=this.type;this.render=function(D,T,K){if(F.enabled===!1||F.autoUpdate===!1&&F.needsUpdate===!1||D.length===0)return;const B=t.getRenderTarget(),k=t.getActiveCubeFace(),O=t.getActiveMipmapLevel(),I=t.state;I.setBlending(vl),I.buffers.depth.getReversed()===!0?I.buffers.color.setClear(0,0,0,0):I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);const j=w!==ul&&this.type===ul,U=w===ul&&this.type!==ul;for(let q=0,Y=D.length;q<Y;q++){const W=D[q],H=W.shadow;if(H===void 0){Yn("WebGLShadowMap:",W,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const J=H.getFrameExtents();if(i.multiply(J),s.copy(H.mapSize),(i.x>f||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/J.x),i.x=s.x*J.x,H.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/J.y),i.y=s.y*J.y,H.mapSize.y=s.y)),H.map===null||j===!0||U===!0){const Q=this.type!==ul?{minFilter:Wi,magFilter:Wi}:{};H.map!==null&&H.map.dispose(),H.map=new Fu(i.x,i.y,Q),H.map.texture.name=W.name+".shadowMap",H.camera.updateProjectionMatrix()}
vendor: 29,150 bytes, line 4310
4310t.setRenderTarget(H.map),t.clear();const ie=H.getViewportCount();for(let Q=0;Q<ie;Q++){const ve=H.getViewport(Q);o.set(s.x*ve.x,s.y*ve.y,s.x*ve.z,s.y*ve.w),I.viewport(o),H.updateMatrices(W,Q),a=H.getFrustum(),P(T,K,H.camera,W,this.type)}H.isPointLightShadow!==!0&&this.type===ul&&A(H,K),H.needsUpdate=!1}w=this.type,F.needsUpdate=!1,t.setRenderTarget(B,k,O)};function A(D,T){const K=e.update(S);b.defines.VSM_SAMPLES!==D.blurSamples&&(b.defines.VSM_SAMPLES=D.blurSamples,v.defines.VSM_SAMPLES=D.blurSamples,b.needsUpdate=!0,v.needsUpdate=!0),D.mapPass===null&&(D.mapPass=new Fu(i.x,i.y)),b.uniforms.shadow_pass.value=D.map.texture,b.uniforms.resolution.value=D.mapSize,b.uniforms.radius.value=D.radius,t.setRenderTarget(D.mapPass),t.clear(),t.renderBufferDirect(T,null,K,b,S,null),v.uniforms.shadow_pass.value=D.mapPass.texture,v.uniforms.resolution.value=D.mapSize,v.uniforms.radius.value=D.radius,t.setRenderTarget(D.map),t.clear(),t.renderBufferDirect(T,null,K,v,S,null)}function N(D,T,K,B){let k=null;const O=K.isPointLight===!0?D.customDistanceMaterial:D.customDepthMaterial;if(O!==void 0)k=O;else if(k=K.isPointLight===!0?d:c,t.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const I=k.uuid,j=T.uuid;let U=m[I];U===void 0&&(U={},m[I]=U);let q=U[j];q===void 0&&(q=k.clone(),U[j]=q,T.addEventListener("dispose",z)),k=q}if(k.visible=T.visible,k.wireframe=T.wireframe,B===ul?k.side=T.shadowSide!==null?T.shadowSide:T.side:k.side=T.shadowSide!==null?T.shadowSide:p[T.side],k.alphaMap=T.alphaMap,k.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,k.map=T.map,k.clipShadows=T.clipShadows,k.clippingPlanes=T.clippingPlanes,k.clipIntersection=T.clipIntersection,k.displacementMap=T.displacementMap,k.displacementScale=T.displacementScale,k.displacementBias=T.displacementBias,k.wireframeLinewidth=T.wireframeLinewidth,k.linewidth=T.linewidth,K.isPointLight===!0&&k.isMeshDistanceMaterial===!0){const I=t.properties.get(k);I.light=K}return k}function P(D,T,K,B,k){if(D.visible===!1)return;if(D.layers.test(T.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&k===ul)&&(!D.frustumCulled||a.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,D.matrixWorld);const j=e.update(D),U=D.material;if(Array.isArray(U)){const q=j.groups;for(let Y=0,W=q.length;Y<W;Y++){const H=q[Y],J=U[H.materialIndex];if(J&&J.visible){const ie=N(D,J,B,k);D.onBeforeShadow(t,D,T,K,j,ie,H),t.renderBufferDirect(K,null,j,ie,D,H),D.onAfterShadow(t,D,T,K,j,ie,H)}}}else if(U.visible){const q=N(D,U,B,k);D.onBeforeShadow(t,D,T,K,j,q,null),t.renderBufferDirect(K,null,j,q,D,null),D.onAfterShadow(t,D,T,K,j,q,null)}}const I=D.children;for(let j=0,U=I.length;j<U;j++)P(I[j],T,K,B,k)}function z(D){D.target.removeEventListener("dispose",z);for(const K in m){const B=m[K],k=D.target.uuid;k in B&&(B[k].dispose(),delete B[k])}}}const J$={[cb]:ub,[db]:fb,[hb]:pb,[Yd]:mb,[ub]:cb,[fb]:db,[pb]:hb,[mb]:Yd};function X$(t,e){function n(){let te=!1;const ye=new $r;let Re=null;const Le=new $r(0,0,0,0);return{setMask:function(fe){Re!==fe&&!te&&(t.colorMask(fe,fe,fe,fe),Re=fe)},setLocked:function(fe){te=fe},setClear:function(fe,Se,Be,Ze,ue){ue===!0&&(fe*=Ze,Se*=Ze,Be*=Ze),ye.set(fe,Se,Be,Ze),Le.equals(ye)===!1&&(t.clearColor(fe,Se,Be,Ze),Le.copy(ye))},reset:function(){te=!1,Re=null,Le.set(-1,0,0,0)}}}function a(){let te=!1,ye=!1,Re=null,Le=null,fe=null;return{setReversed:function(Se){if(ye!==Se){const Be=e.get("EXT_clip_control");Se?Be.clipControlEXT(Be.LOWER_LEFT_EXT,Be.ZERO_TO_ONE_EXT):Be.clipControlEXT(Be.LOWER_LEFT_EXT,Be.NEGATIVE_ONE_TO_ONE_EXT),ye=Se;const Ze=fe;fe=null,this.setClear(Ze)}},getReversed:function(){return ye},setTest:function(Se){Se?Ce(t.DEPTH_TEST):He(t.DEPTH_TEST)},setMask:function(Se){Re!==Se&&!te&&(t.depthMask(Se),Re=Se)},setFunc:function(Se){if(ye&&(Se=J$[Se]),Le!==Se){switch(Se){case cb:t.depthFunc(t.NEVER);break;case ub:t.depthFunc(t.ALWAYS);break;case db:t.depthFunc(t.LESS);break;case Yd:t.depthFunc(t.LEQUAL);break;case hb:t.depthFunc(t.EQUAL);break;case mb:t.depthFunc(t.GEQUAL);break;case fb:t.depthFunc(t.GREATER);break;case pb:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}Le=Se}},setLocked:function(Se){te=Se},setClear:function(Se){fe!==Se&&(ye&&(Se=1-Se),t.clearDepth(Se),fe=Se)},reset:function(){te=!1,Re=null,Le=null,fe=null,ye=!1}}}function i(){let te=!1,ye=null,Re=null,Le=null,fe=null,Se=null,Be=null,Ze=null,ue=null;return{setTest:function(rt){te||(rt?Ce(t.STENCIL_TEST):He(t.STENCIL_TEST))},setMask:function(rt){ye!==rt&&!te&&(t.stencilMask(rt),ye=rt)},setFunc:function(rt,je,_t){(Re!==rt||Le!==je||fe!==_t)&&(t.stencilFunc(rt,je,_t),Re=rt,Le=je,fe=_t)},setOp:function(rt,je,_t){(Se!==rt||Be!==je||Ze!==_t)&&(t.stencilOp(rt,je,_t),Se=rt,Be=je,Ze=_t)},setLocked:function(rt){te=rt},setClear:function(rt){ue!==rt&&(t.clearStencil(rt),ue=rt)},reset:function(){te=!1,ye=null,Re=null,Le=null,fe=null,Se=null,Be=null,Ze=null,ue=null}}}const s=new n,o=new a,c=new i,d=new WeakMap,m=new WeakMap;let f={},p={},b=new WeakMap,v=[],C=null,S=!1,F=null,w=null,A=null,N=null,P=null,z=null,D=null,T=new wr(0,0,0),K=0,B=!1,k=null,O=null,I=null,j=null,U=null;const q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Y=!1,W=0;const H=t.getParameter(t.VERSION);H.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(H)[1]),Y=W>=1):H.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),Y=W>=2);let J=null,ie={};const Q=t.getParameter(t.SCISSOR_BOX),ve=t.getParameter(t.VIEWPORT),pe=new $r().fromArray(Q),Me=new $r().fromArray(ve);function We(te,ye,Re,Le){const fe=new Uint8Array(4),Se=t.createTexture();t.bindTexture(te,Se),t.texParameteri(te,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(te,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Be=0;Be<Re;Be++)te===t.TEXTURE_3D||te===t.TEXTURE_2D_ARRAY?t.texImage3D(ye,0,t.RGBA,1,1,Le,0,t.RGBA,t.UNSIGNED_BYTE,fe):t.texImage2D(ye+Be,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,fe);return Se}const Ae={};Ae[t.TEXTURE_2D]=We(t.TEXTURE_2D,t.TEXTURE_2D,1),Ae[t.TEXTURE_CUBE_MAP]=We(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),Ae[t.TEXTURE_2D_ARRAY]=We(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),Ae[t.TEXTURE_3D]=We(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),c.setClear(0),Ce(t.DEPTH_TEST),o.setFunc(Yd),wt(!1),Nt(MC),Ce(t.CULL_FACE),Bt(vl);function Ce(te){f[te]!==!0&&(t.enable(te),f[te]=!0)}function He(te){f[te]!==!1&&(t.disable(te),f[te]=!1)}function Ct(te,ye){return p[te]!==ye?(t.bindFramebuffer(te,ye),p[te]=ye,te===t.DRAW_FRAMEBUFFER&&(p[t.FRAMEBUFFER]=ye),te===t.FRAMEBUFFER&&(p[t.DRAW_FRAMEBUFFER]=ye),!0):!1}function bt(te,ye){let Re=v,Le=!1;if(te){Re=b.get(ye),Re===void 0&&(Re=[],b.set(ye,Re));const fe=te.textures;if(Re.length!==fe.length||Re[0]!==t.COLOR_ATTACHMENT0){for(let Se=0,Be=fe.length;Se<Be;Se++)Re[Se]=t.COLOR_ATTACHMENT0+Se;Re.length=fe.length,Le=!0}}else Re[0]!==t.BACK&&(Re[0]=t.BACK,Le=!0);Le&&t.drawBuffers(Re)}function Rt(te){return C!==te?(t.useProgram(te),C=te,!0):!1}const zt={[cu]:t.FUNC_ADD,[ZU]:t.FUNC_SUBTRACT,[QU]:t.FUNC_REVERSE_SUBTRACT};zt[ez]=t.MIN,zt[tz]=t.MAX;const Ut={[nz]:t.ZERO,[rz]:t.ONE,[az]:t.SRC_COLOR,[ob]:t.SRC_ALPHA,[uz]:t.SRC_ALPHA_SATURATE,[lz]:t.DST_COLOR,[sz]:t.DST_ALPHA,[iz]:t.ONE_MINUS_SRC_COLOR,[lb]:t.ONE_MINUS_SRC_ALPHA,[cz]:t.ONE_MINUS_DST_COLOR,[oz]:t.ONE_MINUS_DST_ALPHA,[dz]:t.CONSTANT_COLOR,[hz]:t.ONE_MINUS_CONSTANT_COLOR,[mz]:t.CONSTANT_ALPHA,[fz]:t.ONE_MINUS_CONSTANT_ALPHA};function Bt(te,ye,Re,Le,fe,Se,Be,Ze,ue,rt){if(te===vl){S===!0&&(He(t.BLEND),S=!1);return}if(S===!1&&(Ce(t.BLEND),S=!0),te!==XU){if(te!==F||rt!==B){if((w!==cu||P!==cu)&&(t.blendEquation(t.FUNC_ADD),w=cu,P=cu),rt)switch(te){case Dd:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case RC:t.blendFunc(t.ONE,t.ONE);break;case DC:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case PC:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:Wr("WebGLState: Invalid blending: ",te);break}else switch(te){case Dd:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case RC:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case DC:Wr("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case PC:Wr("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Wr("WebGLState: Invalid blending: ",te);break}A=null,N=null,z=null,D=null,T.set(0,0,0),K=0,F=te,B=rt}return}fe=fe||ye,Se=Se||Re,Be=Be||Le,(ye!==w||fe!==P)&&(t.blendEquationSeparate(zt[ye],zt[fe]),w=ye,P=fe),(Re!==A||Le!==N||Se!==z||Be!==D)&&(t.blendFuncSeparate(Ut[Re],Ut[Le],Ut[Se],Ut[Be]),A=Re,N=Le,z=Se,D=Be),(Ze.equals(T)===!1||ue!==K)&&(t.blendColor(Ze.r,Ze.g,Ze.b,ue),T.copy(Ze),K=ue),F=te,B=!1}function re(te,ye){te.side===Us?He(t.CULL_FACE):Ce(t.CULL_FACE);let Re=te.side===ki;ye&&(Re=!Re),wt(Re),te.blending===Dd&&te.transparent===!1?Bt(vl):Bt(te.blending,te.blendEquation,te.blendSrc,te.blendDst,te.blendEquationAlpha,te.blendSrcAlpha,te.blendDstAlpha,te.blendColor,te.blendAlpha,te.premultipliedAlpha),o.setFunc(te.depthFunc),o.setTest(te.depthTest),o.setMask(te.depthWrite),s.setMask(te.colorWrite);const Le=te.stencilWrite;c.setTest(Le),Le&&(c.setMask(te.stencilWriteMask),c.setFunc(te.stencilFunc,te.stencilRef,te.stencilFuncMask),c.setOp(te.stencilFail,te.stencilZFail,te.stencilZPass)),Tt(te.polygonOffset,te.polygonOffsetFactor,te.polygonOffsetUnits),te.alphaToCoverage===!0?Ce(t.SAMPLE_ALPHA_TO_COVERAGE):He(t.SAMPLE_ALPHA_TO_COVERAGE)}function wt(te){k!==te&&(te?t.frontFace(t.CW):t.frontFace(t.CCW),k=te)}function Nt(te){te!==YU?(Ce(t.CULL_FACE),te!==O&&(te===MC?t.cullFace(t.BACK):te===qU?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):He(t.CULL_FACE),O=te}function vt(te){te!==I&&(Y&&t.lineWidth(te),I=te)}function Tt(te,ye,Re){te?(Ce(t.POLYGON_OFFSET_FILL),(j!==ye||U!==Re)&&(t.polygonOffset(ye,Re),j=ye,U=Re)):He(t.POLYGON_OFFSET_FILL)}function Wt(te){te?Ce(t.SCISSOR_TEST):He(t.SCISSOR_TEST)}function Dt(te){te===void 0&&(te=t.TEXTURE0+q-1),J!==te&&(t.activeTexture(te),J=te)}function jt(te,ye,Re){Re===void 0&&(J===null?Re=t.TEXTURE0+q-1:Re=J);let Le=ie[Re];Le===void 0&&(Le={type:void 0,texture:void 0},ie[Re]=Le),(Le.type!==te||Le.texture!==ye)&&(J!==Re&&(t.activeTexture(Re),J=Re),t.bindTexture(te,ye||Ae[te]),Le.type=te,Le.texture=ye)}function he(){const te=ie[J];te!==void 0&&te.type!==void 0&&(t.bindTexture(te.type,null),te.type=void 0,te.texture=void 0)}function ee(){try{t.compressedTexImage2D(...arguments)}catch(te){te("WebGLState:",te)}}function ze(){try{t.compressedTexImage3D(...arguments)}catch(te){te("WebGLState:",te)}}function Ve(){try{t.texSubImage2D(...arguments)}catch(te){te("WebGLState:",te)}}function lt(){try{t.texSubImage3D(...arguments)}catch(te){te("WebGLState:",te)}}function qe(){try{t.compressedTexSubImage2D(...arguments)}catch(te){te("WebGLState:",te)}}function It(){try{t.compressedTexSubImage3D(...arguments)}catch(te){te("WebGLState:",te)}}function gt(){try{t.texStorage2D(...arguments)}catch(te){te("WebGLState:",te)}}function Ee(){try{t.texStorage3D(...arguments)}catch(te){te("WebGLState:",te)}}function Je(){try{t.texImage2D(...arguments)}catch(te){te("WebGLState:",te)}}function $e(){try{t.texImage3D(...arguments)}catch(te){te("WebGLState:",te)}}function Xe(te){pe.equals(te)===!1&&(t.scissor(te.x,te.y,te.z,te.w),pe.copy(te))}function X(te){Me.equals(te)===!1&&(t.viewport(te.x,te.y,te.z,te.w),Me.copy(te))}function ke(te,ye){let Re=m.get(ye);Re===void 0&&(Re=new WeakMap,m.set(ye,Re));let Le=Re.get(te);Le===void 0&&(Le=t.getUniformBlockIndex(ye,te.name),Re.set(te,Le))}function De(te,ye){const Le=m.get(ye).get(te);d.get(ye)!==Le&&(t.uniformBlockBinding(ye,Le,te.__bindingPointIndex),d.set(ye,Le))}function oe(){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),o.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),f={},J=null,ie={},p={},b=new WeakMap,v=[],C=null,S=!1,F=null,w=null,A=null,N=null,P=null,z=null,D=null,T=new wr(0,0,0),K=0,B=!1,k=null,O=null,I=null,j=null,U=null,pe.set(0,0,t.canvas.width,t.canvas.height),Me.set(0,0,t.canvas.width,t.canvas.height),s.reset(),o.reset(),c.reset()}return{buffers:{color:s,depth:o,stencil:c},enable:Ce,disable:He,bindFramebuffer:Ct,drawBuffers:bt,useProgram:Rt,setBlending:Bt,setMaterial:re,setFlipSided:wt,setCullFace:Nt,setLineWidth:vt,setPolygonOffset:Tt,setScissorTest:Wt,activeTexture:Dt,bindTexture:jt,unbindTexture:he,compressedTexImage2D:ee,compressedTexImage3D:ze,texImage2D:Je,texImage3D:$e,updateUBOMapping:ke,uniformBlockBinding:De,texStorage2D:gt,texStorage3D:Ee,texSubImage2D:Ve,texSubImage3D:lt,compressedTexSubImage2D:qe,compressedTexSubImage3D:It,scissor:Xe,viewport:X,reset:oe}}function Z$(t,e,n,a,i,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new vr,f=new WeakMap;let p;const b=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function C(he,ee){return v?new OffscreenCanvas(he,ee):Hm("canvas")}function S(he,ee,ze){let Ve=1;const lt=jt(he);if((lt.width>ze||lt.height>ze)&&(Ve=ze/Math.max(lt.width,lt.height)),Ve<1)if(typeof HTMLImageElement<"u"&&he instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&he instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&he instanceof ImageBitmap||typeof VideoFrame<"u"&&he instanceof VideoFrame){const qe=Math.floor(Ve*lt.width),It=Math.floor(Ve*lt.height);p===void 0&&(p=C(qe,It));const gt=ee?C(qe,It):p;return gt.width=qe,gt.height=It,gt.getContext("2d").drawImage(he,0,0,qe,It),Yn("WebGLRenderer: Texture has been resized from ("+lt.width+"x"+lt.height+") to ("+qe+"x"+It+")."),gt}else return"data"in he&&Yn("WebGLRenderer: Image in DataTexture is too big ("+lt.width+"x"+lt.height+")."),he;return he}function F(he){return he.generateMipmaps}function w(he){t.generateMipmap(he)}function A(he){return he.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:he.isWebGL3DRenderTarget?t.TEXTURE_3D:he.isWebGLArrayRenderTarget||he.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function N(he,ee,ze,Ve,lt=!1){if(he!==null){if(t[he]!==void 0)return t[he];Yn("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+he+"'")}let qe=ee;if(ee===t.RED&&(ze===t.FLOAT&&(qe=t.R32F),ze===t.HALF_FLOAT&&(qe=t.R16F),ze===t.UNSIGNED_BYTE&&(qe=t.R8)),ee===t.RED_INTEGER&&(ze===t.UNSIGNED_BYTE&&(qe=t.R8UI),ze===t.UNSIGNED_SHORT&&(qe=t.R16UI),ze===t.UNSIGNED_INT&&(qe=t.R32UI),ze===t.BYTE&&(qe=t.R8I),ze===t.SHORT&&(qe=t.R16I),ze===t.INT&&(qe=t.R32I)),ee===t.RG&&(ze===t.FLOAT&&(qe=t.RG32F),ze===t.HALF_FLOAT&&(qe=t.RG16F),ze===t.UNSIGNED_BYTE&&(qe=t.RG8)),ee===t.RG_INTEGER&&(ze===t.UNSIGNED_BYTE&&(qe=t.RG8UI),ze===t.UNSIGNED_SHORT&&(qe=t.RG16UI),ze===t.UNSIGNED_INT&&(qe=t.RG32UI),ze===t.BYTE&&(qe=t.RG8I),ze===t.SHORT&&(qe=t.RG16I),ze===t.INT&&(qe=t.RG32I)),ee===t.RGB_INTEGER&&(ze===t.UNSIGNED_BYTE&&(qe=t.RGB8UI),ze===t.UNSIGNED_SHORT&&(qe=t.RGB16UI),ze===t.UNSIGNED_INT&&(qe=t.RGB32UI),ze===t.BYTE&&(qe=t.RGB8I),ze===t.SHORT&&(qe=t.RGB16I),ze===t.INT&&(qe=t.RGB32I)),ee===t.RGBA_INTEGER&&(ze===t.UNSIGNED_BYTE&&(qe=t.RGBA8UI),ze===t.UNSIGNED_SHORT&&(qe=t.RGBA16UI),ze===t.UNSIGNED_INT&&(qe=t.RGBA32UI),ze===t.BYTE&&(qe=t.RGBA8I),ze===t.SHORT&&(qe=t.RGBA16I),ze===t.INT&&(qe=t.RGBA32I)),ee===t.RGB&&(ze===t.UNSIGNED_INT_5_9_9_9_REV&&(qe=t.RGB9_E5),ze===t.UNSIGNED_INT_10F_11F_11F_REV&&(qe=t.R11F_G11F_B10F)),ee===t.RGBA){const It=lt?Lg:ur.getTransfer(Ve);ze===t.FLOAT&&(qe=t.RGBA32F),ze===t.HALF_FLOAT&&(qe=t.RGBA16F),ze===t.UNSIGNED_BYTE&&(qe=It===br?t.SRGB8_ALPHA8:t.RGBA8),ze===t.UNSIGNED_SHORT_4_4_4_4&&(qe=t.RGBA4),ze===t.UNSIGNED_SHORT_5_5_5_1&&(qe=t.RGB5_A1)}return(qe===t.R16F||qe===t.R32F||qe===t.RG16F||qe===t.RG32F||qe===t.RGBA16F||qe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),qe}function P(he,ee){let ze;return he?ee===null||ee===Su||ee===Um?ze=t.DEPTH24_STENCIL8:ee===pl?ze=t.DEPTH32F_STENCIL8:ee===Om&&(ze=t.DEPTH24_STENCIL8,Yn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):ee===null||ee===Su||ee===Um?ze=t.DEPTH_COMPONENT24:ee===pl?ze=t.DEPTH_COMPONENT32F:ee===Om&&(ze=t.DEPTH_COMPONENT16),ze}function z(he,ee){return F(he)===!0||he.isFramebufferTexture&&he.minFilter!==Wi&&he.minFilter!==Gi?Math.log2(Math.max(ee.width,ee.height))+1:he.mipmaps!==void 0&&he.mipmaps.length>0?he.mipmaps.length:he.isCompressedTexture&&Array.isArray(he.image)?ee.mipmaps.length:1}function D(he){const ee=he.target;ee.removeEventListener("dispose",D),K(ee),ee.isVideoTexture&&f.delete(ee)}function T(he){const ee=he.target;ee.removeEventListener("dispose",T),k(ee)}function K(he){const ee=a.get(he);if(ee.__webglInit===void 0)return;const ze=he.source,Ve=b.get(ze);if(Ve){const lt=Ve[ee.__cacheKey];lt.usedTimes--,lt.usedTimes===0&&B(he),Object.keys(Ve).length===0&&b.delete(ze)}a.remove(he)}function B(he){const ee=a.get(he);t.deleteTexture(ee.__webglTexture);const ze=he.source,Ve=b.get(ze);delete Ve[ee.__cacheKey],o.memory.textures--}function k(he){const ee=a.get(he);if(he.depthTexture&&(he.depthTexture.dispose(),a.remove(he.depthTexture)),he.isWebGLCubeRenderTarget)for(let Ve=0;Ve<6;Ve++){if(Array.isArray(ee.__webglFramebuffer[Ve]))for(let lt=0;lt<ee.__webglFramebuffer[Ve].length;lt++)t.deleteFramebuffer(ee.__webglFramebuffer[Ve][lt]);else t.deleteFramebuffer(ee.__webglFramebuffer[Ve]);ee.__webglDepthbuffer&&t.deleteRenderbuffer(ee.__webglDepthbuffer[Ve])}else{if(Array.isArray(ee.__webglFramebuffer))for(let Ve=0;Ve<ee.__webglFramebuffer.length;Ve++)t.deleteFramebuffer(ee.__webglFramebuffer[Ve]);else t.deleteFramebuffer(ee.__webglFramebuffer);if(ee.__webglDepthbuffer&&t.deleteRenderbuffer(ee.__webglDepthbuffer),ee.__webglMultisampledFramebuffer&&t.deleteFramebuffer(ee.__webglMultisampledFramebuffer),ee.__webglColorRenderbuffer)for(let Ve=0;Ve<ee.__webglColorRenderbuffer.length;Ve++)ee.__webglColorRenderbuffer[Ve]&&t.deleteRenderbuffer(ee.__webglColorRenderbuffer[Ve]);ee.__webglDepthRenderbuffer&&t.deleteRenderbuffer(ee.__webglDepthRenderbuffer)}const ze=he.textures;for(let Ve=0,lt=ze.length;Ve<lt;Ve++){const qe=a.get(ze[Ve]);qe.__webglTexture&&(t.deleteTexture(qe.__webglTexture),o.memory.textures--),a.remove(ze[Ve])}a.remove(he)}let O=0;function I(){O=0}function j(){const he=O;return he>=i.maxTextures&&Yn("WebGLTextures: Trying to use "+he+" texture units while this GPU supports only "+i.maxTextures),O+=1,he}function U(he){const ee=[];return ee.push(he.wrapS),ee.push(he.wrapT),ee.push(he.wrapR||0),ee.push(he.magFilter),ee.push(he.minFilter),ee.push(he.anisotropy),ee.push(he.internalFormat),ee.push(he.format),ee.push(he.type),ee.push(he.generateMipmaps),ee.push(he.premultiplyAlpha),ee.push(he.flipY),ee.push(he.unpackAlignment),ee.push(he.colorSpace),ee.join()}function q(he,ee){const ze=a.get(he);if(he.isVideoTexture&&Wt(he),he.isRenderTargetTexture===!1&&he.isExternalTexture!==!0&&he.version>0&&ze.__version!==he.version){const Ve=he.image;if(Ve===null)Yn("WebGLRenderer: Texture marked for update but no image data found.");else if(Ve.complete===!1)Yn("WebGLRenderer: Texture marked for update but image is incomplete");else{Ae(ze,he,ee);return}}else he.isExternalTexture&&(ze.__webglTexture=he.sourceTexture?he.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,ze.__webglTexture,t.TEXTURE0+ee)}function Y(he,ee){const ze=a.get(he);if(he.isRenderTargetTexture===!1&&he.version>0&&ze.__version!==he.version){Ae(ze,he,ee);return}else he.isExternalTexture&&(ze.__webglTexture=he.sourceTexture?he.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,ze.__webglTexture,t.TEXTURE0+ee)}function W(he,ee){const ze=a.get(he);if(he.isRenderTargetTexture===!1&&he.version>0&&ze.__version!==he.version){Ae(ze,he,ee);return}n.bindTexture(t.TEXTURE_3D,ze.__webglTexture,t.TEXTURE0+ee)}function H(he,ee){const ze=a.get(he);if(he.version>0&&ze.__version!==he.version){Ce(ze,he,ee);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ze.__webglTexture,t.TEXTURE0+ee)}const J={[vb]:t.REPEAT,[fl]:t.CLAMP_TO_EDGE,[yb]:t.MIRRORED_REPEAT},ie={[Wi]:t.NEAREST,[Cz]:t.NEAREST_MIPMAP_NEAREST,[kp]:t.NEAREST_MIPMAP_LINEAR,[Gi]:t.LINEAR,[Pv]:t.LINEAR_MIPMAP_NEAREST,[xc]:t.LINEAR_MIPMAP_LINEAR},Q={[Nz]:t.NEVER,[jz]:t.ALWAYS,[Tz]:t.LESS,[PT]:t.LEQUAL,[Mz]:t.EQUAL,[Pz]:t.GEQUAL,[Rz]:t.GREATER,[Dz]:t.NOTEQUAL};function ve(he,ee){if(ee.type===pl&&e.has("OES_texture_float_linear")===!1&&(ee.magFilter===Gi||ee.magFilter===Pv||ee.magFilter===kp||ee.magFilter===xc||ee.minFilter===Gi||ee.minFilter===Pv||ee.minFilter===kp||ee.minFilter===xc)&&Yn("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(he,t.TEXTURE_WRAP_S,J[ee.wrapS]),t.texParameteri(he,t.TEXTURE_WRAP_T,J[ee.wrapT]),(he===t.TEXTURE_3D||he===t.TEXTURE_2D_ARRAY)&&t.texParameteri(he,t.TEXTURE_WRAP_R,J[ee.wrapR]),t.texParameteri(he,t.TEXTURE_MAG_FILTER,ie[ee.magFilter]),t.texParameteri(he,t.TEXTURE_MIN_FILTER,ie[ee.minFilter]),ee.compareFunction&&(t.texParameteri(he,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(he,t.TEXTURE_COMPARE_FUNC,Q[ee.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(ee.magFilter===Wi||ee.minFilter!==kp&&ee.minFilter!==xc||ee.type===pl&&e.has("OES_texture_float_linear")===!1)return;if(ee.anisotropy>1||a.get(ee).__currentAnisotropy){const ze=e.get("EXT_texture_filter_anisotropic");t.texParameterf(he,ze.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ee.anisotropy,i.getMaxAnisotropy())),a.get(ee).__currentAnisotropy=ee.anisotropy}}}function pe(he,ee){let ze=!1;he.__webglInit===void 0&&(he.__webglInit=!0,ee.addEventListener("dispose",D));const Ve=ee.source;let lt=b.get(Ve);lt===void 0&&(lt={},b.set(Ve,lt));const qe=U(ee);if(qe!==he.__cacheKey){lt[qe]===void 0&&(lt[qe]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,ze=!0),lt[qe].usedTimes++;const It=lt[he.__cacheKey];It!==void 0&&(lt[he.__cacheKey].usedTimes--,It.usedTimes===0&&B(ee)),he.__cacheKey=qe,he.__webglTexture=lt[qe].texture}return ze}function Me(he,ee,ze){return Math.floor(Math.floor(he/ze)/ee)}function We(he,ee,ze,Ve){const qe=he.updateRanges;if(qe.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,ee.width,ee.height,ze,Ve,ee.data);else{qe.sort(($e,Xe)=>$e.start-Xe.start);let It=0;for(let $e=1;$e<qe.length;$e++){const Xe=qe[It],X=qe[$e],ke=Xe.start+Xe.count,De=Me(X.start,ee.width,4),oe=Me(Xe.start,ee.width,4);X.start<=ke+1&&De===oe&&Me(X.start+X.count-1,ee.width,4)===De?Xe.count=Math.max(Xe.count,X.start+X.count-Xe.start):(++It,qe[It]=X)}qe.length=It+1;const gt=t.getParameter(t.UNPACK_ROW_LENGTH),Ee=t.getParameter(t.UNPACK_SKIP_PIXELS),Je=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,ee.width);for(let $e=0,Xe=qe.length;$e<Xe;$e++){const X=qe[$e],ke=Math.floor(X.start/4),De=Math.ceil(X.count/4),oe=ke%ee.width,te=Math.floor(ke/ee.width),ye=De,Re=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,oe),t.pixelStorei(t.UNPACK_SKIP_ROWS,te),n.texSubImage2D(t.TEXTURE_2D,0,oe,te,ye,Re,ze,Ve,ee.data)}he.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,gt),t.pixelStorei(t.UNPACK_SKIP_PIXELS,Ee),t.pixelStorei(t.UNPACK_SKIP_ROWS,Je)}}function Ae(he,ee,ze){let Ve=t.TEXTURE_2D;(ee.isDataArrayTexture||ee.isCompressedArrayTexture)&&(Ve=t.TEXTURE_2D_ARRAY),ee.isData3DTexture&&(Ve=t.TEXTURE_3D);const lt=pe(he,ee),qe=ee.source;n.bindTexture(Ve,he.__webglTexture,t.TEXTURE0+ze);const It=a.get(qe);if(qe.version!==It.__version||lt===!0){n.activeTexture(t.TEXTURE0+ze);const gt=ur.getPrimaries(ur.workingColorSpace),Ee=ee.colorSpace===pc?null:ur.getPrimaries(ee.colorSpace),Je=ee.colorSpace===pc||gt===Ee?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,ee.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ee.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,ee.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);let $e=S(ee.image,!1,i.maxTextureSize);$e=Dt(ee,$e);const Xe=s.convert(ee.format,ee.colorSpace),X=s.convert(ee.type);let ke=N(ee.internalFormat,Xe,X,ee.colorSpace,ee.isVideoTexture);ve(Ve,ee);let De;const oe=ee.mipmaps,te=ee.isVideoTexture!==!0,ye=It.__version===void 0||lt===!0,Re=qe.dataReady,Le=z(ee,$e);if(ee.isDepthTexture)ke=P(ee.format===Gm,ee.type),ye&&(te?n.texStorage2D(t.TEXTURE_2D,1,ke,$e.width,$e.height):n.texImage2D(t.TEXTURE_2D,0,ke,$e.width,$e.height,0,Xe,X,null));else if(ee.isDataTexture)if(oe.length>0){te&&ye&&n.texStorage2D(t.TEXTURE_2D,Le,ke,oe[0].width,oe[0].height);for(let fe=0,Se=oe.length;fe<Se;fe++)De=oe[fe],te?Re&&n.texSubImage2D(t.TEXTURE_2D,fe,0,0,De.width,De.height,Xe,X,De.data):n.texImage2D(t.TEXTURE_2D,fe,ke,De.width,De.height,0,Xe,X,De.data);ee.generateMipmaps=!1}else te?(ye&&n.texStorage2D(t.TEXTURE_2D,Le,ke,$e.width,$e.height),Re&&We(ee,$e,Xe,X)):n.texImage2D(t.TEXTURE_2D,0,ke,$e.width,$e.height,0,Xe,X,$e.data);else if(ee.isCompressedTexture)if(ee.isCompressedArrayTexture){te&&ye&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Le,ke,oe[0].width,oe[0].height,$e.depth);for(let fe=0,Se=oe.length;fe<Se;fe++)if(De=oe[fe],ee.format!==Gs)if(Xe!==null)if(te){if(Re)if(ee.layerUpdates.size>0){const Be=a_(De.width,De.height,ee.format,ee.type);for(const Ze of ee.layerUpdates){const ue=De.data.subarray(Ze*Be/De.data.BYTES_PER_ELEMENT,(Ze+1)*Be/De.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,Ze,De.width,De.height,1,Xe,ue)}ee.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,De.width,De.height,$e.depth,Xe,De.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,fe,ke,De.width,De.height,$e.depth,0,De.data,0,0);else Yn("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else te?Re&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,fe,0,0,0,De.width,De.height,$e.depth,Xe,X,De.data):n.texImage3D(t.TEXTURE_2D_ARRAY,fe,ke,De.width,De.height,$e.depth,0,Xe,X,De.data)}else{te&&ye&&n.texStorage2D(t.TEXTURE_2D,Le,ke,oe[0].width,oe[0].height);for(let fe=0,Se=oe.length;fe<Se;fe++)De=oe[fe],ee.format!==Gs?Xe!==null?te?Re&&n.compressedTexSubImage2D(t.TEXTURE_2D,fe,0,0,De.width,De.height,Xe,De.data):n.compressedTexImage2D(t.TEXTURE_2D,fe,ke,De.width,De.height,0,De.data):Yn("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):te?Re&&n.texSubImage2D(t.TEXTURE_2D,fe,0,0,De.width,De.height,Xe,X,De.data):n.texImage2D(t.TEXTURE_2D,fe,ke,De.width,De.height,0,Xe,X,De.data)}else if(ee.isDataArrayTexture)if(te){if(ye&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Le,ke,$e.width,$e.height,$e.depth),Re)if(ee.layerUpdates.size>0){const fe=a_($e.width,$e.height,ee.format,ee.type);for(const Se of ee.layerUpdates){const Be=$e.data.subarray(Se*fe/$e.data.BYTES_PER_ELEMENT,(Se+1)*fe/$e.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,Se,$e.width,$e.height,1,Xe,X,Be)}ee.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,$e.width,$e.height,$e.depth,Xe,X,$e.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ke,$e.width,$e.height,$e.depth,0,Xe,X,$e.data);else if(ee.isData3DTexture)te?(ye&&n.texStorage3D(t.TEXTURE_3D,Le,ke,$e.width,$e.height,$e.depth),Re&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,$e.width,$e.height,$e.depth,Xe,X,$e.data)):n.texImage3D(t.TEXTURE_3D,0,ke,$e.width,$e.height,$e.depth,0,Xe,X,$e.data);else if(ee.isFramebufferTexture){if(ye)if(te)n.texStorage2D(t.TEXTURE_2D,Le,ke,$e.width,$e.height);else{let fe=$e.width,Se=$e.height;for(let Be=0;Be<Le;Be++)n.texImage2D(t.TEXTURE_2D,Be,ke,fe,Se,0,Xe,X,null),fe>>=1,Se>>=1}}else if(oe.length>0){if(te&&ye){const fe=jt(oe[0]);n.texStorage2D(t.TEXTURE_2D,Le,ke,fe.width,fe.height)}for(let fe=0,Se=oe.length;fe<Se;fe++)De=oe[fe],te?Re&&n.texSubImage2D(t.TEXTURE_2D,fe,0,0,Xe,X,De):n.texImage2D(t.TEXTURE_2D,fe,ke,Xe,X,De);ee.generateMipmaps=!1}else if(te){if(ye){const fe=jt($e);n.texStorage2D(t.TEXTURE_2D,Le,ke,fe.width,fe.height)}Re&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Xe,X,$e)}else n.texImage2D(t.TEXTURE_2D,0,ke,Xe,X,$e);F(ee)&&w(Ve),It.__version=qe.version,ee.onUpdate&&ee.onUpdate(ee)}he.__version=ee.version}function Ce(he,ee,ze){if(ee.image.length!==6)return;const Ve=pe(he,ee),lt=ee.source;n.bindTexture(t.TEXTURE_CUBE_MAP,he.__webglTexture,t.TEXTURE0+ze);const qe=a.get(lt);if(lt.version!==qe.__version||Ve===!0){n.activeTexture(t.TEXTURE0+ze);
vendor: 8,462 bytes, line 4310
4310const It=ur.getPrimaries(ur.workingColorSpace),gt=ee.colorSpace===pc?null:ur.getPrimaries(ee.colorSpace),Ee=ee.colorSpace===pc||It===gt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,ee.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ee.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,ee.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ee);const Je=ee.isCompressedTexture||ee.image[0].isCompressedTexture,$e=ee.image[0]&&ee.image[0].isDataTexture,Xe=[];for(let Se=0;Se<6;Se++)!Je&&!$e?Xe[Se]=S(ee.image[Se],!0,i.maxCubemapSize):Xe[Se]=$e?ee.image[Se].image:ee.image[Se],Xe[Se]=Dt(ee,Xe[Se]);const X=Xe[0],ke=s.convert(ee.format,ee.colorSpace),De=s.convert(ee.type),oe=N(ee.internalFormat,ke,De,ee.colorSpace),te=ee.isVideoTexture!==!0,ye=qe.__version===void 0||Ve===!0,Re=lt.dataReady;let Le=z(ee,X);ve(t.TEXTURE_CUBE_MAP,ee);let fe;if(Je){te&&ye&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Le,oe,X.width,X.height);for(let Se=0;Se<6;Se++){fe=Xe[Se].mipmaps;for(let Be=0;Be<fe.length;Be++){const Ze=fe[Be];ee.format!==Gs?ke!==null?te?Re&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be,0,0,Ze.width,Ze.height,ke,Ze.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be,oe,Ze.width,Ze.height,0,Ze.data):Yn("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):te?Re&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be,0,0,Ze.width,Ze.height,ke,De,Ze.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be,oe,Ze.width,Ze.height,0,ke,De,Ze.data)}}}else{if(fe=ee.mipmaps,te&&ye){fe.length>0&&Le++;const Se=jt(Xe[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Le,oe,Se.width,Se.height)}for(let Se=0;Se<6;Se++)if($e){te?Re&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,Xe[Se].width,Xe[Se].height,ke,De,Xe[Se].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,oe,Xe[Se].width,Xe[Se].height,0,ke,De,Xe[Se].data);for(let Be=0;Be<fe.length;Be++){const ue=fe[Be].image[Se].image;te?Re&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be+1,0,0,ue.width,ue.height,ke,De,ue.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be+1,oe,ue.width,ue.height,0,ke,De,ue.data)}}else{te?Re&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,ke,De,Xe[Se]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,oe,ke,De,Xe[Se]);for(let Be=0;Be<fe.length;Be++){const Ze=fe[Be];te?Re&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be+1,0,0,ke,De,Ze.image[Se]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Be+1,oe,ke,De,Ze.image[Se])}}}F(ee)&&w(t.TEXTURE_CUBE_MAP),qe.__version=lt.version,ee.onUpdate&&ee.onUpdate(ee)}he.__version=ee.version}function He(he,ee,ze,Ve,lt,qe){const It=s.convert(ze.format,ze.colorSpace),gt=s.convert(ze.type),Ee=N(ze.internalFormat,It,gt,ze.colorSpace),Je=a.get(ee),$e=a.get(ze);if($e.__renderTarget=ee,!Je.__hasExternalTextures){const Xe=Math.max(1,ee.width>>qe),X=Math.max(1,ee.height>>qe);lt===t.TEXTURE_3D||lt===t.TEXTURE_2D_ARRAY?n.texImage3D(lt,qe,Ee,Xe,X,ee.depth,0,It,gt,null):n.texImage2D(lt,qe,Ee,Xe,X,0,It,gt,null)}n.bindFramebuffer(t.FRAMEBUFFER,he),Tt(ee)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Ve,lt,$e.__webglTexture,0,vt(ee)):(lt===t.TEXTURE_2D||lt>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&lt<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Ve,lt,$e.__webglTexture,qe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ct(he,ee,ze){if(t.bindRenderbuffer(t.RENDERBUFFER,he),ee.depthBuffer){const Ve=ee.depthTexture,lt=Ve&&Ve.isDepthTexture?Ve.type:null,qe=P(ee.stencilBuffer,lt),It=ee.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,gt=vt(ee);Tt(ee)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,gt,qe,ee.width,ee.height):ze?t.renderbufferStorageMultisample(t.RENDERBUFFER,gt,qe,ee.width,ee.height):t.renderbufferStorage(t.RENDERBUFFER,qe,ee.width,ee.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,It,t.RENDERBUFFER,he)}else{const Ve=ee.textures;for(let lt=0;lt<Ve.length;lt++){const qe=Ve[lt],It=s.convert(qe.format,qe.colorSpace),gt=s.convert(qe.type),Ee=N(qe.internalFormat,It,gt,qe.colorSpace),Je=vt(ee);ze&&Tt(ee)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Je,Ee,ee.width,ee.height):Tt(ee)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Je,Ee,ee.width,ee.height):t.renderbufferStorage(t.RENDERBUFFER,Ee,ee.width,ee.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function bt(he,ee){if(ee&&ee.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,he),!(ee.depthTexture&&ee.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Ve=a.get(ee.depthTexture);Ve.__renderTarget=ee,(!Ve.__webglTexture||ee.depthTexture.image.width!==ee.width||ee.depthTexture.image.height!==ee.height)&&(ee.depthTexture.image.width=ee.width,ee.depthTexture.image.height=ee.height,ee.depthTexture.needsUpdate=!0),q(ee.depthTexture,0);const lt=Ve.__webglTexture,qe=vt(ee);if(ee.depthTexture.format===zm)Tt(ee)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,lt,0,qe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,lt,0);else if(ee.depthTexture.format===Gm)Tt(ee)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,lt,0,qe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,lt,0);else throw new Error("Unknown depthTexture format")}function Rt(he){const ee=a.get(he),ze=he.isWebGLCubeRenderTarget===!0;if(ee.__boundDepthTexture!==he.depthTexture){const Ve=he.depthTexture;if(ee.__depthDisposeCallback&&ee.__depthDisposeCallback(),Ve){const lt=()=>{delete ee.__boundDepthTexture,delete ee.__depthDisposeCallback,Ve.removeEventListener("dispose",lt)};Ve.addEventListener("dispose",lt),ee.__depthDisposeCallback=lt}ee.__boundDepthTexture=Ve}if(he.depthTexture&&!ee.__autoAllocateDepthBuffer){if(ze)throw new Error("target.depthTexture not supported in Cube render targets");const Ve=he.texture.mipmaps;Ve&&Ve.length>0?bt(ee.__webglFramebuffer[0],he):bt(ee.__webglFramebuffer,he)}else if(ze){ee.__webglDepthbuffer=[];for(let Ve=0;Ve<6;Ve++)if(n.bindFramebuffer(t.FRAMEBUFFER,ee.__webglFramebuffer[Ve]),ee.__webglDepthbuffer[Ve]===void 0)ee.__webglDepthbuffer[Ve]=t.createRenderbuffer(),Ct(ee.__webglDepthbuffer[Ve],he,!1);else{const lt=he.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,qe=ee.__webglDepthbuffer[Ve];t.bindRenderbuffer(t.RENDERBUFFER,qe),t.framebufferRenderbuffer(t.FRAMEBUFFER,lt,t.RENDERBUFFER,qe)}}else{const Ve=he.texture.mipmaps;if(Ve&&Ve.length>0?n.bindFramebuffer(t.FRAMEBUFFER,ee.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,ee.__webglFramebuffer),ee.__webglDepthbuffer===void 0)ee.__webglDepthbuffer=t.createRenderbuffer(),Ct(ee.__webglDepthbuffer,he,!1);else{const lt=he.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,qe=ee.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,qe),t.framebufferRenderbuffer(t.FRAMEBUFFER,lt,t.RENDERBUFFER,qe)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function zt(he,ee,ze){const Ve=a.get(he);ee!==void 0&&He(Ve.__webglFramebuffer,he,he.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ze!==void 0&&Rt(he)}function Ut(he){const ee=he.texture,ze=a.get(he),Ve=a.get(ee);he.addEventListener("dispose",T);const lt=he.textures,qe=he.isWebGLCubeRenderTarget===!0,It=lt.length>1;if(It||(Ve.__webglTexture===void 0&&(Ve.__webglTexture=t.createTexture()),Ve.__version=ee.version,o.memory.textures++),qe){ze.__webglFramebuffer=[];for(let gt=0;gt<6;gt++)if(ee.mipmaps&&ee.mipmaps.length>0){ze.__webglFramebuffer[gt]=[];for(let Ee=0;Ee<ee.mipmaps.length;Ee++)ze.__webglFramebuffer[gt][Ee]=t.createFramebuffer()}else ze.__webglFramebuffer[gt]=t.createFramebuffer()}else{if(ee.mipmaps&&ee.mipmaps.length>0){ze.__webglFramebuffer=[];for(let gt=0;gt<ee.mipmaps.length;gt++)ze.__webglFramebuffer[gt]=t.createFramebuffer()}else ze.__webglFramebuffer=t.createFramebuffer();if(It)for(let gt=0,Ee=lt.length;gt<Ee;gt++){const Je=a.get(lt[gt]);Je.__webglTexture===void 0&&(Je.__webglTexture=t.createTexture(),o.memory.textures++)}if(he.samples>0&&Tt(he)===!1){ze.__webglMultisampledFramebuffer=t.createFramebuffer(),ze.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ze.__webglMultisampledFramebuffer);for(let gt=0;gt<lt.length;gt++){const Ee=lt[gt];ze.__webglColorRenderbuffer[gt]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,ze.__webglColorRen
vendor: 31,923 bytes, lines 4310-4334
4310derbuffer[gt]);const Je=s.convert(Ee.format,Ee.colorSpace),$e=s.convert(Ee.type),Xe=N(Ee.internalFormat,Je,$e,Ee.colorSpace,he.isXRRenderTarget===!0),X=vt(he);t.renderbufferStorageMultisample(t.RENDERBUFFER,X,Xe,he.width,he.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+gt,t.RENDERBUFFER,ze.__webglColorRenderbuffer[gt])}t.bindRenderbuffer(t.RENDERBUFFER,null),he.depthBuffer&&(ze.__webglDepthRenderbuffer=t.createRenderbuffer(),Ct(ze.__webglDepthRenderbuffer,he,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(qe){n.bindTexture(t.TEXTURE_CUBE_MAP,Ve.__webglTexture),ve(t.TEXTURE_CUBE_MAP,ee);for(let gt=0;gt<6;gt++)if(ee.mipmaps&&ee.mipmaps.length>0)for(let Ee=0;Ee<ee.mipmaps.length;Ee++)He(ze.__webglFramebuffer[gt][Ee],he,ee,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+gt,Ee);else He(ze.__webglFramebuffer[gt],he,ee,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+gt,0);F(ee)&&w(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(It){for(let gt=0,Ee=lt.length;gt<Ee;gt++){const Je=lt[gt],$e=a.get(Je);let Xe=t.TEXTURE_2D;(he.isWebGL3DRenderTarget||he.isWebGLArrayRenderTarget)&&(Xe=he.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Xe,$e.__webglTexture),ve(Xe,Je),He(ze.__webglFramebuffer,he,Je,t.COLOR_ATTACHMENT0+gt,Xe,0),F(Je)&&w(Xe)}n.unbindTexture()}else{let gt=t.TEXTURE_2D;if((he.isWebGL3DRenderTarget||he.isWebGLArrayRenderTarget)&&(gt=he.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(gt,Ve.__webglTexture),ve(gt,ee),ee.mipmaps&&ee.mipmaps.length>0)for(let Ee=0;Ee<ee.mipmaps.length;Ee++)He(ze.__webglFramebuffer[Ee],he,ee,t.COLOR_ATTACHMENT0,gt,Ee);else He(ze.__webglFramebuffer,he,ee,t.COLOR_ATTACHMENT0,gt,0);F(ee)&&w(gt),n.unbindTexture()}he.depthBuffer&&Rt(he)}function Bt(he){const ee=he.textures;for(let ze=0,Ve=ee.length;ze<Ve;ze++){const lt=ee[ze];if(F(lt)){const qe=A(he),It=a.get(lt).__webglTexture;n.bindTexture(qe,It),w(qe),n.unbindTexture()}}}const re=[],wt=[];function Nt(he){if(he.samples>0){if(Tt(he)===!1){const ee=he.textures,ze=he.width,Ve=he.height;let lt=t.COLOR_BUFFER_BIT;const qe=he.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,It=a.get(he),gt=ee.length>1;if(gt)for(let Je=0;Je<ee.length;Je++)n.bindFramebuffer(t.FRAMEBUFFER,It.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Je,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,It.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Je,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,It.__webglMultisampledFramebuffer);const Ee=he.texture.mipmaps;Ee&&Ee.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,It.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,It.__webglFramebuffer);for(let Je=0;Je<ee.length;Je++){if(he.resolveDepthBuffer&&(he.depthBuffer&&(lt|=t.DEPTH_BUFFER_BIT),he.stencilBuffer&&he.resolveStencilBuffer&&(lt|=t.STENCIL_BUFFER_BIT)),gt){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,It.__webglColorRenderbuffer[Je]);const $e=a.get(ee[Je]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,$e,0)}t.blitFramebuffer(0,0,ze,Ve,0,0,ze,Ve,lt,t.NEAREST),d===!0&&(re.length=0,wt.length=0,re.push(t.COLOR_ATTACHMENT0+Je),he.depthBuffer&&he.resolveDepthBuffer===!1&&(re.push(qe),wt.push(qe),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,wt)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,re))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),gt)for(let Je=0;Je<ee.length;Je++){n.bindFramebuffer(t.FRAMEBUFFER,It.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Je,t.RENDERBUFFER,It.__webglColorRenderbuffer[Je]);const $e=a.get(ee[Je]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,It.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Je,t.TEXTURE_2D,$e,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,It.__webglMultisampledFramebuffer)}else if(he.depthBuffer&&he.resolveDepthBuffer===!1&&d){const ee=he.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[ee])}}}function vt(he){return Math.min(i.maxSamples,he.samples)}function Tt(he){const ee=a.get(he);return he.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&ee.__useRenderToTexture!==!1}function Wt(he){const ee=o.render.frame;f.get(he)!==ee&&(f.set(he,ee),he.update())}function Dt(he,ee){const ze=he.colorSpace,Ve=he.format,lt=he.type;return he.isCompressedTexture===!0||he.isVideoTexture===!0||ze!==Xd&&ze!==pc&&(ur.getTransfer(ze)===br?(Ve!==Gs||lt!==Cl)&&Yn("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Wr("WebGLTextures: Unsupported texture color space:",ze)),ee}function jt(he){return typeof HTMLImageElement<"u"&&he instanceof HTMLImageElement?(m.width=he.naturalWidth||he.width,m.height=he.naturalHeight||he.height):typeof VideoFrame<"u"&&he instanceof VideoFrame?(m.width=he.displayWidth,m.height=he.displayHeight):(m.width=he.width,m.height=he.height),m}this.allocateTextureUnit=j,this.resetTextureUnits=I,this.setTexture2D=q,this.setTexture2DArray=Y,this.setTexture3D=W,this.setTextureCube=H,this.rebindTextures=zt,this.setupRenderTarget=Ut,this.updateRenderTargetMipmap=Bt,this.updateMultisampleRenderTarget=Nt,this.setupDepthRenderbuffer=Rt,this.setupFrameBufferTexture=He,this.useMultisampledRTT=Tt}function Q$(t,e){function n(a,i=pc){let s;const o=ur.getTransfer(i);if(a===Cl)return t.UNSIGNED_BYTE;if(a===Ew)return t.UNSIGNED_SHORT_4_4_4_4;if(a===kw)return t.UNSIGNED_SHORT_5_5_5_1;if(a===NT)return t.UNSIGNED_INT_5_9_9_9_REV;if(a===TT)return t.UNSIGNED_INT_10F_11F_11F_REV;if(a===kT)return t.BYTE;if(a===AT)return t.SHORT;if(a===Om)return t.UNSIGNED_SHORT;if(a===_w)return t.INT;if(a===Su)return t.UNSIGNED_INT;if(a===pl)return t.FLOAT;if(a===hh)return t.HALF_FLOAT;if(a===MT)return t.ALPHA;if(a===RT)return t.RGB;if(a===Gs)return t.RGBA;if(a===zm)return t.DEPTH_COMPONENT;if(a===Gm)return t.DEPTH_STENCIL;if(a===DT)return t.RED;if(a===Aw)return t.RED_INTEGER;if(a===Nw)return t.RG;if(a===Tw)return t.RG_INTEGER;if(a===Mw)return t.RGBA_INTEGER;if(a===mg||a===fg||a===pg||a===gg)if(o===br)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===mg)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===fg)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===pg)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===gg)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===mg)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===fg)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===pg)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===gg)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===bb||a===wb||a===Sb||a===Fb)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===bb)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===wb)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===Sb)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===Fb)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===Cb||a===_b||a===Eb)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===Cb||a===_b)return o===br?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===Eb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===kb||a===Ab||a===Nb||a===Tb||a===Mb||a===Rb||a===Db||a===Pb||a===jb||a===Lb||a===Ib||a===Bb||a===Ob||a===Ub)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===kb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===Ab)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===Nb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===Tb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===Mb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===Rb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===Db)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===Pb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===jb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===Lb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===Ib)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===Bb)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===Ob)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===Ub)return o===br?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===zb||a===Gb||a===Hb)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===zb)return o===br?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===Gb)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===Hb)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===Wb||a===Vb||a===$b||a===Kb)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===Wb)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Vb)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===$b)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===Kb)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===Um?t.UNSIGNED_INT_24_8:t[a]!==void 0?t[a]:null}return{convert:n}}const eK=`
4311void main() {
4312
4313	gl_Position = vec4( position, 1.0 );
4314
4315}`,tK=`
4316uniform sampler2DArray depthColor;
4317uniform float depthWidth;
4318uniform float depthHeight;
4319
4320void main() {
4321
4322	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4323
4324	if ( coord.x >= 1.0 ) {
4325
4326		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4327
4328	} else {
4329
4330		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4331
4332	}
4333
4334}`;class nK{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const a=new KT(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=a}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,a=new El({vertexShader:eK,fragmentShader:tK,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Hs(new Qd(20,20),a)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class rK extends mh{constructor(e,n){super();const a=this;let i=null,s=1,o=null,c="local-floor",d=1,m=null,f=null,p=null,b=null,v=null,C=null;const S=typeof XRWebGLBinding<"u",F=new nK,w={},A=n.getContextAttributes();let N=null,P=null;const z=[],D=[],T=new vr;let K=null;const B=new cs;B.viewport=new $r;const k=new cs;k.viewport=new $r;const O=[B,k],I=new wG;let j=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Ae){let Ce=z[Ae];return Ce===void 0&&(Ce=new ry,z[Ae]=Ce),Ce.getTargetRaySpace()},this.getControllerGrip=function(Ae){let Ce=z[Ae];return Ce===void 0&&(Ce=new ry,z[Ae]=Ce),Ce.getGripSpace()},this.getHand=function(Ae){let Ce=z[Ae];return Ce===void 0&&(Ce=new ry,z[Ae]=Ce),Ce.getHandSpace()};function q(Ae){const Ce=D.indexOf(Ae.inputSource);if(Ce===-1)return;const He=z[Ce];He!==void 0&&(He.update(Ae.inputSource,Ae.frame,m||o),He.dispatchEvent({type:Ae.type,data:Ae.inputSource}))}function Y(){i.removeEventListener("select",q),i.removeEventListener("selectstart",q),i.removeEventListener("selectend",q),i.removeEventListener("squeeze",q),i.removeEventListener("squeezestart",q),i.removeEventListener("squeezeend",q),i.removeEventListener("end",Y),i.removeEventListener("inputsourceschange",W);for(let Ae=0;Ae<z.length;Ae++){const Ce=D[Ae];Ce!==null&&(D[Ae]=null,z[Ae].disconnect(Ce))}j=null,U=null,F.reset();for(const Ae in w)delete w[Ae];e.setRenderTarget(N),v=null,b=null,p=null,i=null,P=null,We.stop(),a.isPresenting=!1,e.setPixelRatio(K),e.setSize(T.width,T.height,!1),a.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Ae){s=Ae,a.isPresenting===!0&&Yn("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Ae){c=Ae,a.isPresenting===!0&&Yn("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||o},this.setReferenceSpace=function(Ae){m=Ae},this.getBaseLayer=function(){return b!==null?b:v},this.getBinding=function(){return p===null&&S&&(p=new XRWebGLBinding(i,n)),p},this.getFrame=function(){return C},this.getSession=function(){return i},this.setSession=async function(Ae){if(i=Ae,i!==null){if(N=e.getRenderTarget(),i.addEventListener("select",q),i.addEventListener("selectstart",q),i.addEventListener("selectend",q),i.addEventListener("squeeze",q),i.addEventListener("squeezestart",q),i.addEventListener("squeezeend",q),i.addEventListener("end",Y),i.addEventListener("inputsourceschange",W),A.xrCompatible!==!0&&await n.makeXRCompatible(),K=e.getPixelRatio(),e.getSize(T),S&&"createProjectionLayer"in XRWebGLBinding.prototype){let He=null,Ct=null,bt=null;A.depth&&(bt=A.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,He=A.stencil?Gm:zm,Ct=A.stencil?Um:Su);const Rt={colorFormat:n.RGBA8,depthFormat:bt,scaleFactor:s};p=this.getBinding(),b=p.createProjectionLayer(Rt),i.updateRenderState({layers:[b]}),e.setPixelRatio(1),e.setSize(b.textureWidth,b.textureHeight,!1),P=new Fu(b.textureWidth,b.textureHeight,{format:Gs,type:Cl,depthTexture:new $T(b.textureWidth,b.textureHeight,Ct,void 0,void 0,void 0,void 0,void 0,void 0,He),stencilBuffer:A.stencil,colorSpace:e.outputColorSpace,samples:A.antialias?4:0,resolveDepthBuffer:b.ignoreDepthValues===!1,resolveStencilBuffer:b.ignoreDepthValues===!1})}else{const He={antialias:A.antialias,alpha:!0,depth:A.depth,stencil:A.stencil,framebufferScaleFactor:s};v=new XRWebGLLayer(i,n,He),i.updateRenderState({baseLayer:v}),e.setPixelRatio(1),e.setSize(v.framebufferWidth,v.framebufferHeight,!1),P=new Fu(v.framebufferWidth,v.framebufferHeight,{format:Gs,type:Cl,colorSpace:e.outputColorSpace,stencilBuffer:A.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}P.isXRRenderTarget=!0,this.setFoveation(d),m=null,o=await i.requestReferenceSpace(c),We.setContext(i),We.start(),a.isPresenting=!0,a.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return F.getDepthTexture()};function W(Ae){for(let Ce=0;Ce<Ae.removed.length;Ce++){const He=Ae.removed[Ce],Ct=D.indexOf(He);Ct>=0&&(D[Ct]=null,z[Ct].disconnect(He))}for(let Ce=0;Ce<Ae.added.length;Ce++){const He=Ae.added[Ce];let Ct=D.indexOf(He);if(Ct===-1){for(let Rt=0;Rt<z.length;Rt++)if(Rt>=D.length){D.push(He),Ct=Rt;break}else if(D[Rt]===null){D[Rt]=He,Ct=Rt;break}if(Ct===-1)break}const bt=z[Ct];bt&&bt.connect(He)}}const H=new Pt,J=new Pt;function ie(Ae,Ce,He){H.setFromMatrixPosition(Ce.matrixWorld),J.setFromMatrixPosition(He.matrixWorld);const Ct=H.distanceTo(J),bt=Ce.projectionMatrix.elements,Rt=He.projectionMatrix.elements,zt=bt[14]/(bt[10]-1),Ut=bt[14]/(bt[10]+1),Bt=(bt[9]+1)/bt[5],re=(bt[9]-1)/bt[5],wt=(bt[8]-1)/bt[0],Nt=(Rt[8]+1)/Rt[0],vt=zt*wt,Tt=zt*Nt,Wt=Ct/(-wt+Nt),Dt=Wt*-wt;if(Ce.matrixWorld.decompose(Ae.position,Ae.quaternion,Ae.scale),Ae.translateX(Dt),Ae.translateZ(Wt),Ae.matrixWorld.compose(Ae.position,Ae.quaternion,Ae.scale),Ae.matrixWorldInverse.copy(Ae.matrixWorld).invert(),bt[10]===-1)Ae.projectionMatrix.copy(Ce.projectionMatrix),Ae.projectionMatrixInverse.copy(Ce.projectionMatrixInverse);else{const jt=zt+Wt,he=Ut+Wt,ee=vt-Dt,ze=Tt+(Ct-Dt),Ve=Bt*Ut/he*jt,lt=re*Ut/he*jt;Ae.projectionMatrix.makePerspective(ee,ze,Ve,lt,jt,he),Ae.projectionMatrixInverse.copy(Ae.projectionMatrix).invert()}}function Q(Ae,Ce){Ce===null?Ae.matrixWorld.copy(Ae.matrix):Ae.matrixWorld.multiplyMatrices(Ce.matrixWorld,Ae.matrix),Ae.matrixWorldInverse.copy(Ae.matrixWorld).invert()}this.updateCamera=function(Ae){if(i===null)return;let Ce=Ae.near,He=Ae.far;F.texture!==null&&(F.depthNear>0&&(Ce=F.depthNear),F.depthFar>0&&(He=F.depthFar)),I.near=k.near=B.near=Ce,I.far=k.far=B.far=He,(j!==I.near||U!==I.far)&&(i.updateRenderState({depthNear:I.near,depthFar:I.far}),j=I.near,U=I.far),I.layers.mask=Ae.layers.mask|6,B.layers.mask=I.layers.mask&3,k.layers.mask=I.layers.mask&5;const Ct=Ae.parent,bt=I.cameras;Q(I,Ct);for(let Rt=0;Rt<bt.length;Rt++)Q(bt[Rt],Ct);bt.length===2?ie(I,B,k):I.projectionMatrix.copy(B.projectionMatrix),ve(Ae,I,Ct)};function ve(Ae,Ce,He){He===null?Ae.matrix.copy(Ce.matrixWorld):(Ae.matrix.copy(He.matrixWorld),Ae.matrix.invert(),Ae.matrix.multiply(Ce.matrixWorld)),Ae.matrix.decompose(Ae.position,Ae.quaternion,Ae.scale),Ae.updateMatrixWorld(!0),Ae.projectionMatrix.copy(Ce.projectionMatrix),Ae.projectionMatrixInverse.copy(Ce.projectionMatrixInverse),Ae.isPerspectiveCamera&&(Ae.fov=Yb*2*Math.atan(1/Ae.projectionMatrix.elements[5]),Ae.zoom=1)}this.getCamera=function(){return I},this.getFoveation=function(){if(!(b===null&&v===null))return d},this.setFoveation=function(Ae){d=Ae,b!==null&&(b.fixedFoveation=Ae),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=Ae)},this.hasDepthSensing=function(){return F.texture!==null},this.getDepthSensingMesh=function(){return F.getMesh(I)},this.getCameraTexture=function(Ae){return w[Ae]};let pe=null;function Me(Ae,Ce){if(f=Ce.getViewerPose(m||o),C=Ce,f!==null){const He=f.views;v!==null&&(e.setRenderTargetFramebuffer(P,v.framebuffer),e.setRenderTarget(P));let Ct=!1;He.length!==I.cameras.length&&(I.cameras.length=0,Ct=!0);for(let Ut=0;Ut<He.length;Ut++){const Bt=He[Ut];let re=null;if(v!==null)re=v.getViewport(Bt);else{const Nt=p.getViewSubImage(b,Bt);re=Nt.viewport,Ut===0&&(e.setRenderTargetTextures(P,Nt.colorTexture,Nt.depthStencilTexture),e.setRenderTarget(P))}let wt=O[Ut];wt===void 0&&(wt=new cs,wt.layers.enable(Ut),wt.viewport=new $r,O[Ut]=wt),wt.matrix.fromArray(Bt.transform.matrix),wt.matrix.decompose(wt.position,wt.quaternion,wt.scale),wt.projectionMatrix.fromArray(Bt.projectionMatrix),wt.projectionMatrixInverse.copy(wt.projectionMatrix).invert(),wt.viewport.set(re.x,re.y,re.width,re.height),Ut===0&&(I.matrix.copy(wt.matrix),I.matrix.decompose(I.position,I.quaternion,I.scale)),Ct===!0&&I.cameras.push(wt)}const bt=i.enabledFeatures;if(bt&&bt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&S){p=a.getBinding();const Ut=p.getDepthInformation(He[0]);Ut&&Ut.isValid&&Ut.texture&&F.init(Ut,i.renderState)}if(bt&&bt.includes("camera-access")&&S){e.state.unbindTexture(),p=a.getBinding();for(let Ut=0;Ut<He.length;Ut++){const Bt=He[Ut].camera;if(Bt){let re=w[Bt];re||(re=new KT,w[Bt]=re);const wt=p.getCameraImage(Bt);re.sourceTexture=wt}}}}for(let He=0;He<z.length;He++){const Ct=D[He],bt=z[He];Ct!==null&&bt!==void 0&&bt.update(Ct,Ce,m||o)}pe&&pe(Ae,Ce),Ce.detectedPlanes&&a.dispatchEvent({type:"planesdetected",data:Ce}),C=null}const We=new YT;We.setAnimationLoop(Me),this.setAnimationLoop=function(Ae){pe=Ae},this.dispose=function(){}}}const au=new _l,aK=new ra;function iK(t,e){function n(F,w){F.matrixAutoUpdate===!0&&F.updateMatrix(),w.value.copy(F.matrix)}function a(F,w){w.color.getRGB(F.fogColor.value,zT(t)),w.isFog?(F.fogNear.value=w.near,F.fogFar.value=w.far):w.isFogExp2&&(F.fogDensity.value=w.density)}function i(F,w,A,N,P){w.isMeshBasicMaterial||w.isMeshLambertMaterial?s(F,w):w.isMeshToonMaterial?(s(F,w),p(F,w)):w.isMeshPhongMaterial?(s(F,w),f(F,w)):w.isMeshStandardMaterial?(s(F,w),b(F,w),w.isMeshPhysicalMaterial&&v(F,w,P)):w.isMeshMatcapMaterial?(s(F,w),C(F,w)):w.isMeshDepthMaterial?s(F,w):w.isMeshDistanceMaterial?(s(F,w),S(F,w)):w.isMeshNormalMaterial?s(F,w):w.isLineBasicMaterial?(o(F,w),w.isLineDashedMaterial&&c(F,w)):w.isPointsMaterial?d(F,w,A,N):w.isSpriteMaterial?m(F,w):w.isShadowMaterial?(F.color.value.copy(w.color),F.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function s(F,w){F.opacity.value=w.opacity,w.color&&F.diffuse.value.copy(w.color),w.emissive&&F.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(F.map.value=w.map,n(w.map,F.mapTransform)),w.alphaMap&&(F.alphaMap.value=w.alphaMap,n(w.alphaMap,F.alphaMapTransform)),w.bumpMap&&(F.bumpMap.value=w.bumpMap,n(w.bumpMap,F.bumpMapTransform),F.bumpScale.value=w.bumpScale,w.side===ki&&(F.bumpScale.value*=-1)),w.normalMap&&(F.normalMap.value=w.normalMap,n(w.normalMap,F.normalMapTransform),F.normalScale.value.copy(w.normalScale),w.side===ki&&F.normalScale.value.negate()),w.displacementMap&&(F.displacementMap.value=w.displacementMap,n(w.displacementMap,F.displacementMapTransform),F.displacementScale.value=w.displacementScale,F.displacementBias.value=w.displacementBias),w.emissiveMap&&(F.emissiveMap.value=w.emissiveMap,n(w.emissiveMap,F.emissiveMapTransform)),w.specularMap&&(F.specularMap.value=w.specularMap,n(w.specularMap,F.specularMapTransform)),w.alphaTest>0&&(F.alphaTest.value=w.alphaTest);const A=e.get(w),N=A.envMap,P=A.envMapRotation;N&&(F.envMap.value=N,au.copy(P),au.x*=-1,au.y*=-1,au.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(au.y*=-1,au.z*=-1),F.envMapRotation.value.setFromMatrix4(aK.makeRotationFromEuler(au)),F.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,F.reflectivity.value=w.reflectivity,F.ior.value=w.ior,F.refractionRatio.value=w.refractionRatio),w.lightMap&&(F.lightMap.value=w.lightMap,F.lightMapIntensity.value=w.lightMapIntensity,n(w.lightMap,F.lightMapTransform)),w.aoMap&&(F.aoMap.value=w.aoMap,F.aoMapIntensity.value=w.aoMapIntensity,n(w.aoMap,F.aoMapTransform))}function o(F,w){F.diffuse.value.copy(w.color),F.opacity.value=w.opacity,w.map&&(F.map.value=w.map,n(w.map,F.mapTransform))}function c(F,w){F.dashSize.value=w.dashSize,F.totalSize.value=w.dashSize+w.gapSize,F.scale.value=w.scale}function d(F,w,A,N){F.diffuse.value.copy(w.color),F.opacity.value=w.opacity,F.size.value=w.size*A,F.scale.value=N*.5,w.map&&(F.map.value=w.map,n(w.map,F.uvTransform)),w.alphaMap&&(F.alphaMap.value=w.alphaMap,n(w.alphaMap,F.alphaMapTransform)),w.alphaTest>0&&(F.alphaTest.value=w.alphaTest)}function m(F,w){F.diffuse.value.copy(w.color),F.opacity.value=w.opacity,F.rotation.value=w.rotation,w.map&&(F.map.value=w.map,n(w.map,F.mapTransform)),w.alphaMap&&(F.alphaMap.value=w.alphaMap,n(w.alphaMap,F.alphaMapTransform)),w.alphaTest>0&&(F.alphaTest.value=w.alphaTest)}function f(F,w){F.specular.value.copy(w.specular),F.shininess.value=Math.max(w.shininess,1e-4)}function p(F,w){w.gradientMap&&(F.gradientMap.value=w.gradientMap)}function b(F,w){F.metalness.value=w.metalness,w.metalnessMap&&(F.metalnessMap.value=w.metalnessMap,n(w.metalnessMap,F.metalnessMapTransform)),F.roughness.value=w.roughness,w.roughnessMap&&(F.roughnessMap.value=w.roughnessMap,n(w.roughnessMap,F.roughnessMapTransform)),w.envMap&&(F.envMapIntensity.value=w.envMapIntensity)}function v(F,w,A){F.ior.value=w.ior,w.sheen>0&&(F.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),F.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(F.sheenColorMap.value=w.sheenColorMap,n(w.sheenColorMap,F.sheenColorMapTransform)),w.sheenRoughnessMap&&(F.sheenRoughnessMap.value=w.sheenRoughnessMap,n(w.sheenRoughnessMap,F.sheenRoughnessMapTransform))),w.clearcoat>0&&(F.clearcoat.value=w.clearcoat,F.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(F.clearcoatMap.value=w.clearcoatMap,n(w.clearcoatMap,F.clearcoatMapTransform)),w.clearcoatRoughnessMap&&(F.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap,n(w.clearcoatRoughnessMap,F.clearcoatRoughnessMapTransform)),w.clearcoatNormalMap&&(F.clearcoatNormalMap.value=w.clearcoatNormalMap,n(w.clearcoatNormalMap,F.clearcoatNormalMapTransform),F.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),w.side===ki&&F.clearcoatNormalScale.value.negate())),w.dispersion>0&&(F.dispersion.value=w.dispersion),w.iridescence>0&&(F.iridescence.value=w.iridescence,F.iridescenceIOR.value=w.iridescenceIOR,F.iridescenceThicknessMinimum.value=w.iridescenceThicknessRange[0],F.iridescenceThicknessMaximum.value=w.iridescenceThicknessRange[1],w.iridescenceMap&&(F.iridescenceMap.value=w.iridescenceMap,n(w.iridescenceMap,F.iridescenceMapTransform)),w.iridescenceThicknessMap&&(F.iridescenceThicknessMap.value=w.iridescenceThicknessMap,n(w.iridescenceThicknessMap,F.iridescenceThicknessMapTransform))),w.transmission>0&&(F.transmission.value=w.transmission,F.transmissionSamplerMap.value=A.texture,F.transmissionSamplerSize.value.set(A.width,A.height),w.transmissionMap&&(F.transmissionMap.value=w.transmissionMap,n(w.transmissionMap,F.transmissionMapTransform)),F.thickness.value=w.thickness,w.thicknessMap&&(F.thicknessMap.value=w.thicknessMap,n(w.thicknessMap,F.thicknessMapTransform)),F.attenuationDistance.value=w.attenuationDistance,F.attenuationColor.value.copy(w.attenuationColor)),w.anisotropy>0&&(F.anisotropyVector.value.set(w.anisotropy*Math.cos(w.anisotropyRotation),w.anisotropy*Math.sin(w.anisotropyRotation)),w.anisotropyMap&&(F.anisotropyMap.value=w.anisotropyMap,n(w.anisotropyMap,F.anisotropyMapTransform))),F.specularIntensity.value=w.specularIntensity,F.specularColor.value.copy(w.specularColor),w.specularColorMap&&(F.specularColorMap.value=w.specularColorMap,n(w.specularColorMap,F.specularColorMapTransform)),w.specularIntensityMap&&(F.specularIntensityMap.value=w.specularIntensityMap,n(w.specularIntensityMap,F.specularIntensityMapTransform))}function C(F,w){w.matcap&&(F.matcap.value=w.matcap)}function S(F,w){const A=e.get(w).light;F.referencePosition.value.setFromMatrixPosition(A.matrixWorld),F.nearDistance.value=A.shadow.camera.near,F.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:a,refreshMaterialUniforms:i}}function sK(t,e,n,a){let i={},s={},o=[];const c=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function d(A,N){const P=N.program;a.uniformBlockBinding(A,P)}function m(A,N){let P=i[A.id];P===void 0&&(C(A),P=f(A),i[A.id]=P,A.addEventListener("dispose",F));const z=N.program;a.updateUBOMapping(A,z);const D=e.render.frame;s[A.id]!==D&&(b(A),s[A.id]=D)}function f(A){const N=p();A.__bindingPointIndex=N;const P=t.createBuffer(),z=A.__size,D=A.usage;return t.bindBuffer(t.UNIFORM_BUFFER,P),t.bufferData(t.UNIFORM_BUFFER,z,D),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,N,P),P}function p(){for(let A=0;A<c;A++)if(o.indexOf(A)===-1)return o.push(A),A;return Wr("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function b(A){const N=i[A.id],P=A.uniforms,z=A.__cache;t.bindBuffer(t.UNIFORM_BUFFER,N);for(let D=0,T=P.length;D<T;D++){const K=Array.isArray(P[D])?P[D]:[P[D]];for(let B=0,k=K.length;B<k;B++){const O=K[B];if(v(O,D,B,z)===!0){const I=O.__offset,j=Array.isArray(O.value)?O.value:[O.value];let U=0;for(let q=0;q<j.length;q++){const Y=j[q],W=S(Y);typeof Y=="number"||typeof Y=="boolean"?(O.__data[0]=Y,t.bufferSubData(t.UNIFORM_BUFFER,I+U,O.__data)):Y.isMatrix3?(O.__data[0]=Y.elements[0],O.__data[1]=Y.elements[1],O.__data[2]=Y.elements[2],O.__data[3]=0,O.__data[4]=Y.elements[3],O.__data[5]=Y.elements[4],O.__data[6]=Y.elements[5],O.__data[7]=0,O.__data[8]=Y.elements[6],O.__data[9]=Y.elements[7],O.__data[10]=Y.elements[8],O.__data[11]=0):(Y.toArray(O.__data,U),U+=W.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,I,O.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function v(A,N,P,z){const D=A.value,T=N+"_"+P;if(z[T]===void 0)return typeof D=="number"||typeof D=="boolean"?z[T]=D:z[T]=D.clone(),!0;{const K=z[T];if(typeof D=="number"||typeof D=="boolean"){if(K!==D)return z[T]=D,!0}else if(K.equals(D)===!1)return K.copy(D),!0}return!1}function C(A){const N=A.uniforms;let P=0;const z=16;for(let T=0,K=N.length;T<K;T++){const B=Array.isArray(N[T])?N[T]:[N[T]];for(let k=0,O=B.length;k<O;k++){const I=B[k],j=Array.isArray(I.value)?I.value:[I.value];for(let U=0,q=j.length;U<q;U++){const Y=j[U],W=S(Y),H=P%z,J=H%W.boundary,ie=H+J;P+=J,ie!==0&&z-ie<W.storage&&(P+=z-ie),I.__data=new Float32Array(W.storage/Float32Array.BYTES_PER_ELEMENT),I.__offset=P,P+=W.storage}}}const D=P%z;return D>0&&(P+=z-D),A.__size=P,A.__cache={},this}function S(A){const N={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(N.boundary=4,N.storage=4):A.isVector2?(N.boundary=8,N.storage=8):A.isVector3||A.isColor?(N.boundary=16,N.storage=12):A.isVector4?(N.boundary=16,N.storage=16):A.isMatrix3?(N.boundary=48,N.storage=48):A.isMatrix4?(N.boundary=64,N.storage=64):A.isTexture?Yn("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Yn("WebGLRenderer: Unsupported uniform value type.",A),N}function F(A){const N=A.target;N.removeEventListener("dispose",F);const P=o.indexOf(N.__bindingPointIndex);o.splice(P,1),t.deleteBuffer(i[N.id]),delete i[N.id],delete s[N.id]}function w(){for(const A in i)t.deleteBuffer(i[A]);o=[],i={},s={}}return{bind:d,update:m,dispose:w}}const oK=new Uint16Array([11481,15204,11534,15171,11808,15015,12385,14843,12894,14716,13396,14600,13693,14483,13976,14366,14237,14171,14405,13961,14511,13770,14605,13598,14687,13444,14760,13305,14822,13066,14876,12857,14923,12675,14963,12517,14997,12379,15025,12230,15049,12023,15070,11843,15086,11687,15100,11551,15111,11433,15120,11330,15127,11217,15132,11060,15135,10922,15138,10801,15139,10695,15139,10600,13012,14923,13020,14917,13064,14886,13176,14800,13349,14666,13513,14526,13724,14398,13960,14230,14200,14020,14383,13827,14488,13651,14583,13491,14667,13348,14740,13132,14803,12908,14856,12713,14901,12542,14938,12394,14968,12241,14992,12017,15010,11822,15024,11654,15034,11507,15041,11380,15044,11269,15044,11081,15042,10913,15037,10764,15031,10635,15023,10520,15014,10419,15003,10330,13657,14676,13658,14673,13670,14660,13698,14622,13750,14547,13834,14442,13956,14317,14112,14093,14291,13889,14407,13704,14499,13538,14586,13389,14664,13201,14733,12966,14792,12758,14842,12577,14882,12418,14915,12272,14940,12033,14959,11826,14972,11646,14980,11490,14983,11355,14983,11212,14979,11008,14971,10830,14961,10675,14950,10540,14936,10420,14923,10315,14909,10204,14894,10041,14089,14460,14090,14459,14096,14452,14112,14431,14141,14388,14186,14305,14252,14130,14341,13941,14399,13756,14467,13585,14539,13430,14610,13272,14677,13026,14737,12808,14790,12617,14833,12449,14869,12303,14896,12065,14916,11845,14929,11655,14937,11490,14939,11347,14936,11184,14930,10970,14921,10783,14912,10621,14900,10480,14885,10356,14867,10247,14848,10062,14827,9894,14805,9745,14400,14208,14400,14206,14402,14198,14406,14174,14415,14122,14427,14035,14444,13913,14469,13767,14504,13613,14548,13463,14598,13324,14651,13082,14704,12858,14752,12658,14795,12483,14831,12330,14860,12106,14881,11875,14895,11675,14903,11501,14905,11351,14903,11178,14900,10953,14892,10757,14880,10589,14865,10442,14847,10313,14827,10162,14805,9965,14782,9792,14757,9642,14731,9507,14562,13883,14562,13883,14563,13877,14566,13862,14570,13830,14576,13773,14584,13689,14595,13582,14613,13461,14637,13336,14668,13120,14704,12897,14741,12695,14776,12516,14808,12358,14835,12150,14856,11910,14870,11701,14878,11519,14882,11361,14884,11187,14880,10951,14871,10748,14858,10572,14842,10418,14823,10286,14801,10099,14777,9897,14751,9722,14725,9567,14696,9430,14666,9309,14702,13604,14702,13604,14702,13600,14703,13591,14705,13570,14707,13533,14709,13477,14712,13400,14718,13305,14727,13106,14743,12907,14762,12716,14784,12539,14807,12380,14827,12190,14844,11943,14855,11727,14863,11539,14870,11376,14871,11204,14868,10960,14858,10748,14845,10565,14829,10406,14809,10269,14786,10058,14761,9852,14734,9671,14705,9512,14674,9374,14641,9253,14608,9076,14821,13366,14821,13365,14821,13364,14821,13358,14821,13344,14821,13320,14819,13252,14817,13145,14815,13011,14814,12858,14817,12698,14823,12539,14832,12389,14841,12214,14850,11968,14856,
433411750,14861,11558,14866,11390,14867,11226,14862,10972,14853,10754,14840,10565,14823,10401,14803,10259,14780,10032,14754,9820,14725,9635,14694,9473,14661,9333,14627,9203,14593,8988,14557,8798,14923,13014,14922,13014,14922,13012,14922,13004,14920,12987,14919,12957,14915,12907,14909,12834,14902,12738,14894,12623,14888,12498,14883,12370,14880,12203,14878,11970,14875,11759,14873,11569,14874,11401,14872,11243,14865,10986,14855,10762,14842,10568,14825,10401,14804,10255,14781,10017,14754,9799,14725,9611,14692,9445,14658,9301,14623,9139,14587,8920,14548,8729,14509,8562,15008,12672,15008,12672,15008,12671,15007,12667,15005,12656,15001,12637,14997,12605,14989,12556,14978,12490,14966,12407,14953,12313,14940,12136,14927,11934,14914,11742,14903,11563,14896,11401,14889,11247,14879,10992,14866,10767,14851,10570,14833,10400,14812,10252,14789,10007,14761,9784,14731,9592,14698,9424,14663,9279,14627,9088,14588,8868,14548,8676,14508,8508,14467,8360,15080,12386,15080,12386,15079,12385,15078,12383,15076,12378,15072,12367,15066,12347,15057,12315,15045,12253,15030,12138,15012,11998,14993,11845,14972,11685,14951,11530,14935,11383,14920,11228,14904,10981,14887,10762,14870,10567,14850,10397,14827,10248,14803,9997,14774,9771,14743,9578,14710,9407,14674,9259,14637,9048,14596,8826,14555,8632,14514,8464,14471,8317,14427,8182,15139,12008,15139,12008,15138,12008,15137,12007,15135,12003,15130,11990,15124,11969,15115,11929,15102,11872,15086,11794,15064,11693,15041,11581,15013,11459,14987,11336,14966,11170,14944,10944,14921,10738,14898,10552,14875,10387,14850,10239,14824,9983,14794,9758,14762,9563,14728,9392,14692,9244,14653,9014,14611,8791,14569,8597,14526,8427,14481,8281,14436,8110,14391,7885,15188,11617,15188,11617,15187,11617,15186,11618,15183,11617,15179,11612,15173,11601,15163,11581,15150,11546,15133,11495,15110,11427,15083,11346,15051,11246,15024,11057,14996,10868,14967,10687,14938,10517,14911,10362,14882,10206,14853,9956,14821,9737,14787,9543,14752,9375,14715,9228,14675,8980,14632,8760,14589,8565,14544,8395,14498,8248,14451,8049,14404,7824,14357,7630,15228,11298,15228,11298,15227,11299,15226,11301,15223,11303,15219,11302,15213,11299,15204,11290,15191,11271,15174,11217,15150,11129,15119,11015,15087,10886,15057,10744,15024,10599,14990,10455,14957,10318,14924,10143,14891,9911,14856,9701,14820,9516,14782,9352,14744,9200,14703,8946,14659,8725,14615,8533,14568,8366,14521,8220,14472,7992,14423,7770,14374,7578,14315,7408,15260,10819,15260,10819,15259,10822,15258,10826,15256,10832,15251,10836,15246,10841,15237,10838,15225,10821,15207,10788,15183,10734,15151,10660,15120,10571,15087,10469,15049,10359,15012,10249,14974,10041,14937,9837,14900,9647,14860,9475,14820,9320,14779,9147,14736,8902,14691,8688,14646,8499,14598,8335,14549,8189,14499,7940,14448,7720,14397,7529,14347,7363,14256,7218,15285,10410,15285,10411,15285,10413,15284,10418,15282,10425,15278,10434,15272,10442,15264,10449,15252,10445,15235,10433,15210,10403,15179,10358,15149,10301,15113,10218,15073,10059,15033,9894,14991,9726,14951,9565,14909,9413,14865,9273,14822,9073,14777,8845,14730,8641,14682,8459,14633,8300,14583,8129,14531,7883,14479,7670,14426,7482,14373,7321,14305,7176,14201,6939,15305,9939,15305,9940,15305,9945,15304,9955,15302,9967,15298,9989,15293,10010,15286,10033,15274,10044,15258,10045,15233,10022,15205,9975,15174,9903,15136,9808,15095,9697,15053,9578,15009,9451,14965,9327,14918,9198,14871,8973,14825,8766,14775,8579,14725,8408,14675,8259,14622,8058,14569,7821,14515,7615,14460,7435,14405,7276,14350,7108,14256,6866,14149,6653,15321,9444,15321,9445,15321,9448,15320,9458,15317,9470,15314,9490,15310,9515,15302,9540,15292,9562,15276,9579,15251,9577,15226,9559,15195,9519,15156,9463,15116,9389,15071,9304,15025,9208,14978,9023,14927,8838,14878,8661,14827,8496,14774,8344,14722,8206,14667,7973,14612,7749,14556,7555,14499,7382,14443,7229,14385,7025,14322,6791,14210,6588,14100,6409,15333,8920,15333,8921,15332,8927,15332,8943,15329,8965,15326,9002,15322,9048,15316,9106,15307,9162,15291,9204,15267,9221,15244,9221,15212,9196,15175,9134,15133,9043,15088,8930,15040,8801,14990,8665,14938,8526,14886,8391,14830,8261,14775,8087,14719,7866,14661,7664,14603,7482,14544,7322,14485,7178,14426,6936,14367,6713,14281,6517,14166,6348,14054,6198,15341,8360,15341,8361,15341,8366,15341,8379,15339,8399,15336,8431,15332,8473,15326,8527,15318,8585,15302,8632,15281,8670,15258,8690,15227,8690,15191,8664,15149,8612,15104,8543,15055,8456,15001,8360,14948,8259,14892,8122,14834,7923,14776,7734,14716,7558,14656,7397,14595,7250,14534,7070,14472,6835,14410,6628,14350,6443,14243,6283,14125,6135,14010,5889,15348,7715,15348,771
vendor: 14,717 bytes, line 4334
43347,15348,7725,15347,7745,15345,7780,15343,7836,15339,7905,15334,8e3,15326,8103,15310,8193,15293,8239,15270,8270,15240,8287,15204,8283,15163,8260,15118,8223,15067,8143,15014,8014,14958,7873,14899,7723,14839,7573,14778,7430,14715,7293,14652,7164,14588,6931,14524,6720,14460,6531,14396,6362,14330,6210,14207,6015,14086,5781,13969,5576,15352,7114,15352,7116,15352,7128,15352,7159,15350,7195,15348,7237,15345,7299,15340,7374,15332,7457,15317,7544,15301,7633,15280,7703,15251,7754,15216,7775,15176,7767,15131,7733,15079,7670,15026,7588,14967,7492,14906,7387,14844,7278,14779,7171,14714,6965,14648,6770,14581,6587,14515,6420,14448,6269,14382,6123,14299,5881,14172,5665,14049,5477,13929,5310,15355,6329,15355,6330,15355,6339,15355,6362,15353,6410,15351,6472,15349,6572,15344,6688,15337,6835,15323,6985,15309,7142,15287,7220,15260,7277,15226,7310,15188,7326,15142,7318,15090,7285,15036,7239,14976,7177,14914,7045,14849,6892,14782,6736,14714,6581,14645,6433,14576,6293,14506,6164,14438,5946,14369,5733,14270,5540,14140,5369,14014,5216,13892,5043,15357,5483,15357,5484,15357,5496,15357,5528,15356,5597,15354,5692,15351,5835,15347,6011,15339,6195,15328,6317,15314,6446,15293,6566,15268,6668,15235,6746,15197,6796,15152,6811,15101,6790,15046,6748,14985,6673,14921,6583,14854,6479,14785,6371,14714,6259,14643,6149,14571,5946,14499,5750,14428,5567,14358,5401,14242,5250,14109,5111,13980,4870,13856,4657,15359,4555,15359,4557,15358,4573,15358,4633,15357,4715,15355,4841,15353,5061,15349,5216,15342,5391,15331,5577,15318,5770,15299,5967,15274,6150,15243,6223,15206,6280,15161,6310,15111,6317,15055,6300,14994,6262,14928,6208,14860,6141,14788,5994,14715,5838,14641,5684,14566,5529,14492,5384,14418,5247,14346,5121,14216,4892,14079,4682,13948,4496,13822,4330,15359,3498,15359,3501,15359,3520,15359,3598,15358,3719,15356,3860,15355,4137,15351,4305,15344,4563,15334,4809,15321,5116,15303,5273,15280,5418,15250,5547,15214,5653,15170,5722,15120,5761,15064,5763,15002,5733,14935,5673,14865,5597,14792,5504,14716,5400,14640,5294,14563,5185,14486,5041,14410,4841,14335,4655,14191,4482,14051,4325,13918,4183,13790,4012,15360,2282,15360,2285,15360,2306,15360,2401,15359,2547,15357,2748,15355,3103,15352,3349,15345,3675,15336,4020,15324,4272,15307,4496,15285,4716,15255,4908,15220,5086,15178,5170,15128,5214,15072,5234,15010,5231,14943,5206,14871,5166,14796,5102,14718,4971,14639,4833,14559,4687,14480,4541,14402,4401,14315,4268,14167,4142,14025,3958,13888,3747,13759,3556,15360,923,15360,925,15360,946,15360,1052,15359,1214,15357,1494,15356,1892,15352,2274,15346,2663,15338,3099,15326,3393,15309,3679,15288,3980,15260,4183,15226,4325,15185,4437,15136,4517,15080,4570,15018,4591,14950,4581,14877,4545,14800,4485,14720,4411,14638,4325,14556,4231,14475,4136,14395,3988,14297,3803,14145,3628,13999,3465,13861,3314,13729,3177,15360,263,15360,264,15360,272,15360,325,15359,407,15358,548,15356,780,15352,1144,15347,1580,15339,2099,15328,2425,15312,2795,15292,3133,15264,3329,15232,3517,15191,3689,15143,3819,15088,3923,15025,3978,14956,3999,14882,3979,14804,3931,14722,3855,14639,3756,14554,3645,14470,3529,14388,3409,14279,3289,14124,3173,13975,3055,13834,2848,13701,2658,15360,49,15360,49,15360,52,15360,75,15359,111,15358,201,15356,283,15353,519,15348,726,15340,1045,15329,1415,15314,1795,15295,2173,15269,2410,15237,2649,15197,2866,15150,3054,15095,3140,15032,3196,14963,3228,14888,3236,14808,3224,14725,3191,14639,3146,14553,3088,14466,2976,14382,2836,14262,2692,14103,2549,13952,2409,13808,2278,13674,2154,15360,4,15360,4,15360,4,15360,13,15359,33,15358,59,15357,112,15353,199,15348,302,15341,456,15331,628,15316,827,15297,1082,15272,1332,15241,1601,15202,1851,15156,2069,15101,2172,15039,2256,14970,2314,14894,2348,14813,2358,14728,2344,14640,2311,14551,2263,14463,2203,14376,2133,14247,2059,14084,1915,13930,1761,13784,1609,13648,1464,15360,0,15360,0,15360,0,15360,3,15359,18,15358,26,15357,53,15354,80,15348,97,15341,165,15332,238,15318,326,15299,427,15275,529,15245,654,15207,771,15161,885,15108,994,15046,1089,14976,1170,14900,1229,14817,1266,14731,1284,14641,1282,14550,1260,14460,1223,14370,1174,14232,1116,14066,1050,13909,981,13761,910,13623,839]);let ll=null;function lK(){return ll===null&&(ll=new uG(oK,32,32,Nw,hh),ll.minFilter=Gi,ll.magFilter=Gi,ll.wrapS=fl,ll.wrapT=fl,ll.generateMipmaps=!1,ll.needsUpdate=!0),ll}class cK{constructor(e={}){const{canvas:n=Lz(),context:a=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:m=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:b=!1}=e;this.isWebGLRenderer=!0;let v;if(a!==null){if(typeof WebGLRenderingContext<"u"&&a instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");v=a.getContextAttributes().alpha}else v=o;const C=new Set([Mw,Tw,Aw]),S=new Set([Cl,Su,Om,Um,Ew,kw]),F=new Uint32Array(4),w=new Int32Array(4);let A=null,N=null;const P=[],z=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Sc,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const D=this;let T=!1;this._outputColorSpace=Fi;let K=0,B=0,k=null,O=-1,I=null;const j=new $r,U=new $r;let q=null;const Y=new wr(0);let W=0,H=n.width,J=n.height,ie=1,Q=null,ve=null;const pe=new $r(0,0,H,J),Me=new $r(0,0,H,J);let We=!1;const Ae=new WT;let Ce=!1,He=!1;const Ct=new ra,bt=new Pt,Rt=new $r,zt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ut=!1;function Bt(){return k===null?ie:1}let re=a;function wt($,xe){return n.getContext($,xe)}try{const $={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:d,preserveDrawingBuffer:m,powerPreference:f,failIfMajorPerformanceCaveat:p};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Cw}`),n.addEventListener("webglcontextlost",fe,!1),n.addEventListener("webglcontextrestored",Se,!1),n.addEventListener("webglcontextcreationerror",Be,!1),re===null){const xe="webgl2";if(re=wt(xe,$),re===null)throw wt(xe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch($){throw $("WebGLRenderer: "+$.message),$}let Nt,vt,Tt,Wt,Dt,jt,he,ee,ze,Ve,lt,qe,It,gt,Ee,Je,$e,Xe,X,ke,De,oe,te,ye;function Re(){Nt=new xV(re),Nt.init(),oe=new Q$(re,Nt),vt=new lV(re,Nt,e,oe),Tt=new X$(re,Nt),vt.reversedDepthBuffer&&b&&Tt.buffers.depth.setReversed(!0),Wt=new bV(re),Dt=new B$,jt=new Z$(re,Nt,Tt,Dt,vt,oe,Wt),he=new uV(D),ee=new gV(D),ze=new CG(re),te=new sV(re,ze),Ve=new vV(re,ze,Wt,te),lt=new SV(re,Ve,ze,Wt),X=new wV(re,vt,jt),Je=new cV(Dt),qe=new I$(D,he,ee,Nt,vt,te,Je),It=new iK(D,Dt),gt=new U$,Ee=new $$(Nt),Xe=new iV(D,he,ee,Tt,lt,v,d),$e=new q$(D,lt,vt),ye=new sK(re,Wt,vt,Tt),ke=new oV(re,Nt,Wt),De=new yV(re,Nt,Wt),Wt.programs=qe.programs,D.capabilities=vt,D.extensions=Nt,D.properties=Dt,D.renderLists=gt,D.shadowMap=$e,D.state=Tt,D.info=Wt}Re();const Le=new rK(D,re);this.xr=Le,this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){const $=Nt.get("WEBGL_lose_context");$&&$.loseContext()},this.forceContextRestore=function(){const $=Nt.get("WEBGL_lose_context");$&&$.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function($){$!==void 0&&(ie=$,this.setSize(H,J,!1))},this.getSize=function($){return $.set(H,J)},this.setSize=function($,xe,ne=!0){if(Le.isPresenting){Yn("WebGLRenderer: Can't change size while VR device is presenting.");return}H=$,J=xe,n.width=Math.floor($*ie),n.height=Math.floor(xe*ie),ne===!0&&(n.style.width=$+"px",n.style.height=xe+"px"),this.setViewport(0,0,$,xe)},this.getDrawingBufferSize=function($){return $.set(H*ie,J*ie).floor()},this.setDrawingBufferSize=function($,xe,ne){H=$,J=xe,ie=ne,n.width=Math.floor($*ne),n.height=Math.floor(xe*ne),this.setViewport(0,0,$,xe)},this.getCurrentViewport=function($){return $.copy(j)},this.getViewport=function($){return $.copy(pe)},this.setViewport=function($,xe,ne,me){$.isVector4?pe.set($.x,$.y,$.z,$.w):pe.set($,xe,ne,me),Tt.viewport(j.copy(pe).multiplyScalar(ie).round())},this.getScissor=function($){return $.copy(Me)},this.setScissor=function($,xe,ne,me){$.isVector4?Me.set($.x,$.y,$.z,$.w):Me.set($,xe,ne,me),Tt.scissor(U.copy(Me).multiplyScalar(ie).round())},this.getScissorTest=function(){return We},this.setScissorTest=function($){Tt.setScissorTest(We=$)},this.setOpaqueSort=function($){Q=$},this.setTransparentSort=function($){ve=$},this.getClearColor=function($){return $.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor(...arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha(...arguments)},this.clear=function($=!0,xe=!0,ne=!0){let me=0;if($){let de=!1;if(k!==null){const Ie=k.texture.format;de=C.has(Ie)}if(de){const Ie=k.texture.type,Ke=S.has(Ie),ut=Xe.getClearColor(),ae=Xe.getClearAlpha(),Te=ut.r,Qe=ut.g,ot=ut.b;Ke?(F[0]=Te,F[1]=Qe,F[2]=ot,F[3]=ae,re.clearBufferuiv(re.COLOR,0,F)):(w[0]=Te,w[1]=Qe,w[2]=ot,w[3]=ae,re.clearBufferiv(re.COLOR,0,w))}else me|=re.COLOR_BUFFER_BIT}xe&&(me|=re.DEPTH_BUFFER_BIT),ne&&(me|=re.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),re.clear(me)},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",Se,!1),n.removeEventListener("webglcontextcreationerror",Be,!1),Xe.dispose(),gt.dispose(),Ee.dispose(),Dt.dispose(),he.dispose(),ee.dispose(),lt.dispose(),te.dispose(),ye.dispose(),qe.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",gn),Le.removeEventListener("sessionend",_e),et.stop()};function fe($){$.preventDefault(),OC("WebGLRenderer: Context Lost."),T=!0}function Se(){OC("WebGLRenderer: Context Restored."),T=!1;const $=Wt.autoReset,xe=$e.enabled,ne=$e.autoUpdate,me=$e.needsUpdate,de=$e.type;Re(),Wt.autoReset=$,$e.enabled=xe,$e.autoUpdate=ne,$e.needsUpdate=me,$e.type=de}function Be($){Wr("WebGLRenderer: A WebGL context could not be created. Reason: ",$.statusMessage)}function Ze($){const xe=$.target;xe.removeEventListener("dispose",Ze),ue(xe)}function ue($){rt($),Dt.remove($)}function rt($){const xe=Dt.get($).programs;xe!==void 0&&(xe.forEach(function(ne){qe.releaseProgram(ne)}),$.isShaderMaterial&&qe.releaseShaderCache($))}this.renderBufferDirect=function($,xe,ne,me,de,Ie){xe===null&&(xe=zt);const Ke=de.isMesh&&de.matrixWorld.determinant()<0,ut=st($,xe,ne,me,de);Tt.setMaterial(me,Ke);let ae=ne.index,Te=1;if(me.wireframe===!0){if(ae=Ve.getWireframeAttribute(ne),ae===void 0)return;Te=2}const Qe=ne.drawRange,ot=ne.attributes.position;let pt=Qe.start*Te,ct=(Qe.start+Qe.count)*Te;Ie!==null&&(pt=Math.max(pt,Ie.start*Te),ct=Math.min(ct,(Ie.start+Ie.count)*Te)),ae!==null?(pt=Math.max(pt,0),ct=Math.min(ct,ae.count)):ot!=null&&(pt=Math.max(pt,0),ct=Math.min(ct,ot.count));const Vt=ct-pt;if(Vt<0||Vt===1/0)return;te.setup(de,me,ut,ne,ae);let sn,cn=ke;if(ae!==null&&(sn=ze.get(ae),cn=De,cn.setIndex(sn)),de.isMesh)me.wireframe===!0?(Tt.setLineWidth(me.wireframeLinewidth*Bt()),cn.setMode(re.LINES)):cn.setMode(re.TRIANGLES);else if(de.isLine){let St=me.linewidth;St===void 0&&(St=1),Tt.setLineWidth(St*Bt()),de.isLineSegments?cn.setMode(re.LINES):de.isLineLoop?cn.setMode(re.LINE_LOOP):cn.setMode(re.LINE_STRIP)}else de.isPoints?cn.setMode(re.POINTS):de.isSprite&&cn.setMode(re.TRIANGLES);if(de.isBatchedMesh)if(de._multiDrawInstances!==null)Wm("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),cn.renderMultiDrawInstances(de._multiDrawStarts,de._multiDrawCounts,de._multiDrawCount,de._multiDrawInstances);else if(Nt.get("WEBGL_multi_draw"))cn.renderMultiDraw(de._multiDrawStarts,de._multiDrawCounts,de._multiDrawCount);else{const St=de._multiDrawStarts,le=de._multiDrawCounts,Ne=de._multiDrawCount,Oe=ae?ze.get(ae).bytesPerElement:1,at=Dt.get(me).currentProgram.getUniforms();for(let xt=0;xt<Ne;xt++)at.setValue(re,"_gl_DrawID",xt),cn.render(St[xt]/Oe,le[xt])}else if(de.isInstancedMesh)cn.renderInstances(pt,Vt,de.count);else if(ne.isInstancedBufferGeometry){const St=ne._maxInstanceCount!==void 0?ne._maxInstanceCount:1/0,le=Math.min(ne.instanceCount,St);cn.renderInstances(pt,Vt,le)}else cn.render(pt,Vt)};function je($,xe,ne){$.transparent===!0&&$.side===Us&&$.forceSinglePass===!1?($.side=ki,$.needsUpdate=!0,Z($,xe,ne),$.side=Ec,$.needsUpdate=!0,Z($,xe,ne),$.side=Us):Z($,xe,ne)}this.compile=function($,xe,ne=null){ne===null&&(ne=$),N=Ee.get(ne),N.init(xe),z.push(N),ne.traverseVisible(function(de){de.isLight&&de.layers.test(xe.layers)&&(N.pushLight(de),de.castShadow&&N.pushShadow(de))}),$!==ne&&$.traverseVisible(function(de){de.isLight&&de.layers.test(xe.layers)&&(N.pushLight(de),de.castShadow&&N.pushShadow(de))}),N.setupLights();const me=new Set;return $.traverse(function(de){if(!(de.isMesh||de.isPoints||de.isLine||de.isSprite))return;const Ie=de.material;if(Ie)if(Array.isArray(Ie))for(let Ke=0;Ke<Ie.length;Ke++){const ut=Ie[Ke];je(ut,ne,de),me.add(ut)}else je(Ie,ne,de),me.add(Ie)}),N=z.pop(),me},this.compileAsync=function($,xe,ne=null){const me=this.compile($,xe,ne);return new Promise(de=>{function Ie(){if(me.forEach(function(Ke){Dt.get(Ke).currentProgram.isReady()&&me.delete(Ke)}),me.size===0){de($);return}setTimeout(Ie,10)}Nt.get("KHR_parallel_shader_compile")!==null?Ie():setTimeout(Ie,10)})};let _t=null;function Kt($){_t&&_t($)}function gn(){et.stop()}function _e(){et.start()}const et=new YT;et.setAnimationLoop(Kt),typeof self<"u"&&et.setContext(self),this.setAnimationLoop=function($){_t=$,Le.setAnimationLoop($),$===null?et.stop():et.start()},Le.addEventListener("sessionstart",gn),Le.addEventListener("sessionend",_e),this.render=function($,xe){if(xe!==void 0&&xe.isCamera!==!0){Wr("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if($.matrixWorldAutoUpdate===!0&&$.updateMatrixWorld(),xe.parent===null&&xe.matrixWorldAutoUpdate===!0&&xe.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(xe),xe=Le.getCamera()),$.isScene===!0&&$.onBeforeRender(D,$,xe,k),N=Ee.get($,z.length),N.init(xe),z.push(N),Ct.multiplyMatrices(xe.projectionMatrix,xe.matrixWorldInverse),Ae.setFromProjectionMatrix(Ct,yo,xe.reversedDepth),He=this.localClippingEnabled,Ce=Je.init(this.clippingPlanes,He),A=gt.get($,P.length),A.init(
vendor: 4,305 bytes, line 4334
4334),P.push(A),Le.enabled===!0&&Le.isPresenting===!0){const Ie=D.xr.getDepthSensingMesh();Ie!==null&&Ge(Ie,xe,-1/0,D.sortObjects)}Ge($,xe,0,D.sortObjects),A.finish(),D.sortObjects===!0&&A.sort(Q,ve),Ut=Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1,Ut&&Xe.addToRenderList(A,$),this.info.render.frame++,Ce===!0&&Je.beginShadows();const ne=N.state.shadowsArray;$e.render(ne,$,xe),Ce===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset();const me=A.opaque,de=A.transmissive;if(N.setupLights(),xe.isArrayCamera){const Ie=xe.cameras;if(de.length>0)for(let Ke=0,ut=Ie.length;Ke<ut;Ke++){const ae=Ie[Ke];ft(me,de,$,ae)}Ut&&Xe.render($);for(let Ke=0,ut=Ie.length;Ke<ut;Ke++){const ae=Ie[Ke];ht(A,$,ae,ae.viewport)}}else de.length>0&&ft(me,de,$,xe),Ut&&Xe.render($),ht(A,$,xe);k!==null&&B===0&&(jt.updateMultisampleRenderTarget(k),jt.updateRenderTargetMipmap(k)),$.isScene===!0&&$.onAfterRender(D,$,xe),te.resetDefaultState(),O=-1,I=null,z.pop(),z.length>0?(N=z[z.length-1],Ce===!0&&Je.setGlobalState(D.clippingPlanes,N.state.camera)):N=null,P.pop(),P.length>0?A=P[P.length-1]:A=null};function Ge($,xe,ne,me){if($.visible===!1)return;if($.layers.test(xe.layers)){if($.isGroup)ne=$.renderOrder;else if($.isLOD)$.autoUpdate===!0&&$.update(xe);else if($.isLight)N.pushLight($),$.castShadow&&N.pushShadow($);else if($.isSprite){if(!$.frustumCulled||Ae.intersectsSprite($)){me&&Rt.setFromMatrixPosition($.matrixWorld).applyMatrix4(Ct);const Ke=lt.update($),ut=$.material;ut.visible&&A.push($,Ke,ut,ne,Rt.z,null)}}else if(($.isMesh||$.isLine||$.isPoints)&&(!$.frustumCulled||Ae.intersectsObject($))){const Ke=lt.update($),ut=$.material;if(me&&($.boundingSphere!==void 0?($.boundingSphere===null&&$.computeBoundingSphere(),Rt.copy($.boundingSphere.center)):(Ke.boundingSphere===null&&Ke.computeBoundingSphere(),Rt.copy(Ke.boundingSphere.center)),Rt.applyMatrix4($.matrixWorld).applyMatrix4(Ct)),Array.isArray(ut)){const ae=Ke.groups;for(let Te=0,Qe=ae.length;Te<Qe;Te++){const ot=ae[Te],pt=ut[ot.materialIndex];pt&&pt.visible&&A.push($,Ke,pt,ne,Rt.z,ot)}}else ut.visible&&A.push($,Ke,ut,ne,Rt.z,null)}}const Ie=$.children;for(let Ke=0,ut=Ie.length;Ke<ut;Ke++)Ge(Ie[Ke],xe,ne,me)}function ht($,xe,ne,me){const{opaque:de,transmissive:Ie,transparent:Ke}=$;N.setupLightsView(ne),Ce===!0&&Je.setGlobalState(D.clippingPlanes,ne),me&&Tt.viewport(j.copy(me)),de.length>0&&Mt(de,xe,ne),Ie.length>0&&Mt(Ie,xe,ne),Ke.length>0&&Mt(Ke,xe,ne),Tt.buffers.depth.setTest(!0),Tt.buffers.depth.setMask(!0),Tt.buffers.color.setMask(!0),Tt.setPolygonOffset(!1)}function ft($,xe,ne,me){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;N.state.transmissionRenderTarget[me.id]===void 0&&(N.state.transmissionRenderTarget[me.id]=new Fu(1,1,{generateMipmaps:!0,type:Nt.has("EXT_color_buffer_half_float")||Nt.has("EXT_color_buffer_float")?hh:Cl,minFilter:xc,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ur.workingColorSpace}));const Ie=N.state.transmissionRenderTarget[me.id],Ke=me.viewport||j;Ie.setSize(Ke.z*D.transmissionResolutionScale,Ke.w*D.transmissionResolutionScale);const ut=D.getRenderTarget(),ae=D.getActiveCubeFace(),Te=D.getActiveMipmapLevel();D.setRenderTarget(Ie),D.getClearColor(Y),W=D.getClearAlpha(),W<1&&D.setClearColor(16777215,.5),D.clear(),Ut&&Xe.render(ne);const Qe=D.toneMapping;D.toneMapping=Sc;const ot=me.viewport;if(me.viewport!==void 0&&(me.viewport=void 0),N.setupLightsView(me),Ce===!0&&Je.setGlobalState(D.clippingPlanes,me),Mt($,ne,me),jt.updateMultisampleRenderTarget(Ie),jt.updateRenderTargetMipmap(Ie),Nt.has("WEBGL_multisampled_render_to_texture")===!1){let pt=!1;for(let ct=0,Vt=xe.length;ct<Vt;ct++){const sn=xe[ct],{object:cn,geometry:St,material:le,group:Ne}=sn;if(le.side===Us&&cn.layers.test(me.layers)){const Oe=le.side;le.side=ki,le.needsUpdate=!0,be(cn,ne,me,St,le,Ne),le.side=Oe,le.needsUpdate=!0,pt=!0}}pt===!0&&(jt.updateMultisampleRenderTarget(Ie),jt.updateRenderTargetMipmap(Ie))}D.setRenderTarget(ut,ae,Te),D.setClearColor(Y,W),ot!==void 0&&(me.viewport=ot),D.toneMapping=Qe}function Mt($,xe,ne){const me=xe.isScene===!0?xe.overrideMaterial:null;for(let de=0,Ie=$.length;de<Ie;de++){const Ke=$[de],{object:ut,geometry:ae,group:Te}=Ke;let Qe=Ke.material;Qe.allowOverride===!0&&me!==null&&(Qe=me),ut.layers.test(ne.layers
vendor: 4,832 bytes, line 4334
4334)&&be(ut,xe,ne,ae,Qe,Te)}}function be($,xe,ne,me,de,Ie){$.onBeforeRender(D,xe,ne,me,de,Ie),$.modelViewMatrix.multiplyMatrices(ne.matrixWorldInverse,$.matrixWorld),$.normalMatrix.getNormalMatrix($.modelViewMatrix),de.onBeforeRender(D,xe,ne,me,$,Ie),de.transparent===!0&&de.side===Us&&de.forceSinglePass===!1?(de.side=ki,de.needsUpdate=!0,D.renderBufferDirect(ne,xe,me,de,$,Ie),de.side=Ec,de.needsUpdate=!0,D.renderBufferDirect(ne,xe,me,de,$,Ie),de.side=Us):D.renderBufferDirect(ne,xe,me,de,$,Ie),$.onAfterRender(D,xe,ne,me,de,Ie)}function Z($,xe,ne){xe.isScene!==!0&&(xe=zt);const me=Dt.get($),de=N.state.lights,Ie=N.state.shadowsArray,Ke=de.state.version,ut=qe.getParameters($,de.state,Ie,xe,ne),ae=qe.getProgramCacheKey(ut);let Te=me.programs;me.environment=$.isMeshStandardMaterial?xe.environment:null,me.fog=xe.fog,me.envMap=($.isMeshStandardMaterial?ee:he).get($.envMap||me.environment),me.envMapRotation=me.environment!==null&&$.envMap===null?xe.environmentRotation:$.envMapRotation,Te===void 0&&($.addEventListener("dispose",Ze),Te=new Map,me.programs=Te);let Qe=Te.get(ae);if(Qe!==void 0){if(me.currentProgram===Qe&&me.lightsStateVersion===Ke)return we($,ut),Qe}else ut.uniforms=qe.getUniforms($),$.onBeforeCompile(ut,D),Qe=qe.acquireProgram(ut,ae),Te.set(ae,Qe),me.uniforms=ut.uniforms;const ot=me.uniforms;return(!$.isShaderMaterial&&!$.isRawShaderMaterial||$.clipping===!0)&&(ot.clippingPlanes=Je.uniform),we($,ut),me.needsLights=Ot($),me.lightsStateVersion=Ke,me.needsLights&&(ot.ambientLightColor.value=de.state.ambient,ot.lightProbe.value=de.state.probe,ot.directionalLights.value=de.state.directional,ot.directionalLightShadows.value=de.state.directionalShadow,ot.spotLights.value=de.state.spot,ot.spotLightShadows.value=de.state.spotShadow,ot.rectAreaLights.value=de.state.rectArea,ot.ltc_1.value=de.state.rectAreaLTC1,ot.ltc_2.value=de.state.rectAreaLTC2,ot.pointLights.value=de.state.point,ot.pointLightShadows.value=de.state.pointShadow,ot.hemisphereLights.value=de.state.hemi,ot.directionalShadowMap.value=de.state.directionalShadowMap,ot.directionalShadowMatrix.value=de.state.directionalShadowMatrix,ot.spotShadowMap.value=de.state.spotShadowMap,ot.spotLightMatrix.value=de.state.spotLightMatrix,ot.spotLightMap.value=de.state.spotLightMap,ot.pointShadowMap.value=de.state.pointShadowMap,ot.pointShadowMatrix.value=de.state.pointShadowMatrix),me.currentProgram=Qe,me.uniformsList=null,Qe}function it($){if($.uniformsList===null){const xe=$.currentProgram.getUniforms();$.uniformsList=xg.seqWithValue(xe.seq,$.uniforms)}return $.uniformsList}function we($,xe){const ne=Dt.get($);ne.outputColorSpace=xe.outputColorSpace,ne.batching=xe.batching,ne.batchingColor=xe.batchingColor,ne.instancing=xe.instancing,ne.instancingColor=xe.instancingColor,ne.instancingMorph=xe.instancingMorph,ne.skinning=xe.skinning,ne.morphTargets=xe.morphTargets,ne.morphNormals=xe.morphNormals,ne.morphColors=xe.morphColors,ne.morphTargetsCount=xe.morphTargetsCount,ne.numClippingPlanes=xe.numClippingPlanes,ne.numIntersection=xe.numClipIntersection,ne.vertexAlphas=xe.vertexAlphas,ne.vertexTangents=xe.vertexTangents,ne.toneMapping=xe.toneMapping}function st($,xe,ne,me,de){xe.isScene!==!0&&(xe=zt),jt.resetTextureUnits();const Ie=xe.fog,Ke=me.isMeshStandardMaterial?xe.environment:null,ut=k===null?D.outputColorSpace:k.isXRRenderTarget===!0?k.texture.colorSpace:Xd,ae=(me.isMeshStandardMaterial?ee:he).get(me.envMap||Ke),Te=me.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,Qe=!!ne.attributes.tangent&&(!!me.normalMap||me.anisotropy>0),ot=!!ne.morphAttributes.position,pt=!!ne.morphAttributes.normal,ct=!!ne.morphAttributes.color;let Vt=Sc;me.toneMapped&&(k===null||k.isXRRenderTarget===!0)&&(Vt=D.toneMapping);const sn=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,cn=sn!==void 0?sn.length:0,St=Dt.get(me),le=N.state.lights;if(Ce===!0&&(He===!0||$!==I)){const _n=$===I&&me.id===O;Je.setState(me,$,_n)}let Ne=!1;me.version===St.__version?(St.needsLights&&St.lightsStateVersion!==le.state.version||St.outputColorSpace!==ut||de.isBatchedMesh&&St.batching===!1||!de.isBatchedMesh&&St.batching===!0||de.isBatchedMesh&&St.batchingColor===!0&&de.colorTexture===null||de.isBatchedMesh&&St.batchingColor===!1&&de.colorTexture!==null||de.isInstancedMesh&&St.instancing===!1||!de.isInstancedMesh&&St.instancing===!0||de.isSkinnedMesh&&St.skinning===!1||!de.isSkinnedMesh&&St.skinning===!0||de.isInstancedMesh&&St.instancingColor===!0&&de.instanceColor===null||de.isInstancedMesh&&St.instancingColor===!1&&de.instanceColor!==null||de.isInstancedMesh&&St.instancingMorph===!0&&de.morphTexture===null||de.isInstancedMesh&&St.instancingMorph===!1&&de.morphTexture!==null||St.envMap!==ae||me.fog===!0&&St.fog!==Ie||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Je.numPlanes||St.
vendor: 13,023 bytes, line 4334
4334numIntersection!==Je.numIntersection)||St.vertexAlphas!==Te||St.vertexTangents!==Qe||St.morphTargets!==ot||St.morphNormals!==pt||St.morphColors!==ct||St.toneMapping!==Vt||St.morphTargetsCount!==cn)&&(Ne=!0):(Ne=!0,St.__version=me.version);let Oe=St.currentProgram;Ne===!0&&(Oe=Z(me,xe,de));let at=!1,xt=!1,Qt=!1;const Gt=Oe.getUniforms(),Xt=St.uniforms;if(Tt.useProgram(Oe.program)&&(at=!0,xt=!0,Qt=!0),me.id!==O&&(O=me.id,xt=!0),at||I!==$){Tt.buffers.depth.getReversed()&&$.reversedDepth!==!0&&($._reversedDepth=!0,$.updateProjectionMatrix()),Gt.setValue(re,"projectionMatrix",$.projectionMatrix),Gt.setValue(re,"viewMatrix",$.matrixWorldInverse);const rn=Gt.map.cameraPosition;rn!==void 0&&rn.setValue(re,bt.setFromMatrixPosition($.matrixWorld)),vt.logarithmicDepthBuffer&&Gt.setValue(re,"logDepthBufFC",2/(Math.log($.far+1)/Math.LN2)),(me.isMeshPhongMaterial||me.isMeshToonMaterial||me.isMeshLambertMaterial||me.isMeshBasicMaterial||me.isMeshStandardMaterial||me.isShaderMaterial)&&Gt.setValue(re,"isOrthographic",$.isOrthographicCamera===!0),I!==$&&(I=$,xt=!0,Qt=!0)}if(de.isSkinnedMesh){Gt.setOptional(re,de,"bindMatrix"),Gt.setOptional(re,de,"bindMatrixInverse");const _n=de.skeleton;_n&&(_n.boneTexture===null&&_n.computeBoneTexture(),Gt.setValue(re,"boneTexture",_n.boneTexture,jt))}de.isBatchedMesh&&(Gt.setOptional(re,de,"batchingTexture"),Gt.setValue(re,"batchingTexture",de._matricesTexture,jt),Gt.setOptional(re,de,"batchingIdTexture"),Gt.setValue(re,"batchingIdTexture",de._indirectTexture,jt),Gt.setOptional(re,de,"batchingColorTexture"),de._colorsTexture!==null&&Gt.setValue(re,"batchingColorTexture",de._colorsTexture,jt));const Zt=ne.morphAttributes;if((Zt.position!==void 0||Zt.normal!==void 0||Zt.color!==void 0)&&X.update(de,ne,Oe),(xt||St.receiveShadow!==de.receiveShadow)&&(St.receiveShadow=de.receiveShadow,Gt.setValue(re,"receiveShadow",de.receiveShadow)),me.isMeshGouraudMaterial&&me.envMap!==null&&(Xt.envMap.value=ae,Xt.flipEnvMap.value=ae.isCubeTexture&&ae.isRenderTargetTexture===!1?-1:1),me.isMeshStandardMaterial&&me.envMap===null&&xe.environment!==null&&(Xt.envMapIntensity.value=xe.environmentIntensity),Xt.dfgLUT!==void 0&&(Xt.dfgLUT.value=lK()),xt&&(Gt.setValue(re,"toneMappingExposure",D.toneMappingExposure),St.needsLights&&Lt(Xt,Qt),Ie&&me.fog===!0&&It.refreshFogUniforms(Xt,Ie),It.refreshMaterialUniforms(Xt,me,ie,J,N.state.transmissionRenderTarget[$.id]),xg.upload(re,it(St),Xt,jt)),me.isShaderMaterial&&me.uniformsNeedUpdate===!0&&(xg.upload(re,it(St),Xt,jt),me.uniformsNeedUpdate=!1),me.isSpriteMaterial&&Gt.setValue(re,"center",de.center),Gt.setValue(re,"modelViewMatrix",de.modelViewMatrix),Gt.setValue(re,"normalMatrix",de.normalMatrix),Gt.setValue(re,"modelMatrix",de.matrixWorld),me.isShaderMaterial||me.isRawShaderMaterial){const _n=me.uniformsGroups;for(let rn=0,or=_n.length;rn<or;rn++){const Nr=_n[rn];ye.update(Nr,Oe),ye.bind(Nr,Oe)}}return Oe}function Lt($,xe){$.ambientLightColor.needsUpdate=xe,$.lightProbe.needsUpdate=xe,$.directionalLights.needsUpdate=xe,$.directionalLightShadows.needsUpdate=xe,$.pointLights.needsUpdate=xe,$.pointLightShadows.needsUpdate=xe,$.spotLights.needsUpdate=xe,$.spotLightShadows.needsUpdate=xe,$.rectAreaLights.needsUpdate=xe,$.hemisphereLights.needsUpdate=xe}function Ot($){return $.isMeshLambertMaterial||$.isMeshToonMaterial||$.isMeshPhongMaterial||$.isMeshStandardMaterial||$.isShadowMaterial||$.isShaderMaterial&&$.lights===!0}this.getActiveCubeFace=function(){return K},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return k},this.setRenderTargetTextures=function($,xe,ne){const me=Dt.get($);me.__autoAllocateDepthBuffer=$.resolveDepthBuffer===!1,me.__autoAllocateDepthBuffer===!1&&(me.__useRenderToTexture=!1),Dt.get($.texture).__webglTexture=xe,Dt.get($.depthTexture).__webglTexture=me.__autoAllocateDepthBuffer?void 0:ne,me.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function($,xe){const ne=Dt.get($);ne.__webglFramebuffer=xe,ne.__useDefaultFramebuffer=xe===void 0};const Et=re.createFramebuffer();this.setRenderTarget=function($,xe=0,ne=0){k=$,K=xe,B=ne;let me=!0,de=null,Ie=!1,Ke=!1;if($){const ae=Dt.get($);if(ae.__useDefaultFramebuffer!==void 0)Tt.bindFramebuffer(re.FRAMEBUFFER,null),me=!1;else if(ae.__webglFramebuffer===void 0)jt.setupRenderTarget($);else if(ae.__hasExternalTextures)jt.rebindTextures($,Dt.get($.texture).__webglTexture,Dt.get($.depthTexture).__webglTexture);else if($.depthBuffer){const ot=$.depthTexture;if(ae.__boundDepthTexture!==ot){if(ot!==null&&Dt.has(ot)&&($.width!==ot.image.width||$.height!==ot.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");jt.setupDepthRenderbuffer($)}}const Te=$.texture;(Te.isData3DTexture||Te.isDataArrayTexture||Te.isCompressedArrayTexture)&&(Ke=!0);const Qe=Dt.get($).__webglFramebuffer;$.isWebGLCubeRenderTarget?(Array.isArray(Qe[xe])?de=Qe[xe][ne]:de=Qe[xe],Ie=!0):$.samples>0&&jt.useMultisampledRTT($)===!1?de=Dt.get($).__webglMultisampledFramebuffer:Array.isArray(Qe)?de=Qe[ne]:de=Qe,j.copy($.viewport),U.copy($.scissor),q=$.scissorTest}else j.copy(pe).multiplyScalar(ie).floor(),U.copy(Me).multiplyScalar(ie).floor(),q=We;if(ne!==0&&(de=Et),Tt.bindFramebuffer(re.FRAMEBUFFER,de)&&me&&Tt.drawBuffers($,de),Tt.viewport(j),Tt.scissor(U),Tt.setScissorTest(q),Ie){const ae=Dt.get($.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+xe,ae.__webglTexture,ne)}else if(Ke){const ae=xe;for(let Te=0;Te<$.textures.length;Te++){const Qe=Dt.get($.textures[Te]);re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0+Te,Qe.__webglTexture,ne,ae)}}else if($!==null&&ne!==0){const ae=Dt.get($.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,ae.__webglTexture,ne)}O=-1},this.readRenderTargetPixels=function($,xe,ne,me,de,Ie,Ke,ut=0){if(!($&&$.isWebGLRenderTarget)){Wr("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ae=Dt.get($).__webglFramebuffer;if($.isWebGLCubeRenderTarget&&Ke!==void 0&&(ae=ae[Ke]),ae){Tt.bindFramebuffer(re.FRAMEBUFFER,ae);try{const Te=$.textures[ut],Qe=Te.format,ot=Te.type;if(!vt.textureFormatReadable(Qe)){Wr("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!vt.textureTypeReadable(ot)){Wr("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}xe>=0&&xe<=$.width-me&&ne>=0&&ne<=$.height-de&&($.textures.length>1&&re.readBuffer(re.COLOR_ATTACHMENT0+ut),re.readPixels(xe,ne,me,de,oe.convert(Qe),oe.convert(ot),Ie))}finally{const Te=k!==null?Dt.get(k).__webglFramebuffer:null;Tt.bindFramebuffer(re.FRAMEBUFFER,Te)}}},this.readRenderTargetPixelsAsync=async function($,xe,ne,me,de,Ie,Ke,ut=0){if(!($&&$.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ae=Dt.get($).__webglFramebuffer;if($.isWebGLCubeRenderTarget&&Ke!==void 0&&(ae=ae[Ke]),ae)if(xe>=0&&xe<=$.width-me&&ne>=0&&ne<=$.height-de){Tt.bindFramebuffer(re.FRAMEBUFFER,ae);const Te=$.textures[ut],Qe=Te.format,ot=Te.type;if(!vt.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!vt.textureTypeReadable(ot))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const pt=re.createBuffer();re.bindBuffer(re.PIXEL_PACK_BUFFER,pt),re.bufferData(re.PIXEL_PACK_BUFFER,Ie.byteLength,re.STREAM_READ),$.textures.length>1&&re.readBuffer(re.COLOR_ATTACHMENT0+ut),re.readPixels(xe,ne,me,de,oe.convert(Qe),oe.convert(ot),0);const ct=k!==null?Dt.get(k).__webglFramebuffer:null;Tt.bindFramebuffer(re.FRAMEBUFFER,ct);const Vt=re.fenceSync(re.SYNC_GPU_COMMANDS_COMPLETE,0);return re.flush(),await Iz(re,Vt,4),re.bindBuffer(re.PIXEL_PACK_BUFFER,pt),re.getBufferSubData(re.PIXEL_PACK_BUFFER,0,Ie),re.deleteBuffer(pt),re.deleteSync(Vt),Ie}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function($,xe=null,ne=0){const me=Math.pow(2,-ne),de=Math.floor($.image.width*me),Ie=Math.floor($.image.height*me),Ke=xe!==null?xe.x:0,ut=xe!==null?xe.y:0;jt.setTexture2D($,0),re.copyTexSubImage2D(re.TEXTURE_2D,ne,0,0,Ke,ut,de,Ie),Tt.unbindTexture()};const tt=re.createFramebuffer(),ge=re.createFramebuffer();this.copyTextureToTexture=function($,xe,ne=null,me=null,de=0,Ie=null){Ie===null&&(de!==0?(Wm("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ie=de,de=0):Ie=0);let Ke,ut,ae,Te,Qe,ot,pt,ct,Vt;const sn=$.isCompressedTexture?$.mipmaps[Ie]:$.image;if(ne!==null)Ke=ne.max.x-ne.min.x,ut=ne.max.y-ne.min.y,ae=ne.isBox3?ne.max.z-ne.min.z:1,Te=ne.min.x,Qe=ne.min.y,ot=ne.isBox3?ne.min.z:0;else{const Zt=Math.pow(2,-de);Ke=Math.floor(sn.width*Zt),ut=Math.floor(sn.height*Zt),$.isDataArrayTexture?ae=sn.depth:$.isData3DTexture?ae=Math.floor(sn.depth*Zt):ae=1,Te=0,Qe=0,ot=0}me!==null?(pt=me.x,ct=me.y,Vt=me.z):(pt=0,ct=0,Vt=0);const cn=oe.convert(xe.format),St=oe.convert(xe.type);let le;xe.isData3DTexture?(jt.setTexture3D(xe,0),le=re.TEXTURE_3D):xe.isDataArrayTexture||xe.isCompressedArrayTexture?(jt.setTexture2DArray(xe,0),le=re.TEXTURE_2D_ARRAY):(jt.setTexture2D(xe,0),le=re.TEXTURE_2D),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,xe.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,xe.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,xe.unpackAlignment);const Ne=re.getParameter(re.UNPACK_ROW_LENGTH),Oe=re.getParameter(re.UNPACK_IMAGE_HEIGHT),at=re.getParameter(re.UNPACK_SKIP_PIXELS),xt=re.getParameter(re.UNPACK_SKIP_ROWS),Qt=re.getParameter(re.UNPACK_SKIP_IMAGES);re.pixelStorei(re.UNPACK_ROW_LENGTH,sn.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,sn.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,Te),re.pixelStorei(re.UNPACK_SKIP_ROWS,Qe),re.pixelStorei(re.UNPACK_SKIP_IMAGES,ot);const Gt=$.isDataArrayTexture||$.isData3DTexture,Xt=xe.isDataArrayTexture||xe.isData3DTexture;if($.isDepthTexture){const Zt=Dt.get($),_n=Dt.get(xe),rn=Dt.get(Zt.__renderTarget),or=Dt.get(_n.__renderTarget);Tt.bindFramebuffer(re.READ_FRAMEBUFFER,rn.__webglFramebuffer),Tt.bindFramebuffer(re.DRAW_FRAMEBUFFER,or.__webglFramebuffer);for(let Nr=0;Nr<ae;Nr++)Gt&&(re.framebufferTextureLayer(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,Dt.get($).__webglTexture,de,ot+Nr),re.framebufferTextureLayer(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,Dt.get(xe).__webglTexture,Ie,Vt+Nr)),re.blitFramebuffer(Te,Qe,Ke,ut,pt,ct,Ke,ut,re.DEPTH_BUFFER_BIT,re.NEAREST);Tt.bindFramebuffer(re.READ_FRAMEBUFFER,null),Tt.bindFramebuffer(re.DRAW_FRAMEBUFFER,null)}else if(de!==0||$.isRenderTargetTexture||Dt.has($)){const Zt=Dt.get($),_n=Dt.get(xe);Tt.bindFramebuffer(re.READ_FRAMEBUFFER,tt),Tt.bindFramebuffer(re.DRAW_FRAMEBUFFER,ge);for(let rn=0;rn<ae;rn++)Gt?re.framebufferTextureLayer(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,Zt.__webglTexture,de,ot+rn):re.framebufferTexture2D(re.READ_FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,Zt.__webglTexture,de),Xt?re.framebufferTextureLayer(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,_n.__webglTexture,Ie,Vt+rn):re.framebufferTexture2D(re.DRAW_FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_2D,_n.__webglTexture,Ie),de!==0?re.blitFramebuffer(Te,Qe,Ke,ut,pt,ct,Ke,ut,re.COLOR_BUFFER_BIT,re.NEAREST):Xt?re.copyTexSubImage3D(le,Ie,pt,ct,Vt+rn,Te,Qe,Ke,ut):re.copyTexSubImage2D(le,Ie,pt,ct,Te,Qe,Ke,ut);Tt.bindFramebuffer(re.READ_FRAMEBUFFER,null),Tt.bindFramebuffer(re.DRAW_FRAMEBUFFER,null)}else Xt?$.isDataTexture||$.isData3DTexture?re.texSubImage3D(le,Ie,pt,ct,Vt,Ke,ut,ae,cn,St,sn.data):xe.isCompressedArrayTexture?re.compressedTexSubImage3D(le,Ie,pt,ct,Vt,Ke,ut,ae,cn,sn.data):re.texSubImage3D(le,Ie,pt,ct,Vt,Ke,ut,ae,cn,St,sn):$.isDataTexture?re.texSubImage2D(re.TEXTURE_2D,Ie,pt,ct,Ke,ut,cn,St,sn.data):$.isCompressedTexture?re.compressedTexSubImage2D(re.TEXTURE_2D,Ie,pt,ct,sn.width,sn.height,cn,sn.data):re.texSubImage2D(re.TEXTURE_2D,Ie,pt,ct,Ke,ut,cn,St,sn);re.pixelStorei(re.UNPACK_ROW_LENGTH,Ne),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Oe),re.pixelStorei(re.UNPACK_SKIP_PIXELS,at),re.pixelStorei(re.UNPACK_SKIP_ROWS,xt),re.pixelStorei(re.UNPACK_SKIP_IMAGES,Qt),Ie===0&&xe.generateMipmaps&&re.generateMipmap(le),Tt.unbindTexture()},this.initRenderTarget=function($){Dt.get($).__webglFramebuffer===void 0&&jt.setupRenderTarget($)},this.initTexture=function($){$.isCubeTexture?jt.setTextureCube($,0):$.isData3DTexture?jt.setTexture3D($,0):$.isDataArrayTexture||$.isCompressedArrayTexture?jt.setTexture2DArray($,0):jt.setTexture2D($,0),Tt.unbindTexture()},this.resetState=function(){K=0,B=0,k=null,Tt.reset(),te.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return yo}get outputColorSpace(){return this._outputColorSpace}
4334set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=ur._getDrawingBufferColorSpace(e),n.unpackColorSpace=ur._getUnpackColorSpace()}}const im=t=>t?`/api/proxy-image?url=${encodeURIComponent(t)}`:"",hc=t=>t.preferredName&&t.preferredName.trim()?t.preferredName.trim():[t.firstName,t.middleName,t.lastName].filter(n=>n&&n.trim()).map(n=>n.trim()).join(" ")||"Member";let A_=class{children=new Map;profileKeys=new Set},N_=class{root=new A_;insert(e,n){e=e.toLowerCase();let a=this.root;for(const i of e)a.children.has(i)||a.children.set(i,new A_),a=a.children.get(i),a.profileKeys.add(n)}search(e){e=e.toLowerCase();let n=this.root;for(const a of e){if(!n.children.has(a))return new Set;n=n.children.get(a)}return n.profileKeys}};const uK=()=>{let t=[],e=new N_;const n=()=>{e=new N_,t.forEach(a=>{[hc(a),a.jobTitle,a.company,a.bio].filter(Boolean).join(" ").toLowerCase().split(/\s+/).forEach(o=>{o.length>0&&e.insert(o,a.memberKey)})})};return{setProfiles:a=>{t=a,n()},addProfiles:a=>{const i=new Set(t.map(o=>o.memberKey)),s=a.filter(o=>!i.has(o.memberKey));t=[...t,...s],n()},getCount:()=>t.length,searchKeys:a=>{if(a.trim()==="")return t.map(s=>s.memberKey);const i=e.search(a.trim());return t.filter(s=>i.has(s.memberKey)).map(s=>s.memberKey)},getProfile:a=>t.find(i=>i.memberKey===a),getProfiles:a=>{const i=new Set(a);return t.filter(s=>i.has(s.memberKey))}}},dK=t=>{const e=document.createElement("canvas"),n=512;e.width=n,e.height=n;const a=e.getContext("2d");if(!a)throw new Error("Could not get canvas context");a.clearRect(0,0,n,n);const i=Math.round(n*.04),s=Math.round(n*.2),o=(d,m,f,p,b)=>{a.beginPath(),a.moveTo(d+b,m),a.lineTo(d+f-b,m),a.quadraticCurveTo(d+f,m,d+f,m+b),a.lineTo(d+f,m+p-b),a.quadraticCurveTo(d+f,m+p,d+f-b,m+p),a.lineTo(d+b,m+p),a.quadraticCurveTo(d,m+p,d,m+p-b),a.lineTo(d,m+b),a.quadraticCurveTo(d,m,d+b,m),a.closePath()};o(0,0,n,n,s),a.fillStyle="#888888",a.fill(),a.save(),o(i,i,n-i*2,n-i*2,Math.max(0,s-i)),a.clip(),a.drawImage(t,i,i,n-i*2,n-i*2),a.restore();const c=new VT(e);
4334return c.colorSpace=Fi,c.minFilter=xc,c.magFilter=Gi,c.anisotropy=16,c.generateMipmaps=!0,c.needsUpdate=!0,c},hK=t=>{const n=document.createElement("canvas");n.width=512,n.height=512;const a=n.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("Could not get canvas context");const i=Math.round(512*.2),s=512/2,o=512*.8,c=Math.round(512*.125);a.shadowBlur=c,a.shadowColor="#FFD700",a.shadowOffsetX=0,a.shadowOffsetY=0;const d=s-o/2,m=s-o/2,f=o;a.fillStyle="#FFD700",a.beginPath(),a.moveTo(d+i,m),a.lineTo(d+f-i,m),a.quadraticCurveTo(d+f,m,d+f,m+i),a.lineTo(d+f,m+f-i),a.quadraticCurveTo(d+f,m+f,d+f-i,m+f),a.lineTo(d+i,m+f),a.quadraticCurveTo(d,m+f,d,m+f-i),a.lineTo(d,m+i),a.quadraticCurveTo(d,m,d+i,m),a.closePath(),a.fill(),a.globalCompositeOperation="destination-out",a.shadowBlur=0,a.fillStyle="rgba(0, 0, 0, 1)",a.beginPath(),a.moveTo(d+i,m),a.lineTo(d+f-i,m),a.quadraticCurveTo(d+f,m,d+f,m+i),a.lineTo(d+f,m+f-i),a.quadraticCurveTo(d+f,m+f,d+f-i,m+f),a.lineTo(d+i,m+f),a.quadraticCurveTo(d,m+f,d,m+f-i),a.lineTo(d,m+i),a.quadraticCurveTo(d,m,d+i,m),a.closePath(),a.fill();const p=a.getImageData(0,0,512,512),b=p.data;for(let F=0;F<b.length;F+=4)b[F+3]>0&&(b[F]=255,b[F+1]=215,b[F+2]=0);const v=document.createElement("canvas");v.width=512,v.height=512;const C=v.getContext("2d");if(!C)throw new Error("Could not get canvas context");C.putImageData(p,0,0);const S=new VT(v);
4334return S.colorSpace=Fi,S.needsUpdate=!0,S},mK=()=>{const{toast:t}=nr(),e=()=>{const st=new URLSearchParams(window.location.search).get("view");return st==="photos"||st==="cards"?st:"photos"},[n,a]=x.useState(e()),[i,s]=x.useState([]),[o,c]=x.useState(""),[d,m]=x.useState(null),[f,p]=x.useState(!0),[b,v]=x.useState(!0),[C,S]=x.useState(0),[F,w]=x.useState(!1),[A,N]=x.useState(null),[P,z]=x.useState(null),[D,T]=x.useState(null),[K,B]=x.useState({x:0,y:0}),[k,O]=x.useState(0),[I,j]=x.useState(!0),[U,q]=x.useState(!1),[Y,W]=x.useState(!1),[H,J]=x.useState(0),[ie,Q]=x.useState(60),ve=x.useRef(uK()),pe=x.useRef(null),Me=x.useRef(null),We=x.useRef(!1),Ae=x.useRef(null),Ce=x.useRef(null),He=x.useRef(null),Ct=x.useRef(null),bt=x.useRef(null);x.useRef(null);const Rt=x.useRef(null),zt=x.useRef(null),Ut=x.useRef(null),Bt=x.useRef(new Map),re=x.useRef(new Map),wt=x.useRef(new SG),Nt=x.useRef(new vr),vt=x.useRef(1),Tt=x.useRef({x:0,y:0}),Wt=x.useRef(null),Dt=x.useRef(0),jt=x.useRef(0),he=x.useRef(null),ee=x.useRef(null),ze=x.useRef([]),Ve=x.useRef(!1),lt=x.useRef(0),qe=x.useRef(null),It=x.useRef(null),gt=x.useRef(!1),Ee=x.useRef(0),Je=x.useRef("none"),$e=x.useRef(0),Xe=x.useRef(new Set),X=x.useRef([]),ke=x.useRef(new Map),[De,oe]=x.useState(0),[te,ye]=x.useState({cameraAngle:0,visibleCount:0,availableCount:0}),Re=x.useRef(0),Le=!1,fe=40,Se=10,Be=ie,Ze=x.useRef(new Map),ue=x.useRef(new Map),rt=x.useRef(new Set),je=x.useRef(null),_t=x.useRef(null),Kt=x.useRef(new Map);x.useRef(new Map);const[gn,_e]=x.useState({width:150,height:150,imageSize:48});x.useRef(new Map),x.useEffect(()=>{const we=()=>{const Lt=document.documentElement,Ot=Lt.classList.contains("dark")||Lt.getAttribute("data-theme")==="dark";j(Ot)};we();const st=new MutationObserver(we);return st.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>st.disconnect()},[]),x.useEffect(()=>{const we=new URLSearchParams(window.location.search);we.set("view",n);const st=`${window.location.pathname}?${we.toString()}`;window.history.replaceState({},"",st)},[n]);const et=ve.current.searchKeys(o),Ge=ve.current.getProfiles(et),ht=n==="photos"?Ge.filter(we=>we.profileImageUrl):Ge;x.useEffect(()=>{(async()=>{try{const Lt=await(await fetch("/api/getPublicProfilesToken")).json();Lt.success?m(Lt.token):t({variant:"destructive",title:"Error",description:"Failed to initialize profile viewer"})}
4334catch(st){console.error("Error getting session token:",st),t({variant:"destructive",title:"Error",description:"Failed to connect to server"})}})()},[t]),x.useEffect(()=>{if(!d)return;(async()=>{const Lt=ve.current.getCount()===0;try{Lt&&p(!0);const Ot=window.innerWidth,Et=window.innerHeight;let tt,ge;n==="photos"||n==="spatial"?(tt=Math.floor((Ot-100)/108),ge=108):(tt=Math.floor((Ot-100)/220),ge=100);const $=Math.ceil(Et/ge)+2,xe=n==="spatial"?1e3:Math.min(tt*$,50),me=await(await fetch("/api/getPublicProfiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d,offset:0,limit:xe})})).json();if(me.success){const de=me.profiles,Ie=Array.from(new Map(de.map(Ke=>[Ke.memberKey,Ke])).values());ve.current.setProfiles(Ie),s(Ie.map(Ke=>Ke.memberKey)),S(me.total),v(me.hasMore),w(me.isDemoData||!1)}else t({variant:"destructive",title:"Error",description:me.message||"Failed to load profiles"})}catch(Ot){console.error("Error loading profiles:",Ot),t({variant:"destructive",title:"Error",description:"Failed to load member profiles"})}finally{Lt&&p(!1)}})()},[d,n,t]);const ft=x.useCallback(async()=>{if(!(!d||!b||f))try{const st=await(await fetch("/api/getPublicProfiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d,offset:ve.current.getCount(),limit:20})})).json();st.success&&(ve.current.addProfiles(st.profiles),s(Lt=>{const Ot=st.profiles.map(ge=>ge.memberKey),Et=new Set(Lt),tt=Ot.filter(ge=>!Et.has(ge));return[...Lt,...tt]}),v(st.hasMore))}catch(we){console.error("Error loading more profiles:",we)}},[d,b,f,i.length]);x.useEffect(()=>{n!=="spatial"&&o.trim()!==""&&ht.length<20&&b&&!f&&(console.log(`[SEARCH] Only ${ht.length} matches found, loading more profiles...`),ft())},[ht.length,o,b,f,n,ft]),x.useEffect(()=>{if(n!=="spatial")return Ae.current&&Ae.current.disconnect(),Ae.current=new IntersectionObserver(we=>{we[0].isIntersecting&&b&&!f&&ft()},{threshold:.1}),Ce.current&&Ae.current.observe(Ce.current),()=>{Ae.current&&Ae.current.disconnect()}},[n,b,f,ft]),x.useCallback(()=>{const we=He.current;if(!we)return;const st=we.clientWidth,Lt=we.clientHeight;if(!(st===0||Lt===0)&&n==="spatial"){const Ot=Math.min(st,Lt),Et=Math.max(48,Math.min(120,Ot/15));_e({width:Et,height:Et,imageSize:Et})}},[n]),x.useEffect(()=>{if(n!=="spatial"){q(!1),Ut.current&&(Ut.current.dispose(),Ut.current=null),Rt.current=null,zt.current=null,Bt.current.clear();return}const we=Ct.current;if(!we)return;const st=new cG;st.background=null,Rt.current=st;for(let ct=0;ct<fe;ct++)for(let Vt=0;Vt<Se;Vt++){const sn=`${ct},${Vt}`;ue.current.set(sn,0),rt.current.add(sn)}const Lt=we.clientWidth/we.clientHeight,Et=Be*Math.PI/180,ge=2*Math.atan(Math.tan(Et/2)/Lt)*180/Math.PI,$=new cs(ge,Lt,.1,1e3);{const ct=-((Be-60)/30)*2;$.position.set(0,ct,0),$.rotation.y=lt.current}zt.current=$;const xe=new cK({antialias:!0,alpha:!0});we.appendChild(xe.domElement),Ut.current=xe,xe.setSize(we.clientWidth,we.clientHeight,!1);const me=xe.domElement.getBoundingClientRect().width/we.clientWidth;xe.setPixelRatio(window.devicePixelRatio*me),xe.setSize(we.clientWidth,we.clientHeight,!0),vt.current=1;const de={current:we.clientWidth},Ie=()=>{if(!we||!$||!xe)return;const ct=we.clientWidth,Vt=we.clientHeight;ct>de.current&&(de.current=ct);const sn=de.current/ct,cn=ct/Vt,St=Be*Math.PI/180,Ne=2*Math.atan(Math.tan(St/2)/cn)*180/Math.PI;$.fov=Ne,$.aspect=cn,$.updateProjectionMatrix(),xe.setSize(ct,Vt,!1);const xt=xe.domElement.getBoundingClientRect().width/ct,Qt=window.devicePixelRatio*xt;xe.setPixelRatio(Qt),xe.setSize(ct,Vt,!0);const Gt=sn;vt.current=Gt,Bt.current.forEach(Xt=>{const Zt=P&&Xt.userData.profile?.memberKey===P.memberKey?1.1:1;Xt.scale.set(Gt*Zt,Gt*Zt,1)}),re.current.forEach(Xt=>{const _n=(Xt.userData.basePhotoSize||2)/2*Gt;Xt.scale.set(_n,_n,1)})};window.addEventListener("resize",Ie);const Ke="ontouchstart"in window||navigator.maxTouchPoints>0,ut=ct=>{if(!we)return;const Vt="touches"in ct?ct.touches[0]?.clientX:ct.clientX,sn="touches"in ct?ct.touches[0]?.clientY:ct.clientY;Vt===void 0||sn===void 0||(qe.current={x:Vt,y:sn},It.current={x:Vt,y:sn},Ee.current=0,gt.current=!1,Je.current="none",$e.current=0)},ae=ct=>{if(!we)return;const Vt="touches"in ct?ct.touches[0]?.clientX:ct.clientX,sn="touches"in ct?ct.touches[0]?.clientY:ct.clientY;if(Vt===void 0||sn===void 0)return;const cn=we.getBoundingClientRect();if(!Ke&&!gt.current&&(Nt.current.x=(Vt-cn.left)/cn.width*2-1,Nt.current.y=-((sn-cn.top)/cn.height)*2+1,Tt.current.x=Vt,Tt.current.y=sn),qe.current&&It.current){const St=Vt-It.current.x,le=sn-It.current.y,Ne=Math.sqrt(St*St+le*le);Ee.current=Ne;const Oe=Vt-qe.current.x;if(Ne>5){if(Je.current==="none"){const at=Math.abs(St),xt=Math.abs(le);Je.current=at>xt?"horizontal":"vertical"}if(Je.current==="horizontal"){gt.current=!0;const at=Be*(Math.PI/180),xt=Oe/cn.width*at;lt.current+=xt,$e.current=xt,qe.current={x:Vt,y:sn},"touches"in ct&&ct.preventDefault()}}}},Te=()=>{qe.current=null,It.current=null,gt.current=!1,Ee.current=0,Je.current="none"},Qe=()=>{if(Ke&&(T(null),Wt.current)){const ct=Wt.current.userData.profile,Vt=re.current.get(ct.memberKey);Vt&&(Vt.userData.glowDirection="out",Vt.userData.glowStartTime=Date.now()),Wt.current=null}},ot=()=>{Te()},pt=ct=>{if(!we||!$)return;const Vt=gt.current,sn=Ee.current,cn=Je.current;if(Te(),Vt||cn!=="none"||sn>=5){if(Ke&&(T(null),Wt.current)){const xt=Wt.current.userData.profile,Qt=re.current.get(xt.memberKey);Qt&&(Qt.userData.glowDirection="out",Qt.userData.glowStartTime=Date.now()),Wt.current=null}return}const St="changedTouches"in ct?ct.changedTouches[0]?.clientX:ct.clientX,le="changedTouches"in ct?ct.changedTouches[0]?.clientY:ct.clientY;if(St===void 0||le===void 0)return;const Ne=we.getBoundingClientRect();Nt.current.x=(St-Ne.left)/Ne.width*2-1,Nt.current.y=-((le-Ne.top)/Ne.height)*2+1,wt.current.setFromCamera(Nt.current,$);const Oe=Array.from(Bt.current.values()),at=wt.current.intersectObjects(Oe);if(at.length>0){const Qt=at[0].object.userData.profile;Qt&&N(Qt)}if(Ke&&(T(null),Wt.current)){const xt=Wt.current.userData.profile,Qt=re.current.get(xt.memberKey);Qt&&(Qt.userData.glowDirection="out",Qt.userData.glowStartTime=Date.now()),Wt.current=null}};return Ke?(we.addEventListener("touchstart",ut),we.addEventListener("touchmove",ae,{passive:!1}),we.addEventListener("touchend",pt),we.addEventListener("touchcancel",ot),document.addEventListener("visibilitychange",Qe)):(we.addEventListener("mousedown",ut),we.addEventListener("mousemove",ae),we.addEventListener("mouseleave",Qe),document.addEventListener("mouseup",pt)),q(!0),()=>{window.removeEventListener("resize",Ie),Ke?(we.removeEventListener("touchstart",ut),we.removeEventListener("touchmove",ae),we.removeEventListener("touchend",pt),we.removeEventListener("touchcancel",ot),document.removeEventListener("visibilitychange",Qe)):(we.removeEventListener("mousedown",ut),we.removeEventListener("mousemove",ae),we.removeEventListener("mouseleave",Qe),document.removeEventListener("mouseup",pt)),xe&&(we.removeChild(xe.domElement),xe.dispose()),Bt.current.forEach(ct=>{if(ct.geometry&&ct.geometry.dispose(),ct.material instanceof js){const Vt=ct.material;Vt.map&&Vt.map.dispose(),ct.material.dispose()}}),Bt.current.clear(),ee.current&&(ee.current.dispose(),ee.current=null),he.current&&(he.current.dispose(),he.current=null),Ze.current.forEach(ct=>{ct.geometry&&ct.geometry.dispose(),ct.material instanceof js&&ct.material.dispose()}),Ze.current.clear(),ue.current.clear(),rt.current.clear(),je.current&&(je.current.traverse(ct=>{ct instanceof Hs&&(ct.geometry&&ct.geometry.dispose(),ct.material instanceof js&&ct.material.dispose())}),Rt.current?.remove(je.current),je.current=null),Kt.current.forEach(ct=>{Rt.current?.remove(ct),ct.geometry&&ct.geometry.dispose(),ct.material instanceof js&&ct.material.dispose()}),Kt.current.clear(),Wt.current=null}},[n,Y,fe,Se]),x.useEffect(()=>{if(n!=="spatial"||!zt.current)return;const we=zt.current,st=Ct.current;if(!st)return;const Lt=st.clientWidth/st.clientHeight,Et=ie*Math.PI/180,ge=2*Math.atan(Math.tan(Et/2)/Lt)*180/Math.PI;we.fov=ge,we.updateProjectionMatrix()},[n,ie]),x.useEffect(()=>{if(n!=="spatial"||!U||!Rt.current)return;const we=Rt.current;new yG;const st=new Set(ht.map(Et=>Et.memberKey));Bt.current.forEach((Et,tt)=>{if(!st.has(tt)){if(we.remove(Et),Et.geometry&&Et.geometry.dispose(),Et.material instanceof js){const $=Et.material;$.map&&$.map.dispose(),Et.material.dispose()}Bt.current.delete(tt);const ge=re.current.get(tt);ge&&(we.remove(ge),ge.material instanceof js&&ge.material.dispose(),re.current.delete(tt)),Xe.current.delete(tt),ke.current.delete(tt)}}),X.current=X.current.filter(Et=>st.has(Et)),ht.forEach(Et=>{const tt=Et.memberKey;!Xe.current.has(tt)&&!X.current.includes(tt)&&X.current.push(tt)}
4334);const Lt=()=>{if(Ve.current||ze.current.length===0)return;Ve.current=!0;const Et=()=>{ze.current.splice(0,5).forEach(({profile:$,img:xe})=>{if(!Rt.current||Bt.current.has($.memberKey))return;const ne=dK(xe);Ut.current&&(ne.anisotropy=Ut.current.capabilities.getMaxAnisotropy());const me=window.innerWidth<640,de=window.innerHeight>window.innerWidth,Ie=me&&de?2.4:2,Ke=new Qd(Ie,Ie),ut=new uu({map:ne,side:Us,transparent:!0,alphaTest:.01,opacity:0}),ae=new Hs(Ke,ut),Te=15,Qe=ke.current.get($.memberKey);let ot,pt;if(Qe)ot=(Qe.col+.5)/fe*Math.PI*2,pt=-10+(Qe.row+.5)/Se*20,ke.current.delete($.memberKey);else{const at=lt.current,xt=Math.PI*(2/3),Qt=(Math.random()-.5)*xt*2,Gt=at+Qt;ot=(Math.floor((Gt%(Math.PI*2)+Math.PI*2)%(Math.PI*2)/(Math.PI*2)*fe)%fe+.5)/fe*Math.PI*2;const Zt=Math.random();pt=-10+(Math.floor(Zt*6)+2+.5)/Se*20}const ct=Te;ae.position.set(Math.cos(ot)*ct,pt,-Math.sin(ot)*ct);const Vt=ae.position.clone(),sn=ot,cn=.01*60;ae.userData={velocity:new Pt((Math.random()-.5)*cn*2,(Math.random()-.5)*cn*2,(Math.random()-.5)*cn),basePosition:Vt,baseAngle:sn,baseRadius:ct,profile:$,fadeStartTime:Date.now(),fadeDuration:500},Rt.current.add(ae),ae.scale.set(vt.current,vt.current,1),Bt.current.set($.memberKey,ae),ee.current||(ee.current=new Qd(2.5,2.5)),he.current||(he.current=hK());const St=new uu({map:he.current,transparent:!0,opacity:0,side:Us,depthWrite:!1}),le=new Hs(ee.current,St);le.position.copy(ae.position);const Ne=new Pt;Ne.subVectors(zt.current.position,ae.position),Ne.normalize(),le.position.addScaledVector(Ne,.01),le.userData={glowIntensity:0,glowStartTime:0,glowDirection:null,basePhotoSize:Ie},Rt.current.add(le);const Oe=Ie/2*vt.current;le.scale.set(Oe,Oe,1),re.current.set($.memberKey,le)}),ze.current.length>0?requestAnimationFrame(Et):Ve.current=!1};requestAnimationFrame(Et)};Xe.current.size===0&&X.current.length===0&&ht.length>0&&(Xe.current=new Set,X.current=ht.map(Et=>Et.memberKey),console.log("INITIALIZED POOLS (grid-based):",{loaded:Xe.current.size,available:X.current.length,total:ht.length})),ht.forEach(Et=>{if(!Bt.current.has(Et.memberKey)&&Xe.current.has(Et.memberKey)&&Et.profileImageUrl){const tt=new Image;tt.onload=()=>{Xe.current.has(Et.memberKey)&&(ze.current.push({profile:Et,img:tt}),Lt())},tt.onerror=ge=>{console.error("Error loading texture for",hc(Et),":",ge)},tt.src=im(Et.profileImageUrl)}})},[n,U,o,i.length,De]),x.useEffect(()=>{if(n!=="spatial"||!U){bt.current&&(cancelAnimationFrame(bt.current),bt.current=null);return}const we=Rt.current,st=zt.current,Lt=Ut.current;if(!we||!st||!Lt)return;Dt.current=performance.now();const Ot=Et=>{const tt=(Et-Dt.current)/1e3;Dt.current=Et;const ge=Math.min(tt,.1);{const St=-((Be-60)/30)*2;st.position.y=St,st.rotation.y=lt.current,!gt.current&&Math.abs($e.current)>1e-4&&(lt.current+=$e.current,st.rotation.y=lt.current,$e.current*=.95,Math.abs($e.current)<1e-4&&($e.current=0))}if(je.current&&(je.current.rotation.y=lt.current),_t.current){const St=lt.current+Math.PI/2;_t.current.rotation.y=St}const $=ht.length,ne=X.current.length/$,me=Be/2*(Math.PI/180);let de;if(ne>.5)de=me+30*Math.PI/180;else if(ne<.2)de=me+10*Math.PI/180;else{const le=(10+(ne-.2)/.3*20)*(Math.PI/180);de=me+le}const Ie=lt.current+Math.PI/2,Ke=[];Bt.current.forEach((St,le)=>{const Ne=St.userData.baseAngle;if(Ne!==void 0){let Oe=Ne-Ie;for(;Oe>Math.PI;)Oe-=2*Math.PI;for(;Oe<-Math.PI;)Oe+=2*Math.PI;Ke.push({memberKey:le,angleDiff:Oe})}}),Ke.sort((St,le)=>Math.abs(le.angleDiff)-Math.abs(St.angleDiff));const ut=[];for(const{memberKey:St,angleDiff:le}of Ke)Math.abs(le)>de&&ut.push(St);ut.forEach(St=>{const le=Bt.current.get(St);if(le){we.remove(le),le.geometry&&le.geometry.dispose(),le.material instanceof uu&&(le.material.map&&le.material.map.dispose(),le.material.dispose()),Bt.current.delete(St);const Ne=re.current.get(St);Ne&&(we.remove(Ne),Ne.material instanceof js&&Ne.material.dispose(),re.current.delete(St)),Xe.current.delete(St),X.current.includes(St)||X.current.push(St)}});const ae=[];rt.current.forEach(St=>{const[le,Ne]=St.split(","),Oe=parseInt(le),at=parseInt(Ne);if(at<2||at>7)return;const xt=(Oe+.5)/fe*Math.PI*2,Qt=lt.current+Math.PI/2;let Gt=xt-Qt;for(;Gt>Math.PI;)Gt-=2*Math.PI;for(;Gt<-Math.PI;)Gt+=2*Math.PI;const Xt=Be/2*(Math.PI/180),Zt=10*(Math.PI/180),_n=Xt+Zt;Math.abs(Gt)<=_n&&ae.push({col:Oe,row:at,angleDiff:Gt})}),ae.sort((St,le)=>Math.abs(St.angleDiff)-Math.abs(le.angleDiff));const Qe=Math.min(ae.length,5,X.current.length);Qe>0&&(X.current.splice(0,Qe).forEach((le,Ne)=>{const Oe=ae[Ne];if(Oe){Xe.current.add(le),ke.current.set(le,Oe);const at=`${Oe.col},${Oe.row}`,xt=ue.current.get(at)||0;ue.current.set(at,xt+1),rt.current.delete(at)}}),oe(le=>le+1)),Et-Re.current>200&&(Re.current=Et,ye({cameraAngle:lt.current,visibleCount:Bt.current.size,availableCount:X.current.length})),Bt.current.forEach((St,le)=>{const Ne=St.userData.velocity,Oe=St.userData.basePosition;St.position.x+=Ne.x*ge*H,St.position.y+=Ne.y*ge*H,St.position.z+=Ne.z*ge*H;const at=2,xt=St.position.x-Oe.x,Qt=St.position.y-Oe.y,Gt=St.position.z-Oe.z;if(Math.abs(xt)>at&&(Ne.x*=-1,St.position.x=Oe.x+Math.sign(xt)*at),Math.abs(Qt)>at&&(Ne.y*=-1,St.position.y=Oe.y+Math.sign(Qt)*at),Math.abs(Gt)>at&&(Ne.z*=-1,St.position.z=Oe.z+Math.sign(Gt)*at),St.userData.fadeStartTime&&St.material instanceof uu){const Zt=Date.now()-St.userData.fadeStartTime,_n=St.userData.fadeDuration||500;if(Zt<_n){let rn=Zt/_n;rn=rn<.5?2*rn*rn:1-Math.pow(-2*rn+2,2)/2,St.material.opacity=rn}else St.material.opacity=1,delete St.userData.fadeStartTime,delete St.userData.fadeDuration}St.lookAt(st.position);const Xt=re.current.get(le);if(Xt){Xt.position.copy(St.position);const Zt=new Pt;Zt.subVectors(st.position,St.position),Zt.normalize(),Xt.position.addScaledVector(Zt,.01),Xt.lookAt(st.position)}}),ue.current.forEach((St,le)=>{ue.current.set(le,0)}),ke.current.forEach(St=>{const le=`${St.col},${St.row}`,Ne=ue.current.get(le)||0;ue.current.set(le,Ne+1)});const ot=15,pt=20,ct=-10,Vt=1.2,sn=2;if(Bt.current.forEach(St=>{const le=St.position;for(let Ne=0;Ne<fe;Ne++)for(let Oe=0;Oe<Se;Oe++){const at=(Ne+.5)/fe*Math.PI*2,xt=ct+(Oe+.5)/Se*pt,Qt=Math.cos(at)*ot,Gt=xt,Xt=-Math.sin(at)*ot,Zt=le.x-Qt,_n=le.y-Gt,rn=le.z-Xt,or=Math.sqrt(Zt*Zt+_n*_n+rn*rn),Nr=Vt+sn,Ca=Math.max(0,1-or/Nr);if(Ca>0){const qi=`${Ne},${Oe}`,fs=ue.current.get(qi)||0;ue.current.set(qi,fs+Ca)}}}),ue.current.forEach((St,le)=>{St<.5?rt.current.add(le):rt.current.delete(le)}),!("ontouchstart"in window||navigator.maxTouchPoints>0)){wt.current.setFromCamera(Nt.current,st);const St=Array.from(Bt.current.values()),le=wt.current.intersectObjects(St);if(le.length>0){const Ne=le[0].object,Oe=Ne.userData.profile;if(Wt.current!==Ne){if(Wt.current){const at=Wt.current.userData.profile,xt=re.current.get(at.memberKey);xt&&(xt.userData.glowDirection="out",xt.userData.glowStartTime=Date.now())}if(Wt.current=Ne,jt.current=Date.now(),Oe){B({x:Tt.current.x,y:Tt.current.y}),T(Oe);const at=re.current.get(Oe.memberKey);
4334at&&(at.userData.glowDirection="in",at.userData.glowStartTime=Date.now()),Me.current&&(cancelAnimationFrame(Me.current),Me.current=null),O(0),z(null),We.current=!1,pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{z(Oe),We.current=!0,Mt()},500)}}}else{T(null);const Ne=We.current;if(pe.current&&(clearTimeout(pe.current),pe.current=null,We.current=!1),Ne&&be(),Wt.current){const Oe=Wt.current.userData.profile,at=re.current.get(Oe.memberKey);at&&(at.userData.glowDirection="out",at.userData.glowStartTime=Date.now())}Wt.current=null}}re.current.forEach(St=>{const le=St.userData;if(le.glowDirection){const Ne=Date.now()-le.glowStartTime,Oe=le.glowDirection==="in"?250:500;let at=Math.min(Ne/Oe,1);le.glowDirection==="out"&&(at=1-at),at=at<.5?2*at*at:1-Math.pow(-2*at+2,2)/2,le.glowIntensity=at,St.material instanceof uu&&(St.material.opacity=at*1);const xt=Array.from(Bt.current.entries()).find(([Qt,Gt])=>re.current.get(Qt)===St);if(xt){const[Qt,Gt]=xt,Xt=vt.current,Zt=1+at*.1,_n=Xt*Zt;Gt.scale.set(_n,_n,1)}Ne>=Oe&&(le.glowDirection=null)}}),Lt.render(we,st),bt.current=requestAnimationFrame(Ot)};return Ot(performance.now()),()=>{bt.current&&cancelAnimationFrame(bt.current)}},[n,U,H,ie]);const Mt=()=>{Me.current&&cancelAnimationFrame(Me.current);const we=Date.now(),st=1e3,Lt=()=>{const Ot=Date.now()-we;let Et=Math.min(Ot/st,1);Et=Et<.5?2*Et*Et:1-Math.pow(-2*Et+2,2)/2,O(Et),Et<1&&(Me.current=requestAnimationFrame(Lt))};Lt()},be=()=>{Me.current&&cancelAnimationFrame(Me.current),We.current=!1;const we=k,st=Date.now(),Lt=1e3,Ot=()=>{const Et=Date.now()-st;let tt=Math.min(Et/Lt,1);tt=tt<.5?2*tt*tt:1-Math.pow(-2*tt+2,2)/2,O(we*(1-tt)),tt<1?Me.current=requestAnimationFrame(Ot):z(null)};Ot()},Z=we=>n==="photos"?r.jsx("div",{className:"cursor-pointer select-none",onMouseEnter:st=>{z(we),B({x:st.clientX,y:st.clientY})},onMouseLeave:()=>{z(null)},onClick:()=>N(we),children:we.profileImageUrl?r.jsx("img",{src:im(we.profileImageUrl),alt:hc(we),className:"portrait:w-full portrait:h-auto portrait:aspect-square landscape:w-24 landscape:h-24 sm:w-24 sm:h-24 rounded-md object-cover border-2 border-gray-400 transition-all duration-150",style:{filter:P?.memberKey===we.memberKey?"drop-shadow(0 0 6px #FFD700)":"none",transform:P?.memberKey===we.memberKey?"scale(1.1)":"scale(1)"}}):r.jsx("div",{className:"portrait:w-full portrait:aspect-square landscape:w-24 landscape:h-24 sm:w-24 sm:h-24 rounded-md bg-muted flex items-center justify-center border-2 border-gray-400",children:r.jsx(Bs,{className:"portrait:w-1/3 portrait:h-1/3 landscape:w-12 landscape:h-12 sm:w-12 sm:h-12 text-muted-foreground"})})},we.memberKey):r.jsx("div",{className:"select-none",onMouseEnter:st=>{z(we),B({x:st.clientX,y:st.clientY})},onMouseLeave:()=>{z(null)},onClick:()=>N(we),children:r.jsx(Fo,{variant:"compact",name:hc(we),profileImageUrl:im(we.profileImageUrl),title:we.jobTitle,company:we.company,city:we.city,stateProvince:we.stateProvince,country:we.country,bio:we.bio,memberKey:we.memberKey,isDonor:we.isDonor,isVolunteer:!!we.tracks?.length,showDonorBadge:we.isDonor,showVolunteerBadge:!!we.tracks?.length,disableClick:!0})},we.memberKey),it=we=>we.length<=50?we:we.substring(0,50)+"...";return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(Os,{}),r.jsxs("div",{className:"container mx-auto px-4 py-8 mt-16",children:[r.jsxs("div",{className:"mb-8",children:[r.jsx("h1",{className:"text-4xl font-bold mb-2",children:"Member Profiles"}),r.jsx("p",{className:"text-muted-foreground",children:C>0?o.trim()?`${ht.length} of ${C} members match your search`:`${C} members sharing their profiles`:"Loading member profiles..."}),F&&r.jsx("div",{className:"mt-4 p-3 bg-yellow-50 dark:bg-yellow-950 border border-yellow-200 dark:border-yellow-800 rounded-lg",children:r.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:["⚠️ ",r.jsx("strong",{children:"Demo Mode:"}),"  These are not actual XR Guild members. Photos are from real people, used with permission via "," ",r.jsx("a",{href:"https://unsplash.com",target:"_blank",rel:"noopener noreferrer",className:"underline hover:no-underline",children:"Unsplash"})," ",r.jsx("br",{}),"Personas are randomly generated. Email: [email protected] for any concerns."]})})]}),r.jsxs("div",{className:"mb-8 flex items-center gap-8",children:[r.jsx(kx,{value:n,onValueChange:we=>a(we),children:r.jsxs("div",{className:"flex gap-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xl,{value:"photos",id:"photos"}),r.jsx(Ht,{htmlFor:"photos",children:"Photos"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xl,{value:"cards",id:"cards"}),r.jsx(Ht,{htmlFor:"cards",children:"Cards"})]})]})}),r.jsxs("div",{className:"flex-1 max-w-md relative",children:[r.jsx(Eu,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(un,{type:"text",placeholder:"Search profiles...",value:o,onChange:we=>c(we.target.value),className:"pl-10"})]}),n==="spatial"&&r.jsxs("div",{className:"flex items-center gap-3 min-w-[200px]",children:[r.jsxs(Ht,{htmlFor:"animSpeed",className:"text-sm whitespace-nowrap",children:["Animation: ",r.jsx("span",{className:"inline-block min-w-[2.5rem] text-right",children:H===0?"Off":`${H.toFixed(1)}x`})]}),r.jsx("input",{id:"animSpeed",type:"range",min:"0",max:"5",step:"0.1",value:H,onChange:we=>J(parseFloat(we.target.value)),className:"flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),n==="spatial"&&r.jsxs("div",{className:"flex items-center gap-3 min-w-[200px]",children:[r.jsxs(Ht,{htmlFor:"fovSlider",className:"text-sm whitespace-nowrap",children:["FOV: ",r.jsxs("span",{className:"inline-block min-w-[2.5rem] text-right",children:[ie,"°"]})]}),r.jsx("input",{id:"fovSlider",type:"range",min:"60",max:"90",step:"5",value:ie,onChange:we=>Q(parseInt(we.target.value)),className:"flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]})]}),f?r.jsx("div",{className:"text-center py-20",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading profiles..."})}):n==="spatial"?r.jsxs("div",{className:"relative",children:[r.jsx("div",{ref:we=>{Ct.current=we,W(!!we)},className:"w-full border rounded-lg cursor-pointer",style:{height:window.matchMedia("(orientation: portrait)").matches?"calc(100vh - 300px)":`${90-(ie-60)/30*22.5}vh`}}),D&&Ct.current&&(()=>{const we=Ct.current.getBoundingClientRect(),st=Tt.current.x-we.left,Lt=Tt.current.y-we.top;return r.jsxs("div",{className:"absolute pointer-events-none px-3 py-2 rounded-lg text-center",style:{left:`${st}
4334px`,top:`${Lt+30}px`,backgroundColor:I?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.9)",color:I?"#ffffff":"#000000",transform:"translate(-50%, 0)",whiteSpace:"nowrap",fontSize:"14px",fontWeight:"600",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",zIndex:10},children:[hc(D),(D.jobTitle||D.company)&&r.jsx("div",{style:{fontSize:"12px",opacity:.8,fontWeight:"400"},children:[D.jobTitle,D.company].filter(Boolean).join(", ")})]})})(),Le]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`grid gap-3 ${n==="photos"?"portrait:grid-cols-2 portrait:min-[400px]:grid-cols-3 landscape:grid-cols-[repeat(auto-fit,96px)] sm:grid-cols-[repeat(auto-fit,96px)]":"portrait:grid-cols-1 portrait:min-[360px]:grid-cols-2 landscape:grid-cols-3 sm:grid-cols-[repeat(auto-fit,200px)]"}`,children:ht.map((we,st)=>{const Lt=Z(we);return Lt?{...Lt,key:`${we.memberKey}-${st}`}:null})}),b&&r.jsx("div",{ref:Ce,className:"h-20 flex items-center justify-center",children:r.jsx("p",{className:"text-muted-foreground",children:"Loading more..."})})]})]}),P&&!A&&r.jsx("div",{className:"fixed z-50 pointer-events-none",style:{left:K.x+10,top:K.y+10,opacity:k},children:r.jsx(Ft,{className:"p-4 max-w-sm shadow-lg border-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[P.profileImageUrl?r.jsx("img",{src:im(P.profileImageUrl),alt:hc(P),className:"w-16 h-16 rounded-lg object-cover flex-shrink-0"}):r.jsx("div",{className:"w-16 h-16 rounded-lg bg-muted flex items-center justify-center flex-shrink-0",children:r.jsx(Bs,{className:"w-8 h-8 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-lg",children:hc(P)}),(P.jobTitle||P.company)&&r.jsx("p",{className:"text-sm text-muted-foreground",children:[P.jobTitle,P.company].filter(Boolean).join(", ")}),P.bio&&r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:it(P.bio)})]})]})})}),A&&r.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>N(null),children:r.jsx("div",{onClick:we=>we.stopPropagation(),children:r.jsx(Fo,{variant:"expanded",name:hc(A),profileImageUrl:im(A.profileImageUrl),title:A.jobTitle,company:A.company,city:A.city,stateProvince:A.stateProvince,country:A.country,bio:A.bio,memberKey:A.memberKey,isDonor:A.isDonor,isVolunteer:!!A.tracks?.length,showDonorBadge:A.isDonor,showVolunteerBadge:!!A.tracks?.length,onClose:()=>N(null)})})}),r.jsx(iw,{})]})},QT=()=>{const t=Do();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100 dark:bg-gray-900",children:r.jsxs("div",{className:"text-center",children:[r.jsx("h1",{className:"mb-4 text-4xl font-bold text-gray-900 dark:text-white",children:"404"}),r.jsx("p",{className:"mb-4 text-xl text-gray-600 dark:text-gray-400",children:"Oops! Page not found"}),r.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:"Return to Home"})]})})},eM=x.createContext(void 0);function fK({children:t}){const e=_r(),n=Do(),[a,i]=x.useState(!1),[s,o]=x.useState(null),[c,d]=x.useState(null),[m,f]=x.useState([]),[p,b]=x.useState(null),[v,C]=x.useState(null),[S,F]=x.useState(!1),[w,A]=x.useState(!0),[N,P]=x.useState(!1);nr();const z=I=>I===404||I>=500&&I<=599,D=async I=>{let U=0,q=!1,Y=0;const W=5;for(;U<30;){try{if((await fetch("/api/health",{method:"GET"})).ok){q=!0;const J=await fetch("/api/admin-auth/session",{method:"GET",headers:{"X-Session-ID":I}});if(J.ok){const ie=await J.json();i(!0),o(ie.email),d(ie.role);const Q=ie.tracks||[];return f(ve=>JSON.stringify(ve)===JSON.stringify(Q)?ve:Q),b(I),C(ie.guildEmail||null),F(ie.canSendAsGuildEmail||!1),P(!1),console.log("[AdminAuth] Session re-validated successfully"),!0}else if(z(J.status))console.log(`[AdminAuth] Admin routes not ready yet (${J.status}), continuing to wait...`);else if(J.status===401&&Y<W)console.log(`[AdminAuth] Got 401, sessions may not be loaded yet (retry ${Y+1}/${W})`),Y++;
4334else return console.log(`[AdminAuth] Session invalid (${J.status})`),!1}}catch{q&&console.log("[AdminAuth] Server was healthy but connection failed, retrying...")}await new Promise(H=>setTimeout(H,1e3)),U++}return console.log("[AdminAuth] Timed out waiting for server"),!1},T=async()=>{try{const I=sessionStorage.getItem("adminSessionId");if(!I){i(!1),o(null),d(null),f([]),b(null),C(null),F(!1),A(!1);return}const j=await fetch("/api/admin-auth/session",{method:"GET",headers:{"X-Session-ID":I}});if(j.ok){const U=await j.json();i(!0),o(U.email),d(U.role);const q=U.tracks||[];f(Y=>JSON.stringify(Y)===JSON.stringify(q)?Y:q),b(I),C(U.guildEmail||null),F(U.canSendAsGuildEmail||!1),console.log("[AdminAuth] Guild email info:",U.guildEmail,"canSend:",U.canSendAsGuildEmail),P(!1)}else{if(z(j.status))throw console.log(`[AdminAuth] Got ${j.status} - treating as server unavailable`),new Error("Backend unavailable");j.status===401?(console.log("[AdminAuth] Got 401 - session is invalid, clearing"),sessionStorage.removeItem("adminSessionId"),i(!1),o(null),d(null),f([]),b(null)):j.status===429?console.log("[AdminAuth] Got 429 - rate limited, skipping session check"):(console.log(`[AdminAuth] Session check failed with status ${j.status}`),sessionStorage.removeItem("adminSessionId"),i(!1),o(null),d(null),f([]),b(null))}}catch{const j=sessionStorage.getItem("adminSessionId");j&&window.location.pathname.startsWith("/admin")&&window.location.pathname!=="/admin/login"?(console.log("[AdminAuth] Server unavailable, showing stand-by screen..."),P(!0),await D(j)||(console.log("[AdminAuth] Session invalid after server restart"),sessionStorage.removeItem("adminSessionId"),i(!1),o(null),d(null),f([]),b(null),P(!1))):(i(!1),o(null),d(null),f([]),b(null))}finally{A(!1)}},K=async()=>{try{const I=sessionStorage.getItem("adminSessionId");I&&await fetch("/api/admin-auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:I})}),sessionStorage.removeItem("adminSessionId")}catch(I){console.error("Logout failed:",I),sessionStorage.removeItem("adminSessionId")}finally{i(!1),o(null),d(null),f([]),b(null),C(null),F(!1)}},B=s&&c?{email:s,role:c}:null,k=n.pathname.endsWith("/login")||n.pathname.endsWith("/setup"),O=!w&&!N&&!a&&!k;return x.useEffect(()=>{T();const I=setInterval(()=>{sessionStorage.getItem("adminSessionId")&&!N&&T()},3e4);return()=>clearInterval(I)},[]),x.useEffect(()=>{O&&e("/admin/login",{replace:!0})},[O,e]),N?r.jsx(ku,{isConnected:!1,showImmediately:!0}):w?r.jsx("div",{className:"flex items-center justify-center min-h-screen",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"Checking authentication..."})]})}
4334):O?null:r.jsx(eM.Provider,{value:{isAuthenticated:a,adminEmail:s,adminRole:c,adminTracks:m,sessionId:p,user:B,adminGuildEmail:v,canSendAsGuildEmail:S,checkAuth:T,logout:K},children:t})}function ia(){const t=x.useContext(eM);if(t===void 0)throw new Error("useAdminAuth must be used within AdminAuthProvider");return t}function Po(){const t=_r(),{toast:e}=nr(),{checkAuth:n,sessionId:a}=ia();return async(i,s)=>{try{const o=new Headers(s?.headers);a&&!o.has("x-session-id")&&o.set("x-session-id",a);const c=await fetch(i,{...s,headers:o});if(c.status>=500)return console.log(`[adminFetch] Server unavailable (${c.status}), not clearing session`),await n(),c;if(c.status===401){try{if(!(await fetch("/api/health")).ok)return console.log("[adminFetch] Got 401 but server health check failed, not clearing session"),await n(),c}catch{return console.log("[adminFetch] Got 401 but can't reach server, not clearing session"),await n(),c}sessionStorage.removeItem("adminSessionId"),e({variant:"destructive",title:"Session Expired",description:"Your admin session has expired. Please log in again."}),await n(),t("/admin/login")}return c}catch(o){throw o}}}function pK({children:t}){const{sessionId:e,isAuthenticated:n}=ia();return r.jsx(OA,{sessionId:e,isAuthenticated:n,children:t})}const gK=th("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Lw=x.forwardRef(({className:t,variant:e,...n},a)=>r.jsx("div",{ref:a,role:"alert",className:ln(gK({variant:e}),t),...n}));Lw.displayName="Alert";const xK=x.forwardRef(({className:t,...e},n)=>r.jsx("h5",{ref:n,className:ln("mb-1 font-medium leading-none tracking-tight",t),...e}));xK.displayName="AlertTitle";const Iw=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{ref:n,className:ln("text-sm [&_p]:leading-relaxed",t),...e}));Iw.displayName="AlertDescription";function tM(){const{restartCountdown:t,cancelRestartCountdown:e}=rf(),{adminRole:n}=ia();if(!t)return null;const{scheduledBy:a,remainingSeconds:i}=t,s=i<=10,o=d=>{if(d<60)return`${d} second${d!==1?"s":""}`;const m=Math.floor(d/60),f=d%60;return f===0?`${m} minute${m!==1?"s":""}`:`${m}m ${f}s`},c=()=>{e()};return r.jsx("div",{className:"w-full p-4 pb-0",children:r.jsxs(Lw,{className:`${s?"bg-red-100 border-red-500 text-red-900":"bg-orange-100 border-orange-500 text-orange-900"}`,children:[r.jsx(po,{className:"h-4 w-4"}),r.jsxs(Iw,{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("strong",{children:"Server Restart Scheduled"})," by ",a,r.jsx("br",{}),"Restarting in: ",r.jsx("strong",{children:o(i)}),i<=30&&r.jsx("span",{className:"ml-2",children:"- Save your work now!"})]}),n==="SUPER_ADMIN"&&r.jsx(Fe,{variant:"outline",size:"sm",onClick:c,className:"ml-4",children:"Cancel Restart"})]})]})})}function vK(){const{isConnected:t}=rf(),{isAuthenticated:e}=ia();return e?r.jsx(ku,{isConnected:t}):null}const Mx="xrguild_registered_admins_v2",Bw="xrguild_registered_admin_emails";function Rx(){try{const t=localStorage.getItem(Mx);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to load registered admins:",t),[]}}function Ow(){try{const t=localStorage.getItem(Bw);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?typeof e[0]=="string"?e.map(n=>({email:n})):e:[]}catch{return[]}}function Xb(t,e,n,a){const i=Rx(),s=i.findIndex(c=>c.memberKey===t);s>=0&&i.splice(s,1);const o=[{memberKey:t,displayName:e,role:n,email:a?.toLowerCase()},...i];if(localStorage.setItem(Mx,JSON.stringify(o)),a){const c=Ow(),d=c.filter(m=>m.email.toLowerCase()!==a.toLowerCase());d.length!==c.length&&localStorage.setItem(Bw,JSON.stringify(d))}}function yK(t){const n=Rx().filter(a=>a.memberKey!==t);localStorage.setItem(Mx,JSON.stringify(n))}function bK(t){const e=t.toLowerCase().trim(),a=Rx().filter(o=>o.email?.toLowerCase()!==e);localStorage.setItem(Mx,JSON.stringify(a));const s=Ow().filter(o=>o.email.toLowerCase()!==e);localStorage.setItem(Bw,JSON.stringify(s))}
4334function T_(){const t=Rx();return t.length>0?t:Ow().map(e=>({memberKey:"",email:e.email,displayName:e.email,role:e.role}))}const M_=t=>t?t.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()):"";function wK({onAuthSuccess:t,onServerUnavailable:e}){const{toast:n}=nr(),[a,i]=x.useState([]),[s,o]=x.useState(""),[c,d]=x.useState(!1),[m,f]=x.useState(!1);x.useEffect(()=>{const v=T_();i(v),v.length===0&&d(!0)},[]);const p=async v=>{if(!v.trim()){n({variant:"destructive",title:"Email Required",description:"Please enter your admin email address"});return}f(!0);try{const C=await fetch("/api/admin-auth/passkey/authentication-options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:v.trim().toLowerCase()})});if(C.status>=500)throw new Error("SERVER_UNAVAILABLE");if(!C.ok){const P=await C.json();throw new Error(P.message||"Failed to start authentication")}const S=await C.json(),F=S.options?.challenge||S.challenge,w=await jg(S.options||S),A=await fetch("/api/admin-auth/passkey/verify-authentication",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:v.trim().toLowerCase(),response:w,challenge:F})});if(A.status>=500)throw new Error("SERVER_UNAVAILABLE");if(!A.ok){const P=await A.json();throw new Error(P.message||"Authentication failed")}const N=await A.json();N.sessionId&&sessionStorage.setItem("adminSessionId",N.sessionId),N.memberKey&&Xb(N.memberKey,N.displayName,N.role,N.email),n({title:"Login Successful",description:`Welcome back, ${N.displayName||N.email}!`}),t()}catch(C){console.error("Authentication error:",C),C.message==="SERVER_UNAVAILABLE"||C.name==="TypeError"?e?e():n({variant:"destructive",title:"Server Unavailable",description:"The server is currently unavailable. Please wait and try again."}):C.name==="NotAllowedError"?n({variant:"destructive",title:"Authentication Cancelled",description:"You cancelled the passkey authentication"}):n({variant:"destructive",title:"Authentication Failed",description:C.message||"Failed to authenticate with passkey"})}finally{f(!1)}},b=v=>{v.memberKey?yK(v.memberKey):v.email&&bK(v.email);const C=T_();i(C),C.length===0&&d(!0)};return r.jsxs(Ft,{className:"w-full max-w-md",children:[r.jsxs(bn,{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ra,{className:"h-6 w-6 text-primary"}),r.jsx(wn,{className:"text-2xl",children:"Admin Login"})]}),r.jsx(Ln,{children:"Sign in with your passkey to access the admin console"})]}),r.jsxs(fn,{children:[r.jsxs("div",{className:"space-y-4",children:[a.length>0&&!c&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ht,{children:"Select your account"}),a.map((v,C)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Fe,{type:"button",variant:"outline",className:"flex-1 justify-start h-auto py-3",onClick:()=>p(v.email||""),disabled:m||!v.email,children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-primary/10",children:r.jsx(Bs,{className:"h-5 w-5 text-primary"})}),r.jsx("div",{className:"flex flex-col items-start",children:v.displayName&&v.displayName!==v.email?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-medium",children:v.displayName}),r.jsx("span",{className:"text-xs text-muted-foreground",children:v.role?M_(v.role):v.email})]}):v.role?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-medium",children:M_(v.role)}),r.jsx("span",{className:"text-xs text-muted-foreground",children:v.email})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-medium",children:v.email}),r.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[r.jsx(gF,{className:"h-3 w-3"}),"Tap to sign in"]})]})})]})}),r.jsx(Fe,{type:"button",variant:"ghost",size:"icon",onClick:()=>b(v),disabled:m,className:"flex-shrink-0",children:r.jsx(gr,{className:"h-4 w-4"})})]},v.memberKey||v.email||C)),r.jsxs(Fe,{type:"button",variant:"ghost",className:"w-full",onClick:()=>d(!0),disabled:m,children:[r.jsx(Cr,{className:"mr-2 h-4 w-4"}),"Recover your account"]})]}),c&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"custom-email",children:"Admin Email"}),r.jsx(un,{id:"custom-email",type:"email",placeholder:"[email protected]",value:s,onChange:v=>o(v.target.value),disabled:m,autoComplete:"off",onKeyDown:v=>{v.key==="Enter"&&s.trim()&&p(s)}})]}),r.jsx(Fe,{type:"button",className:"w-full",onClick:()=>p(s),disabled:m||!s.trim(),children:m?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Authenticating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(gF,{className:"mr-2 h-4 w-4"}),"Sign In with Passkey"]})}),a.length>0&&r.jsx(Fe,{type:"button",variant:"ghost",className:"w-full",onClick:()=>{d(!1),o("")},disabled:m,children:"Back to saved accounts"})]}),m&&!c&&r.jsx("div",{className:"flex items-center justify-center py-4",children:r.jsxs("div",{className:"text-center",children:[r.jsx(on,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-primary"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Authenticating..."})]})})]}),r.jsxs("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:"Passkeys use Touch ID, Face ID, or security ke
4334ys"}),r.jsx("p",{className:"mt-1",children:"No passwords required"})]})]})]})}function SK(){const t=_r(),{isAuthenticated:e,checkAuth:n}=ia(),[a,i]=x.useState(!1);x.useEffect(()=>{e&&t("/admin/dashboard")},[e,t]),x.useEffect(()=>{if(!a)return;const d=setInterval(async()=>{try{const m=await fetch("/api/admin-status");m.ok&&(await m.json()).enabled&&i(!1)}catch{}},1e3);return()=>clearInterval(d)},[a]);const s=async()=>{await n(),t("/admin/dashboard")},o=()=>{i(!0)};return a?r.jsx(ku,{isConnected:!1,showImmediately:!0}):r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-muted/20 to-primary/10 flex items-center justify-center p-4",children:r.jsxs("div",{className:"w-full max-w-md space-y-8",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-4",children:r.jsx(Ra,{className:"h-8 w-8 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold tracking-tight",children:"XR Guild"}),r.jsx("p",{className:"mt-2 text-lg text-muted-foreground",children:"Admin Console"})]}),r.jsx(wK,{onAuthSuccess:s,onServerUnavailable:o}),r.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Secured with passkey authentication"})]})})}async function FK(){try{const t=await fetch("/api/tracks");if(!t.ok)throw new Error("Failed to fetch tracks");return(await t.json()).tracks}catch(t){return console.error("Error fetching tracks:",t),[]}}async function Bg(){return FK()}function CK(t,e){return x.useReducer((n,a)=>e[n][a]??n,t)}var Uw="ScrollArea",[nM]=Xa(Uw),[_K,ms]=nM(Uw),rM=x.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:a="hover",dir:i,scrollHideDelay:s=600,...o}=t,[c,d]=x.useState(null),[m,f]=x.useState(null),[p,b]=x.useState(null),[v,C]=x.useState(null),[S,F]=x.useState(null),[w,A]=x.useState(0),[N,P]=x.useState(0),[z,D]=x.useState(!1),[T,K]=x.useState(!1),B=Hn(e,O=>d(O)),k=uh(i);return r.jsx(_K,{scope:n,type:a,dir:k,scrollHideDelay:s,scrollArea:c,viewport:m,onViewportChange:f,content:p,onContentChange:b,scrollbarX:v,onScrollbarXChange:C,scrollbarXEnabled:z,onScrollbarXEnabledChange:D,scrollbarY:S,onScrollbarYChange:F,scrollbarYEnabled:T,onScrollbarYEnabledChange:K,onCornerWidthChange:A,onCornerHeightChange:P,children:r.jsx(Tn.div,{dir:k,...o,ref:B,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});rM.displayName=Uw;var aM="ScrollAreaViewport",iM=x.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:a,nonce:i,...s}=t,o=ms(aM,n),c=x.useRef(null),d=Hn(e,c,o.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),r.jsx(Tn.div,{"data-radix-scroll-area-viewport":"",...s,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:r.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});iM.displayName=aM;var jo="ScrollAreaScrollbar",zw=x.forwardRef((t,e)=>{const{forceMount:n,...a}=t,i=ms(jo,t.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,c=t.orientation==="horizontal";return x.useEffect(()=>(c?s(!0):o(!0),()=>{c?s(!1):o(!1)}),[c,s,o]),i.type==="hover"?r.jsx(EK,{...a,ref:e,forceMount:n}):i.type==="scroll"?r.jsx(kK,{...a,ref:e,forceMount:n}):i.type==="auto"?r.jsx(sM,{...a,ref:e,forceMount:n}):i.type==="always"?r.jsx(Gw,{...a,ref:e}):null});zw.displayName=jo;var EK=x.forwardRef((t,e)=>{const{forceMount:n,...a}=t,i=ms(jo,t.__scopeScrollArea),[s,o]=x.useState(!1);return x.useEffect(()=>{const c=i.scrollArea;let d=0;if(c){const m=()=>{window.clearTimeout(d),o(!0)},f=()=>{d=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return c.addEventListener("pointerenter",m),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",m),c.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),r.jsx(Yi,{present:n||s,children:r.jsx(sM,{"data-state":s?"visible":"hidden",...a,ref:e})})}),kK=x.forwardRef((t,e)=>{const{forceMount:n,...a}=t,i=ms(jo,t.__scopeScrollArea),s=t.orientation==="horizontal",o=Px(()=>d("SCROLL_END"),100),[c,d]=CK("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(c==="idle"){const m=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(m)}},[c,i.scrollHideDelay,d]),x.useEffect(()=>{const m=i.viewport,f=s?"scrollLeft":"scrollTop";if(m){let p=m[f];const b=()=>{const v=m[f];p!==v&&(d("SCROLL"),o()),p=v};return m.addEventListener("scroll",b),()=>m.removeEventListener("scroll",b)}},[i.viewport,s,d,o]),r.jsx(Yi,{present:n||c!=="hidden",children:r.jsx(Gw,{"data-state":c==="hidden"?"hidden":"visible",...a,ref:e,onPointerEnter:vn(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:vn(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),sM=x.forwardRef((t,e)=>{const n=ms(jo,t.__scopeScrollArea),{forceMount:a,...i}=t,[s,o]=x.useState(!1),c=t.orientation==="horizontal",d=Px(()=>
vendor: 4,317 bytes, line 4334
4334{if(n.viewport){const m=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?m:f)}},10);return eh(n.viewport,d),eh(n.content,d),r.jsx(Yi,{present:a||s,children:r.jsx(Gw,{"data-state":s?"visible":"hidden",...i,ref:e})})}),Gw=x.forwardRef((t,e)=>{const{orientation:n="vertical",...a}=t,i=ms(jo,t.__scopeScrollArea),s=x.useRef(null),o=x.useRef(0),[c,d]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=dM(c.viewport,c.content),f={...a,sizes:c,onSizesChange:d,hasThumb:m>0&&m<1,onThumbChange:b=>s.current=b,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:b=>o.current=b};function p(b,v){return DK(b,o.current,c,v)}return n==="horizontal"?r.jsx(AK,{...f,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const b=i.viewport.scrollLeft,v=R_(b,c,i.dir);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollLeft=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollLeft=p(b,i.dir))}}):n==="vertical"?r.jsx(NK,{...f,ref:e,onThumbPositionChange:()=>{if(i.viewport&&s.current){const b=i.viewport.scrollTop,v=R_(b,c);s.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:b=>{i.viewport&&(i.viewport.scrollTop=b)},onDragScroll:b=>{i.viewport&&(i.viewport.scrollTop=p(b))}}):null}),AK=x.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...i}=t,s=ms(jo,t.__scopeScrollArea),[o,c]=x.useState(),d=x.useRef(null),m=Hn(e,d,s.onScrollbarXChange);return x.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),r.jsx(lM,{"data-orientation":"horizontal",...i,ref:m,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Dx(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,p)=>{if(s.viewport){const b=s.viewport.scrollLeft+f.deltaX;t.onWheelScroll(b),mM(b,p)&&f.preventDefault()}},onResize:()=>{d.current&&s.viewport&&o&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Ug(o.paddingLeft),paddingEnd:Ug(o.paddingRight)}})}})}),NK=x.forwardRef((t,e)=>{const{sizes:n,onSizesChange:a,...i}=t,s=ms(jo,t.__scopeScrollArea),[o,c]=x.useState(),d=x.useRef(null),m=Hn(e,d,s.onScrollbarYChange);return x.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),r.jsx(lM,{"data-orientation":"vertical",...i,ref:m,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Dx(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,p)=>{if(s.viewport){const b=s.viewport.scrollTop+f.deltaY;t.onWheelScroll(b),mM(b,p)&&f.preventDefault()}},onResize:()=>{d.current&&s.viewport&&o&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Ug(o.paddingTop),paddingEnd:Ug(o.paddingBottom)}})}})}),[TK,oM]=nM(jo),lM=x.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:m,onWheelScroll:f,onResize:p,...b}=t,v=ms(jo,n),[C,S]=x.useState(null),F=Hn(e,B=>S(B)),w=x.useRef(null),A=x.useRef(""),N=v.viewport,P=a.content-a.viewport,z=ua(f),D=ua(d),T=Px(p,10);function K(B){if(w.current){const k=B.clientX-w.current.left,O=B.clientY-w.current.top;m({x:k,y:O})}}return x.useEffect(()=>{const B=k=>{const O=k.target;C?.contains(O)&&z(k,P)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[N,C,P,z]),x.useEffect(D,[a,D]),eh(C,T),eh(v.content,T),r.jsx(TK,{scope:n,scrollbar:C,hasThumb:i,onThumbChange:ua(s),onThumbPointerUp:ua(o),onThumbPositionChange:D,onThumbPointerDown:ua(c),children:r.jsx(Tn.div,{...b,ref:F,style:{position:"absolute",...b.style},onPointerDown:vn(t.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),w.current=C.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),K(B))}
vendor: 4,242 bytes, line 4334
4334),onPointerMove:vn(t.onPointerMove,K),onPointerUp:vn(t.onPointerUp,B=>{const k=B.target;k.hasPointerCapture(B.pointerId)&&k.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=A.current,v.viewport&&(v.viewport.style.scrollBehavior=""),w.current=null})})})}),Og="ScrollAreaThumb",cM=x.forwardRef((t,e)=>{const{forceMount:n,...a}=t,i=oM(Og,t.__scopeScrollArea);return r.jsx(Yi,{present:n||i.hasThumb,children:r.jsx(MK,{ref:e,...a})})}),MK=x.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:a,...i}=t,s=ms(Og,n),o=oM(Og,n),{onThumbPositionChange:c}=o,d=Hn(e,p=>o.onThumbChange(p)),m=x.useRef(void 0),f=Px(()=>{m.current&&(m.current(),m.current=void 0)},100);return x.useEffect(()=>{const p=s.viewport;if(p){const b=()=>{if(f(),!m.current){const v=PK(p,c);m.current=v,c()}};return c(),p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[s.viewport,f,c]),r.jsx(Tn.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:vn(t.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),C=p.clientX-v.left,S=p.clientY-v.top;o.onThumbPointerDown({x:C,y:S})}),onPointerUp:vn(t.onPointerUp,o.onThumbPointerUp)})});cM.displayName=Og;var Hw="ScrollAreaCorner",uM=x.forwardRef((t,e)=>{const n=ms(Hw,t.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?r.jsx(RK,{...t,ref:e}):null});uM.displayName=Hw;var RK=x.forwardRef((t,e)=>{const{__scopeScrollArea:n,...a}=t,i=ms(Hw,n),[s,o]=x.useState(0),[c,d]=x.useState(0),m=!!(s&&c);return eh(i.scrollbarX,()=>{const f=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(f),d(f)}),eh(i.scrollbarY,()=>{const f=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(f),o(f)}),m?r.jsx(Tn.div,{...a,ref:e,style:{width:s,height:c,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Ug(t){return t?parseInt(t,10):0}function dM(t,e){const n=t/e;return isNaN(n)?0:n}function Dx(t){const e=dM(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=(t.scrollbar.size-n)*e;return Math.max(a,18)}function DK(t,e,n,a="ltr"){const i=Dx(n),s=i/2,o=e||s,c=i-o,d=n.scrollbar.paddingStart+o,m=n.scrollbar.size-n.scrollbar.paddingEnd-c,f=n.content-n.viewport,p=a==="ltr"?[0,f]:[f*-1,0];return hM([d,m],p)(t)}function R_(t,e,n="ltr"){const a=Dx(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-i,o=e.content-e.viewport,c=s-a,d=n==="ltr"?[0,o]:[o*-1,0],m=Im(t,d);return hM([0,o],[0,c])(m)}function hM(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const a=(e[1]-e[0])/(t[1]-t[0]);return e[0]+a*(n-t[0])}}function mM(t,e){return t>0&&t<e}var PK=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},a=0;return(function i(){const s={left:t.scrollLeft,top:t.scrollTop},o=n.left!==s.left,c=n.top!==s.top;(o||c)&&e(),n=s,a=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(a)};function Px(t,e){const n=ua(t),a=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),x.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,e)},[n,e])}function eh(t,e){const n=ua(e);fa(()=>{let a=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(a),i.unobserve(t)}}},[t,n])}var fM=rM,jK=iM,LK=uM;const pM=x.forwardRef(({className:t,children:e,...n},a)=>r.jsxs(fM,{ref:a,className:ln("relative overflow-hidden",t),...n,children:[r.jsx(jK,{className:"h-full w-full rounded-[inherit]",children:e}),r.jsx(gM,{}),r.jsx(LK,{})]}));pM.displayName=fM.displayName;const gM=x.forwardRef(({className:t,orientation:e="vertical",...n},a)=>r.jsx(zw,{ref:a,orientation:e,className:ln("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:r.jsx(cM,{className:"relative flex-1 rounded-full bg-border"})}));gM.displayName=zw.displayName;function xM({open:t,onOpenChange:e,members:n,invalidNames:a,activatedHandles:i,sessionId:s,adminEmail
4334:o,onApprovalComplete:c,filterMemberKey:d,filterMemberName:m}){const{toast:f}=nr(),[p,b]=x.useState(!1),[v,C]=x.useState(new Map),[S,F]=x.useState(new Set),w=x.useRef([]),A=x.useRef(new Map);x.useEffect(()=>{t&&(C(new Map),F(new Set),w.current=[],A.current=new Map)},[t]);const N=x.useMemo(()=>n.filter(j=>{if(!j.memberKey||!j.requestedEmail?.names?.length||j.guildEmail)return!1;const U=j.requestedEmail.status;return!(U&&U!=="requested"||d&&j.memberKey!==d)}),[n,d]),P=x.useMemo(()=>{const j=new Set;for(const U of n)U.requestedEmail?.approvedHandle&&j.add(U.requestedEmail.approvedHandle.toLowerCase());return j},[n]),z=x.useMemo(()=>{const j=new Map;for(const U of N){const q=U.firstName||"",Y=U.lastName||"",W=U.preferredName||"",H=q.toLowerCase().replace(/[^a-z]/g,""),J=Y.toLowerCase().replace(/[^a-z]/g,""),ie=W.toLowerCase().replace(/[^a-z]/g,""),Q=(U.requestedEmail?.names||[]).map(Me=>Me.toLowerCase().trim()).filter(Me=>Me.length>0).filter(Me=>!a.has(Me)&&!S.has(Me)).filter(Me=>!i.has(Me)).filter(Me=>!P.has(Me)),ve=`${H}.${J}`,pe=ie&&!a.has(ie)&&!S.has(ie)&&!i.has(ie)&&!P.has(ie)?ie:null;j.set(U.memberKey,{memberKey:U.memberKey,name:`${q} ${Y}`.trim()||U.email,firstName:q,lastName:Y,preferredName:W,allHandles:Q,suggestedHandle:ve,preferredHandle:pe})}return j},[N,a,S,i,P]),D=x.useMemo(()=>{const j=new Set;for(const[,U]of v)j.add(U);return j},[v]),T=x.useMemo(()=>{const j=[],U=new Map,q=new Set;for(const[Y,W]of v){const H=z.get(W);H&&(q.add(Y),U.has(Y)||U.set(Y,[]),U.get(Y).some(J=>J.memberKey===W)||U.get(Y).push(H))}for(const[Y,W]of z)if(!D.has(Y))if(d){const H=W.allHandles[0];H&&(U.has(H)||U.set(H,[]),U.get(H).some(J=>J.memberKey===Y)||U.get(H).push(W))}else{let H=null;for(const J of W.allHandles){const ie=v.get(J);if(!ie||ie===Y){H=J;break}}H||(W.preferredHandle&&!v.has(W.preferredHandle)&&!P.has(W.preferredHandle)?H=W.preferredHandle:!v.has(W.suggestedHandle)&&!a.has(W.suggestedHandle)&&!i.has(W.suggestedHandle)&&!P.has(W.suggestedHandle)&&(H=W.suggestedHandle)),H&&(U.has(H)||U.set(H,[]),U.get(H).some(J=>J.memberKey===Y)||U.get(H).push(W))}for(const[Y,W]of U)j.push({handle:Y,members:W,hasConflict:W.length>1});if(w.current.length===0){j.sort((Y,W)=>Y.hasConflict&&!W.hasConflict?-1:!Y.hasConflict&&W.hasConflict?1:Y.handle.localeCompare(W.handle)),w.current=j.map(Y=>Y.handle);for(const Y of j)for(const W of Y.members)A.current.set(W.memberKey,Y.handle)}else{const Y=new Map(j.map(J=>[J.handle,J])),W=[],H=new Set;for(const J of w.current){const ie=Y.get(J);if(ie){W.push(ie),H.add(J);for(const Q of ie.members)A.current.set(Q.memberKey,J)}}for(const J of j)if(!H.has(J.handle)){let ie=W.length;for(const Q of J.members){const ve=A.current.get(Q.memberKey);if(ve){const pe=W.findIndex(Me=>Me.handle===ve);pe!==-1&&pe+1<ie&&(ie=pe+1)}}W.splice(ie,0,J),H.add(J.handle),w.current.splice(ie,0,J.handle);for(const Q of J.members)A.current.set(Q.memberKey,J.handle)}j.length=0,j.push(...W)}if(!d){const Y=new Map(v);let W=!1;for(const H of j)!H.hasConflict&&H.members.length===1&&(Y.has(H.handle)||(Y.set(H.handle,H.members[0].memberKey),W=!0));W&&setTimeout(()=>C(Y),0)}return j},[z,D,v,a,i,d]),K=async j=>{F(U=>new Set(U).add(j)),C(U=>{const q=new Map(U);return q.delete(j),q});try{const U=await fetch("/api/admin/invalid-names/add",{method:"POST",headers:{"Content-Type":"application/json","x-admin-se
4334ssion":adminSession},body:JSON.stringify({handle:j})});if(!U.ok){const q=await U.json();throw new Error(q.message||"Failed to ban handle")}f({title:"Handle Banned",description:`"${j}" has been added to the banned list`})}catch(U){F(q=>{const Y=new Set(q);return Y.delete(j),Y}),f({title:"Error",description:`Failed to ban handle: ${U instanceof Error?U.message:"Unknown error"}`,variant:"destructive"})}},B=(j,U)=>{C(q=>{const Y=new Map(q);return U===""?Y.delete(j):Y.set(j,U),Y})},k=async()=>{if(v.size===0){f({title:"No Selections",description:"Please select at least one email to approve",variant:"destructive"});return}b(!0);try{const j=Array.from(v.entries()).map(([Y,W])=>({memberKey:W,approvedHandle:Y})),U=await fetch("/api/admin/approve-email-requests",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":s},body:JSON.stringify({approvals:j,approvedBy:o})}),q=await U.json();if(U.ok&&q.success){const Y=q.results.filter(H=>H.success).length,W=q.results.length-Y;f({title:"Approval Complete",description:`${Y} email(s) approved${W>0?`, ${W} failed`:""}. Notification emails sent.`}),e(!1),c?.()}else f({title:"Error",description:q.message||"Failed to approve emails",variant:"destructive"})}catch(j){console.error("Error approving emails:",j),f({title:"Error",description:"An error occurred while approving emails",variant:"destructive"})}finally{b(!1)}},O=v.size,I=T.some(j=>j.hasConflict&&!v.has(j.handle));return r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"max-w-3xl max-h-[80vh]",children:[r.jsxs(ha,{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Cr,{className:"h-5 w-5"}),r.jsx(ma,{children:d?`Approve Guild Email for ${m}`:"Approve Guild Email Requests"})]}),r.jsx(Fa,{children:d?"Review and approve email requests for this member.":"Review and approve pending email requests. Click a name to assign the handle to them."})]}),T.length===0&&D.size===0?r.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[r.jsx(Cr,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),r.jsx("p",{children:"No pending email requests"})]}):r.jsx(pM,{className:"h-[400px]",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{className:"sticky top-0 bg-background border-b",children:r.jsxs("tr",{className:"text-left text-muted-foreground",children:[r.jsx("th",{className:"py-2 px-2 font-medium",children:"Requested Handle"}),r.jsx("th",{className:"py-2 px-2 font-medium",children:"Requestor(s)"}),r.jsx("th",{className:"py-2 px-2 font-medium w-20",children:"Status"})]})}),r.jsx("tbody",{children:T.map(j=>{const U=v.get(j.handle),q=d&&j.members.length===1,Y=q?j.members[0]:null,W=Y?Array.from(v.entries()).find(([,H])=>H===Y.memberKey)?.[0]:null;return r.jsxs("tr",{className:`border-b ${j.hasConflict&&!U?"bg-orange-50 dark:bg-orange-950/20":""}`,children:[r.jsx("td",{className:"py-2 px-2 align-top",children:q&&Y?r.jsx("div",{className:"flex flex-wrap gap-2",children:Y.allHandles.map(H=>{const J=W===H;return r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs("button",{type:"button",onClick:()=>B(H,Y.memberKey),className:`font-mono text-xs px-1.5 py-0.5 rounded transition-colors ${J?"bg-primary text-primary-foreground font-medium":"bg-muted hover:bg-muted/80 cursor-pointer"}`,title:`Select ${H}@xrguild.org`,children:[H,"@"]}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>K(H),className:"h-5 w-5 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",title:"Ban this email handle",children:r.jsx(gr,{className:"h-3 w-3"})})]},H)})}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("code",{className:"font-mono text-xs bg-muted px-1.5 py-0.5 rounded",children:[j.handle,"@"]}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>K(j.handle),className:"h-5 w-5 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",title:"Ban this email handle",children:r.jsx(gr,{className:"h-3 w-3"})})]})}),r.jsx("td",{className:"py-2 px-2 align-top",children:r.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:q&&Y?r.jsx("span",{className:"text-sm",children:Y.name}):j.members.map((H,J)=>{const ie=U===H.memberKey;return r.jsxs("span",{className:"inline-flex items-center",children:[r.jsx("button",{type:"button",onClick:()=>B(j.handle,H.memberKey),className:`text-sm px-1.5 py-0.5 rounded transition-colors ${ie?"bg-primary text-primary-foreground font-medium":"hover:bg-muted cursor-pointer"}`,title:`Select ${H.name} for ${j.handle}@xrguild.org`,children:H.name}),H.allHandles.length>1&&r.jsx(Lr,{delayDuration:100,children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("span",{className:"ml-1 text-xs text-muted-foreground cursor-help px-1",children:["+",H.allHandles.length-1]})}),r.jsx(Ir,{children:r.jsxs("p",{className:"text-xs",children:["Also requested: ",H.allHandles.filter(Q=>
4334Q!==j.handle).join(", ")]})})]})}),J<j.members.length-1&&r.jsx("span",{className:"text-muted-foreground mx-0.5",children:"·"})]},H.memberKey)})})}),r.jsx("td",{className:"py-2 px-2 align-top",children:q?W?r.jsx(an,{variant:"outline",className:"text-xs text-green-600 border-green-300",children:"✓"}):r.jsx(an,{variant:"outline",className:"text-xs text-muted-foreground",children:"Pick one"}):j.hasConflict&&!U?r.jsxs(an,{variant:"destructive",className:"gap-1 text-xs",children:[r.jsx(ah,{className:"h-3 w-3"}),"Pick one"]}):U?r.jsx(an,{variant:"outline",className:"text-xs text-green-600 border-green-300",children:"✓"}):r.jsx(an,{variant:"outline",className:"text-xs text-green-600 border-green-300",children:"Ready"})})]},j.handle)})})]})}),r.jsxs(_o,{className:"gap-2",children:[r.jsx(Fe,{variant:"outline",onClick:()=>e(!1),disabled:p,children:"Cancel"}),r.jsxs(Fe,{onClick:k,disabled:p||O===0||I,title:I?"Resolve all conflicts before approving":void 0,children:[p&&r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Approve ",O," Email",O!==1?"s":""]})]})]})})}function IK({member:t,allMembers:e,sessionId:n,adminEmail:a,onApprovalComplete:i}){const[s,o]=x.useState(!1),[c,d]=x.useState(new Set),[m,f]=x.useState(new Set);x.useEffect(()=>{s&&c.size===0&&p()},[s]);const p=async()=>{try{const K=await fetch("/api/admin/email-validation-data",{method:"GET",headers:{"Content-Type":"application/json","x-session-id":n}});if(K.ok){const B=await K.json();d(new Set(B.invalidNames||[])),f(new Set(B.activatedHandles||[]))}}catch(K){console.error("Error fetching validation data:",K)}},b=()=>{o(!0)},v=()=>{i?.(),o(!1)},C=t.guildEmail,S=t.requestedEmail,F=S?.names||[],w=S?.approvedHandle,A=S?.status,N=S?.error,P=C?.trim(),z=F.length>0,D=t.preferredName||[t.firstName,t.lastName].filter(Boolean).join(" ")||t.email;let T;if(P){const K=C.replace("@xrguild.org",""),B=S?.useGuildEmail;let k=A;B?k="primary":!A&&C&&(k="legacy");const O=k?` (${k})`:"";T=r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{className:"font-mono text-xs cursor-pointer px-2 py-1 rounded hover:bg-muted text-center",onClick:b,children:[K,O&&r.jsx("span",{className:"block text-[10px] text-muted-foreground",children:O})]})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:B?"Primary guild email":k?`Guild email (${k})`:"Activated guild email"})})]})})}else if(A&&w){const B={approved:{label:"approved",tooltip:"Approved, awaiting notification"},notified:{label:"notified",tooltip:"Member notified, awaiting activation"},activated:{label:"activated",tooltip:"Account created, awaiting verification"},verified:{label:"verified",tooltip:"Email verified, ready to set as primary"},error:{label:"error",tooltip:N||"Error during approval"}}[A]||{label:A,tooltip:`Status: ${A}`};T=r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{className:"font-mono text-xs cursor-pointer px-2 py-1 rounded hover:bg-muted text-center",onClick:b,children:[w,r.jsxs("span",{className:"block text-[10px] text-muted-foreground",children:["(",B.label,")"]})]})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:B.tooltip})})]})})}else if(z){const K=F.length;T=r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs(Fe,{variant:"ghost",size:"sm",className:"h-7 px-3 text-xs",onClick:b,children:[K," requested"]})}),r.jsx(Ir,{children:r.jsxs("p",{className:"text-xs",children:["Click to approve: ",F.join(", ")]})})]})})}else T=r.jsx("div",{className:"text-muted-foreground text-xs text-center px-2 py-1",children:"-"});return r.jsxs(r.Fragment,{children:[T,r.jsx(xM,{open:s,onOpenChange:o,members:e,invalidNames:c,activatedHandles:m,sessionId:n,adminEmail:a,onApprovalComplete:v,filterMemberKey:t.memberKey,filterMemberName:D})]})}function BK({open:t,onOpenChange:e,recipients:n,defaultSubject:a="",defaultBody:i="",adminGuildEmail:s,canSendAsAdmin:o=!1,ccOptions:c=[]}){const[d,m]=x.useState(a),[f,p]=x.useState(i),[b,v]=x.useState(!1),[C,S]=x.useState(new Set),[F,w]=x.useState(""),{toast:A}=nr(),N=Po();x.useEffect(()=>{t&&(m(a),p(i),S(new Set),w(""))},[t,a,i]);const P=()=>{const O=Array.from(C);if(F.trim()){const I=F.split(",").map(j=>j.trim()).filter(j=>j);O.push(...I)}return O},z=O=>{S(I=>{const j=new Set(I);return j.has(O)?j.delete(O):j.add(O),j})},D=async()=>{const O=`Subject: ${d}
4335
4336${f}`;try{await navigator.clipboard.writeText(O),A({title:"Copied to clipboard",description:"Email content copied with subject line"})}catch{A({variant:"destructive",title:"Copy failed",description:"Could not copy to clipboard"})}},T=()=>{const O=n.join(","),I=P();let j=`mailto:${O}?subject=${encodeURIComponent(d)}&body=${encodeURIComponent(f)}`;I.length>0&&(j+=`&cc=${encodeURIComponent(I.join(","))}`),window.location.href=j},K=async()=>
4336{if(!s||!o)return;v(!0);const O=P();try{const I=await N("/api/admin/send-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:n,cc:O.length>0?O:void 0,subject:d,body:f,from:s})});if(!I.ok){const j=await I.json();throw new Error(j.message||"Failed to send email")}A({title:"Email sent",description:`Sent to ${n.length} recipient${n.length!==1?"s":""}`}),e(!1)}catch(I){A({variant:"destructive",title:"Send failed",description:I.message||"Could not send email"})}finally{v(!1)}},B=n.length,k=B<=3?n.join(", "):`${n.slice(0,3).join(", ")} and ${B-3} more`;return r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"sm:max-w-[700px] w-[95vw]",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Compose Email"}),r.jsxs(Fa,{children:["To: ",k," (",B," recipient",B!==1?"s":"",")"]})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[c.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{children:"CC"}),r.jsx("div",{className:"flex flex-wrap gap-3 p-2 bg-muted/50 rounded-md",children:c.map(O=>r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ar,{checked:C.has(O.email),onCheckedChange:()=>z(O.email)}),r.jsx("span",{title:O.email,children:O.label})]},O.email))}),r.jsx(un,{value:F,onChange:O=>w(O.target.value),placeholder:"Other CCs (comma-separated emails)",className:"text-sm"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"email-subject",children:"Subject"}),r.jsx(un,{id:"email-subject",value:d,onChange:O=>m(O.target.value),placeholder:"Enter subject line..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"email-body",children:"Message"}),r.jsx(zi,{id:"email-body",value:f,onChange:O=>p(O.target.value),placeholder:"Enter your message...",rows:10,className:"font-mono text-sm"})]})]}),r.jsxs(_o,{className:"flex-col sm:flex-row gap-2",children:[r.jsxs(Fe,{variant:"outline",onClick:()=>e(!1),children:[r.jsx(gr,{className:"h-4 w-4 mr-2"}),"Cancel"]}),r.jsxs(Fe,{variant:"outline",onClick:D,children:[r.jsx(ex,{className:"h-4 w-4 mr-2"}),"Copy"]}),r.jsxs(Fe,{variant:"outline",onClick:T,children:[r.jsx(Cr,{className:"h-4 w-4 mr-2"}),"Native Email"]}),r.jsxs(Fe,{onClick:K,disabled:!o||b||!d.trim(),title:o?void 0:"Requires verified guild email to send directly",children:[b?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(tx,{className:"h-4 w-4 mr-2"}),"Send",s?` as ${s}`:""]})]})]})})}function jx(t={}){const{onReload:e,debounceMs:n=1e3}=t,[a,i]=x.useState([]),[s,o]=x.useState(!1),[c,d]=x.useState(!1),m=x.useRef(null),f=x.useRef(e);x.useEffect(()=>{f.current=e},[e]),x.useEffect(()=>{const v=C=>{const{memberKey:S,timestamp:F}=C.detail;i(w=>w.find(N=>N.memberKey===S)?w.map(N=>N.memberKey===S?{...N,timestamp:F||Date.now()}:N):[...w,{memberKey:S,timestamp:F||Date.now()}])};return window.addEventListener("ws-member-updated",v),()=>{window.removeEventListener("ws-member-updated",v)}},[]),x.useEffect(()=>{if(!(!s||a.length===0||c))return m.current&&clearTimeout(m.current),m.current=setTimeout(async()=>{if(f.current){d(!0);try{await f.current(),i([])}catch(v){console.error("[useProfileChanges] Auto-reload failed:",v)}finally{d(!1)}}},n),()=>{m.current&&clearTimeout(m.current)}},[s,a.length,c,n]);const p=x.useCallback(v=>{o(v!==void 0?v:C=>!C)},[]),b=x.useCallback(async()=>{if(!c){d(!0);try{f.current&&await f.current(),i([])}catch(v){throw console.error("[useProfileChanges] Manual reload failed:",v),v}finally{d(!1)}}},[c]);return{pendingCount:a.length,isWatching:s,isReloading:c,toggleWatch:p,triggerReload:b,changedMemberKeys:a.map(v=>v.memberKey)}}function vM({viewAllTracks:t=!1}){const e=_r(),{toast:n}
4336=nr(),{isAuthenticated:a,adminEmail:i,adminRole:s,adminTracks:o,sessionId:c,user:d,adminGuildEmail:m,canSendAsGuildEmail:f,logout:p}=ia(),b=Po(),[v,C]=x.useState(!0),[S,F]=x.useState([]),[w,A]=x.useState([]),[N,P]=x.useState([]),[z,D]=x.useState([]),[T,K]=x.useState({}),[B,k]=x.useState({}),[O,I]=x.useState(new Set),[j,U]=x.useState(null),[q,Y]=x.useState({}),[W,H]=x.useState({}),J=x.useRef({}),[ie,Q]=x.useState(!1),[ve,pe]=x.useState(""),[Me,We]=x.useState(""),[Ae,Ce]=x.useState(!1),[He,Ct]=x.useState([]),[bt,Rt]=x.useState(""),[zt,Ut]=x.useState(!1),{sendFieldChange:Bt}=rf(),re=jx({onReload:async()=>{const oe=await b("/api/admin/refreshCache",{method:"POST"});if(!oe.ok)throw new Error("Failed to refresh cache");const te=await oe.json(),ye=Array.isArray(te.members)?te.members:[];D(ye);const Re=w.map(async fe=>{const Se=S.find(je=>je.id===fe),Be=Se?.name||fe,Ze=ye.filter(je=>je.tracks?.includes(fe)),ue=ye.filter(je=>je.requestedTracks?.includes(fe)),rt=ye.filter(je=>je.leading?.includes(fe)||Se?.trackLeads?.includes(je.email));return{trackId:fe,trackName:Be,teamMembers:Ze,interestedMembers:ue,leads:rt}}),Le=await Promise.all(Re);P(Le),n({title:"Cache Refreshed",description:`Loaded ${ye.length} members from database`})}}),wt=(oe,te,ye)=>{F(Le=>Le.map(fe=>fe.id===oe?{...fe,[te]:ye}:fe));const Re=Array.isArray(ye)?JSON.stringify(ye):ye.toString();Bt("track",oe,te,`track:${oe}:${te}`,Re)},Nt=t?s==="SUPER_ADMIN"||s==="SUPPORT_ADMIN":s==="TRACK_LEAD"&&o.length>0;if(x.useEffect(()=>{a&&c&&Nt&&vt()},[a,c,Nt,t]),x.useEffect(()=>{if(!a||!c||!Nt)return;const oe=async()=>{try{const ye=await b("/api/admin/members");if(!ye.ok)return;const Re=await ye.json(),Le=Array.isArray(Re.members)?Re.members:[];P(fe=>fe.map(Se=>({...Se,teamMembers:Le.filter(Be=>Be.tracks?.includes(Se.trackId)),interestedMembers:Le.filter(Be=>Be.requestedTracks?.includes(Se.trackId)&&!Be.tracks?.includes(Se.trackId)),leads:Le.filter(Be=>Be.leading?.includes(Se.trackId))}))),D(Le),console.log("[TrackLeadDashboard] Polled for updates")}catch(ye){console.error("[TrackLeadDashboard] Poll error:",ye)}},te=setInterval(()=>{document.hidden||oe()},3e4);return()=>clearInterval(te)},[a,c,Nt]),x.useEffect(()=>()=>{Object.values(J.current).forEach(oe=>clearTimeout(oe))},[]),x.useEffect(()=>{const oe=()=>{document.hidden&&(console.log("[TrackLeadDashboard] Page hidden, canceling pending auto-saves"),Object.values(J.current).forEach(te=>clearTimeout(te)),J.current={})};return document.addEventListener("visibilitychange",oe),()=>{document.removeEventListener("visibilitychange",oe)}},[]),x.useEffect(()=>{const oe=te=>{const{memberKey:ye,member:Re}=te.detail;Re&&(D(Le=>Le.map(fe=>fe.memberKey===ye?{...fe,...Re}:fe)),P(Le=>Le.map(fe=>({...fe,teamMembers:fe.teamMembers.map(Se=>Se.memberKey===ye?{...Se,...Re}:Se),interestedMembers:fe.interestedMembers.map(Se=>Se.memberKey===ye?{...Se,...Re}:Se),leads:fe.leads.map(Se=>Se.memberKey===ye?{...Se,...Re}:Se)}))),console.log("[TrackLeadDashboard] Real-time update received for:",ye))};return window.addEventListener("ws-member-updated",oe),()=>{window.removeEventListener("ws-member-updated",oe)}},[]),x.useEffect(()=>{const oe=te=>{const{fieldKey:ye,value:Re,updatedBy:Le}=te.detail;console.log("[TrackLeadDashboard] Field updated by another client:",{fieldKey:ye,value:Re,updatedBy:Le});const fe=ye.split(":"),Se=fe[0];if(Se==="track"){const Be=fe[1],Ze=fe[2];F(ue=>ue.map(rt=>{if(rt.id===Be){let je=Re;if(Ze==="autoWelcome"||Ze==="useDefaultWelcome")je=Re==="true"||Re===!0;else if(Ze==="minHours")je=parseFloat(Re)||0;else if(Ze==="ccList")try{je=typeof Re=="string"?JSON.parse(Re):Re}catch(_t){console.error("Failed to parse ccList:",_t),je=[]}return{...rt,[Ze]:je}}return rt})),n({title:"Track Updated",description:`Field "${Ze}" was updated by ${Le}`})}else if(Se==="member-notes"){const Be=fe[1],Ze=fe[2];Y(ue=>({...ue,[Be]:{...ue[Be],[Ze]:{notes:Re}}})),n({title:"Notes Updated",description:`Member notes were updated by ${Le}`})}};return window.addEventListener("ws-field-updated",oe),()=>{window.removeEventListener("ws-field-updated",oe)}},[n]),!a)return null;const vt=async()=>{try{C(!0);try{const ye=await b("/api/admin/special-users");if(ye.ok){const Re=await ye.json();Ct(Re.specialUsers?.trackLeads||[])}}catch(ye){console.error("Error loading special users:",ye)}const oe=await Bg();F(oe);const te=t?oe.map(ye=>ye.id):o;A(te),await Tt(te,oe)}catch(oe){console.error("Error loading track lead dashboard:",oe),n({variant:"destructive",title:"Error",description:"Failed to load dashboard data"})}finally{C(!1)}},Tt=async(oe,te)=>{try{const ye=await b("/api/admin/members");if(!ye.ok)throw new Error("Failed to fetch members");const Re=await ye.json();if(!Re||!Re.members)throw console.error("Invalid members response:",Re),new Error("Invalid response from members API");const Le=Array.isArray(Re.members)?Re.members:[];console.log(`Loaded ${Le.length} members for track stats`),D(Le);const fe=oe.map(async ue=>{try{const rt=await b(`/api/admin/track-notes?trackId=${ue}`);if(rt.ok){const je=await rt.json();return{trackId:ue,memberNotes:je.memberNotes||{}}}}catch(rt){console.error(`Error loading notes for track ${ue}:`,rt)}return{trackId:ue,memberNotes:{}}}),Se=await Promise.all(fe),Be={};Se.forEach(ue=>{Be[ue.trackId]=ue.memberNotes}),Y(Be);const Ze=oe.map(ue=>{const rt=te.find(je=>je.id===ue);return{trackId:ue,trackName:rt?.name||ue,teamMembers:Le.filter(je=>je.tracks?.includes(ue)),interestedMembers:Le.filter(je=>je.requestedTracks?.includes(ue)&&!je.tracks?.includes(ue)),leads:Le.filter(je=>je.leading?.includes(ue))}});P(Ze)}catch(ye){throw console.error("Error loading track stats:",ye),ye}},Wt=oe=>{K(te=>te[oe]?{...te,[oe]:!1}:{[oe]:!0})},Dt=(oe,te)=>`${oe}:${te}`,jt=()=>{const oe=new Set;for(const te of O){const ye=te.split(":").slice(1).join(":");oe.add(ye)}return Array.from(oe)},he=()=>{const oe=new Set;for(const te of O){const ye=te.split(":")[0];oe.add(ye)}return Array.from(oe)},ee=(oe,te)=>O.has(Dt(oe,te)),ze=(oe,te)=>{const ye=Dt(oe,te);I(Re=>{const Le=new Set(Re);return Le.has(ye)?Le.delete(ye):Le.add(ye),Le})},Ve=()=>{Ut(!0)},lt=()=>{I(new Set)},qe=(oe,te)=>{const ye=te.map(Le=>Dt(oe,Le.email)),Re=ye.every(Le=>O.has(Le));I(Le=>{const fe=new Set(Le);return Re?ye.forEach(Se=>fe.delete(Se)):ye.forEach(Se=>fe.add(Se)),fe})},It=(oe,te)=>te.filter(ye=>
4336ee(oe,ye.email)).length,gt=async()=>{await p(),n({title:"Logged Out",description:"You have been successfully logged out"}),e("/admin/login")},Ee=oe=>{const ye=(N.find(fe=>fe.trackId===oe)?.leads||[]).map(fe=>fe.memberKey).filter(Boolean),Re=He.map(fe=>fe.memberKey);return[...new Set([...ye,...Re])]},Je=(oe,te,ye)=>{const Re=S.find(Se=>Se.id===oe);if(!Re)return;let Le=Re.ccList||Ee(oe),fe;ye?fe=[...new Set([...Le,te])]:fe=Le.filter(Se=>Se!==te),wt(oe,"ccList",fe)},$e=oe=>{if(!oe.welcomeMessage)return;const te=d?.firstName||"Jane",ye=d?.lastName||"Doe",Re=i||"[email protected]",fe=N.find(je=>je.trackId===oe.id)?.leads.map(je=>je.preferredName?.split(" ")[0]||je.firstName).filter(Boolean)||[];let Se="Track Leads";if(fe.length===1)Se=fe[0];else if(fe.length===2)Se=`${fe[0]} and ${fe[1]}`;else if(fe.length>2){const je=fe[fe.length-1];Se=`${fe.slice(0,-1).join(", ")} and ${je}`}let Be=`Welcome to ${oe.name}`,Ze=oe.welcomeMessage;const ue=oe.welcomeMessage.match(/^subject:\s*(.+?)(?:\r?\n|$)/i);ue&&(Be=ue[1].trim(),Ze=oe.welcomeMessage.substring(ue[0].length).trim());const rt=je=>je.replace(/\{name\}/g,te).replace(/\{firstName\}/g,te).replace(/\{lastName\}/g,ye).replace(/\{preferredName\}/g,te).replace(/\{email\}/g,Re).replace(/\{trackName\}/g,oe.name).replace(/\{leads\}/g,Se).replace(/\{member\}/g,te).replace(/\{track\}/g,oe.name);pe(rt(Be)),We(rt(Ze)),Q(!0)}
4336,Xe=async oe=>{if(!(!oe.welcomeMessage||!i)){Ce(!0);try{const te=await b("/api/admin/test-track-welcome",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackId:oe.id,welcomeMessage:oe.welcomeMessage,trackName:oe.name,recipientEmail:i})}),ye=await te.json();te.ok&&ye.success?n({title:"Test Email Sent",description:`Welcome email sent to ${i}`}):n({variant:"destructive",title:"Error",description:ye.message||"Failed to send test email"})}catch(te){console.error("Error sending test welcome:",te),n({variant:"destructive",title:"Error",description:"An error occurred while sending test email"})}finally{Ce(!1)}}},X=async(oe,te)=>{try{U(oe);const ye=await b("/api/admin/accept-track-member",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberEmail:oe,trackId:te})});if(!ye.ok)throw new Error("Failed to accept member");const Re=await ye.json();I(Le=>new Set(Le).add(oe)),P(Le=>Le.map(fe=>{if(fe.trackId!==te)return fe;const Se=fe.interestedMembers.find(Ze=>Ze.email===oe);if(!Se)return fe;const Be={...Se,tracks:[...Se.tracks||[],te],requestedTracks:(Se.requestedTracks||[]).filter(Ze=>Ze!==te)};return{...fe,teamMembers:[...fe.teamMembers,Be],interestedMembers:fe.interestedMembers.filter(Ze=>Ze.email!==oe)}})),n({title:"✓ Member Accepted",description:Re.emailSent?"Added to team and welcome email sent!":"Added to team and email list. Remember to send a welcome message!"})}catch(ye){console.error("Error accepting member:",ye),n({variant:"destructive",title:"Error",description:"Failed to accept member"})}finally{U(null)}},ke=(oe,te)=>{const ye=S.find(Le=>Le.id===oe);if(!ye)return null;const Re=W[oe];return r.jsxs("div",{className:"space-y-6 p-2 md:p-4",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold border-b pb-2",children:"Track Information"}),r.jsx("div",{children:r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"name",value:ye.name,onChange:Le=>{F(fe=>fe.map(Se=>Se.id===oe?{...Se,name:Le}:Se))},type:"input",label:"Track Name",disabled:Re,inputProps:{placeholder:"Track name..."}})}),r.jsx("div",{children:r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"pitch",value:ye.pitch||"",onChange:Le=>{F(fe=>fe.map(Se=>Se.id===oe?{...Se,pitch:Le}:Se))},type:"input",label:"Pitch (one-line summary)",disabled:Re,inputProps:{placeholder:"Brief track pitch..."}})}),r.jsx("div",{children:r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"description",value:ye.description,onChange:Le=>{F(fe=>fe.map(Se=>Se.id===oe?{...Se,description:Le}:Se))},type:"textarea",label:"Description",disabled:Re,textareaProps:{placeholder:"Track description...",className:"min-h-[150px] resize-none"}})}),r.jsx("div",{children:r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"meetingCadence",value:ye.meetingCadence||"",onChange:Le=>{F(fe=>fe.map(Se=>Se.id===oe?{...Se,meetingCadence:Le}:Se))},type:"input",label:"Meeting Time / Cadence",disabled:Re,inputProps:{placeholder:"e.g., Every Tuesday at 2pm PT"}})}),r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"minHours",value:(ye.minHours??1).toString(),onChange:Le=>{const fe=Math.max(0,Math.min(5,parseFloat(Le)||0));F(Se=>Se.map(Be=>Be.id===oe?{...Be,minHours:fe}:Be))},type:"input",label:"Min Hours (per month)",disabled:Re,inputProps:{type:"number",min:"0",max:"5",step:"0.5",placeholder:"e.g., 2",className:"w-24"},helperText:"(0-5 hours)"}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("label",{className:"text-sm font-medium whitespace-nowrap",children:"Digest Frequency:"}),r.jsxs("select",{value:ye.digestFrequency??"weekly",onChange:Le=>{const fe=Le.target.value;F(Se=>Se.map(Be=>Be.id===oe?{...Be,digestFrequency:fe}:Be)),wt(oe,"digestFrequency",fe)},disabled:Re,className:"px-3 py-2 border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[r.jsx("option",{value:"none",children:"None (no digests)"}),r.jsx("option",{value:"daily",children:"Daily"}),r.jsx("option",{value:"weekly",children:"Weekly"}),r.jsx("option",{value:"test-10min",children:"Test (every 10 min)"}),r.jsx("option",{value:"test-1min",children:"Test (every 1 min)"})]}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Periodic email summary of track membership changes"})]}),ye.googleGroup&&r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium block mb-1",children:"Google Group"}),r.jsxs("div",{className:"p-3 bg-muted/30 rounded-md",children:[r.jsxs("a",{href:`mailto:${ye.googleGroup}`,className:"text-primary hover:underline font-medium flex items-center gap-2",children:[r.jsx(Cr,{className:"h-4 w-4"}),ye.googleGroup]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Click to compose email to this group"})]})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"text-sm font-medium block mb-2",children:["CC 
4336List for Track Emails",r.jsx("span",{className:"block text-xs font-normal text-muted-foreground mt-1",children:"Select who receives CCs when track emails are sent"})]}),r.jsx("div",{className:"space-y-2 bg-muted/30 p-3 rounded-md",children:(()=>{const Le=ye.ccList||Ee(oe),Se=(N.find(je=>je.trackId===oe)?.leads||[]).filter(je=>je.memberKey).map(je=>({memberKey:je.memberKey,email:je.guildEmail||je.email,displayName:je.preferredName||je.firstName||je.email,isGuildEmail:!!je.guildEmail})),Be=He.map(je=>({memberKey:je.memberKey,email:je.email,displayName:je.displayName,isGuildEmail:je.email.endsWith("@xrguild.org"),isSpecialUser:!0})),Ze=[...Se,...Be],ue=new Set;return Ze.filter(je=>ue.has(je.memberKey)?!1:(ue.add(je.memberKey),!0)).map(je=>{const _t=Le.includes(je.memberKey);return r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[r.jsx("input",{type:"checkbox",checked:_t,onChange:Kt=>Je(oe,je.memberKey,Kt.target.checked),className:"w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",disabled:Re}),r.jsxs("span",{children:[je.displayName," (",je.email,")"]}),je.isGuildEmail&&r.jsx(an,{variant:"outline",className:"text-xs",children:"Guild"}),"isSpecialUser"in je&&je.isSpecialUser&&r.jsx(an,{variant:"secondary",className:"text-xs",children:"Coordinator"})]},je.memberKey)})})()})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-start justify-between mb-1",children:[r.jsxs("label",{className:"text-sm font-medium",children:["Welcome Message Template",r.jsx("span",{className:"block text-xs font-normal text-muted-foreground mt-1",children:'Start with "subject: Your Subject" on first line'})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[r.jsx("input",{type:"checkbox",checked:ye.autoWelcome??!1,onChange:Le=>{wt(oe,"autoWelcome",Le.target.checked)},className:"w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",disabled:Re}),"Automatic Welcome on Member Profile Change"]}),r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[r.jsx("input",{type:"checkbox",checked:ye.useDefaultWelcome??!1,onChange:async Le=>{const fe=Le.target.checked;if(!fe&&!ye.welcomeMessage){let Se=bt;if(!Se)try{const Be=await b("/api/admin/email-templates/track-welcome-default");Be.ok&&(Se=(await Be.json()).template?.emailText||"",Rt(Se))}catch{}if(Se){F(Be=>Be.map(Ze=>Ze.id===oe?{...Ze,useDefaultWelcome:fe,welcomeMessage:Se}:Ze)),wt(oe,"useDefaultWelcome",fe),wt(oe,"welcomeMessage",Se);return}}wt(oe,"useDefaultWelcome",fe)},className:"w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",disabled:Re}),"Use Default Track Welcome Email"]})]})]}),!ye.useDefaultWelcome&&r.jsx(Oi,{resource:"track",resourceId:oe,fieldName:"welcomeMessage",value:ye.welcomeMessage||"",onChange:Le=>{F(fe=>fe.map(Se=>Se.id===oe?{...Se,welcomeMessage:Le}:Se))},type:"textarea",disabled:Re,textareaProps:{placeholder:`subject: Welcome to {trackName}
4337
4338Hi {name},
4339
4340Welcome to our team!
4341
4342- {leads}`,className:"min-h-[150px] resize-none font-mono text-sm"}}),ye.useDefaultWelcome&&r.jsx("div",{className:"p-4 bg-muted/30 rounded-md border border-dashed",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"This track uses the default welcome email template managed by administrators."})}),r.jsxs("div",{className:"mt-2",children:[r.jsx("span",{className:"text-xs font-medium",children:"Available Variables:"}),r.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{name}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{firstName}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{lastName}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{preferredName}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{email}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{trackName}"}),r.jsx("code",{className:"px-2 py-0.5 bg-muted rounded text-xs",children:"{leads}"})]})]}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>$e(ye),disabled:!ye.welcomeMessage||Re,className:"flex-1",children:[r.jsx(Fc,{className:"mr-2 h-4 w-4"}),"Preview"]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>Xe(ye),disabled:!ye.welcomeMessage||Re||Ae,className:"flex-1",children:[Ae?r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}):r.jsx(tx,{className:"mr-2 h-4 w-4"}),"Send Test to Me"]})]})]}),Re&&r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(on,{className:"w-3 h-3 animate-spin"}),"Saving track information..."]})]}),r.jsxs("div",{className:"space-y-3 border-t pt-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"Track Leads"}),te.length===0?r.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No track leads assigned"}):De(te,oe,"leads")]})]})},De=(oe,te,ye)=>{if(oe.length===0)return r.jsx("div",{className:"text-sm text-muted-foreground italic p-2 md:p-4",children:"No members in this category"});const Re=ye==="requested";return r.jsx("div",{className:"space-y-2 md:space-y-3 p-2 md:p-4",children:oe.map(Le=>{const fe=Le.preferredName||[Le.firstName,Le.middleName,Le.lastName].filter(
4342Boolean).join(" ")||"No name",Se=Le.memberKey||Le.email,Be=`${Se}-${te}`,Ze=B[Be],ue=ee(te,Le.email),rt=j===Le.email,je=q[te]?.[Se]?.notes||"";return r.jsx("div",{className:"border rounded-lg bg-card overflow-hidden",children:r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-0",children:[r.jsxs("div",{className:"md:border-r p-2 md:p-3 flex flex-row gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-2 w-24 flex-shrink-0 items-center",children:[r.jsx(Fe,{size:"sm",variant:"ghost",onClick:()=>ze(te,Le.email),className:`h-8 w-8 p-0 ${ue?"bg-green-600 hover:bg-green-700 text-white":"bg-black hover:bg-gray-800 text-white"}`,title:ue?"Remove from email list":"Add to email list",children:r.jsx(Cr,{className:"h-4 w-4"})}),r.jsx(IK,{member:Le,allMembers:z,sessionId:c||"",adminEmail:i||"",onApprovalComplete:()=>Tt(w,S)}),Re&&r.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>X(Le.email,te),disabled:rt,className:"h-8 gap-1 text-xs border-green-600 text-green-600 hover:bg-green-50 whitespace-nowrap",children:rt?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-3 w-3 animate-spin"}),"Welcoming..."]}):r.jsxs(r.Fragment,{children:[r.jsx(bo,{className:"h-3 w-3"}),"Welcome"]})})]}),r.jsx("div",{className:"flex-1",children:r.jsx(Fo,{name:fe,title:Le.jobTitle,company:Le.company,bio:Le.bio,profileImageUrl:Le.profileImageUrl,memberKey:Le.memberKey,variant:"compact"})})]}),r.jsx("div",{className:"border-t md:border-t-0 p-2 md:p-3 flex flex-col",children:r.jsx(Oi,{resource:"member-notes",resourceId:`${te}:${Se}`,fieldName:"notes",value:je,onChange:_t=>{Y(Kt=>({...Kt,[te]:{...Kt[te],[Se]:{notes:_t}}}
4342))},type:"textarea",disabled:Ze,textareaProps:{placeholder:"Add notes about this member...",className:"flex-1 min-h-[80px] resize-none"}})})]})},`${te}-${Le.email}`)})})};return!a||!Nt?null:v?r.jsx("div",{className:"min-h-screen flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx(on,{className:"w-12 h-12 animate-spin text-primary mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading dashboard..."})]})}):r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20",children:[r.jsx(tM,{}),r.jsx("header",{className:"border-b bg-card/50 backdrop-blur supports-[backdrop-filter]:bg-card/50",children:r.jsx("div",{className:"container mx-auto px-2 md:px-4 py-3 md:py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx(Ra,{className:"h-6 w-6 md:h-8 md:w-8 text-primary"}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-lg md:text-2xl font-bold",children:t?"Track Lead View (All Tracks)":"Track Lead Dashboard"}),r.jsx("p",{className:"text-xs md:text-sm text-muted-foreground hidden md:block",children:i})]})]}),r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsxs("div",{className:"hidden md:flex items-center gap-2 text-sm",children:[re.pendingCount>0?r.jsxs(an,{variant:"secondary",className:"bg-amber-100 text-amber-800 border-amber-200",children:[re.pendingCount," changed"]}):r.jsx("span",{className:"text-xs text-muted-foreground",children:"No pending changes"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:re.triggerReload,disabled:re.isReloading||re.pendingCount===0&&!re.isWatching,className:"gap-1 h-7 px-2",title:"Reload data from server",children:r.jsx(Rr,{className:`h-3 w-3 ${re.isReloading?"animate-spin":""}`})}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(ar,{id:"watch-changes-tl",checked:re.isWatching,onCheckedChange:oe=>re.toggleWatch(oe===!0),className:"h-3 w-3"}),r.jsx("label",{htmlFor:"watch-changes-tl",className:"text-xs cursor-pointer flex items-center gap-0.5",children:r.jsx(Fc,{className:"h-3 w-3"})})]})]}),O.size>0&&r.jsxs("div",{className:"flex items-center gap-1 md:gap-2",children:[r.jsxs(Fe,{variant:"default",size:"sm",onClick:Ve,className:"gap-1 md:gap-2 text-xs md:text-sm",children:[r.jsx(na,{className:"h-3 w-3 md:h-4 md:w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Email All"})," (",jt().length,")"]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:lt,className:"gap-1",title:"Clear all selections",children:[r.jsx(gr,{className:"h-3 w-3"}),r.jsx("span",{className:"hidden sm:inline",children:"Clear"})]})]}),r.jsx(an,{variant:"outline",className:"text-xs md:text-sm hidden md:inline-flex",children:"Track Lead"}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:gt,className:"gap-1 md:gap-2",children:[r.jsx(rh,{className:"h-3 w-3 md:h-4 md:w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Logout"})]})]})]})})}),r.jsx("main",{className:"container mx-auto px-2 md:px-4 py-4 md:py-8",children:r.jsxs("div",{className:"space-y-4 md:space-y-6",children:[w.length===0&&!t&&r.jsx(Ft,{className:"border-amber-200 bg-amber-50 dark:bg-amber-950/20",children:r.jsxs(bn,{children:[r.jsx(wn,{children:"No Tracks Assigned"}),r.jsx(Ln,{children:"You are not currently assigned to lead any tracks. Contact a super admin to get assigned."})]})}),N.map(oe=>{const te=`${oe.trackId}-leads`,ye=`${oe.trackId}-team`,Re=`${oe.trackId}-requested`,Le=T[te],fe=T[ye],Se=T[Re],Be=Le||fe||Se;return r.jsxs("div",{className:"space-y-3 md:space-y-4",children:[r.jsx("h2",{className:"text-xl md:text-2xl font-bold",children:oe.trackName}),r.jsxs("div",{className:"grid gap-3 md:gap-4 md:grid-cols-3",children:[r.jsx(Ft,{className:`cursor-pointer hover:shadow-lg transition-all ${Le?"ring-2 ring-green-500 shadow-lg":""}`,children:r.jsxs(bn,{onClick:()=>Wt(te),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(wn,{className:"flex items-center gap-2 text-lg",children:[r.jsx(Ra,{className:"h-5 w-5 text-green-600"}),"Admin"]}),Le?r.jsx(gl,{className:"h-5 w-5"}):r.jsx(Ja,{className:"h-5 w-5"})]}),r.jsx(Ln,{children:"Manage track info & leads"})]})}
4342),r.jsx(Ft,{className:`cursor-pointer hover:shadow-lg transition-all ${fe?"ring-2 ring-blue-500 shadow-lg":""}`,children:r.jsx(bn,{children:r.jsxs("div",{className:"flex items-center justify-between",onClick:()=>Wt(ye),children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs(wn,{className:"flex items-center gap-2 text-lg",children:[r.jsx(na,{className:"h-5 w-5 text-blue-600"}),"Members"]}),r.jsxs(Ln,{children:[oe.teamMembers.length," active members",It(oe.trackId,oe.teamMembers)>0&&r.jsxs("span",{className:"ml-1",children:["(",It(oe.trackId,oe.teamMembers)," selected)"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Fe,{variant:"ghost",size:"sm",onClick:Ze=>{Ze.stopPropagation(),qe(oe.trackId,oe.teamMembers)},className:"h-8 w-8 p-0",title:It(oe.trackId,oe.teamMembers)===oe.teamMembers.length?"Deselect all members":"Select all members",children:r.jsx(Cr,{className:"h-4 w-4"})}),fe?r.jsx(gl,{className:"h-5 w-5"}):r.jsx(Ja,{className:"h-5 w-5"})]})]})})}),r.jsx(Ft,{className:`cursor-pointer hover:shadow-lg transition-all ${Se?"ring-2 ring-amber-500 shadow-lg":""}`,children:r.jsx(bn,{children:r.jsxs("div",{className:"flex items-center justify-between",onClick:()=>Wt(Re),children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs(wn,{className:"flex items-center gap-2 text-lg",children:[r.jsx(na,{className:"h-5 w-5 text-amber-600"}),"Requested"]}),r.jsxs(Ln,{children:[oe.interestedMembers.length," requested",It(oe.trackId,oe.interestedMembers)>0&&r.jsxs("span",{className:"ml-1",children:["(",It(oe.trackId,oe.interestedMembers)," selected)"]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Fe,{variant:"ghost",size:"sm",onClick:Ze=>{Ze.stopPropagation(),qe(oe.trackId,oe.interestedMembers)},className:"h-8 w-8 p-0",title:It(oe.trackId,oe.interestedMembers)===oe.interestedMembers.length?"Deselect all requested members":"Select all requested members",children:r.jsx(Cr,{className:"h-4 w-4"})}),Se?r.jsx(gl,{className:"h-5 w-5"}):r.jsx(Ja,{className:"h-5 w-5"})]})]})})})]}),Be&&r.jsx(Ft,{children:r.jsxs(fn,{className:"pt-2 md:pt-6",children:[Le&&ke(oe.trackId,oe.leads),fe&&De(oe.teamMembers,oe.trackId,"team"),Se&&De(oe.interestedMembers,oe.trackId,"requested")]})})]},oe.trackId)})]})}),r.jsx(Sa,{open:ie,onOpenChange:Q,children:r.jsxs(da,{className:"max-w-2xl",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Welcome Email Preview"}),r.jsx(Fa,{children:"Preview of how the welcome email will look with sample data"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-semibold",children:"Subject:"}),r.jsx("p",{className:"mt-1 p-3 bg-muted rounded",children:ve})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-semibold",children:"Body:"}),r.jsx("pre",{className:"mt-1 p-3 bg-muted rounded whitespace-pre-wrap font-sans text-sm",children:Me})]})]})]})}),r.jsx(BK,{open:zt,onOpenChange:Ut,recipients:jt(),adminGuildEmail:m||void 0,canSendAsAdmin:f,ccOptions:(()=>{const oe=[],te=new Set,ye=i?.toLowerCase(),Re=new Set(he());for(const Le of N)if(Re.has(Le.trackId))for(const fe of Le.leads||[]){const Se=fe.email?.toLowerCase();if(Se&&!te.has(Se)&&Se!==ye){te.add(Se);const Be=fe.preferredName||fe.firstName||Se.split("@")[0];oe.push({email:fe.email,label:`${Be} (${Le.trackName})`,group:"Track Leads"})}}for(const Le of He){const fe=Le.email?.toLowerCase();fe&&!te.has(fe)&&fe!==ye&&(te.add(fe),oe.push({email:Le.email,label:Le.displayName||Le.email.split("@")[0],group:"Special"}))}return oe})()})]})}function OK(){const t=_r(),{toast:e}=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,logout:s}=ia();if(n&&i==="TRACK_LEAD")return r.jsx(vM,{});const o=d=>{t(d)},c=async()=>{await s(),e({title:"Logged Out",description:"You have been successfully logged out"}),t("/admin/login")};return n?r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20",children:[r.jsx("header",{className:"border-b bg-card/50 backdrop-blur supports-[backdrop-filter]:bg-card/50",children:r.jsx("div",{className:"container mx-auto px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ra,{className:"h-8 w-8 text-primary"}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold",children:"XR Guild Admin Console"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(an,{variant:"outline",className:"text-sm",children:i}),r.jsxs(Fe,{variant:"outline",onClick:c,className:"gap-2",children:[r.jsx(rh,{className:"h-4 w-4"}),"Logout"]})]})]})})}),r.jsxs("main",{className:"container mx-auto px-4 py-8",children:[r.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>o("/admin/members"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(na,{className:"h-5 w-5 text-primary"}),"Members"]}),r.jsx(Ln,{children:"View and manage guild members"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse all guild members, view profiles, and check verification status"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>o("/admin/tracks"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(gP,{className:"h-5 w-5 text-primary"}),"Tracks Overview"]}),r.jsx(Ln,{children:"View all tracks with members and leads"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"See all tracks with members, leads, and pending requests"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>o("/admin/track-lead-view"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(jy,{className:"h-5 w-5 text-primary"}),"Track Lead View"]}
4342),r.jsx(Ln,{children:"Manage tracks as a Track Lead"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Full track lead interface for all tracks: approve members, send welcome emails, edit settings"})})]}),i==="SUPER_ADMIN"&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>o("/admin/management"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Ra,{className:"h-5 w-5 text-primary"}),"Admins"]}),r.jsx(Ln,{children:"Manage admin accounts and roles"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Add/remove admins, assign roles, and manage passkeys"})})]}),i==="SUPER_ADMIN"&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer border-warning/50",onClick:()=>o("/admin/migration"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Fm,{className:"h-5 w-5 text-warning"}),"Migration"]}),r.jsx(Ln,{children:"Migrate old member data to new schema"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Review, fix, and commit migrated member data from legacy system"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN"||i==="TRACK_LEAD")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/track-activity"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(nP,{className:"h-5 w-5 text-primary"}),"Track Activity"]}),r.jsx(Ln,{children:"View track membership changes"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"See who joined, left, was promoted, or made changes to tracks"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/admin-service-logs"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(hP,{className:"h-5 w-5 text-primary"}),"Admin Service Logs"]}),r.jsx(Ln,{children:"View admin authentication logs"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Track admin logins, passkey changes, and permission updates"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/visitor-stats"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(lP,{className:"h-5 w-5 text-primary"}),"Visitor Stats"]}),r.jsx(Ln,{children:"Real-time traffic and sessions"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"View page views, unique visitors, and active sessions"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/email-templates"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Cr,{className:"h-5 w-5 text-primary"}),"Email Templates"]}),r.jsx(Ln,{children:"Edit automated email templates"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize emails sent to members for welcome, profile updates, and more"})})]}),(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/member-feedback"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Dy,{className:"h-5 w-5 text-primary"}),"Member Feedback"]}),r.jsx(Ln,{children:"Review feedback and aspirations"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"See what members are saying and what they hope to accomplish"})})]}),i==="SUPER_ADMIN"&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/security"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Ra,{className:"h-5 w-5 text-primary"}),"Security"]}),r.jsx(Ln,{children:"IP bans and fail2ban management"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"View banned IPs, unban, and manage whitelist"})})]}),i==="SUPER_ADMIN"&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>t("/admin/storage"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(p3,{className:"h-5 w-5 text-primary"}),"Storage"]}),r.jsx(Ln,{children:"R2 buckets — find and clean up orphan images"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Inspect bucket usage and remove image objects no record references"})})]}),i==="SUPER_ADMIN"&&r.jsxs(Ft,{className:"hover:shadow-lg transition-shadow cursor-pointer border-red-500/50 bg-red-50/50 dark:bg-red-950/20",onClick:()=>t("/admin/testing-tools"),children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2 text-red-600 dark:text-red-400",children:[r.jsx(ah,{className:"h-5 w-5"}),"Testing Tools"]}),r.jsx(Ln,{className:"text-red-900/70 dark:text-red-200/70",children:"Dangerous operations for testing only"})]}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Regenerate test data, clear Google Groups, and other destructive operations"})})]})]}),r.jsxs(Ft,{className:"mt-8 border-primary/20",children:[r.jsxs(bn,{children:[r.jsx(wn,{children:"Welcome to the Admin Console"}),r.jsx(Ln,{children:"This is the new passkey-based admin interface for XR Guild"})]}),r.jsxs(fn,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold mb-2",children:"Security Features"}),r.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-muted-foreground",children:[r.jsx("li",{children:"Passkey authentication (Touch ID, Face ID, security ke
4342ys)"}),r.jsx("li",{children:"Role-based access control"}),r.jsx("li",{children:"8-hour session expiration"}),r.jsx("li",{children:"Complete audit logging"}),r.jsx("li",{children:"Read-only admin permissions in database"})]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"font-semibold mb-2",children:["Your Access Level: ",i]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[i==="SUPER_ADMIN"&&"Full access to all admin functions including user management",i==="SUPPORT_ADMIN"&&"Access to member support and basic admin functions",i==="TRACK_LEAD"&&"View track members and grant email addresses"]})]})]})]})]})]}):null}function UK(){const[t]=G1(),e=_r(),{toast:n}=nr(),[a,i]=x.useState(""),[s,o]=x.useState([]),[c,d]=x.useState(null),[m,f]=x.useState(null),[p,b]=x.useState(""),[v,C]=x.useState(!1),[S,F]=x.useState(null),[w,A]=x.useState(null),[N,P]=x.useState(!0),[z,D]=x.useState(null),[T,K]=x.useState(!1),[B,k]=x.useState(!1);x.useEffect(()=>{const U=t.get("token");if(!U){n({variant:"destructive",title:"Invalid Setup Link",description:"No setup token found in URL"}),e("/admin/login");return}(async()=>{try{P(!0);const Y=await fetch(`/api/admin-auth/setup-token/${U}`),W=await Y.json();if(!Y.ok){D(W.message||"Invalid setup token"),n({variant:"destructive",title:"Invalid Setup Token",description:W.message||"This setup link is invalid or has expired"});return}o(W.emails||[]),i(W.primaryEmail||W.emails?.[0]||""),d(W.memberKey),f(W.memberName),A(W.role),F(U),K(W.hasExistingPasskeys||!1)}catch(Y){console.error("Failed to fetch token details:",Y),D("Failed to load setup token"),n({variant:"destructive",title:"Error",description:"Failed to load setup token details"})}finally{P(!1)}})()},[t,e,n]);const O=async()=>{if(!a.trim()){n({variant:"destructive",title:"Email Required",description:"Please enter your admin email address"});return}if(!p.trim()){n({variant:"destructive",title:"Device Name Required",description:"Please enter a name for this device"});return}if(!S){n({variant:"destructive",title:"Invalid Setup Token",description:"Setup token is missing"});return}C(!0);try{const U=await fetch("/api/admin-auth/passkey/registration-options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a.trim().toLowerCase(),setupToken:S})});if(!U.ok){const J=await U.json();throw new Error(J.message||"Failed to start registration")}const q=await U.json(),Y=q.options?.challenge||q.challenge,W=await rT(q.options||q),H=await fetch("/api/admin-auth/passkey/verify-registration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a.trim().toLowerCase(),response:W,challenge:Y,deviceName:p.trim(),setupToken:S})});if(!H.ok){const J=await H.json();throw new Error(J.message||"Registration failed")}c&&Xb(c,m||void 0,w||void 0,a),n({title:"Passkey Registered!",description:"Your passkey has been successfully registered. Redirecting to login..."}),setTimeout(()=>{e("/admin/login")},2e3)}catch(U){console.error("Registration error:",U),U.name==="NotAllowedError"?n({variant:"destructive",title:"Registration Cancelled",description:"You cancelled the passkey registration"}):n({variant:"destructive",title:"Registration Failed",description:U.message||"Failed to register passkey"})}finally{C(!1)}},I=async()=>{if(!S){n({variant:"destructive",title:"Invalid Setup Token",description:"Setup token is missing"});return}k(!0);try{const U=await fetch("/api/admin-auth/setup-authentication-options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupToken:S})});if(!U.ok){const J=await U.json();throw new Error(J.message||"Failed to start authentication")}const q=await U.json(),Y=q.options?.challenge||q.challenge,W=await jg(q.options||q),H=await fetch("/api/admin-auth/activate-with-passkey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupToken:S,response:W,challenge:Y})});if(!H.ok){const J=await H.json();throw new Error(J.message||"Activation failed")}c&&Xb(c,m||void 0,w||void 0,a),n({title:"Admin Access Activated!",description:"Your existing passkey has been verified. Redirecting to login..."}),setTimeout(()=>{e("/admin/login")},2e3)}catch(U){console.error("Authentication error:",U),U.name==="NotAllowedError"?n({variant:"destructive",title:"Authentication Cancelled",description:"You cancelled the passkey authentication"}):n({variant:"destructive",title:"Authentication Failed",description:U.message||"Failed to authenticate with passkey"})}finally{k(!1)}};if(N)return r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-muted/20 to-primary/10 flex items-center justify-center p-4",children:r.jsxs("div",{className:"text-center",children:[r.jsx(on,{className:"h-8 w-8 animate-spin mx-auto mb-4 text-primary"}),r.jsx("p",{className:"text-muted-foreground",children:"Loading setup details..."})]})});if(z||!S)return r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-muted/20 to-primary/10 flex items-center justify-center p-4",children:r.jsxs(Ft,{className:"w-full max-w-md",children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2 text-destructive",children:[r.jsx(po,{className:"h-5 w-5"}),"Invalid Setup Link"]}
4342),r.jsx(Ln,{children:z||"This setup link is invalid or has expired"})]}),r.jsx(fn,{children:r.jsx(Fe,{onClick:()=>e("/admin/login"),className:"w-full",children:"Go to Login"})})]})});const j=U=>({SUPER_ADMIN:"Super Admin",SUPPORT_ADMIN:"Support Admin",TRACK_LEAD:"Track Lead"})[U]||U;return r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-muted/20 to-primary/10 flex items-center justify-center p-4",children:r.jsxs("div",{className:"w-full max-w-md space-y-8",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-4",children:r.jsx(Ra,{className:"h-8 w-8 text-primary"})}),r.jsx("h1",{className:"text-4xl font-bold tracking-tight",children:"Admin Setup"}),r.jsx("p",{className:"mt-2 text-lg text-muted-foreground",children:"Register your first passkey"})]}),r.jsxs(Lw,{children:[r.jsx(po,{className:"h-4 w-4"}),r.jsxs(Iw,{children:["You're setting up ",w?j(w):"admin"," access for ",r.jsx("strong",{children:m||a}),". This is a one-time setup link."]})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsx(wn,{children:T?"Verify Your Identity":"Create Your Passkey"}),r.jsx(Ln,{children:T?"You already have a passkey registered. Verify your identity to activate admin access.":"Use Touch ID, Face ID, or a security key to secure your admin access"})]}),r.jsx(fn,{children:T?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted rounded-lg",children:[r.jsx(wg,{className:"h-8 w-8 text-primary"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"Existing passkey detected"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Use your registered passkey to verify and activate admin access"})]})]}),r.jsx(Fe,{className:"w-full",onClick:I,disabled:B,children:B?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):r.jsxs(r.Fragment,{children:[r.jsx(wg,{className:"mr-2 h-4 w-4"}),"Verify with Passkey"]})})]}):r.jsxs("form",{className:"space-y-4",onSubmit:U=>{U.preventDefault(),O()},children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"setup-email",children:"Admin Email"}),s.length>1?r.jsxs(Sl,{value:a,onValueChange:i,disabled:v,children:[r.jsx(To,{id:"setup-email",children:r.jsx(Fl,{placeholder:"Select an email"})}),r.jsx(Mo,{children:s.map(U=>r.jsx(ta,{value:U,children:U},U))})]}):r.jsx(un,{id:"setup-email",type:"email",value:a,readOnly:!0,disabled:!0,className:"bg-muted",autoComplete:"email"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:s.length>1?"Choose which email to use for login. You can use any of your emails.":`This passkey will be linked to ${a}`})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"setup-device-name",children:"Device Name"}),r.jsx(un,{id:"setup-device-name",type:"text",placeholder:"MacBook Pro, iPhone 13, etc.",value:p,onChange:U=>b(U.target.value),disabled:v}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose a name to identify this device"})]}),r.jsx(Fe,{type:"submit",className:"w-full",disabled:v,children:v?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating Passkey..."]}):"Create Passkey"})]})})]}),r.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"After registration, you'll be redirected to the login page"})]})})}const Ww=x.forwardRef(({className:t,...e},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:ln("w-full caption-bottom text-sm",t),...e})}));Ww.displayName="Table";const Vw=x.forwardRef(({className:t,...e},n)=>r.jsx("thead",{ref:n,className:ln("[&_tr]:border-b",t),...e}));Vw.displayName="TableHeader";const $w=x.forwardRef(({className:t,...e},n)=>r.jsx("tbody",{ref:n,className:ln("[&_tr:last-child]:border-0",t),...e}));$w.displayName="TableBody";const zK=x.forwardRef(({className:t,...e},n)=>r.jsx("tfoot",{ref:n,className:ln("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));zK.displayName="TableFooter";const jd=x.forwardRef(({className:t,...e},n)=>r.jsx("tr",{ref:n,className:ln("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));jd.displayName="TableRow";const uo=x.forwardRef(({className:t,...e},n)=>r.jsx("th",{ref:n,className:ln("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));uo.displayName="TableHead";const Ds=x.forwardRef(({className:t,...e},n)=>r.jsx("td",{ref:n,className:ln("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Ds.displayName="TableCell";const GK=x.forwardRef(({className:t,...e},n)=>r.jsx("caption",{ref:n,className:ln("mt-4 text-sm text-muted-foreground",t),...e}));GK.displayName="TableCaption";
4342function Lo({title:t,subtitle:e,adminEmail:n,adminRole:a,onLogout:i,backTo:s="/admin/dashboard",quickLinks:o=[],pendingChangesCount:c=0,isWatching:d=!1,isReloading:m=!1,onReload:f,onWatchChange:p}){const b=_r(),v=f||p;return r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Fe,{onClick:()=>b(s),variant:"outline",size:"icon",title:"Back",children:r.jsx(Zg,{className:"w-4 h-4"})}),r.jsx(Ra,{className:"h-8 w-8 text-primary"}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-3xl font-bold",children:t}),e&&r.jsx("p",{className:"text-sm text-muted-foreground",children:e})]})]}),v&&r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:c>0?r.jsxs(an,{variant:"secondary",className:"bg-amber-100 text-amber-800 border-amber-200",children:[c," profile",c!==1?"s":""," changed"]}):r.jsx("span",{className:"text-muted-foreground",children:"No pending changes"})}),f&&r.jsxs(Fe,{variant:"outline",size:"sm",onClick:f,disabled:m||c===0&&!d,className:"gap-1.5",title:"Reload data from server",children:[r.jsx(Rr,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),"Reload"]}),p&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(ar,{id:"watch-changes",checked:d,onCheckedChange:C=>p(C===!0)}),r.jsxs("label",{htmlFor:"watch-changes",className:"text-sm cursor-pointer flex items-center gap-1",children:[r.jsx(Fc,{className:"h-3.5 w-3.5"}),"Watch"]})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[o.length>0&&r.jsxs(r.Fragment,{children:[o.map((C,S)=>r.jsxs(Fe,{variant:"outline",onClick:()=>b(C.path),className:"gap-2",children:[C.icon,C.label]},S)),r.jsx("div",{className:"h-6 w-px bg-border"})]}),n?r.jsxs("div",{className:"text-right",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"Logged in as"}),r.jsx("div",{className:"font-semibold",children:n}),a?r.jsx(an,{variant:"outline",className:"mt-1",children:a}):null]}):null,i&&r.jsxs(Fe,{variant:"outline",onClick:i,children:[r.jsx(rh,{className:"h-4 w-4 mr-2"}),"Logout"]})]})]})}function yM({members:t,onSelect:e,placeholder:n="Search for a member...",maxResults:a=5,className:i,selectedMember:s,onClear:o}){const[c,d]=x.useState(""),[m,f]=x.useState(!1),[p,b]=x.useState(0),v=x.useRef(null),C=x.useRef(null),S=x.useMemo(()=>{if(!c.trim()||c.length<2)return[];const D=c.toLowerCase().trim().split(/\s+/);return t.filter(T=>{const K=(T.firstName||"").toLowerCase(),B=(T.lastName||"").toLowerCase(),k=(T.middleName||"").toLowerCase(),O=(T.preferredName||"").toLowerCase(),I=(T.email||"").toLowerCase(),j=(T.guildEmail||"").toLowerCase(),U=(T.requestedEmail?.names||[]).join(" ").toLowerCase(),q=(T.secondaryEmails||[]).join(" ").toLowerCase(),Y=`${K} ${B}`.trim();return D.every(W=>K.includes(W)||B.includes(W)||k.includes(W)||O.includes(W)||I.includes(W)||j.includes(W)||U.includes(W)||q.includes(W)||Y.includes(W))}).slice(0,a)},[t,c,a]);x.useEffect(()=>{const z=D=>{C.current&&!C.current.contains(D.target)&&v.current&&!v.current.contains(D.target)&&f(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]),x.useEffect(()=>{b(0)},[S]);const F=z=>{if(!(!m||S.length===0))switch(z.key){case"ArrowDown":z.preventDefault(),b(D=>Math.min(D+1,S.length-1));break;case"ArrowUp":z.preventDefault(),b(D=>Math.max(D-1,0));break;case"Enter":z.preventDefault(),S[p]&&w(S[p]);break;case"Escape":f(!1);break}},w=z=>{e(z),d(""),f(!1)},A=()=>{d(""),o&&o(),v.current?.focus()},N=z=>z.preferredName?`${z.preferredName} ${z.lastName||""}`.trim():`${z.firstName||""} ${z.lastName||""}`.trim()||z.email||"Unknown",P=z=>z.guildEmail||z.email||"";return s?r.jsx("div",{className:ln("relative",i),children:r.jsxs("div",{className:"flex items-center gap-2 p-2 border rounded-md bg-muted/50",children:[r.jsx(Bs,{className:"w-4 h-4 text-muted-foreground"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("span",{className:"font-medium",children:N(s)}),r.jsx("span",{className:"text-muted-foreground ml-2 text-sm",children:P(s)})]}),r.jsx("button",{type:"button",onClick:A,className:"p-1 hover:bg-muted rounded",children:r.jsx(gr,{className:"w-4 h-4 text-muted-foreground"})})]})}):r.jsxs("div",{className:ln("relative",i),children:[r.jsxs("div",{className:"relative",children:[r.jsx(Eu,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(un,{ref:v,type:"text",value:c,onChange:z=>{d(z.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:F,placeholder:n,className:"pl-9"})]}),m&&S.length>0&&r.jsx("div",{ref:C,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-lg max-h-60 overflow-auto",children:S.map((z,D)=>r.jsxs("button",{type:"button",onClick:()=>w(z),onMouseEnter:()=>b(D),className:ln("w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-muted",D===
4342p&&"bg-muted"),children:[r.jsx(Bs,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium truncate",children:N(z)}),r.jsx("div",{className:"text-sm text-muted-foreground truncate",children:P(z)})]})]},z.memberKey))}),m&&c.length>=2&&S.length===0&&r.jsxs("div",{ref:C,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-lg p-3 text-sm text-muted-foreground",children:['No members found matching "',c,'"']})]})}const lc=[{value:"ADMIN_LOGIN",label:"Login",color:"bg-green-100 text-green-800"},{value:"ADMIN_LOGOUT",label:"Logout",color:"bg-gray-100 text-gray-800"},{value:"ADMIN_LOGIN_FAILED",label:"Login Failed",color:"bg-red-100 text-red-800"},{value:"ADMIN_LOGIN_BLOCKED",label:"Login Blocked",color:"bg-orange-100 text-orange-800"},{value:"PASSKEY_REGISTERED",label:"Passkey Registered",color:"bg-blue-100 text-blue-800"},{value:"ADMIN_INVITED",label:"Admin Invited",color:"bg-purple-100 text-purple-800"},{value:"ADMIN_ROLE_CHANGED",label:"Role Changed",color:"bg-yellow-100 text-yellow-800"},{value:"ADMIN_IPS_UPDATED",label:"IPs Updated",color:"bg-indigo-100 text-indigo-800"},{value:"ADMIN_REMOVED",label:"Admin Removed",color:"bg-red-100 text-red-800"}];function bM({logs:t,loading:e=!1,title:n="Audit Logs",description:a,showEventFilters:i=!0,maxHeight:s="600px"}){const[o,c]=x.useState(""),[d,m]=x.useState(new Set(lc.map(S=>S.value))),f=S=>{const F=new Set(d);F.has(S)?F.delete(S):F.add(S),m(F)},p=()=>{d.size===lc.length?m(new Set):m(new Set(lc.map(S=>S.value)))},b=x.useMemo(()=>{let S=t;if(S=S.filter(F=>d.has(F.action)),o&&o.trim()){const F=o.trim();if(F.length>100)return S;const w=F.toLowerCase();S=S.filter(A=>{try{return!!(A.actorName?.toLowerCase().includes(w)||(A.actorEmail||A.adminEmail)?.toLowerCase().includes(w)||A.ipAddress?.toLowerCase().includes(w)||A.device?.toLowerCase().includes(w)||A.action?.toLowerCase().includes(w)||A.details&&JSON.stringify(A.details).toLowerCase().includes(w))}catch{return!1}})}return S},[t,o,d]),v=S=>lc.find(w=>w.value===S)?.color||"bg-gray-100 text-gray-800",C=S=>lc.find(w=>w.value===S)?.label||S;return r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(pP,{className:"w-5 h-5"}),n]}),a&&r.jsx(Ln,{children:a}),r.jsxs("div",{className:"relative mt-4",children:[r.jsx(Eu,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),r.jsx(un,{placeholder:"Search by email, IP, device, or event details...",value:o,onChange:S=>c(S.target.value),className:"pl-10"})]}),i&&r.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:p,className:`h-7 text-xs ${d.size===lc.length?"bg-green-600 text-white hover:bg-green-700 border-green-600":"border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:"All"}),lc.map(S=>r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>f(S.value),className:`h-7 text-xs ${d.has(S.value)?"bg-green-600 text-white hover:bg-green-700 border-green-600":"border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:S.label},S.value))]}),r.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["Showing ",b.length," of ",t.length," entries"]})]}),r.jsx(fn,{children:e?r.jsx("p",{className:"text-center text-gray-500 py-4",children:"Loading..."}):r.jsxs("div",{className:"space-y-1 overflow-y-auto",style:{maxHeight:s},children:[b.map((S,F)=>r.jsxs("div",{className:"px-3 py-2 bg-gray-50 rounded border border-gray-200 text-sm hover:bg-gray-100 transition-colors",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(an,{className:`${v(S.action)} text-xs`,children:C(S.action)}),r.jsx("span",{className:"font-medium text-gray-700",children:S.actorName||S.actorEmail||S.adminEmail})]}),r.jsx("span",{className:"text-xs text-gray-500",children:new Date(S.timestamp).toLocaleString()})]}),(S.details&&Object.keys(S.details).length>0||S.device)&&r.jsxs("div",{className:"mt-1 text-xs text-gray-500 flex gap-3",children:[S.details&&Object.keys(S.details).length>0&&r.jsx("span",{children:JSON.stringify(S.details)}),S.device&&r.jsxs("span",{children:["Device: ",S.device]})]})]},F)),b.length===0&&!e&&r.jsx("p",{className:"text-center text-gray-500 py-8",children:o||d.size<lc.length?"No logs match your filters":"No logs found"})]})})]})}function HK(){const t=_r(),{sessionId:e,user:n}=ia(),a=Po(),{toast:i}
4342=nr(),[s,o]=x.useState([]),[c,d]=x.useState([]),[m,f]=x.useState([]),[p,b]=x.useState([]),[v,C]=x.useState(!1),[S,F]=x.useState(!1),[w,A]=x.useState(!1),[N,P]=x.useState(null),[z,D]=x.useState("SUPPORT_ADMIN"),[T,K]=x.useState(!1),[B,k]=x.useState(!1),[O,I]=x.useState(""),[j,U]=x.useState(null),[q,Y]=x.useState(""),[W,H]=x.useState(null),[J,ie]=x.useState(!1),[Q,ve]=x.useState(null),[pe,Me]=x.useState(""),[We,Ae]=x.useState(!1),[Ce,He]=x.useState(new Set),[Ct,bt]=x.useState(!1),[Rt,zt]=x.useState(0),[Ut,Bt]=x.useState(!1),[re,wt]=x.useState(0),Nt=n?.role==="SUPER_ADMIN";x.useEffect(()=>{Nt&&(Dt(),jt(),vt(),Tt())},[Nt]);const vt=async()=>{try{const X=await Bg();f(X)}catch(X){console.error("Error loading tracks:",X)}},Tt=async()=>{try{const X=await a("/api/admin/members",{method:"GET"});if(X.ok){const ke=await X.json();b(ke.members||[])}}catch(X){console.error("Error loading members:",X)}},Wt=X=>X.map(ke=>m.find(oe=>oe.id===ke)?.name||ke);x.useEffect(()=>{if(!Ct||!Nt||!e)return;const X=setInterval(async()=>{try{const ke=await fetch(`/api/admin-auth/data-version?sessionId=${e}`);if(!ke.ok){console.error("Failed to poll data version");return}const oe=(await ke.json()).changeCounter;if(Rt===0){zt(oe);return}if(oe>Rt){const te=oe-Rt;wt(te),Bt(!0)}}catch(ke){console.error("Error polling data version:",ke)}},5e3);return()=>clearInterval(X)},[Ct,Nt,e,Rt]);const Dt=async()=>{try{C(!0);const X=await a("/api/admin-auth/admins",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e})});if(!X.ok)throw new Error("Failed to load admins");const ke=await X.json();o(ke.admins)}catch(X){i({variant:"destructive",title:"Error",description:X instanceof Error?X.message:"Failed to load admins"})}finally{C(!1)}},jt=async()=>{try{F(!0);const X=await a("/api/admin-auth/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,limit:200})});if(!X.ok)throw new Error("Failed to load logs");let De=(await X.json()).logs||[];if(Ce.size>0){const oe=new Set,te=new Set;s.forEach(ye=>{Ce.has(ye.memberKey)&&(ye.actorId!==void 0&&oe.add(ye.actorId),ye.allEmails&&ye.allEmails.forEach(Re=>te.add(Re.toLowerCase())),ye.email&&te.add(ye.email.toLowerCase()))}),De=De.filter(ye=>{if(ye.actorId!==void 0&&oe.has(ye.actorId))return!0;const Re=(ye.adminEmail||ye.actorEmail||"").toLowerCase();return Re&&te.has(Re)})}d(De.slice(0,20))}catch(X){i({variant:"destructive",title:"Error",description:X instanceof Error?X.message:"Failed to load logs"})}finally{F(!1)}},he=async()=>{await Promise.all([Dt(),jt()]);try{const X=await fetch(`/api/admin-auth/data-version?sessionId=${e}`);if(X.ok){const ke=await X.json();zt(ke.changeCounter)}}catch(X){console.error("Error updating counter after reload:",X)}Bt(!1),wt(0)},ee=async()=>{if(!w){A(!0);try{await Promise.all([Dt(),jt()])}finally{A(!1)}}},ze=async X=>{try{const ke=await fetch("/api/admin-auth/invite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,memberKey:X.memberKey,email:X.email,role:X.role})}),De=await ke.json();if(!ke.ok)throw new Error(De.message||"Failed to generate setup URL");const oe=De.setupUrl;let te=!1;try{await navigator.clipboard.writeText(oe),te=!0}catch(ye){console.error("Clipboard API failed:",ye);try{const Re=document.createElement("textarea");Re.value=oe,Re.style.position="fixed",Re.style.left="-999999px",Re.style.top="-999999px",document.body.appendChild(Re),Re.focus(),Re.select(),te=document.execCommand("copy"),document.body.removeChild(Re)}catch(Re){console.error("Fallback copy failed:",Re)}}i(te?{title:"Setup URL Copied",description:`Passkey registration URL for ${X.displayName||X.email} copied to clipboard`}:{title:"Setup URL Generated",description:oe,duration:15e3})}catch(ke){i({variant:"destructive",title:"Error",description:ke instanceof Error?ke.message:"Failed to generate setup URL"})}};x.useEffect(()=>{Nt&&jt()},[Ce]);const Ve=X=>{const ke=new Set(Ce);ke.has(X)?ke.delete(X):ke.add(X),He(ke)},lt=X=>{const ke=s.find(De=>De.memberKey===X);return ke?ke.role:null},qe=async X=>{if(X.preventDefault(),!N){i({variant:"destructive",title:"Validation Error",description:"Please select a member to invite"});return}if(z==="TRACK_LEAD"&&(!N.leading||N.leading.length===0)){i({variant:"destructive",title:"Validation Error",description:"This member does not lead any tracks. Assign track leadership in their profile first."});return}try{K(!0);const ke=await fetch("/api/admin-auth/invite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,memberKey:N.memberKey,role:z})}),De=await ke.json();if(!ke.ok)throw new Error(De.message||"Failed to invite admin");i({title:"Admin Invited",description:`Setup URL generated for ${N.firstName||N.lastName||"member"}`}),I(De.setupUrl),P(null),await Dt(),await jt()}catch(ke){i({variant:"destructive",title:"Invitation Failed",description:ke instanceof Error?ke.message:"Failed to invite admin"})}finally{K(!1)}},It=async()=>
4342{if(!N){i({variant:"destructive",title:"Validation Error",description:"Please select a member to invite"});return}if(z==="TRACK_LEAD"&&(!N.leading||N.leading.length===0)){i({variant:"destructive",title:"Validation Error",description:"This member does not lead any tracks. Assign track leadership in their profile first."});return}try{k(!0);const X=await fetch("/api/admin-auth/invite-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,memberKey:N.memberKey,role:z})}),ke=await X.json();if(!X.ok)throw new Error(ke.message||"Failed to send invite email");ke.emailSent?i({title:"Invite Email Sent",description:`Email sent to ${ke.recipientEmail}`}):(i({variant:"destructive",title:"Email Failed",description:ke.emailError||"Failed to send email, but setup URL was generated"}),I(ke.setupUrl)),P(null),await Dt(),await jt()}catch(X){i({variant:"destructive",title:"Invitation Failed",description:X instanceof Error?X.message:"Failed to send invite email"})}finally{k(!1)}},gt=async()=>{if(j){if(q==="TRACK_LEAD"&&(!j.tracks||j.tracks.length===0)){i({variant:"destructive",title:"Validation Error",description:"This member does not lead any tracks. Assign track leadership in their profile first."});return}try{const X=await fetch(`/api/admin-auth/admins/${j.memberKey}/role`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,newRole:q})}),ke=await X.json();if(!X.ok)throw new Error(ke.message||"Failed to update role");i({title:"Role Updated",description:`${j.displayName||j.email} is now ${q}${q==="TRACK_LEAD"&&j.tracks&&j.tracks.length>0?` for ${Wt(j.tracks).join(", ")}`:""}`}),U(null),await Dt(),await jt()}catch(X){i({variant:"destructive",title:"Update Failed",description:X instanceof Error?X.message:"Failed to update role"})}}},Ee=async()=>{if(W)try{ie(!0);const X=await fetch(`/api/admin-auth/admins/${W.memberKey}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e})}),ke=await X.json();if(!X.ok)throw new Error(ke.message||"Failed to remove admin");i({title:"Admin Removed",description:`${W.displayName||W.email} has been removed`}),H(null),await Dt(),await jt()}catch(X){i({variant:"destructive",title:"Removal Failed",description:X instanceof Error?X.message:"Failed to remove admin"})}finally{ie(!1)}},Je=async()=>{if(Q)try{Ae(!0);const X=pe.split(",").map(oe=>oe.trim()).filter(oe=>oe.length>0),ke=await fetch(`/api/admin-auth/admins/${Q.memberKey}/allowed-ips`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,allowedIPs:X})}),De=await ke.json();if(!ke.ok)throw new Error(De.message||"Failed to update allowed IPs");i({title:"Allowed IPs Updated",description:`IP restrictions updated for ${Q.displayName||Q.email}`}),ve(null),await Dt(),await jt()}catch(X){i({variant:"destructive",title:"Update Failed",description:X instanceof Error?X.message:"Failed to update allowed IPs"})}finally{Ae(!1)}},$e=X=>{navigator.clipboard.writeText(X),i({title:"Copied",description:"Setup URL copied to clipboard"})},Xe=X=>{const{role:ke,tracks:De}=X;return{SUPER_ADMIN:r.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 bg-red-100 dark:bg-red-900/50 text-red-800 dark:text-red-200 rounded text-xs font-medium",children:[r.jsx(Ra,{className:"w-3 h-3"})," Super Admin"]}),SUPPORT_ADMIN:r.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 bg-blue-100 dark:bg-blue-900/50 text-blue-800 dark:text-blue-200 rounded text-xs font-medium",children:[r.jsx(na,{className:"w-3 h-3"})," Support Admin"]}),TRACK_LEAD:r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded text-xs font-medium",children:[r.jsx(Fc,{className:"w-3 h-3"})," Track Lead"]}),X.tracks&&X.tracks.length>0&&r.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-300 px-2",children:Wt(X.tracks).join(", ")})]})}[ke]||ke};return Nt?r.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[r.jsx(Lo,{title:"Admin Management",subtitle:"Manage admin accounts and permissions",adminEmail
4342:n?.email,adminRole:n?.role,onLogout:async()=>{t("/admin/login")}}),r.jsxs("div",{className:"flex justify-end items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"watch-page",checked:Ct,onCheckedChange:X=>bt(X)}),r.jsx(Ht,{htmlFor:"watch-page",className:"text-sm cursor-pointer",children:"Watch this page"})]}),r.jsxs(Fe,{onClick:ee,variant:"outline",disabled:w,children:[r.jsx(Rr,{className:`w-4 h-4 mr-2 ${w?"animate-spin":""}`}),w?"Refreshing...":"Refresh"]})]}),Ut&&r.jsx("div",{className:"fixed top-4 right-4 z-50 max-w-md",children:r.jsx(Ft,{className:"border-primary shadow-lg",children:r.jsx(fn,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(u3,{className:"w-5 h-5 text-primary flex-shrink-0"}),r.jsx("div",{className:"flex-1",children:r.jsxs("p",{className:"text-sm font-medium",children:[re," ",re===1?"update":"updates"," since last refresh"]})}),r.jsx(Fe,{onClick:he,size:"sm",className:"ml-2",children:"Reload"})]})})})}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(bo,{className:"w-5 h-5"}),"Invite New Admin"]}),r.jsx(Ln,{children:"Generate a setup token and invite a new admin"})]}),r.jsxs(fn,{children:[r.jsxs("form",{onSubmit:qe,className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{children:"Select Member"}),r.jsx(yM,{members:p,onSelect:P,selectedMember:N,onClear:()=>{P(null)},placeholder:"Search by name or email...",className:"mt-1.5"})]}),r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"inviteRole",children:"Role"}),r.jsxs(Sl,{value:z,onValueChange:D,children:[r.jsx(To,{id:"inviteRole",children:r.jsx(Fl,{})}),r.jsxs(Mo,{children:[r.jsx(ta,{value:"SUPER_ADMIN",children:"Super Admin"}),r.jsx(ta,{value:"SUPPORT_ADMIN",children:"Support Admin"}),r.jsx(ta,{value:"TRACK_LEAD",children:"Track Lead"})]})]})]})]}),N&&(()=>{const X=lt(N.memberKey);return X?r.jsxs("div",{className:"p-2 bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded text-sm text-amber-800 dark:text-amber-200",children:["This member is already a ",r.jsx("strong",{children:X}),". Creating an invite will add a passkey."]}):null})(),z==="TRACK_LEAD"&&N&&r.jsxs("div",{children:[r.jsx(Ht,{className:"mb-2 block",children:"Tracks Led"}),r.jsx("div",{className:"flex flex-wrap gap-2 p-3 border rounded-md bg-muted/50",children:N.leading&&N.leading.length>0?N.leading.map(X=>{const ke=m.find(De=>De.id===X);return r.jsx(an,{variant:"secondary",className:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-200",children:ke?.name||X},X)}):r.jsx("span",{className:"text-sm text-muted-foreground",children:"This member does not lead any tracks"})}),(!N.leading||N.leading.length===0)&&r.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:"Assign track leadership in the member's profile first"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Fe,{type:"submit",disabled:T||B,children:T?"Generating...":"Generate Invite"}),r.jsx(Fe,{type:"button",variant:"secondary",disabled:T||B||!N,onClick:It,children:B?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Cr,{className:"mr-2 h-4 w-4"}),"Generate Email"]})})]})]}),O&&r.jsxs("div",{className:"mt-4 p-4 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded",children:[r.jsxs("div",{className:"flex justify-between items-start gap-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("p",{className:"text-sm font-medium text-green-900 dark:text-green-100 mb-1",children:"Setup URL Generated"}),r.jsx("code",{className:"text-xs text-green-800 dark:text-green-200 break-all",children:O})]}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>$e(O),children:r.jsx(dP,{className:"w-4 h-4"})})]}),r.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-2",children:"Send this URL to the new admin. It expires in 7 days and can only be used once."})]})]})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{children:["Current Admins (",s.length,")"]}),r.jsx(Ln,{children:"Manage admin accounts and their permissions"})]}),r.jsx(fn,{children:v?r.jsx("p",{className:"text-center text-gray-500 py-4",children:"Loading..."}):r.jsxs(Ww,{children:[r.jsx(Vw,{children:r.jsxs(jd,{children:[r.jsx(uo,{className:"w-12",children:r.jsx("span",{className:"sr-only",children:"Select"})}),r.jsx(uo,{children:"Email"}),r.jsx(uo,{children:"Role"}),r.jsx(uo,{children:"Passkeys"}),r.jsx(uo,{children:"Added"}),r.jsx(uo,{children:"Last Login"}),r.jsx(uo,{children:"Last Action"}),r.jsx(uo,{children:"Allowed IPs"})]})}),r.jsx($w,{children:s.map(X=>r.jsxs(jd,{children:[r.jsx(Ds,{children:r.jsx(ar,{checked:Ce.has(X.memberKey),onCheckedChange:()=>Ve(X.memberKey)})}),r.jsx(Ds,{className:"font-medium",children:r.jsxs("div",{children:[r.jsxs("div",{children:[X.displayName||X.email,r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(#",X.actorId,")"]})]}),X.displayName&&X.displayName!==X.email&&r.jsx("div",{className:"text-xs text-muted-foreground",children:X.email})]})}),r.jsx(Ds,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[Xe(X),X.memberKey!==n?.memberKey&&r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>{U(X),Y(X.role)},title:"Edit role",children:r.jsx(Sg,{className:"w-3 h-3"})})]})}),r.jsx(Ds,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{children:X.passkeyCount}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>ze(X),title:"Generate setup URL for additional passkey",className:"h-6 w-6 p-0",children:r.jsx(ko,{className:"w-3 h-3"})})]})}),r.jsx(Ds,{className:"text-sm text-gray-600 dark:text-gray-300",children:new Date(X.addedDate).toLocaleDateString()}),r.jsx(Ds,{className:"text-sm text-gray-600 dark:text-gray-300",children:X.lastLogin?new Date(X.lastLogin).toLocaleStr
4342ing():"Never"}),r.jsx(Ds,{className:"text-sm text-gray-600 dark:text-gray-300",children:X.lastAction?r.jsxs("div",{children:[r.jsx("div",{children:new Date(X.lastAction).toLocaleString()}),X.lastActionType&&r.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:X.lastActionType})]}):"Never"}),r.jsx(Ds,{className:"text-sm text-gray-600 dark:text-gray-300",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"flex-1",children:X.allowedIPs.length>0?X.allowedIPs.join(", "):"None"}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>{ve(X),Me(X.allowedIPs.join(", "))},title:"Edit allowed IPs",children:r.jsx(Sg,{className:"w-3 h-3"})})]})})]},X.memberKey))})]})})]}),Ce.size>0&&r.jsx(bM,{logs:c,loading:S,title:`Audit Logs for Selected Admin${Ce.size>1?"s":""}`,description:`Showing last 20 log entries for: ${Array.from(Ce).map(X=>{const ke=s.find(De=>De.memberKey===X);return ke?.displayName||ke?.email||X}).join(", ")}`,showEventFilters:!0,maxHeight:"500px"}),r.jsx(Sa,{open:!!j,onOpenChange:X=>!X&&U(null),children:r.jsxs(da,{className:"sm:max-w-[600px]",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Change Admin Role"}),r.jsxs(Fa,{children:["Update the role for ",j?.displayName||j?.email]})]}),r.jsxs("div",{className:"py-4 space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{htmlFor:"newRole",children:"New Role"}),r.jsxs(Sl,{value:q,onValueChange:Y,children:[r.jsx(To,{id:"newRole",children:r.jsx(Fl,{})}),r.jsxs(Mo,{children:[r.jsx(ta,{value:"SUPER_ADMIN",children:"Super Admin"}),r.jsx(ta,{value:"SUPPORT_ADMIN",children:"Support Admin"}),r.jsx(ta,{value:"TRACK_LEAD",children:"Track Lead"})]})]})]}),q==="TRACK_LEAD"&&j&&r.jsxs("div",{children:[r.jsx(Ht,{className:"mb-2 block",children:"Tracks Led"}),r.jsx("div",{className:"flex flex-wrap gap-2 p-3 border rounded-md bg-muted/50",children:j.tracks&&j.tracks.length>0?j.tracks.map(X=>{const ke=m.find(De=>De.id===X);return r.jsx(an,{variant:"secondary",className:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-200",children:ke?.name||X},X)}):r.jsx("span",{className:"text-sm text-muted-foreground",children:"This member does not lead any tracks"})}),(!j.tracks||j.tracks.length===0)&&r.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:"Assign track leadership in the member's profile first"})]})]}),r.jsxs(_o,{className:"flex justify-between items-center",children:[r.jsx(Fe,{variant:"destructive",onClick:()=>{j&&(H(j),U(null))},children:"Delete This Admin"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Fe,{variant:"outline",onClick:()=>U(null),children:"Cancel"}),r.jsx(Fe,{onClick:gt,children:"Update Role"})]})]})]})}),r.jsx(Sa,{open:!!W,onOpenChange:X=>!X&&H(null),children:r.jsxs(da,{children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Remove Admin"}),r.jsxs(Fa,{children:["Are you sure you want to remove ",W?.displayName||W?.email,"? This action cannot be undone."]})]}),r.jsxs(_o,{children:[r.jsx(Fe,{variant:"outline",onClick:()=>H(null),disabled:J,children:"Cancel"}),r.jsx(Fe,{variant:"destructive",onClick:Ee,disabled:J,children:J?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):"Remove Admin"})]})]})}),r.jsx(Sa,{open:!!Q,onOpenChange:X=>!X&&ve(null),children:r.jsxs(da,{children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Edit Allowed IP Addresses"}),r.jsxs(Fa,{children:["Configure which IP addresses ",Q?.displayName||Q?.email," can login from. Enter IP addresses separated by commas. Leave empty to allow all IPs."]})]}),r.jsxs("div",{className:"py-4",children:[r.jsx(Ht,{htmlFor:"allowedIPs",children:"Allowed IP Addresses"}),r.jsx(un,{id:"allowedIPs",placeholder:"192.168.1.1, 10.0.0.5, 203.0.113.42",value:pe,onChange:X=>Me(X.target.value),className:"mt-2"}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Current IPs: ",Q?.allowedIPs.length?Q.allowedIPs.join(", "):"None"]})]}),r.jsxs(_o,{children:[r.jsx(Fe,{variant:"outline",onClick:()=>ve(null),disabled:We,children:"Cancel"}),r.jsx(Fe,{onClick:Je,disabled:We,children:We?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update IPs"})]})]})})]}):r.jsx("div",{className:"max-w-7xl mx-auto p-6",children:r.jsx(Ft,{children:r.jsxs(bn,{children:[r.jsx(wn,{children:"Access Denied"}),r.jsx(Ln,{children:"Only SUPER_ADMIN can manage admin accounts"})]})})})}function yc(t,e){return typeof t=="function"?t(e):t}function Ki(t,e){return n=>{e.setState(a=>({...a,[t]:yc(n,a[t])}))}}function Lx(t){return t instanceof Function}function WK(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function VK(t,e){const n=[],a=i=>
vendor: 48,258 bytes, lines 4342-4345
4342{i.forEach(s=>{n.push(s);const o=e(s);o!=null&&o.length&&a(o)})};return a(t),n}function In(t,e,n){let a=[],i;return s=>{let o;n.key&&n.debug&&(o=Date.now());const c=t(s);if(!(c.length!==a.length||c.some((f,p)=>a[p]!==f)))return i;a=c;let m;if(n.key&&n.debug&&(m=Date.now()),i=e(...c),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-m)*100)/100,b=p/16,v=(C,S)=>{for(C=String(C);C.length<S;)C=" "+C;return C};console.info(`%c⏱ ${v(p,5)} /${v(f,5)} ms`,`
4343            font-size: .6rem;
4344            font-weight: bold;
4345            color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n?.key)}return i}}function Bn(t,e,n,a){return{debug:()=>{var i;return(i=t?.debugAll)!=null?i:t[e]},key:!1,onChange:a}}function $K(t,e,n,a){const i=()=>{var o;return(o=s.getValue())!=null?o:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(a),renderValue:i,getContext:In(()=>[t,n,e,s],(o,c,d,m)=>({table:o,column:c,row:d,cell:m,getValue:m.getValue,renderValue:m.renderValue}),Bn(t.options,"debugCells"))};return t._features.forEach(o=>{o.createCell==null||o.createCell(s,n,e,t)},{}),s}function KK(t,e,n,a){var i,s;const c={...t._getDefaultColumnDef(),...e},d=c.accessorKey;let m=(i=(s=c.id)!=null?s:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof c.header=="string"?c.header:void 0,f;if(c.accessorFn?f=c.accessorFn:d&&(d.includes(".")?f=b=>{let v=b;for(const S of d.split(".")){var C;v=(C=v)==null?void 0:C[S]}return v}:f=b=>b[c.accessorKey]),!m)throw new Error;let p={id:`${String(m)}`,accessorFn:f,parent:a,depth:n,columnDef:c,columns:[],getFlatColumns:In(()=>[!0],()=>{var b;return[p,...(b=p.columns)==null?void 0:b.flatMap(v=>v.getFlatColumns())]},Bn(t.options,"debugColumns")),getLeafColumns:In(()=>[t._getOrderColumnsFn()],b=>{var v;if((v=p.columns)!=null&&v.length){let C=p.columns.flatMap(S=>S.getLeafColumns());return b(C)}return[p]},Bn(t.options,"debugColumns"))};for(const b of t._features)b.createColumn==null||b.createColumn(p,t);return p}const Ya="debugHeaders";function D_(t,e,n){var a;let s={id:(a=n.id)!=null?a:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),o.push(d)};return c(s),o},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(o=>{o.createHeader==null||o.createHeader(s,t)}),s}const YK={createTable:t=>{t.getHeaderGroups=In(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a,i)=>{var s,o;const c=(s=a?.map(p=>n.find(b=>b.id===p)).filter(Boolean))!=null?s:[],d=(o=i?.map(p=>n.find(b=>b.id===p)).filter(Boolean))!=null?o:[],m=n.filter(p=>!(a!=null&&a.includes(p.id))&&!(i!=null&&i.includes(p.id)));return Yp(e,[...c,...m,...d],t)},Bn(t.options,Ya)),t.getCenterHeaderGroups=In(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a,i)=>(n=n.filter(s=>!(a!=null&&a.includes(s.id))&&!(i!=null&&i.includes(s.id))),Yp(e,n,t,"center")),Bn(t.options,Ya)),t.getLeftHeaderGroups=In(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,a)=>{var i;const s=(i=a?.map(o=>n.find(c=>c.id===o)).filter(Boolean))!=null?i:[];return Yp(e,s,t,"left")},Bn(t.options,Ya)),t.getRightHeaderGroups=In(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,a)=>{var i;const s=(i=a?.map(o=>n.find(c=>c.id===o)).filter(Boolean))!=null?i:[];return Yp(e,s,t,"right")},Bn(t.options,Ya)),t.getFooterGroups=In(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Bn(t.options,Ya)),t.getLeftFooterGroups=In(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Bn(t.options,Ya)),t.getCenterFooterGroups=In(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Bn(t.options,Ya)),t.getRightFooterGroups=In(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Bn(t.options,Ya)),t.getFlatHeaders=In(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Bn(t.options,Ya)),t.getLeftFlatHeaders=In(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Bn(t.options,Ya)),t.getCenterFlatHeaders=In(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Bn(t.options,Ya)),t.getRightFlatHeaders=In(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Bn(t.options,Ya)),t.getCenterLeafHeaders=In(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Bn(t.options,Ya)),t.getLeftLeafHeaders=In(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Bn(t.options,Ya)),t.getRightLeafHeaders=In(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var a;return!((a=n.subHeaders)!=null&&a.length)}),Bn(t.options,Ya)),t.getLeafHeaders=In(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,a)=>{var i,s,o,c,d,m;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(o=(c=n[0])==null?void 0:c.headers)!=null?o:[],...(d=(m=a[0])==null?void 0:m.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},Bn(t.options,Ya))}};function Yp(t,e,n,a){var i,s;let o=0;const c=function(b,v){v===void 0&&(v=1),o=Math.max(o,v),b.filter(C=>C.getIsVisible()).forEach(C=>{var S;(S=C.columns)!=null&&S.length&&c(C.columns,v+1)},0)};c(t);let d=[];const m=(b,v)=>{const C={depth:v,id:[a,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];b.forEach(F=>{const w=[...S].reverse()[0],A=F.column.depth===C.depth;let N,P=!1;if(A&&F.column.parent?N=F.column.parent:(N=F.column,P=!0),w&&w?.column===N)w.subHeaders.push(F);else{const z=D_(n,N,{id:[a,v,N.id,F?.id].filter(Boolean).join("_"),isPlaceholder:P,placeholderId:P?`${S.filter(D=>D.column===N).length}`:void 0,depth:v,index:S.length});z.subHeaders.push(F),S.push(z)}C.headers.push(F),F.headerGroup=C}),d.push(C),v>0&&m(S,v-1)},f=e.map((b,v)=>D_(n,b,{depth:o,index:v}));m(f,o-1),d.reverse();const p=b=>b.filter(C=>C.column.getIsVisible()).map(C=>{let S=0,F=0,w=[0];C.subHeaders&&C.subHeaders.length?(w=[],p(C.subHeaders).forEach(N=>{let{colSpan:P,rowSpan:z}=N;S+=P,w.push(z)})):S=1;const A=Math.min(...w);return F=F+A,C.colSpan=S,C.rowSpan=F,{colSpan:S,rowSpan:F}});return p((i=(s=d[0])==null?void 0:s.headers)!=null?i:[]),d}const qK=(t,e,n,a,i,s,o)=>{let c={id:e,index:a,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const m=t.getColumn(d);if(m!=null&&m.accessorFn)return c._valuesCache[d]=m.accessorFn(c.original,a),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const m=t.getColumn(d);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=m.columnDef.getUniqueValues(c.original,a),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var m;return(m=c.getValue(d))!=null?m:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>VK(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?t.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],m=c;for(;;){const f=m.getParentRow();if(!f)break;d.push(f),m=f}return d.reverse()},getAllCells:In(()=>[t.getAllLeafColumns()],d=>d.map(m=>$K(t,c,m,m.id)),Bn(t.options,"debugRows")),_getAllCellsByColumnId:In(()=>[c.getAllCells()],d=>d.reduce((m,f)=>(m[f.column.id]=f,m),{}),Bn(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const m=t._features[d];m==null||m.createRow==null||m.createRow(c,t)}return c},JK={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},wM=(t,e,n)=>{var a,i;const s=n==null||(a=n.toString())==null?void 0:a.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};wM.autoRemove=t=>Ws(t);const SM=(t,e,n)=>{var a;return!!(!((a=t.getValue(e))==null||(a=a.toString())==null)&&a.includes(n))};SM.autoRemove=t=>Ws(t);const FM=(t,e,n)=>{var a;return((a=t.getValue(e))==null||(a=a.toString())==null?void 0:a.toLowerCase())===n?.toLowerCase()};FM.autoRemove=t=>Ws(t);const CM=(t,e,n)=>{var a;return(a=t.getValue(e))==null?void 0:a.includes(n)};CM.autoRemove=t=>Ws(t);const _M=(t,e,n)=>!n.some(a=>{var i;return!((i=t.getValue(e))!=null&&i.includes(a))});_M.autoRemove=t=>Ws(t)||!(t!=null&&t.length);const EM=(t,e,n)=>n.some(a=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(a)});EM.autoRemove=t=>Ws(t)||!(t!=null&&t.length);const kM=(t,e,n)=>t.getValue(e)===n;kM.autoRemove=t=>Ws(t);const AM=(t,e,n)=>t.getValue(e)==n;AM.autoRemove=t=>Ws(t);const Kw=(t,e,n)=>{let[a,i]=n;const s=t.getValue(e);return s>=a&&s<=i};Kw.resolveFilterValue=t=>{let[e,n]=t,a=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(a)?-1/0:a,o=n===null||Number.isNaN(i)?1/0:i;if(s>o){const c=s;s=o,o=c}return[s,o]};Kw.autoRemove=t=>Ws(t)||Ws(t[0])&&Ws(t[1]);const ml={includesString:wM,includesStringSensitive:SM,equalsString:FM,arrIncludes:CM,arrIncludesAll:_M,arrIncludesSome:EM,equals:kM,weakEquals:AM,inNumberRange:Kw};function Ws(t){return t==null||t===""}const XK={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ki("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],a=n?.getValue(t.id);return typeof a=="string"?ml.includesString:typeof a=="number"?ml.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?ml.equals:Array.isArray(a)?ml.arrIncludes:ml.weakEquals},t.getFilterFn=()=>{var n,a;return Lx(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(a=e.options.filterFns)==null?void 0:a[t.columnDef.filterFn])!=null?n:ml[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,a,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((a=e.options.enableColumnFilters)!=null?a:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(a=>a.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,a;return(n=(a=e.getState().columnFilters)==null?void 0:a.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(a=>{const i=t.getFilterFn(),s=a?.find(f=>f.id===t.id),o=yc(n,s?s.value:void 0);if(P_(i,o,t)){var c;return(c=a?.filter(f=>f.id!==t.id))!=null?c:[]}const d={id:t.id,value:o};if(s){var m;return(m=a?.map(f=>f.id===t.id?d:f))!=null?m:[]}return a!=null&&a.length?[...a,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),a=i=>{var s;return(s=yc(e,i))==null?void 0:s.filter(o=>{const c=n.find(d=>d.id===o.id);if(c){const d=c.getFilterFn();if(P_(d,o.value,c))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(a)},t.resetColumnFilters=e=>{var n,a;t.setColumnFilters(e?[]:(n=(a=t.initialState)==null?void 0:a.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function P_(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const ZK=(t,e,n)=>n.reduce((a,i)=>{const s=i.getValue(t);return a+(typeof s=="number"?s:0)},0),QK=(t,e,n)=>{let a;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(a>s||a===void 0&&s>=s)&&(a=s)}),a},eY=(t,e,n)=>{let a;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(a<s||a===void 0&&s>=s)&&(a=s)}),a},tY=(t,e,n)=>{let a,i;return n.forEach(s=>{const o=s.getValue(t);o!=null&&(a===void 0?o>=o&&(a=i=o):(a>o&&(a=o),i<o&&(i=o)))}),[a,i]},nY=(t,e)=>{let n=0,a=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,a+=s)}),n)return a/n},rY=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!WK(n))return;if(n.length===1)return n[0];const a=Math.floor(n.length/2),i=n.sort((s,o)=>s-o);return n.length%2!==0?i[a]:(i[a-1]+i[a])/2},aY=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),iY=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,sY=(t,e)=>e.length,dy={sum:ZK,min:QK,max:eY,extent:tY,mean:nY,median:rY,unique:aY,uniqueCount:iY,count:sY},oY={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ki("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(a=>a!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,a;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((a=e.options.enableGrouping)!=null?a:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],a=n?.getValue(t.id);if(typeof a=="number")return dy.sum;if(Object.prototype.toString.call(a)==="[object Date]")return dy.extent},t.getAggregationFn=()=>{var n,a;if(!t)throw new Error;return Lx(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(a=e.options.aggregationFns)==null?void 0:a[t.columnDef.aggregationFn])!=null?n:dy[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,a;t.setGrouping(e?[]:(n=(a=t.initialState)==null?void 0:a.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const a=e.getColumn(n);return a!=null&&a.columnDef.getGroupingValue?(t._groupingValuesCache[n]=a.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,a)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function lY(t,e,n){if(!(e!=null&&e.length)||!n)return t;const a=t.filter(s=>!e.includes(s.id));return n==="remove"?a:[...e.map(s=>t.find(o=>o.id===s)).filter(Boolean),...a]}const cY={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ki("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=In(n=>[_m(e,n)],n=>n.findIndex(a=>a.id===t.id),Bn(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var a;return((a=_m(e,n)[0])==null?void 0:a.id)===t.id},t.getIsLastColumn=n=>{var a;const i=_m(e,n);return((a=i[i.length-1])==null?void 0:a.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=In(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,a)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const o=[...e],c=[...i];for(;c.length&&o.length;){const d=o.shift(),m=c.findIndex(f=>f.id===d);m>-1&&s.push(c.splice(m,1)[0])}s=[...s,...c]}return lY(s,n,a)},Bn(t.options,"debugTable"))}},hy=()=>({left:[],right:[]}),uY={getInitialState:t=>({columnPinning:hy(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ki("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const a=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,o;if(n==="right"){var c,d;return{left:((c=i?.left)!=null?c:[]).filter(p=>!(a!=null&&a.includes(p))),right:[...((d=i?.right)!=null?d:[]).filter(p=>!(a!=null&&a.includes(p))),...a]}}if(n==="left"){var m,f;return{left:[...((m=i?.left)!=null?m:[]).filter(p=>!(a!=null&&a.includes(p))),...a],right:((f=i?.right)!=null?f:[]).filter(p=>!(a!=null&&a.includes(p)))}}return{left:((s=i?.left)!=null?s:[]).filter(p=>!(a!=null&&a.includes(p))),right:((o=i?.right)!=null?o:[]).filter(p=>!(a!=null&&a.includes(p)))}})},t.getCanPin=()=>t.getLeafColumns().some(a=>{var i,s,o;return((i=a.columnDef.enablePinning)!=null?i:!0)&&((s=(o=e.options.enableColumnPinning)!=null?o:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(c=>c.id),{left:a,right:i}=e.getState().columnPinning,s=n.some(c=>a?.includes(c)),o=n.some(c=>i?.includes(c));return s?"left":o?"right":!1},t.getPinnedIndex=()=>{var n,a;const i=t.getIsPinned();return i?(n=(a=e.getState().columnPinning)==null||(a=a[i])==null?void 0:a.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=In(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,a,i)=>{const s=[...a??[],...i??[]];return n.filter(o=>!s.includes(o.column.id))},Bn(e.options,"debugRows")),t.getLeftVisibleCells=In(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,a)=>(a??[]).map(s=>n.find(o=>o.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Bn(e.options,"debugRows")),t.getRightVisibleCells=In(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,a)=>(a??[]).map(s=>n.find(o=>o.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Bn(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,a;return t.setColumnPinning(e?hy():(n=(a=t.initialState)==null?void 0:a.columnPinning)!=null?n:hy())},t.getIsSomeColumnsPinned=e=>{var n;const a=t.getState().columnPinning;if(!e){var i,s;return!!((i=a.left)!=null&&i.length||(s=a.right)!=null&&s.length)}return!!((n=a[e])!=null&&n.length)},t.getLeftLeafColumns=In(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(a=>e.find(i=>i.id===a)).filter(Boolean),Bn(t.options,"debugColumns")),t.getRightLeafColumns=In(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(a=>e.find(i=>i.id===a)).filter(Boolean),Bn(t.options,"debugColumns")),t.getCenterLeafColumns=In(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,a)=>{const i=[...n??[],...a??[]];return e.filter(s=>!i.includes(s.id))},Bn(t.options,"debugColumns"))}};function dY(t){return t||(typeof document<"u"?document:null)}const qp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},my=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hY={getDefaultColumnDef:()=>qp,getInitialState:t=>({columnSizing:{},columnSizingInfo:my(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ki("columnSizing",t),onColumnSizingInfoChange:Ki("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,a,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:qp.minSize,(a=s??t.columnDef.size)!=null?a:qp.size),(i=t.columnDef.maxSize)!=null?i:qp.maxSize)},t.getStart=In(n=>[n,_m(e,n),e.getState().columnSizing],(n,a)=>a.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),Bn(e.options,"debugColumns")),t.getAfter=In(n=>[n,_m(e,n),e.getState().columnSizing],(n,a)=>a.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),Bn(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:a,...i}=n;return i})},t.getCanResize=()=>{var n,a;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((a=e.options.enableColumnResizing)!=null?a:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const a=i=>{if(i.subHeaders.length)i.subHeaders.forEach(a);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return a(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const a=e.getColumn(t.column.id),i=a?.getCanResize();return s=>{if(!a||!i||(s.persist==null||s.persist(),fy(s)&&s.touches&&s.touches.length>1))return;const o=t.getSize(),c=t?t.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[a.id,a.getSize()]],d=fy(s)?Math.round(s.touches[0].clientX):s.clientX,m={},f=(w,A)=>{typeof A=="number"&&(e.setColumnSizingInfo(N=>{var P,z;const D=e.options.columnResizeDirection==="rtl"?-1:1,T=(A-((P=N?.startOffset)!=null?P:0))*D,K=Math.max(T/((z=N?.startSize)!=null?z:0),-.999999);return N.columnSizingStart.forEach(B=>{let[k,O]=B;m[k]=Math.round(Math.max(O+O*K,0)*100)/100}),{...N,deltaOffset:T,deltaPercentage:K}}),(e.options.columnResizeMode==="onChange"||w==="end")&&e.setColumnSizing(N=>({...N,...m})))},p=w=>f("move",w),b=w=>{f("end",w),e.setColumnSizingInfo(A=>({...A,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=dY(n),C={moveHandler:w=>p(w.clientX),upHandler:w=>{v?.removeEventListener("mousemove",C.moveHandler),v?.removeEventListener("mouseup",C.upHandler),b(w.clientX)}},S={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),upHandler:w=>{var A;v?.removeEventListener("touchmove",S.moveHandler),v?.removeEventListener("touchend",S.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),b((A=w.touches[0])==null?void 0:A.clientX)}},F=mY()?{passive:!1}:!1;fy(s)?(v?.addEventListener("touchmove",S.moveHandler,F),v?.addEventListener("touchend",S.upHandler,F)):(v?.addEventListener("mousemove",C.moveHandler,F),v?.addEventListener("mouseup",C.upHandler,F)),e.setColumnSizingInfo(w=>({...w,startOffset:d,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:a.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?my():(n=t.initialState.columnSizingInfo)!=null?n:my())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((a,i)=>a+i.getSize(),0))!=null?e:0}}};let Jp=null;function mY(){if(typeof Jp=="boolean")return Jp;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Jp=t,Jp}function fy(t){return t.type==="touchstart"}const fY={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ki("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(a=>({...a,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,a;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(a=e.getState().columnVisibility)==null?void 0:a[t.id])!=null?n:!0},t.getCanHide=()=>{var n,a;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((a=e.options.enableHiding)!=null?a:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=In(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(a=>a.column.getIsVisible()),Bn(e.options,"debugRows")),t.getVisibleCells=In(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,a,i)=>[...n,...a,...i],Bn(e.options,"debugRows"))},createTable:t=>{const e=(n,a)=>In(()=>[a(),a().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Bn(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var a;t.setColumnVisibility(n?{}:(a=t.initialState.columnVisibility)!=null?a:{})},t.toggleAllColumnsVisible=n=>{var a;n=(a=n)!=null?a:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var a;t.toggleAllColumnsVisible((a=n.target)==null?void 0:a.checked)}}};function _m(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const pY={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},gY={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Ki("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const a=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,a,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((a=e.options.enableGlobalFilter)!=null?a:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>ml.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:a}=t.options;return Lx(a)?a:a==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[a])!=null?e:ml[a]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},xY={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ki("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var a,i;if(!e){t._queue(()=>{e=!0});return}if((a=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?a:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=a=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(a),t.toggleAllRowsExpanded=a=>{a??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=a=>{var i,s;t.setExpanded(a?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const a=t.getState().expanded;return a===!0||Object.values(a).some(Boolean)},t.getIsAllRowsExpanded=()=>{const a=t.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let a=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const o=s.split(".");a=Math.max(a,o.length)}),a},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(a=>{var i;const s=a===!0?!0:!!(a!=null&&a[t.id]);let o={};if(a===!0?Object.keys(e.getRowModel().rowsById).forEach(c=>{o[c]=!0}):o=a,n=(i=n)!=null?i:!s,!s&&n)return{...o,[t.id]:!0};if(s&&!n){const{[t.id]:c,...d}=o;return d}return a})},t.getIsExpanded=()=>{var n;const a=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:a===!0||a?.[t.id])},t.getCanExpand=()=>{var n,a,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((a=e.options.enableExpanding)!=null?a:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,a=t;for(;n&&a.parentId;)a=e.getRow(a.parentId,!0),n=a.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Zb=0,Qb=10,py=()=>({pageIndex:Zb,pageSize:Qb}),vY={getInitialState:t=>({...t,pagination:{...py(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ki("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var a,i;if(!e){t._queue(()=>{e=!0});return}if((a=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?a:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=a=>{const i=s=>yc(a,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=a=>{var i;t.setPagination(a?py():(i=t.initialState.pagination)!=null?i:py())},t.setPageIndex=a=>{t.setPagination(i=>{let s=yc(a,i.pageIndex);const o=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,o)),{...i,pageIndex:s}})},t.resetPageIndex=a=>{var i,s;t.setPageIndex(a?Zb:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Zb)},t.resetPageSize=a=>{var i,s;t.setPageSize(a?Qb:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Qb)},t.setPageSize=a=>{t.setPagination(i=>{const s=Math.max(1,yc(a,i.pageSize)),o=i.pageSize*i.pageIndex,c=Math.floor(o/s);return{...i,pageIndex:c,pageSize:s}})},t.setPageCount=a=>t.setPagination(i=>{var s;let o=yc(a,(s=t.options.pageCount)!=null?s:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...i,pageCount:o}}),t.getPageOptions=In(()=>[t.getPageCount()],a=>{let i=[];return a&&a>0&&(i=[...new Array(a)].fill(null).map((s,o)=>o)),i},Bn(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:a}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:a<i-1},t.previousPage=()=>t.setPageIndex(a=>a-1),t.nextPage=()=>t.setPageIndex(a=>a+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var a;return(a=t.options.pageCount)!=null?a:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var a;return(a=t.options.rowCount)!=null?a:t.getPrePaginationRowModel().rows.length}}},gy=()=>({top:[],bottom:[]}),yY={getInitialState:t=>({rowPinning:gy(),...t}),getDefaultOptions:t=>({onRowPinningChange:Ki("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,a,i)=>{const s=a?t.getLeafRows().map(d=>{let{id:m}=d;return m}):[],o=i?t.getParentRows().map(d=>{let{id:m}=d;return m}):[],c=new Set([...o,t.id,...s]);e.setRowPinning(d=>{var m,f;if(n==="bottom"){var p,b;return{top:((p=d?.top)!=null?p:[]).filter(S=>!(c!=null&&c.has(S))),bottom:[...((b=d?.bottom)!=null?b:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)]}}if(n==="top"){var v,C;return{top:[...((v=d?.top)!=null?v:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)],bottom:((C=d?.bottom)!=null?C:[]).filter(S=>!(c!=null&&c.has(S)))}}return{top:((m=d?.top)!=null?m:[]).filter(S=>!(c!=null&&c.has(S))),bottom:((f=d?.bottom)!=null?f:[]).filter(S=>!(c!=null&&c.has(S)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:a,enablePinning:i}=e.options;return typeof a=="function"?a(t):(n=a??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:a,bottom:i}=e.getState().rowPinning,s=n.some(c=>a?.includes(c)),o=n.some(c=>i?.includes(c));return s?"top":o?"bottom":!1},t.getPinnedIndex=()=>{var n,a;const i=t.getIsPinned();if(!i)return-1;const s=(n=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(o=>{let{id:c}=o;return c});return(a=s?.indexOf(t.id))!=null?a:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,a;return t.setRowPinning(e?gy():(n=(a=t.initialState)==null?void 0:a.rowPinning)!=null?n:gy())},t.getIsSomeRowsPinned=e=>{var n;const a=t.getState().rowPinning;if(!e){var i,s;return!!((i=a.top)!=null&&i.length||(s=a.bottom)!=null&&s.length)}return!!((n=a[e])!=null&&n.length)},t._getPinnedRows=(e,n,a)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(o=>{const c=t.getRow(o,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(o=>e.find(c=>c.id===o))).filter(Boolean).map(o=>({...o,position:a}))},t.getTopRows=In(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Bn(t.options,"debugRows")),t.getBottomRows=In(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Bn(t.options,"debugRows")),t.getCenterRows=In(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,a)=>{const i=new Set([...n??[],...a??[]]);return e.filter(s=>!i.has(s.id))},Bn(t.options,"debugRows"))}},bY={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ki("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const a={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(a[s.id]=!0)}):i.forEach(s=>{delete a[s.id]}),a})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const a=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{e1(i,s.id,a,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=In(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?xy(t,n):{rows:[],flatRows:[],rowsById:{}},Bn(t.options,"debugTable")),t.getFilteredSelectedRowModel=In(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?xy(t,n):{rows:[],flatRows:[],rowsById:{}},Bn(t.options,"debugTable")),t.getGroupedSelectedRowModel=In(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?xy(t,n):{rows:[],flatRows:[],rowsById:{}},Bn(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let a=!!(e.length&&Object.keys(n).length);return a&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(a=!1),a},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let a=!!e.length;return a&&e.some(i=>!n[i.id])&&(a=!1),a},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,a)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var o;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const c={...s};return e1(c,t.id,n,(o=a?.selectChildren)!=null?o:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Yw(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return t1(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return t1(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return a=>{var i;n&&t.toggleSelected((i=a.target)==null?void 0:i.checked)}}}},e1=(t,e,n,a,i)=>{var s;const o=i.getRow(e,!0);n?(o.getCanMultiSelect()||Object.keys(t).forEach(c=>delete t[c]),o.getCanSelect()&&(t[e]=!0)):delete t[e],a&&(s=o.subRows)!=null&&s.length&&o.getCanSelectSubRows()&&o.subRows.forEach(c=>e1(t,c.id,n,a,i))};function xy(t,e){const n=t.getState().rowSelection,a=[],i={},s=function(o,c){return o.map(d=>{var m;const f=Yw(d,n);if(f&&(a.push(d),i[d.id]=d),(m=d.subRows)!=null&&m.length&&(d={...d,subRows:s(d.subRows)}),f)return d}).filter(Boolean)};return{rows:s(e.rows),flatRows:a,rowsById:i}}function Yw(t,e){var n;return(n=e[t.id])!=null?n:!1}function t1(t,e,n){var a;if(!((a=t.subRows)!=null&&a.length))return!1;let i=!0,s=!1;return t.subRows.forEach(o=>{if(!(s&&!i)&&(o.getCanSelect()&&(Yw(o,e)?s=!0:i=!1),o.subRows&&o.subRows.length)){const c=t1(o,e);c==="all"?s=!0:(c==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const n1=/([0-9]+)/gm,wY=(t,e,n)=>NM(kc(t.getValue(n)).toLowerCase(),kc(e.getValue(n)).toLowerCase()),SY=(t,e,n)=>NM(kc(t.getValue(n)),kc(e.getValue(n))),FY=(t,e,n)=>qw(kc(t.getValue(n)).toLowerCase(),kc(e.getValue(n)).toLowerCase()),CY=(t,e,n)=>qw(kc(t.getValue(n)),kc(e.getValue(n))),_Y=(t,e,n)=>{const a=t.getValue(n),i=e.getValue(n);return a>i?1:a<i?-1:0},EY=(t,e,n)=>qw(t.getValue(n),e.getValue(n));function qw(t,e){return t===e?0:t>e?1:-1}function kc(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function NM(t,e){const n=t.split(n1).filter(Boolean),a=e.split(n1).filter(Boolean);for(;n.length&&a.length;){const i=n.shift(),s=a.shift(),o=parseInt(i,10),c=parseInt(s,10),d=[o,c].sort();if(isNaN(d[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(d[1]))return isNaN(o)?-1:1;if(o>c)return 1;if(c>o)return-1}return n.length-a.length}const sm={alphanumeric:wY,alphanumericCaseSensitive:SY,text:FY,textCaseSensitive:CY,datetime:_Y,basic:EY},kY={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ki("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const i of n){const s=i?.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return sm.datetime;if(typeof s=="string"&&(a=!0,s.split(n1).length>1))return sm.alphanumeric}return a?sm.text:sm.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,a;if(!t)throw new Error;return Lx(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(a=e.options.sortingFns)==null?void 0:a[t.columnDef.sortingFn])!=null?n:sm[t.columnDef.sortingFn]},t.toggleSorting=(n,a)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(o=>{const c=o?.find(v=>v.id===t.id),d=o?.findIndex(v=>v.id===t.id);let m=[],f,p=s?n:i==="desc";if(o!=null&&o.length&&t.getCanMultiSort()&&a?c?f="toggle":f="add":o!=null&&o.length&&d!==o.length-1?f="replace":c?f="toggle":f="replace",f==="toggle"&&(s||i||(f="remove")),f==="add"){var b;m=[...o,{id:t.id,desc:p}],m.splice(0,m.length-((b=e.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else f==="toggle"?m=o.map(v=>v.id===t.id?{...v,desc:p}:v):f==="remove"?m=o.filter(v=>v.id!==t.id):m=[{id:t.id,desc:p}];return m})},t.getFirstSortDir=()=>{var n,a;return((n=(a=t.columnDef.sortDescFirst)!=null?a:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var a,i;const s=t.getFirstSortDir(),o=t.getIsSorted();return o?o!==s&&((a=e.options.enableSortingRemoval)==null||a)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:o==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,a;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((a=e.options.enableSorting)!=null?a:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,a;return(n=(a=t.columnDef.enableMultiSort)!=null?a:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const a=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return a?a.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,a;return(n=(a=e.getState().sorting)==null?void 0:a.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(a=>a.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return a=>{n&&(a.persist==null||a.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(a):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,a;t.setSorting(e?[]:(n=(a=t.initialState)==null?void 0:a.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},AY=[YK,fY,cY,uY,JK,XK,pY,gY,kY,oY,xY,vY,yY,bY,hY];function NY(t){var e,n;const a=[...AY,...(e=t._features)!=null?e:[]];let i={_features:a};const s=i._features.reduce((b,v)=>Object.assign(b,v.getDefaultOptions==null?void 0:v.getDefaultOptions(i)),{}),o=b=>i.options.mergeOptions?i.options.mergeOptions(s,b):{...s,...b};let d={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(b=>{var v;d=(v=b.getInitialState==null?void 0:b.getInitialState(d))!=null?v:d});const m=[];let f=!1;const p={_features:a,options:{...s,...t},initialState:d,_queue:b=>{m.push(b),f||(f=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();f=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{i.setState(i.initialState)},setOptions:b=>{const v=yc(b,i.options);i.options=o(v)},getState:()=>i.options.state,setState:b=>{i.options.onStateChange==null||i.options.onStateChange(b)},_getRowId:(b,v,C)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(b,v,C))!=null?S:`${C?[C.id,v].join("."):v}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(b,v)=>{let C=(v?i.getPrePaginationRowModel():i.getRowModel()).rowsById[b];if(!C&&(C=i.getCoreRowModel().rowsById[b],!C))throw new Error;return C},_getDefaultColumnDef:In(()=>[i.options.defaultColumn],b=>{var v;return b=(v=b)!=null?v:{},{header:C=>{const S=C.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:C=>{var S,F;return(S=(F=C.renderValue())==null||F.toString==null?void 0:F.toString())!=null?S:null},...i._features.reduce((C,S)=>Object.assign(C,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...b}},Bn(t,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:In(()=>[i._getColumnDefs()],b=>{const v=function(C,S,F){return F===void 0&&(F=0),C.map(w=>{const A=KK(i,w,F,S),N=w;return A.columns=N.columns?v(N.columns,A,F+1):[],A})};return v(b)},Bn(t,"debugColumns")),getAllFlatColumns:In(()=>[i.getAllColumns()],b=>b.flatMap(v=>v.getFlatColumns()),Bn(t,"debugColumns")),_getAllFlatColumnsById:In(()=>[i.getAllFlatColumns()],b=>b.reduce((v,C)=>(v[C.id]=C,v),{}),Bn(t,"debugColumns")),getAllLeafColumns:In(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(b,v)=>{let C=b.flatMap(S=>S.getLeafColumns());return v(C)},Bn(t,"debugColumns")),getColumn:b=>i._getAllFlatColumnsById()[b]};Object.assign(i,p);for(let b=0;b<i._features.length;b++){const v=i._features[b];v==null||v.createTable==null||v.createTable(i)}return i}function TY(){return t=>In(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},a=function(i,s,o){s===void 0&&(s=0);const c=[];for(let m=0;m<i.length;m++){const f=qK(t,t._getRowId(i[m],m,o),i[m],m,s,void 0,o?.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,c.push(f),t.options.getSubRows){var d;f.originalSubRows=t.options.getSubRows(i[m],m),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=a(f.originalSubRows,s+1,f))}}return c};return n.rows=a(e),n},Bn(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function MY(t){const e=[],n=a=>{var i;e.push(a),(i=a.subRows)!=null&&i.length&&a.getIsExpanded()&&a.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function RY(t){return e=>In(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,a)=>
4345{if(!a.rows.length)return a;const{pageSize:i,pageIndex:s}=n;let{rows:o,flatRows:c,rowsById:d}=a;const m=i*s,f=m+i;o=o.slice(m,f);let p;e.options.paginateExpandedRows?p={rows:o,flatRows:c,rowsById:d}:p=MY({rows:o,flatRows:c,rowsById:d}),p.flatRows=[];const b=v=>{p.flatRows.push(v),v.subRows.length&&v.subRows.forEach(b)};return p.rows.forEach(b),p},Bn(e.options,"debugTable"))}function DY(){return t=>In(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const a=t.getState().sorting,i=[],s=a.filter(d=>{var m;return(m=t.getColumn(d.id))==null?void 0:m.getCanSort()}),o={};s.forEach(d=>{const m=t.getColumn(d.id);m&&(o[d.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const c=d=>{const m=d.map(f=>({...f}));return m.sort((f,p)=>{for(let v=0;v<s.length;v+=1){var b;const C=s[v],S=o[C.id],F=S.sortUndefined,w=(b=C?.desc)!=null?b:!1;let A=0;if(F){const N=f.getValue(C.id),P=p.getValue(C.id),z=N===void 0,D=P===void 0;if(z||D){if(F==="first")return z?-1:1;if(F==="last")return z?1:-1;A=z&&D?0:z?F:-F}}if(A===0&&(A=S.sortingFn(f,p,C.id)),A!==0)return w&&(A*=-1),S.invertSorting&&(A*=-1),A}return f.index-p.index}),m.forEach(f=>{var p;i.push(f),(p=f.subRows)!=null&&p.length&&(f.subRows=c(f.subRows))}),m};return{rows:c(n.rows),flatRows:i,rowsById:n.rowsById}},Bn(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function j_(t,e){return t?PY(t)?x.createElement(t,e):t:null}function PY(t){return jY(t)||typeof t=="function"||LY(t)}function jY(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function LY(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function IY(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=x.useState(()=>({current:NY(e)})),[a,i]=x.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...a,...t.state},onStateChange:o=>{i(o),t.onStateChange==null||t.onStateChange(o)}})),n.current}var TM=["PageUp","PageDown"],MM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ph="Slider",[r1,BY,OY]=Vm(ph),[DM]=Xa(ph,[OY]),[UY,Ix]=DM(ph),PM=x.forwardRef((t,e)=>{const{name:n,min:a=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:m=[a],value:f,onValueChange:p=()=>{},onValueCommit:b=()=>{},inverted:v=!1,form:C,...S}=t,F=x.useRef(new Set),w=x.useRef(0),N=o==="horizontal"?zY:GY,[P=[],z]=ds({prop:f,defaultProp:m,onChange:O=>{[...F.current][w.current]?.focus(),p(O)}}),D=x.useRef(P);function T(O){const I=KY(P,O);k(O,I)}function K(O){k(O,w.current)}function B(){const O=D.current[w.current];P[w.current]!==O&&b(P)}function k(O,I,{commit:j}={commit:!1}){const U=XY(s),q=ZY(Math.round((O-a)/s)*s+a,U),Y=Im(q,[a,i]);z((W=[])=>{const H=VY(W,Y,I);if(JY(H,d*s)){w.current=H.indexOf(Y);const J=String(H)!==String(W);return J&&j&&b(H),J?H:W}else return W})}return r.jsx(UY,{scope:t.__scopeSlider,name:n,disabled:c,min:a,max:i,valueIndexToChangeRef:w,thumbs:F.current,values:P,orientation:o,form:C,children:r.jsx(r1.Provider,{scope:t.__scopeSlider,children:r.jsx(r1.Slot,{scope:t.__scopeSlider,children:r.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...S,ref:e,onPointerDown:vn(S.onPointerDown,()=>{c||(D.current=P)}),min:a,max:i,inverted:v,onSlideStart:c?void 0:T,onSlideMove:c?void 0:K,onSlideEnd:c?void 0:B,onHomeKeyDown:()=>!c&&k(a,0,{commit:!0}),onEndKeyDown:()=>!c&&k(i,P.length-1,{commit:!0}),onStepKeyDown:({event:O,direction:I})=>{if(!c){const q=TM.includes(O.key)||O.shiftKey&&MM.includes(O.key)?10:1,Y=w.current,W=P[Y],H=s*q*I;k(W+H,Y,{commit:!0})}}})})})})});PM.displayName=ph;var[jM,LM]=DM(ph,{startEdge:"left",endEdge:"right",size:"width",direction:1}),zY=x.forwardRef((t,e)=>{const{min:n,max:a,dir:i,inverted:s,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}
4345=t,[p,b]=x.useState(null),v=Hn(e,N=>b(N)),C=x.useRef(void 0),S=uh(i),F=S==="ltr",w=F&&!s||!F&&s;function A(N){const P=C.current||p.getBoundingClientRect(),z=[0,P.width],T=Jw(z,w?[n,a]:[a,n]);return C.current=P,T(N-P.left)}return r.jsx(jM,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:r.jsx(IM,{dir:S,"data-orientation":"horizontal",...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const P=A(N.clientX);o?.(P)},onSlideMove:N=>{const P=A(N.clientX);c?.(P)},onSlideEnd:()=>{C.current=void 0,d?.()},onStepKeyDown:N=>{const z=RM[w?"from-left":"from-right"].includes(N.key);m?.({event:N,direction:z?-1:1})}})})}),GY=x.forwardRef((t,e)=>{const{min:n,max:a,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...m}=t,f=x.useRef(null),p=Hn(e,f),b=x.useRef(void 0),v=!i;function C(S){const F=b.current||f.current.getBoundingClientRect(),w=[0,F.height],N=Jw(w,v?[a,n]:[n,a]);return b.current=F,N(S-F.top)}return r.jsx(jM,{scope:t.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:r.jsx(IM,{"data-orientation":"vertical",...m,ref:p,style:{...m.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const F=C(S.clientY);s?.(F)},onSlideMove:S=>{const F=C(S.clientY);o?.(F)},onSlideEnd:()=>{b.current=void 0,c?.()},onStepKeyDown:S=>{const w=RM[v?"from-bottom":"from-top"].includes(S.key);d?.({event:S,direction:w?-1:1})}})})}),IM=x.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...m}=t,f=Ix(ph,n);return r.jsx(Tn.span,{...m,ref:e,onKeyDown:vn(t.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):TM.concat(MM).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:vn(t.onPointerDown,p=>{const b=p.target;b.setPointerCapture(p.pointerId),p.preventDefault(),f.thumbs.has(b)?b.focus():a(p)}),onPointerMove:vn(t.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&i(p)}),onPointerUp:vn(t.onPointerUp,p=>{const b=p.target;b.hasPointerCapture(p.pointerId)&&(b.releasePointerCapture(p.pointerId),s(p))})})}),BM="SliderTrack",OM=x.forwardRef((t,e)=>{const{__scopeSlider:n,...a}=t,i=Ix(BM,n);return r.jsx(Tn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:e})});OM.displayName=BM;var a1="SliderRange",UM=x.forwardRef((t,e)=>{const{__scopeSlider:n,...a}=t,i=Ix(a1,n),s=LM(a1,n),o=x.useRef(null),c=Hn(e,o),d=i.values.length,m=i.values.map(b=>HM(b,i.min,i.max)),f=d>1?Math.min(...m):0,p=100-Math.max(...m);return r.jsx(Tn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...a,ref:c,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:p+"%"}})});UM.displayName=a1;var i1="SliderThumb",zM=x.forwardRef((t,e)=>{const n=BY(t.__scopeSlider),[a,i]=x.useState(null),s=Hn(e,c=>i(c)),o=x.useMemo(()=>a?n().findIndex(c=>c.ref.current===a):-1,[n,a]);return r.jsx(HY,{...t,ref:s,index:o})}),HY=x.forwardRef((t,e)=>{const{__scopeSlider:n,index:a,name:i,...s}=t,o=Ix(i1,n),c=LM(i1,n),[d,m]=x.useState(null),f=Hn(e,A=>m(A)),p=d?o.form||!!d.closest("form"):!0,b=sx(d),v=o.values[a],C=v===void 0?0:HM(v,o.min,o.max),S=$Y(a,o.values.length),F=b?.[c.size],w=F?YY(F,C,c.direction):0;return x.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),r.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${C}% + ${w}px)`},children:[r.jsx(r1.ItemSlot,{scope:t.__scopeSlider,children:r.jsx(Tn.span,{role:"slider","aria-label":t["aria-label"]||S,"aria-valuemin":o.min,"aria-valuenow":v,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:f,style:v===void 0?{display:"none"}:t.style,onFocus:vn(t.onFocus,()=>{o.valueIndexToChangeRef.current=a})})}),p&&r.jsx(GM,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:v},a)]})});zM.displayName=i1;var WY="RadioBubbleInput",GM=x.forwardRef(({__scopeSlider:t,value:e,...n},a)=>{const i=x.useRef(null),s=Hn(i,a),o=xx(e);return x.useEffect(()=>{const c=i.current;if(!c)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==e&&f){const p=new Event("input",{bubbles:!0});f.call(c,e),c.dispatchEvent(p)}},[o,e]),r.jsx(Tn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});GM.displayName=WY;function VY(t=[],e,n){const a=[...t];return a[n]=e,a.sort((i,s)=>i-s)}function HM(t,e,n){const s=100/(n-e)*(t-e);return Im(s,[0,100])}function $Y(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function KY(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),a=Math.min(...n);return n.indexOf(a)}
4345function YY(t,e,n){const a=t/2,s=Jw([0,50],[0,a]);return(a-s(e)*n)*n}function qY(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function JY(t,e){if(e>0){const n=qY(t);return Math.min(...n)>=e}return!0}function Jw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const a=(e[1]-e[0])/(t[1]-t[0]);return e[0]+a*(n-t[0])}}function XY(t){return(String(t).split(".")[1]||"").length}function ZY(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var WM=PM,QY=OM,eq=UM,tq=zM;const uf=x.forwardRef(({className:t,...e},n)=>r.jsxs(WM,{ref:n,className:ln("relative flex w-full touch-none select-none items-center",t),...e,children:[r.jsx(QY,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:r.jsx(eq,{className:"absolute h-full bg-primary"})}),r.jsx(tq,{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"})]}));uf.displayName=WM.displayName;function om({value:t,maxWidth:e="200px",className:n="",transform:a}){const[i,s]=x.useState(!1);if(!t)return r.jsx("span",{className:"text-muted-foreground",children:"-"});const o=a?a(t):t,c=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return r.jsx(Lr,{delayDuration:300,children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{onClick:c,className:`group flex items-center gap-1 cursor-pointer hover:bg-muted/50 rounded px-2 py-1 -mx-2 -my-1 transition-colors ${n}`,style:{maxWidth:e},children:[r.jsx("span",{className:"truncate flex-1 select-none text-sm",children:o}),r.jsx("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:i?r.jsx(oi,{className:"h-3 w-3 text-green-600"}):r.jsx(ex,{className:"h-3 w-3 text-muted-foreground"})})]})}),r.jsxs(Ir,{side:"top",className:"max-w-sm break-all",children:[r.jsx("p",{className:"text-xs",children:t}),r.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:i?"Copied!":"Click to copy"})]})]})})}function Ld({email:t,profileImageUrl:e,displayName:n,size:a="md",showNameAndEmail:i=!1,className:s=""}){const{toast:o}=nr(),[c,d]=x.useState(!1),m={sm:"w-8 h-8",md:"w-[50px] h-[50px]",lg:"w-16 h-16"},f=async()=>{d(!0);const b=window.open("about:blank","_blank");try{const v=sessionStorage.getItem("adminSessionId"),C=await fetch("/api/admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json","x-session-id":v||""},body:JSON.stringify({email:t})});if(C.ok){const S=await C.json();if(console.log(`[ViewAsButton] View As session created for ${t}`),b&&!b.closed){b.location.href="/member";const F=w=>{w.origin===window.location.origin&&w.data?.type==="MEMBER_PORTAL_READY"&&w.source===b&&(b.postMessage({type:"IMPERSONATION_SESSION",sessionId:S.sessionId},window.location.origin),window.removeEventListener("message",F),console.log("[ViewAsButton] Sent session to member window via postMessage"))};window.addEventListener("message",F),setTimeout(()=>{window.removeEventListener("message",F)},1e4),o({title:"Member View Opened",description:`Viewing member portal as ${t}`})}else o({title:"Window Blocked",description:"Please allow popups and try again",variant:"destructive",duration:8e3})}else throw new Error("Failed to create impersonation session")}catch(v){console.error("[ViewAsButton] Error:",v),o({title:"Error",description:"Failed to open member view",variant:"destructive"}),b&&!b.closed&&b.close()}finally{d(!1)}},p=r.jsx(r.Fragment,{children:c?r.jsx(on,{className:`${m[a]} animate-spin`}):e?r.jsx("img",{src:e,alt:n||"Profile",loading:"lazy",className:`${m[a]} rounded-[5px] object-cover flex-shrink-0`}):r.jsx(cP,{className:`${m[a]} text-muted-foreground flex-shrink-0`})});return i?r.jsxs("button",{onClick:f,disabled:c,className:`flex items-center gap-3 p-2 rounded-lg hover:bg-muted/50 transition-colors cursor-pointer text-left w-full ${s}`,title:`View as ${t}`,children:[p,r.jsxs("div",{className:"flex-1 min-w-0",children:[n&&r.jsx("div",{className:"font-medium truncate",children:n}),r.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t})]})]}
4345):r.jsx(Fe,{size:"sm",variant:"outline",onClick:f,disabled:c,className:`p-0 h-auto ${s}`,title:`View as ${t}`,children:p})}const nq=t=>({"United States":"US","United Kingdom":"UK",Canada:"CA",Australia:"AU",Germany:"DE",France:"FR",Spain:"ES",Italy:"IT",Netherlands:"NL",Belgium:"BE",Switzerland:"CH",Austria:"AT",Poland:"PL",Sweden:"SE",Norway:"NO",Denmark:"DK",Finland:"FI",Ireland:"IE",Portugal:"PT",Greece:"GR","Czech Republic":"CZ",Romania:"RO",Hungary:"HU",Slovakia:"SK",Bulgaria:"BG",Croatia:"HR",Slovenia:"SI",Lithuania:"LT",Latvia:"LV",Estonia:"EE"})[t]||t,rq=t=>{if(!t)return 0;const e=new Date(t),a=Math.abs(new Date().getTime()-e.getTime());return Math.floor(a/(1e3*60*60*24*7))};function aq({members:t,loading:e=!1,onMemberUpdate:n,onOpenEmailApproval:a,onIncrementBounce:i,onResetBounce:s,onSetTimelineEditor:o,onSetUseInGrid:c,sessionId:d="",adminEmail:m=""}){nr();const[f,p]=x.useState([]),[b,v]=x.useState(""),[C,S]=x.useState("all"),[F,w]=x.useState(new Set),[A,N]=x.useState(new Set),[P,z]=x.useState({});x.useEffect(()=>{(async()=>{try{const O=await fetch("/api/tracks");if(O.ok){const I=await O.json(),j={};I.tracks.forEach(U=>{j[U.id]=U.name}),z(j)}}catch(O){console.error("Failed to fetch track names:",O)}})()},[]);const D=k=>{a&&a(k)},T=x.useMemo(()=>[{accessorKey:"email",header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),children:["Email",r.jsx(lo,{className:"ml-2 h-4 w-4"})]}),cell:({row:k})=>r.jsx(om,{value:k.getValue("email"),maxWidth:"10em",className:"font-medium"})},{id:"bounces",accessorFn:k=>{const O=k.bounces||{};return Object.values(O).reduce((j,U)=>j+U,0)},sortingFn:(k,O)=>{const I=k.original.bounces||{},j=O.original.bounces||{},U=Object.values(I).reduce((Y,W)=>Y+W,0),q=Object.values(j).reduce((Y,W)=>Y+W,0);return U-q},header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["Bounces",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),size:80,cell:({row:k})=>{const O=k.original.email,I=k.original.guildEmail,j=k.original.secondaryEmails||[],U=k.original.bounces||{},q=Object.entries(U).filter(([J,ie])=>ie>0),Y=q.reduce((J,[ie,Q])=>J+Q,0),W=[I?I.includes("@")?I:`${I}@xrguild.org`:null,...j].filter(J=>!!J&&J.toLowerCase()!==O?.toLowerCase()),H=W.length;return Y===0?r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("div",{className:"text-center text-muted-foreground text-xs cursor-pointer hover:bg-muted rounded px-2 py-1",onClick:()=>i?.(k.original.memberKey||"",O),children:"-"})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:"Click to mark current email as bounced"})})]})}):r.jsxs("div",{className:"flex items-center justify-center gap-1",children:[r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{className:"text-center text-red-600 font-medium cursor-pointer hover:bg-red-50 dark:hover:bg-red-950 rounded px-2 py-1",onClick:()=>i?.(k.original.memberKey||"",O),children:[Y,H>0&&r.jsxs("span",{className:"ml-1 text-green-600 text-xs",children:["(",H,")"]})]})}),r.jsx(Ir,{children:r.jsxs("div",{className:"text-xs",children:[r.jsx("p",{className:"font-medium mb-1",children:"Bounced emails:"}),q.map(([J,ie])=>r.jsxs("p",{className:"text-red-600",children:[J,": ",ie]},J)),r.jsx("p",{className:"mt-1 text-muted-foreground",children:"Click to increment for current email"}),H>0&&r.jsxs("p",{className:"text-green-600 mt-1",children:[H," alternate: ",W.join(", ")]})]})})]})}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("button",{className:"p-0.5 text-muted-foreground hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-950 rounded",onClick:J=>{J.stopPropagation(),q.forEach(([ie])=>{s?.(k.original.memberKey||"",ie)})},children:r.jsx(gr,{className:"h-3 w-3"})})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:"Clear all bounces"})})]})})]})}},{id:"name",accessorFn:k=>k.preferredName||`${k.firstName||""} ${k.lastName||""}`.trim(),header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>
4345k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["Name",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>{const O=k.original.preferredName,I=`${k.original.firstName||""} ${k.original.lastName||""}`.trim(),j=O||I,U=!!O;return r.jsx(om,{value:j,maxWidth:"12em",className:U?"text-pink-600":""})}},{accessorKey:"city",header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["City",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>r.jsx(om,{value:k.getValue("city"),maxWidth:"7em"})},{accessorKey:"stateProvince",header:"State",cell:({row:k})=>r.jsx(om,{value:k.getValue("stateProvince"),maxWidth:"5em"})},{accessorKey:"country",header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["Country",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>r.jsx(om,{value:k.getValue("country"),maxWidth:"6em",transform:nq})},{id:"allTimeDonations",accessorFn:k=>{const O=k.donationStatus?.imported;return O?O.lifetimeTotal||O.totalAmount||(O.donations||[]).reduce((I,j)=>I+(j.amount||0),0):0},header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["All time",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>{const O=k.getValue("allTimeDonations");return O?r.jsxs("span",{children:["$",O.toFixed(0)]}):r.jsx("span",{className:"text-muted-foreground",children:"-"})}},{id:"thisYear",accessorFn:k=>{const O=k.donationStatus?.imported?.donations||[],I=new Date;return I.setFullYear(I.getFullYear()-1),O.filter(j=>j.date&&new Date(j.date)>=I).reduce((j,U)=>j+(U.amount||0),0)},header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0 text-green-600",children:["This Year",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>{const O=k.getValue("thisYear");return O?r.jsxs("span",{className:"text-green-600",children:["$",O.toFixed(0)]}):r.jsx("span",{className:"text-muted-foreground",children:"-"})}},{accessorKey:"linkedIn",header:"LI",size:50,cell:({row:k})=>{const O=k.getValue("linkedIn");return O?.trim()?r.jsx("div",{className:"flex justify-center",children:r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 transition-colors",onClick:I=>I.stopPropagation(),children:r.jsx(C1,{className:"h-5 w-5"})})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:"Open LinkedIn profile"})})]})})}):r.jsx("div",{className:"text-muted-foreground text-xs text-center",children:"-"})}},{accessorKey:"requestedEmail",header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["Guild Email",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),sortingFn:(k,O)=>{const I=k.original.guildEmail||"",j=O.original.guildEmail||"",U=k.original.requestedEmail?.names||[],q=O.original.requestedEmail?.names||[];return I&&j?I.localeCompare(j):I&&!j?-1:!I&&j?1:q.length-U.length},cell:({row:k})=>{const O=k.original.guildEmail,I=k.original.requestedEmail,j=I?.names||[],U=I?.approvedHandle,q=I?.status,Y=I?.error,W=O?.trim(),H=j.length>0;if(W){const J=O.replace("@xrguild.org",""),ie=I?.useGuildEmail;let Q=q;ie?Q="primary":!q&&O&&(Q="legacy");const ve=Q?` (${Q})`:"";return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{className:"font-mono text-xs cursor-pointer px-2 py-1 rounded hover:bg-muted text-center",onClick:()=>D(k.original),children:[J,ve&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:ve})]})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:ie?"Primary guild email":Q?`Guild email (${Q})`:"Activated guild email"})})]})})}if(q&&U){const ie={approved:{label:"approved",tooltip:"Approved, awaiting notification"},notified:{label:"notified",tooltip:"Member notified, awaiting activation"},activated:{label:"activated",tooltip:"Account created, awaiting verification"},verified:{label:"verified",tooltip:"Email verified, ready to set as primary"},error:{label:"error",tooltip:Y||"Error during approval"}}[q]||{label:q,tooltip:`Status: ${q}`};return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("div",{className:"font-mono text-xs cursor-pointer px-2 py-1 rounded hover:bg-muted text-center",onClick:()=>D(k.original),children:[U,r.jsxs("span",{className:"ml-1 text-[10px] text-muted-foreground",children:["(",ie.label,")"]})]})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:ie.tooltip})})]})})}if(H){const J=j.length;return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs(Fe,{variant:"ghost",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>D(k.original),children:[J," requested"]})}),r.jsx(Ir,{children:r.jsxs("p",{className:"text-xs",children:["Click to approve: ",j.join(", ")
4345]})})]})})}return r.jsx("div",{className:"text-muted-foreground text-xs text-center",children:"-"})}},{accessorKey:"Created",header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["Weeks",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),cell:({row:k})=>{const O=k.getValue("Created"),I=rq(O);return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("div",{className:"text-center text-sm cursor-help",children:I})}),r.jsx(Ir,{children:r.jsxs("p",{className:"text-xs",children:["Joined: ",O?new Date(O).toLocaleDateString():"Unknown"]})})]})})}},{id:"timelineEditor",header:()=>r.jsxs("div",{className:"text-center leading-tight",children:["Time",r.jsx("br",{}),"Edit"]}),size:50,cell:({row:k})=>{const O=k.original.memberKey,I=k.original.timelineEditor||!1,j=O?F.has(O):!1,U=async q=>{if(!(!O||!o)){w(Y=>new Set([...Y,O]));try{await o(O,q),n?.(k.original.email,{timelineEditor:q})}finally{w(Y=>{const W=new Set(Y);return W.delete(O),W})}}};return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("div",{className:"flex justify-center",children:r.jsx(ar,{checked:I,disabled:j||!O,onCheckedChange:U})})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs",children:"Timeline Editor: can approve/reject edits"})})]})})}},{id:"actions",accessorFn:k=>k.profileImageUrl?1:0,header:({column:k})=>r.jsxs(Fe,{variant:"ghost",onClick:()=>k.toggleSorting(k.getIsSorted()==="asc"),className:"whitespace-normal h-auto py-0",children:["View As",r.jsx(lo,{className:"ml-1 h-3 w-3 flex-shrink-0"})]}),sortingFn:(k,O)=>{const I=k.original.profileImageUrl?1:0,j=O.original.profileImageUrl?1:0;if(I!==j)return j-I;const U=k.original.preferredName||k.original.firstName||"",q=O.original.preferredName||O.original.firstName||"";return U.localeCompare(q)},cell:({row:k})=>{const O=k.getValue("email"),I=k.original.profileImageUrl;return r.jsx(Ld,{email:O,profileImageUrl:I})}},{id:"useInGrid",header:()=>r.jsx("div",{className:"text-center leading-tight",children:"Use"}),size:50,cell:({row:k})=>{const O=k.original.memberKey,I=k.original.useInGrid||!1,j=!!k.original.profileImageUrl,U=O?A.has(O):!1,q=k.original.public?.image===!0||!k.original.public&&k.original.publicProfile===!0,Y=async W=>{if(!(!O||!c)){N(H=>new Set([...H,O]));try{await c(O,W),n?.(k.original.email,{useInGrid:W})}finally{N(H=>{const J=new Set(H);return J.delete(O),J})}}};return j?r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx("div",{className:"flex justify-center",children:r.jsx(ar,{checked:I,disabled:U||!O,onCheckedChange:Y,className:q?"border-green-500 data-[state=checked]:bg-green-500 data-[state=checked]:border-green-500":"border-red-400 data-[state=checked]:bg-red-400 data-[state=checked]:border-red-400"})})}),r.jsx(Ir,{children:r.jsxs("p",{className:"text-xs",children:[q?"Image is public":"Image is private"," — include in profile grid"]})})]})}):null}}],[F,A,o,c,n]),K=x.useMemo(()=>{let k=t;if(C==="donors"?k=k.filter(O=>O.donationStatus?.isDonor):C==="public"&&(k=k.filter(O=>O.publicProfile)),b&&b.trim()){const O=b.trim();if(O.length>100)return k;const I=O.toLowerCase();k=k.filter(j=>{const U=[j.firstName,j.middleName,j.lastName].filter(Boolean).join(" "),q=j.preferredName?[j.preferredName,j.lastName].filter(Boolean).join(" "):null;return!!([j.email,j.firstName,j.middleName,j.lastName,j.preferredName,U,q,j.city,j.stateProvince,j.country,j.bio,j.company,j.jobTitle,j.skills,j.interests,j.discordId,j.linkedIn,j.website].filter(Boolean).some(ie=>{try{return ie&&typeof ie=="string"&&ie.toLowerCase().includes(I)}catch{return!1}})||[...j.tracks||[],...j.requestedTracks||[],...j.leading||[]].some(ie=>{try{if(!ie||typeof ie!="string")return!1;const Q=P[ie];return Q&&Q.toLowerCase().includes(I)||ie.toLowerCase().includes(I)}catch{return!1}}))})}return k},[t,C,b,P]),B=IY({data:K,columns:T,getCoreRowModel:TY(),getSortedRowModel:DY(),getPaginationRowModel:RY(),autoResetPageIndex:!1,onSortingChange:p,state:{sorting:f},initialState:{pagination:{pageSize:10}}});return e?r.jsx(Ft,{className:"p-8 border-2",children:r.jsxs("div",{className:"flex items-center justify-center",children:[r.jsx(on,{className:"w-8 h-8 text-primary animate-spin"}),r.jsx("span",{className:"ml-2",children:"Loading members..."})]})}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Ft,{className:"p-2",children:r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{variant:C==="all"?"default":"outline",size:"sm",onClick:()=>S("all"),children:["All Members (",t.length,")"]}),r.jsxs(Fe,{variant:C==="donors"?"default":"outline",size:"sm",onClick:()=>S("donors"),children:["Donors (",t.filter(k=>k.donationStatus?.isDonor).length,")"]}),r.jsxs(Fe,{variant:C==="public"?"default":"outline",size:"sm",onClick:()=>S("public"),children:["Public Profiles (",t.filter(k=>k.publicProfile).length,")"]})]}),r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(Eu,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(un,{placeholder:"Search...",value:b??"",onChange:k=>v(String(k.target.value)),className:"pl-8"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Show:"}),r.jsxs(kx,{value:String(B.getState().pagination.pageSize),onValueChange:k=>{k==="all"?B.setPageSize(B.getFilteredRowModel().rows.length||10):B.setPageSize(Number(k))},className:"flex gap-2",children:[r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx(xl,{value:"10",id:"size-10",className:"h-3 w-3"}),r.jsx(Ht,{htmlFor:"size-10",className:"text-xs cursor-pointer",children:"10"})]}),r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx(xl,{value:"20",id:"size-20",className:"h-3 w-3"}),r.jsx(Ht,{htmlFor:"size-20",className:"text-xs cursor-pointer",children:"20"})]}),r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx(xl,{value:String(B.getFilteredRowModel().rows.length||10),id:"size-all",className:"h-3 w-3"}),r.jsx(Ht,{htmlFor:"size-all",className:"text-xs cursor-pointer",children:"All"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>B.previousPage(),disabled:!B.getCanPreviousPage(),className:"h-7 px-2",children:"Prev"}),r.jsx("div",{className:"flex-1",children:r.jsx(uf,{value:[B.getState().pagination.pageIndex],onValueChange:k=>B.setPageIndex(k[0]),max:Math.max(0,B.getPageCount()-1),step:1,className:"w-full"})}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>B.nextPage(),disabled:!B.getCanNextPage(),className:"h-7 px-2",children:"Next"}),r.jsxs("div",{className:"text-xs whitespace-nowrap",children:[B.getState().pagination.pageIndex+1,"/",B.getPageCount()]})]})]})}),r.jsxs(Ft,{className:"border-2",children:[r.jsx("div",{className:"overflow-x-auto",children:r.jsxs(Ww,{children:[r.jsx(Vw,{children:B.getHeaderGroups().map(k=>r.jsx(jd,{children:k.headers.map(O=>r.jsx(uo,{className:"px-1 py-1",children:O.isPlaceholder?null:j_(O.column.columnDef.header,O.getContext())},O.id))},k.id))}),r.jsx($w,{children:B.getRowModel().rows?.length?B.getRowModel().rows.map(k=>r.jsx(jd,{"data-state":k.getIsSelected()&&"selected",children:k.getVisibleCells().map(O=>r.jsx(Ds,{className:"px-1 py-1",children:j_(O.column.columnDef.cell,O.getContext())},O.id))},k.id)):r.jsx(jd,{children:r.jsx(Ds,{colSpan:T.length,className:"h-24 text-center",children:"No members found."})})})]})}),r.jsxs("div",{className:"py-2 px-4 border-t text-xs text-muted-foreground text-center",children:["Showing ",B.getState().pagination.pageIndex*B.getState().pagination.pageSize+1," to"," ",Math.min((B.getState().pagination.pageIndex+1)*B.getState().pagination.pageSize,B.getFilteredRowModel().rows.length)," ","of ",B.getFilteredRowModel().rows.length," members"]})]})]})}const L_=[{id:"requested",label:"Requested",description:"Reset to initial request state"},{id:"approved",label:"Approved",description:"Re-send notification email"}
4345,{id:"notified",label:"Notified",description:"Mark as notified"},{id:"activated",label:"Activated",description:"Create Google account"},{id:"verified",label:"Verified",description:"Bypass verification"},{id:"primary",label:"Primary",description:"Toggle primary email"}];function iq(t,e,n){if(e)return 6;switch(t){case"verified":return 4;case"activated":return 3;case"notified":return 2;case"approved":return 1;case"error":return 1;case"requested":return 0;default:return n?3:-1}}function sq(t,e){return t==="activated"||t==="verified"||!!e}function oq({open:t,onOpenChange:e,member:n,sessionId:a,onActionComplete:i}){const{toast:s}=nr(),[o,c]=x.useState(null),[d,m]=x.useState(null);if(!n)return null;const f=n.requestedEmail,p=f?.status,b=f?.approvedHandle,v=b?`${b}@xrguild.org`:n.guildEmail,C=f?.useGuildEmail,S=iq(p,C,n.guildEmail),F=sq(p,n.guildEmail),w=n.preferredName||(n.firstName&&n.lastName?`${n.firstName} ${n.lastName}`:n.email),A=async(z,D,T={})=>{c(z);try{const K=await fetch(D,{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":a},body:JSON.stringify({memberKey:n.memberKey,...T})}),B=await K.json();K.ok&&B.success?(s({title:"Action Complete",description:B.message||`${z} completed successfully`}),i?.(B.activatedHandles),e(!1)):s({title:"Error",description:B.message||`Failed to ${z.toLowerCase()}`,variant:"destructive"})}catch(K){console.error(`Error performing ${z}:`,K),s({title:"Error",description:`An error occurred while performing ${z.toLowerCase()}`,variant:"destructive"})}finally{c(null)}},N=(z,D)=>{if(!(D===S&&z!=="primary"))switch(z){case"requested":m({open:!0,title:"Reset to Requested",description:F?`This will DELETE the Google account ${v} and reset the status to "Requested". All emails and data will be lost. Continue?`:`This will reset the status to "Requested" and delete any existing Google account for ${v}. Continue?`,destructive:!0,onConfirm:()=>{m(null),A("Reset to Requested","/api/admin/guild-email/reset-status",{targetStatus:"requested",deleteAccount:!0})}});break;case"approved":F?m({open:!0,title:"Reset to Approved",description:`This will DELETE the Google account ${v} and re-send the notification email. Continue?`,destructive:!0,onConfirm:()=>{m(null),A("Reset to Approved","/api/admin/guild-email/resend-notification",{deleteAccount:!0})}}):A("Send Notification","/api/admin/guild-email/resend-notification");break;case"notified":F?m({open:!0,title:"Reset to Notified",description:`This will DELETE the Google account ${v} and reset status to "Notified". Continue?`,destructive:!0,onConfirm:()=>{m(null),A("Reset to Notified","/api/admin/guild-email/reset-status",{targetStatus:"notified",deleteAccount:!0})}}):D>S?A("Mark as Notified","/api/admin/guild-email/reset-status",{targetStatus:"notified"}):A("Resend Notification","/api/admin/guild-email/resend-notification");break;case"activated":m({open:!0,title:F?"Resend Account Email":"Activate Guild Email",description:F?`This will generate a new password and resend the account setup email for ${v}. Continue?`:`This will create the Google account ${v} for ${w}. Continue?`,onConfirm:()=>{m(null),A("Activate","/api/admin/guild-email/create-account")}});break;case"verified":D>=S?m({open:!0,title:"Mark as Verified",description:`This will bypass the email verification requirement and mark ${v} as verified. Continue?`,onConfirm:()=>{m(null),A("Mark Verified","/api/admin/guild-email/reset-status",{targetStatus:"verified"})}}):m({open:!0,title:"Reset to Activated",description:`This will reset status to "Activated" and resend the account setup email for ${v}. Continue?`,onConfirm:()=>{m(null),A("Reset to Activated","/api/admin/guild-email/create-account")}});break;case"primary":const T=!C;A(T?"Set as Primary":"Remove Primary","/api/admin/guild-email/toggle-primary",{useGuildEmail:T,setVerified:T});break}},P=z=>z?new Date(z).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null;return r.jsxs(r.Fragment,{children:[r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"max-w-xl",children:[r.jsxs(ha,{children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Cr,{className:"h-5 w-5"}),r.jsx(ma,{children:"Guild Email Management"})]}),r.jsxs(Fa,{children:[w," • ",v||"No email approved yet"]})]}),f?.error&&r.jsx("div",{className:"bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 rounded-lg p-3",children:r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(po,{className:"h-4 w-4 text-red-600 mt-0.5"}),r.jsx("div",{className:"text-sm text-red-600",children:f.error})]})}),r.jsxs("div",{className:"py-4",children:[r.jsx("div",{className:"flex items-center justify-between",children:L_.map((z,D)=>{const T=D<S,K=D===S,B=D>S,k=o===null&&(D<S||D===S+1||z.id==="primary"&&S>=5||z.id==="verified"&&S===4),O=o===z.id;return r.jsxs("div",{className:"flex items-center flex-1 last:flex-none",children:[r.jsxs("button",{onClick:()=>k&&N(z.id,D),disabled:!k||o!==null,className:ln("flex flex-col items-center transition-all",k&&"cursor-pointer hover:scale-110",!k&&"cursor-default opacity-60"),title:k?z.description:void 0,children:[r.jsx("div",{className:ln("w-8 h-8 rounded-full flex items-center justify-center text-xs font-medium transition-all border-2",T&&"bg-green-500 border-green-500 text-white",K&&"bg-primary border-primary text-primary-foreground",B&&"bg-muted border-muted-foreground
4345/30 text-muted-foreground",k&&!T&&!K&&"hover:border-primary hover:text-primary"),children:O?r.jsx(on,{className:"w-4 h-4 animate-spin"}):T?r.jsx(oi,{className:"w-4 h-4"}):r.jsx("span",{children:D+1})}),r.jsx("span",{className:ln("mt-1.5 text-xs font-medium",T&&"text-green-600 dark:text-green-400",K&&"text-primary",B&&"text-muted-foreground"),children:z.label})]}),D<L_.length-1&&r.jsx("div",{className:ln("flex-1 h-0.5 mx-2",D<S?"bg-green-500":"bg-muted")})]},z.id)})}),r.jsxs("div",{className:"mt-3 text-center text-sm text-muted-foreground",children:[S===1&&"Waiting for admin approval",S===2&&"Approved - click Notified to send notification",S===3&&"Notification sent - waiting for member to activate",S===4&&"Account created - waiting for member to verify",S===5&&"Verified - member can set as primary",S>=6&&"Guild email is set as primary contact"]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground border-t pt-3 space-y-1",children:[f?.approvedBy&&r.jsxs("div",{children:["Approved by ",f.approvedBy," ",f.approvedAt&&`• ${P(f.approvedAt)}`]}),f?.activatedAt&&r.jsxs("div",{children:["Activated ",P(f.activatedAt)]}),f?.verifiedAt&&r.jsxs("div",{children:["Verified ",P(f.verifiedAt)]})]})]})}),r.jsx(Bm,{open:d?.open,onOpenChange:z=>!z&&m(null),children:r.jsxs(Gd,{children:[r.jsxs(Hd,{children:[r.jsx(Vd,{children:d?.title}),r.jsx($d,{children:d?.description})]}),r.jsxs(Wd,{children:[r.jsx(Fx,{children:"Cancel"}),r.jsx(mu,{onClick:d?.onConfirm,className:d?.destructive?"bg-red-600 hover:bg-red-700":void 0,children:"Continue"})]})]})})]})}function I_(t,e){return t?e==="monthly"?`$${t}/mo ($${t*12}/yr)`:e==="yearly"||e==="annual"?`$${t}/yr`:`$${t}`:"$0"}function lq({open:t,onOpenChange:e,previewData:n,allMembers:a,onApply:i}){const[s,o]=x.useState(!1),[c,d]=x.useState(!1),[m,f]=x.useState({});if(!n)return null;const{matched:p,unmatched:b,unchanged:v,totalRows:C,succeededRows:S,totalDonors:F}=n,w=D=>D in m?m[D]:b[D]?.suggestedMemberKey||null,A=(D,T)=>{f(K=>({...K,[D]:T}))},N=b.filter((D,T)=>w(T)).length,P=p.length+N,z=async()=>{o(!0);try{const D=[];for(let T=0;T<b.length;T++){const K=w(T);K&&D.push({donor:b[T],memberKey:K})}await i(p,D)}finally{o(!1)}};return r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Import Givebutter Transactions"}),r.jsxs(Fa,{children:[S," succeeded transactions from ",C," rows, ",F," unique donors"]})]}),r.jsxs("div",{className:"flex gap-4 text-sm mb-4",children:[r.jsxs("div",{className:"bg-green-50 border border-green-200 rounded px-3 py-2",children:[r.jsx("span",{className:"font-semibold text-green-700",children:p.length}),r.jsx("span",{className:"text-green-600 ml-1",children:"to update"})]}),r.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded px-3 py-2",children:[r.jsx("span",{className:"font-semibold",children:v}),r.jsx("span",{className:"text-muted-foreground ml-1",children:"unchanged"})]}),r.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded px-3 py-2",children:[r.jsx("span",{className:"font-semibold text-amber-700",children:b.length}),r.jsx("span",{className:"text-amber-600 ml-1",children:"unmatched"}),N>0&&r.jsxs("span",{className:"text-green-600 ml-1",children:["(",N," linked)"]})]})]}),p.length>0&&r.jsxs("div",{className:"mb-4",children:[r.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Members to Update"}),r.jsx("div",{className:"border rounded overflow-hidden",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{className:"bg-muted/50",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Member"}),r.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Current"}),r.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"New"}),r.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Changes"})]})}),r.jsx("tbody",{children:p.map(D=>r.jsxs("tr",{className:"border-t",children:[r.jsxs("td",{className:"px-3 py-2",children:[r.jsx("div",{className:"font-medium",children:D.memberName}),r.jsx("div",{className:"text-xs text-muted-foreground",children:D.memberEmail}),D.donorEmail!==D.memberEmail&&r.jsxs("div",{className:"text-xs text-blue-500",children:["via ",D.donorEmail]})]}),r.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:I_(D.currentAmount,D.currentFrequency)}),r.jsx("td",{className:"px-3 py-2 text-green-600 font-medium",children:I_(D.newAmount,D.newFrequency)}),r.jsx("td",{className:"px-3 py-2",children:r.jsxs("div",{className:"text-xs space-y-0.5",children:[D.changes.map((T,K)=>r.jsx("div",{className:"text-muted-foreground",children:T},K)),r.jsxs("div",{className:"text-blue-600",children:[D.transactionCount," transactions"]})]})})]},D.memberKey))})]})})]}),b.length>0&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("button",{className:"flex items-center gap-1 text-sm font-semibold text-amber-700 hover:text-amber-800",onClick:()=>d(!c),children:[c?r.jsx(Ja,{className:"h-4 w-4"}):r.jsx(nh,{className:"h-4 w-4"}),b.length," unmatched donors - link to members or skip"]}),c&&r.jsx("div",{className:"mt-2 space-y-2",children:b.map((D,T)=>{const K=w(T),B=K&&a.find(k=>k.memberKey===K)||null;return r.jsxs("div",{className:"border rounded p-3 bg-amber-50/30",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"font-medium",children:D.name}),r.jsxs("span",{className:"text-muted-foreground text-xs ml-2",children:["(",D.email,")"]}),D.postalCode&&r.jsxs("span",{className:"text-muted-foreground text-xs ml-2",children:["ZIP: ",D.postalCode]}),r.jsxs("span",{className:"text-xs ml-2",children:["$",D.totalAmount.toFixed(0),", ",D.transactionCount," txns"]})]}),K&&r.jsx(Fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-muted-foreground hover:text-destructive",onClick:()=>A(T,null),title:"Unlink (skip this donor)",children:r.jsx(gr,{className:"h-3 w-3"})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Link to:"}),r.jsx(yM,{members:a,onSelect:k=>A(T,k.memberKey),selectedMember:B,onClear:()=>A(T,null),placeholder:D.suggestedMemberName?`Suggested: ${D.suggestedMemberName}`:"Search member...",className:"flex-1",maxResults:5})]})]},T)})})]}),p.length===0&&b.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No member records need updating. All matched donors are already up to date."}),r.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[r.jsx(Fe,{variant:"outline",onClick:()=>e(!1),disabled:s,children:"Cancel"}),P>0&&r.jsx(Fe,{onClick:z,disabled:s,children:s?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}),"Applying..."]}):`Apply ${P} Changes`})]})]})})}function Xw(t,e){const n=x.useRef(e);x.useEffect(function(){e!==n.current&&t.attributionControl!=null&&(n.current!=null&&t.attributionControl.removeAttribution(n.current),e!=null&&t.attributionControl.addAttribution(e)),n.current=e},[t,e])}function cq(t,e,n){e.center!==n.center&&t.setLatLng(e.center),e.radius!=null&&e.radius!==n.radius&&t.setRadius(e.radius)}const VM=1;function $M(t){return Object.freeze({__version:VM,map:t})}function KM(t,e){return Object.freeze({...t,...e})}
4345const Zw=x.createContext(null),Qw=Zw.Provider;function df(){const t=x.useContext(Zw);if(t==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return t}function eS(t){function e(n,a){const{instance:i,context:s}=t(n).current;return x.useImperativeHandle(a,()=>i),n.children==null?null:Jt.createElement(Qw,{value:s},n.children)}return x.forwardRef(e)}function YM(t){function e(n,a){const[i,s]=x.useState(!1),{instance:o}=t(n,s).current;x.useImperativeHandle(a,()=>o),x.useEffect(function(){i&&o.update()},[o,i,n.children]);const c=o._contentNode;return c?_u.createPortal(n.children,c):null}return x.forwardRef(e)}function tS(t){function e(n,a){const{instance:i}=t(n).current;return x.useImperativeHandle(a,()=>i),null}return x.forwardRef(e)}function qM(t){return function(n){const a=df(),i=t(n,a),{instance:s}=i.current,o=x.useRef(n.position),{position:c}=n;return x.useEffect(function(){return s.addTo(a.map),function(){s.remove()}},[a.map,s]),x.useEffect(function(){c!=null&&c!==o.current&&(s.setPosition(c),o.current=c)},[s,c]),i}}function Bx(t,e){const n=x.useRef();x.useEffect(function(){return e!=null&&t.instance.on(e),n.current=e,function(){n.current!=null&&t.instance.off(n.current),n.current=null}},[t,e])}function hf(t,e){const n=t.pane??e.pane;return n?{...t,pane:n}:t}function JM(t,e){return function(a,i){const s=df(),o=t(hf(a,s),s);return Xw(s.map,a.attribution),Bx(o.current,a.eventHandlers),e(o.current,s,a,i),o}}var vm={exports:{}};var uq=vm.exports,B_;function XM(){return B_||(B_=1,(function(t,e){(function(n,a){a(e)})(uq,(function(n){var a="1.9.4";function i(u){var g,_,M,V;for(_=1,M=arguments.length;_<M;_++){V=arguments[_];for(g in V)u[g]=V[g]}return u}var s=Object.create||(function(){function u(){}return function(g){return u.prototype=g,new u}})();function o(u,g){var _=Array.prototype.slice;if(u.bind)return u.bind.apply(u,_.call(arguments,1));var M=_.call(arguments,2);return function(){return u.apply(g,M.length?M.concat(_.call(arguments)):arguments)}}var c=0;function d(u){return"_leaflet_id"in u||(u._leaflet_id=++c),u._leaflet_id}function m(u,g,_){var M,V,ce,Ue;return Ue=function(){M=!1,V&&(ce.apply(_,V),V=!1)},ce=function(){M?V=arguments:(u.apply(_,arguments),setTimeout(Ue,g),M=!0)},ce}function f(u,g,_){var M=g[1],V=g[0],ce=M-V;return u===M&&_?u:((u-V)%ce+ce)%ce+V}function p(){return!1}function b(u,g){if(g===!1)return u;var _=Math.pow(10,g===void 0?6:g);return Math.round(u*_)/_}function v(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function C(u){return v(u).split(/\s+/)}function S(u,g){Object.prototype.hasOwnProperty.call(u,"options")||(u.options=u.options?s(u.options):{});for(var _ in g)u.options[_]=g[_];return u.options}function F(u,g,_){var M=[];for(var V in u)M.push(encodeURIComponent(_?V.toUpperCase():V)+"="+encodeURIComponent(u[V]));return(!g||g.indexOf("?")===-1?"?":"&")+M.join("&")}var w=/\{ *([\w_ -]+) *\}/g;function A(u,g){return u.replace(w,function(_,M){var V=g[M];if(V===void 0)throw new Error("No value provided for variable "+_);return typeof V=="function"&&(V=V(g)),V})}var N=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"};function P(u,g){for(var _=0;_<u.length;_++)if(u[_]===g)return _;return-1}var z="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function D(u){return window["webkit"+u]||window["moz"+u]||window["ms"+u]}var T=0;function K(u){var g=+new Date,_=Math.max(0,16-(g-T));return T=g+_,window.setTimeout(u,_)}var B=window.requestAnimationFrame||D("RequestAnimationFrame")||K,k=window.cancelAnimationFrame||D("CancelAnimationFrame")||D("CancelRequestAnimationFrame")||function(u){window.clearTimeout(u)};function O(u,g,_){if(_&&B===K)u.call(g);else return B.call(window,o(u,g))}function I(u){u&&k.call(window,u)}var j={__proto__:null,extend:i,create:s,bind:o,get lastId(){return c},stamp:d,throttle:m,wrapNum:f,falseFn:p,formatNum:b,trim:v,splitWords:C,setOptions:S,getParamString:F,template:A,isArray:N,indexOf:P,emptyImageUrl:z,requestFn:B,cancelFn:k,requestAnimFrame:O,cancelAnimFrame:I};function U(){}U.extend=function(u){var g=function(){S(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},_=g.__super__=this.prototype,M=s(_);M.constructor=g,g.prototype=M;for(var V in this)Object.prototype.hasOwnProperty.call(this,V)&&V!=="prototype"&&V!=="__super__"&&(g[V]=this[V]);return u.statics&&i(g,u.statics),u.includes&&(q(u.includes),i.apply(null,[M].concat(u.includes))),i(M,u),delete M.statics,delete M.includes,M.options&&(M.options=_.options?s(_.options):{},i(M.options,u.options)),M._initHooks=[],M.callInitHooks=function(){if(!this._initHooksCalled){_.callInitHooks&&_.callInitHooks.call(this),this._initHooksCalled=!0;for(var ce=0,Ue=M._initHooks.length;ce<Ue;ce++)M._initHooks[ce].call(this)}},g},U.include=function(u){var g=this.prototype.options;return i(this.prototype,u),u.options&&(this.prototype.options=g,this.mergeOptions(u.options)),this},U.mergeOptions=function(u){return i(this.prototype.options,u),this},U.addInitHook=function(u){var g=Array.prototype.slice.call(arguments,1
4345),_=typeof u=="function"?u:function(){this[u].apply(this,g)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(_),this};function q(u){if(!(typeof L>"u"||!L||!L.Mixin)){u=N(u)?u:[u];for(var g=0;g<u.length;g++)u[g]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Y={on:function(u,g,_){if(typeof u=="object")for(var M in u)this._on(M,u[M],g);else{u=C(u);for(var V=0,ce=u.length;V<ce;V++)this._on(u[V],g,_)}return this},off:function(u,g,_){if(!arguments.length)delete this._events;else if(typeof u=="object")for(var M in u)this._off(M,u[M],g);else{u=C(u);for(var V=arguments.length===1,ce=0,Ue=u.length;ce<Ue;ce++)V?this._off(u[ce]):this._off(u[ce],g,_)}return this},_on:function(u,g,_,M){if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}if(this._listens(u,g,_)===!1){_===this&&(_=void 0);var V={fn:g,ctx:_};M&&(V.once=!0),this._events=this._events||{},this._events[u]=this._events[u]||[],this._events[u].push(V)}},_off:function(u,g,_){var M,V,ce;if(this._events&&(M=this._events[u],!!M)){if(arguments.length===1){if(this._firingCount)for(V=0,ce=M.length;V<ce;V++)M[V].fn=p;delete this._events[u];return}if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}var Ue=this._listens(u,g,_);if(Ue!==!1){var dt=M[Ue];this._firingCount&&(dt.fn=p,this._events[u]=M=M.slice()),M.splice(Ue,1)}}},fire:function(u,g,_){if(!this.listens(u,_))return this;var M=i({},g,{type:u,target:this,sourceTarget:g&&g.sourceTarget||this});if(this._events){var V=this._events[u];if(V){this._firingCount=this._firingCount+1||1;for(var ce=0,Ue=V.length;ce<Ue;ce++){var dt=V[ce],kt=dt.fn;dt.once&&this.off(u,kt,dt.ctx),kt.call(dt.ctx||this,M)}this._firingCount--}}return _&&this._propagateEvent(M),this},listens:function(u,g,_,M){typeof u!="string"&&console.warn('"string" type argument expected');var V=g;typeof g!="function"&&(M=!!g,V=void 0,_=void 0);var ce=this._events&&this._events[u];if(ce&&ce.length&&this._listens(u,V,_)!==!1)return!0;if(M){for(var Ue in this._eventParents)if(this._eventParents[Ue].listens(u,g,_,M))return!0}return!1},_listens:function(u,g,_){if(!this._events)return!1;var M=this._events[u]||[];if(!g)return!!M.length;_===this&&(_=void 0);for(var V=0,ce=M.length;V<ce;V++)if(M[V].fn===g&&M[V].ctx===_)return V;return!1},once:function(u,g,_){if(typeof u=="object")for(var M in u)this._on(M,u[M],g,!0);else{u=C(u);for(var V=0,ce=u.length;V<ce;V++)this._on(u[V],g,_,!0)}return this},addEventParent:function(u){return this._eventParents=this._eventParents||{},this._eventParents[d(u)]=u,this},removeEventParent:function(u){return this._eventParents&&delete this._eventParents[d(u)],this},_propagateEvent:function(u){for(var g in this._eventParents)this._eventParents[g].fire(u.type,i({layer:u.target,propagatedFrom:u.target},u),!0)}};Y.addEventListener=Y.on,Y.removeEventListener=Y.clearAllEventListeners=Y.off,Y.addOneTimeEventListener=Y.once,Y.fireEvent=Y.fire,Y.hasEventListeners=Y.listens;var W=U.extend(Y);function H(u,g,_){this.x=_?Math.round(u):u,this.y=_?Math.round(g):g}var J=Math.trunc||function(u){return u>0?Math.floor(u):Math.ceil(u)};H.prototype={clone:function(){return new H(this.x,this.y)},add:function(u){return this.clone()._add(ie(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(ie(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new H(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new H(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=J(this.x),this.y=J(this.y),this},distanceTo:function(u){u=ie(u);var g=u.x-this.x,_=u.y-this.y;return Math.sqrt(g*g+_*_)},equals:function(u){return u=ie(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=ie(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+b(this.x)+", "+b(this.y)+")"}};function ie(u,g,_){return u instanceof H?u:N(u)?new H(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new H(u.x,u.y):new H(u,g,_)}function Q(u,g){if(u)for(var _=g?[u,g]:u,M=0,V=_.length;M<V;M++)this.extend(_[M])}Q.prototype={extend:function(u){var g,_;if(!u)return this;
4345if(u instanceof H||typeof u[0]=="number"||"x"in u)g=_=ie(u);else if(u=ve(u),g=u.min,_=u.max,!g||!_)return this;return!this.min&&!this.max?(this.min=g.clone(),this.max=_.clone()):(this.min.x=Math.min(g.x,this.min.x),this.max.x=Math.max(_.x,this.max.x),this.min.y=Math.min(g.y,this.min.y),this.max.y=Math.max(_.y,this.max.y)),this},getCenter:function(u){return ie((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,u)},getBottomLeft:function(){return ie(this.min.x,this.max.y)},getTopRight:function(){return ie(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(u){var g,_;return typeof u[0]=="number"||u instanceof H?u=ie(u):u=ve(u),u instanceof Q?(g=u.min,_=u.max):g=_=u,g.x>=this.min.x&&_.x<=this.max.x&&g.y>=this.min.y&&_.y<=this.max.y},intersects:function(u){u=ve(u);var g=this.min,_=this.max,M=u.min,V=u.max,ce=V.x>=g.x&&M.x<=_.x,Ue=V.y>=g.y&&M.y<=_.y;return ce&&Ue},overlaps:function(u){u=ve(u);var g=this.min,_=this.max,M=u.min,V=u.max,ce=V.x>g.x&&M.x<_.x,Ue=V.y>g.y&&M.y<_.y;return ce&&Ue},isValid:function(){return!!(this.min&&this.max)},pad:function(u){var g=this.min,_=this.max,M=Math.abs(g.x-_.x)*u,V=Math.abs(g.y-_.y)*u;return ve(ie(g.x-M,g.y-V),ie(_.x+M,_.y+V))},equals:function(u){return u?(u=ve(u),this.min.equals(u.getTopLeft())&&this.max.equals(u.getBottomRight())):!1}};function ve(u,g){return!u||u instanceof Q?u:new Q(u,g)}function pe(u,g){if(u)for(var _=g?[u,g]:u,M=0,V=_.length;M<V;M++)this.extend(_[M])}pe.prototype={extend:function(u){var g=this._southWest,_=this._northEast,M,V;if(u instanceof We)M=u,V=u;else if(u instanceof pe){if(M=u._southWest,V=u._northEast,!M||!V)return this}else return u?this.extend(Ae(u)||Me(u)):this;return!g&&!_?(this._southWest=new We(M.lat,M.lng),this._northEast=new We(V.lat,V.lng)):(g.lat=Math.min(M.lat,g.lat),g.lng=Math.min(M.lng,g.lng),_.lat=Math.max(V.lat,_.lat),_.lng=Math.max(V.lng,_.lng)),this},pad:function(u){var g=this._southWest,_=this._northEast,M=Math.abs(g.lat-_.lat)*u,V=Math.abs(g.lng-_.lng)*u;return new pe(new We(g.lat-M,g.lng-V),new We(_.lat+M,_.lng+V))},getCenter:function(){return new We((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new We(this.getNorth(),this.getWest())},getSouthEast:function(){return new We(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(u){typeof u[0]=="number"||u instanceof We||"lat"in u?u=Ae(u):u=Me(u);var g=this._southWest,_=this._northEast,M,V;
4345return u instanceof pe?(M=u.getSouthWest(),V=u.getNorthEast()):M=V=u,M.lat>=g.lat&&V.lat<=_.lat&&M.lng>=g.lng&&V.lng<=_.lng},intersects:function(u){u=Me(u);var g=this._southWest,_=this._northEast,M=u.getSouthWest(),V=u.getNorthEast(),ce=V.lat>=g.lat&&M.lat<=_.lat,Ue=V.lng>=g.lng&&M.lng<=_.lng;return ce&&Ue},overlaps:function(u){u=Me(u);var g=this._southWest,_=this._northEast,M=u.getSouthWest(),V=u.getNorthEast(),ce=V.lat>g.lat&&M.lat<_.lat,Ue=V.lng>g.lng&&M.lng<_.lng;return ce&&Ue},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(u,g){return u?(u=Me(u),this._southWest.equals(u.getSouthWest(),g)&&this._northEast.equals(u.getNorthEast(),g)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Me(u,g){return u instanceof pe?u:new pe(u,g)}function We(u,g,_){if(isNaN(u)||isNaN(g))throw new Error("Invalid LatLng object: ("+u+", "+g+")");this.lat=+u,this.lng=+g,_!==void 0&&(this.alt=+_)}We.prototype={equals:function(u,g){if(!u)return!1;u=Ae(u);var _=Math.max(Math.abs(this.lat-u.lat),Math.abs(this.lng-u.lng));return _<=(g===void 0?1e-9:g)},toString:function(u){return"LatLng("+b(this.lat,u)+", "+b(this.lng,u)+")"},distanceTo:function(u){return He.distance(this,Ae(u))},wrap:function(){return He.wrapLatLng(this)},toBounds:function(u){var g=180*u/40075017,_=g/Math.cos(Math.PI/180*this.lat);return Me([this.lat-g,this.lng-_],[this.lat+g,this.lng+_])},clone:function(){return new We(this.lat,this.lng,this.alt)}};function Ae(u,g,_){return u instanceof We?u:N(u)&&typeof u[0]!="object"?u.length===3?new We(u[0],u[1],u[2]):u.length===2?new We(u[0],u[1]):null:u==null?u:typeof u=="object"&&"lat"in u?new We(u.lat,"lng"in u?u.lng:u.lon,u.alt):g===void 0?null:new We(u,g,_)}var Ce={latLngToPoint:function(u,g){var _=this.projection.project(u),M=this.scale(g);return this.transformation._transform(_,M)},pointToLatLng:function(u,g){var _=this.scale(g),M=this.transformation.untransform(u,_);return this.projection.unproject(M)},project:function(u){return this.projection.project(u)},unproject:function(u){return this.projection.unproject(u)},scale:function(u){return 256*Math.pow(2,u)},zoom:function(u){return Math.log(u/256)/Math.LN2},getProjectedBounds:function(u){if(this.infinite)return null;var g=this.projection.bounds,_=this.scale(u),M=this.transformation.transform(g.min,_),V=this.transformation.transform(g.max,_);return new Q(M,V)},infinite:!1,wrapLatLng:function(u){var g=this.wrapLng?f(u.lng,this.wrapLng,!0):u.lng,_=this.wrapLat?f(u.lat,this.wrapLat,!0):u.lat,M=u.alt;return new We(_,g,M)},wrapLatLngBounds:function(u){var g=u.getCenter(),_=this.wrapLatLng(g),M=g.lat-_.lat,V=g.lng-_.lng;if(M===0&&V===0)return u;
4345var ce=u.getSouthWest(),Ue=u.getNorthEast(),dt=new We(ce.lat-M,ce.lng-V),kt=new We(Ue.lat-M,Ue.lng-V);return new pe(dt,kt)}},He=i({},Ce,{wrapLng:[-180,180],R:6371e3,distance:function(u,g){var _=Math.PI/180,M=u.lat*_,V=g.lat*_,ce=Math.sin((g.lat-u.lat)*_/2),Ue=Math.sin((g.lng-u.lng)*_/2),dt=ce*ce+Math.cos(M)*Math.cos(V)*Ue*Ue,kt=2*Math.atan2(Math.sqrt(dt),Math.sqrt(1-dt));return this.R*kt}}),Ct=6378137,bt={R:Ct,MAX_LATITUDE:85.0511287798,project:function(u){var g=Math.PI/180,_=this.MAX_LATITUDE,M=Math.max(Math.min(_,u.lat),-_),V=Math.sin(M*g);return new H(this.R*u.lng*g,this.R*Math.log((1+V)/(1-V))/2)},unproject:function(u){var g=180/Math.PI;return new We((2*Math.atan(Math.exp(u.y/this.R))-Math.PI/2)*g,u.x*g/this.R)},bounds:(function(){var u=Ct*Math.PI;return new Q([-u,-u],[u,u])})()};function Rt(u,g,_,M){if(N(u)){this._a=u[0],this._b=u[1],this._c=u[2],this._d=u[3];return}this._a=u,this._b=g,this._c=_,this._d=M}Rt.prototype={transform:function(u,g){return this._transform(u.clone(),g)},_transform:function(u,g){return g=g||1,u.x=g*(this._a*u.x+this._b),u.y=g*(this._c*u.y+this._d),u},untransform:function(u,g){return g=g||1,new H((u.x/g-this._b)/this._a,(u.y/g-this._d)/this._c)}};function zt(u,g,_,M){return new Rt(u,g,_,M)}var Ut=i({},He,{code:"EPSG:3857",projection:bt,transformation:(function(){var u=.5/(Math.PI*bt.R);return zt(u,.5,-u,.5)})()}),Bt=i({},Ut,{code:"EPSG:900913"});function re(u){return document.createElementNS("http://www.w3.org/2000/svg",u)}function wt(u,g){var _="",M,V,ce,Ue,dt,kt;for(M=0,ce=u.length;M<ce;M++){for(dt=u[M],V=0,Ue=dt.length;V<Ue;V++)kt=dt[V],_+=(V?"L":"M")+kt.x+" "+kt.y;_+=g?Ge.svg?"z":"x":""}return _||"M0 0"}var Nt=document.documentElement.style,vt="ActiveXObject"in window,Tt=vt&&!document.addEventListener,Wt="msLaunchUri"in navigator&&!("documentMode"in document),Dt=et("webkit"),jt=et("android"),he=et("android 2")||et("android 3"),ee=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ze=jt&&et("Google")&&ee<537&&!("AudioNode"in window),Ve=!!window.opera,lt=!Wt&&et("chrome"),qe=et("gecko")&&!Dt&&!Ve&&!vt,It=!lt&&et("safari"),gt=et("phantom"),Ee="OTransition"in Nt,Je=navigator.platform.indexOf("Win")===0,$e=vt&&"transition"in Nt,Xe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!he,X="MozPerspective"in Nt,ke=!window.L_DISABLE_3D&&($e||Xe||X)&&!Ee&&!gt,De=typeof orientation<"u"||et("mobile"),oe=De&&Dt,te=De&&Xe,ye=!window.PointerEvent&&window.MSPointerEvent,Re=!!(window.PointerEvent||ye),Le="ontouchstart"in window||!!window.TouchEvent,fe=!window.L_NO_TOUCH&&(Le||Re),Se=De&&Ve,Be=De&&qe,Ze=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,ue=(function(){var u=!1;try{var g=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",p,g),window.removeEventListener("testPassiveEventSupport",p,g)}catch{}return u})(),rt=(function(){return!!document.createElement("canvas").getContext})(),je=!!(document.createElementNS&&re("svg").createSVGRect),_t=!!je&&(function(){var u=document.createElement("div");return u.innerHTML="<svg/>",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Kt=!je&&(function(){try{var u=document.createElement("div");u.innerHTML='<v:shape adj="1"/>';var g=u.firstChild;return g.style.behavior="url(#default#VML)",g&&typeof g.adj=="object"}catch{return!1}})(),gn=navigator.platform.indexOf("Mac")===0,_e=navigator.platform.indexOf("Linux")===0;function et(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var Ge={ie:vt,ielt9:Tt,edge:Wt,webkit:Dt,android:jt,android23:he,androidStock:ze,opera:Ve,chrome:lt,gecko:qe,safari:It,phantom:gt,opera12:Ee,win:Je,ie3d:$e,webkit3d:Xe,gecko3d:X,any3d:ke,mobile:De,mobileWebkit:oe,mobileWebkit3d:te,msPointer:ye,pointer:Re,touch:fe,touchNative:Le,mobileOpera:Se,mobileGecko:Be,retina:Ze,passiveEvents:ue,canvas:rt,svg:je,vml:Kt,inlineSvg:_t,mac:gn,linux:_e},ht=Ge.msPointer?"MSPointerDown":"pointerdown",ft=Ge.msPointer?"MSPointerMove":"pointermove",Mt=Ge.msPointer?"MSPointerUp":"pointerup",be=Ge.msPointer?"MSPointerCancel":"pointercancel",Z={touchstart:ht,touchmove:ft,touchend:Mt,touchcancel:be},it={touchstart:ne,touchmove:xe,touchend:xe,touchcancel:xe},we={},st=!1;function Lt(u,g,_){return g==="touchstart"&&$(),it[g]?(_=it[g].bind(this,_),u.addEventListener(Z[g],_,!1),_):(console.warn("wrong event specified:",g),p)}function Ot(u,g,_){if(!Z[g]){console.warn("wrong event specified:",g);return}u.removeEventListener(Z[g],_,!1)}function Et(u){we[u.pointerId]=u}function tt(u){we[u.pointerId]&&(we[u.pointerId]=u)}function ge(u){delete we[u.pointerId]}function $(){st||(document.addEventListener(ht,Et,!0),document.addEventListener(ft,tt,!0),document.addEventListener(Mt,ge,!0),document.addEventListener(be,ge,!0),st=!0)}function xe(u,g){if(g.pointerType!==(g.MSPOINTER_TYPE_MOUSE||"mouse")){g.touches=[];for(var _ in we)g.touches.push(we[_]);g.changedTouches=[g],u(g)}}function ne(u,g){g.MSPOINTER_TYPE_TOUCH&&g.pointerType===g.MSPOINTER_TYPE_TOUCH&&xn(g),xe(u,g)}function me(u){var g={},_,M;for(M in u)_=u[M],g[M]=_&&_.bind?_.bind(u):_;return u=g,g.type="dblclick",g.detail=2,g.isTrusted=!1,g._simulated=!0,g}var de=200;function Ie(u,g){u.addEventListener("dblclick",g);var _=0,M;function V(ce){if(ce.detail!==1){M=ce.detail;return}if(!(ce.pointerType==="mouse"||ce.sourceCapabilities&&!ce.sourceCapabilities.firesTouchEvents)){var Ue=mr(ce);if(!(Ue.some(function(kt){return kt instanceof HTMLLabelElement&&kt.attributes.for})&&!Ue.some(function(kt){return kt instanceof HTMLInputElement||kt instanceof HTMLSelectElement}))){var dt=Date.now();dt-_<=de?(M++,M===2&&g(me(ce))):M=1,_=dt}}}return u.addEventListener("click",V),{dblclick:g,simDblclick:V}}function Ke(u,g){u.removeEventListener("dblclick",g.dblclick),u.removeEventListener("click",g.simDblclick)}var ut=Gt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=Gt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Te=ae==="webkitTransition"||ae==="OTransition"?ae+"End":"transitionend";function Qe(u){return typeof u=="string"?document.getElementById(u):u}function ot(u,g){var _=u.style[g]||u.currentStyle&&u.currentStyle[g];if((!_||_==="auto")&&document.defaultView){var M=document.defaultView.getComputedStyle(u,null);_=M?M[g]:null}return _==="auto"?null:_}function pt(u,g,_){var M=document.createElement(u);return M.className=g||"",_&&_.appendChild(M),M}function ct(u){var g=u.parentNode;g&&g.removeChild(u)}function Vt(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function sn(u){var g=u.parentNode;g&&g.lastChild!==u&&g.appendChild(u)}function cn(u){var g=u.parentNode;g&&g.firstChild!==u&&g.insertBefore(u,g.firstChild)}function St(u,g){if(u.classList!==void 0)return u.classList.contains(g);var _=at(u);return _.length>0&&new RegExp("(^|\\s)"+g+"(\\s|$)").test(_)}function le(u,g){if(u.classList!==void 0)for(var _=C(g),M=0,V=_.length;M<V;M++)u.classList.add(_[M]);else if(!St(u,g)){var ce=at(u);Oe(u,(ce?ce+" ":"")+g)}}function Ne(u,g){u.classList!==void 0?u.classList.remove(g):Oe(u,v((" "+at(u)+" ").replace(" "+g+" "," ")))}function Oe(u,g){u.className.baseVal===void 0?u.className=g:u.className.baseVal=g}function at(u){return u.correspondingElement&&(u=u.correspondingElement),u.className.baseVal===void 0?u.className:u.className.baseVal}function xt(u,g){"opacity"in u.style?u.style.opacity=g:"filter"in u.style&&Qt(u,g)}function Qt(u,g){var _=!1,M="DXImageTransform.Microsoft.Alpha";try{_=u.filters.item(M)}catch{if(g===1)return}g=Math.round(g*100),_?(_.Enabled=g!==100,_.Opacity=g):u.style.filter+=" progid:"+M+"(opacity="+g+")"}function Gt(u){for(var g=document.documentElement.style,_=0;_<u.length;_++)if(u[_]in g)return u[_];return!1}
4345function Xt(u,g,_){var M=g||new H(0,0);u.style[ut]=(Ge.ie3d?"translate("+M.x+"px,"+M.y+"px)":"translate3d("+M.x+"px,"+M.y+"px,0)")+(_?" scale("+_+")":"")}function Zt(u,g){u._leaflet_pos=g,Ge.any3d?Xt(u,g):(u.style.left=g.x+"px",u.style.top=g.y+"px")}function _n(u){return u._leaflet_pos||new H(0,0)}var rn,or,Nr;if("onselectstart"in document)rn=function(){jn(window,"selectstart",xn)},or=function(){hr(window,"selectstart",xn)};else{var Ca=Gt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);rn=function(){if(Ca){var u=document.documentElement.style;Nr=u[Ca],u[Ca]="none"}},or=function(){Ca&&(document.documentElement.style[Ca]=Nr,Nr=void 0)}}function qi(){jn(window,"dragstart",xn)}function fs(){hr(window,"dragstart",xn)}var _a,Pa;function qr(u){for(;u.tabIndex===-1;)u=u.parentNode;u.style&&(Jr(),_a=u,Pa=u.style.outlineStyle,u.style.outlineStyle="none",jn(window,"keydown",Jr))}function Jr(){_a&&(_a.style.outlineStyle=Pa,_a=void 0,Pa=void 0,hr(window,"keydown",Jr))}function ui(u){do u=u.parentNode;while((!u.offsetWidth||!u.offsetHeight)&&u!==document.body);return u}function Ea(u){var g=u.getBoundingClientRect();return{x:g.width/u.offsetWidth||1,y:g.height/u.offsetHeight||1,boundingClientRect:g}}var ja={__proto__:null,TRANSFORM:ut,TRANSITION:ae,TRANSITION_END:Te,get:Qe,getStyle:ot,create:pt,remove:ct,empty:Vt,toFront:sn,toBack:cn,hasClass:St,addClass:le,removeClass:Ne,setClass:Oe,getClass:at,setOpacity:xt,testProp:Gt,setTransform:Xt,setPosition:Zt,getPosition:_n,get disableTextSelection(){return rn},get enableTextSelection(){return or},disableImageDrag:qi,enableImageDrag:fs,preventOutline:qr,restoreOutline:Jr,getSizedParentNode:ui,getScale:Ea};function jn(u,g,_,M){if(g&&typeof g=="object")for(var V in g)mn(u,V,g[V],_);else{g=C(g);for(var ce=0,Ue=g.length;ce<Ue;ce++)mn(u,g[ce],_,M)}return this}var Br="_leaflet_events";function hr(u,g,_,M){if(arguments.length===1)Io(u),delete u[Br];else if(g&&typeof g=="object")for(var V in g)En(u,V,g[V],_);else if(g=C(g),arguments.length===2)Io(u,function(dt){return P(g,dt)!==-1});else for(var ce=0,Ue=g.length;ce<Ue;ce++)En(u,g[ce],_,M);return this}function Io(u,g){for(var _ in u[Br]){var M=_.split(/\d/)[0];(!g||g(M))&&En(u,M,null,null,_)}}
4345var Ai={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function mn(u,g,_,M){var V=g+d(_)+(M?"_"+d(M):"");if(u[Br]&&u[Br][V])return this;var ce=function(dt){return _.call(M||u,dt||window.event)},Ue=ce;!Ge.touchNative&&Ge.pointer&&g.indexOf("touch")===0?ce=Lt(u,g,ce):Ge.touch&&g==="dblclick"?ce=Ie(u,ce):"addEventListener"in u?g==="touchstart"||g==="touchmove"||g==="wheel"||g==="mousewheel"?u.addEventListener(Ai[g]||g,ce,Ge.passiveEvents?{passive:!1}:!1):g==="mouseenter"||g==="mouseleave"?(ce=function(dt){dt=dt||window.event,ka(u,dt)&&Ue(dt)},u.addEventListener(Ai[g],ce,!1)):u.addEventListener(g,Ue,!1):u.attachEvent("on"+g,ce),u[Br]=u[Br]||{},u[Br][V]=ce}function En(u,g,_,M,V){V=V||g+d(_)+(M?"_"+d(M):"");var ce=u[Br]&&u[Br][V];if(!ce)return this;!Ge.touchNative&&Ge.pointer&&g.indexOf("touch")===0?Ot(u,g,ce):Ge.touch&&g==="dblclick"?Ke(u,ce):"removeEventListener"in u?u.removeEventListener(Ai[g]||g,ce,!1):u.detachEvent("on"+g,ce),u[Br][V]=null}function Sn(u){return u.stopPropagation?u.stopPropagation():u.originalEvent?u.originalEvent._stopped=!0:u.cancelBubble=!0,this}function Wn(u){return mn(u,"wheel",Sn),this}function yn(u){return jn(u,"mousedown touchstart dblclick contextmenu",Sn),u._leaflet_disable_click=!0,this}function xn(u){return u.preventDefault?u.preventDefault():u.returnValue=!1,this}function Mn(u){return xn(u),Sn(u),this}function mr(u){if(u.composedPath)return u.composedPath();for(var g=[],_=u.target;_;)g.push(_),_=_.parentNode;return g}function zn(u,g){if(!g)return new H(u.clientX,u.clientY);var _=Ea(g),M=_.boundingClientRect;return new H((u.clientX-M.left)/_.x-g.clientLeft,(u.clientY-M.top)/_.y-g.clientTop)}var lr=Ge.linux&&Ge.chrome?window.devicePixelRatio:Ge.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function qn(u){return Ge.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/lr:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function ka(u,g){var _=g.relatedTarget;if(!_)return!0;try{for(;_&&_!==u;)_=_.parentNode}catch{return!1}return _!==u}var Ji={__proto__:null,on:jn,off:hr,stopPropagation:Sn,disableScrollPropagation:Wn,disableClickPropagation:yn,preventDefault:xn,stop:Mn,getPropagationPath:mr,getMousePosition:zn,getWheelDelta:qn,isExternalTarget:ka,addListener:jn,removeListener:hr},La=W.extend({run:function(u,g,_,M){this.stop(),this._el=u,this._inProgress=!0,this._duration=_||.25,this._easeOutPower=1/Math.max(M||.5,.2),this._startPos=_n(u),this._offset=g.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=O(this._animate,this),this._step()},_step:function(u){var g=+new Date-this._startTime,_=this._duration*1e3;g<_?this._runFrame(this._easeOut(g/_),u):(this._runFrame(1),this._complete())},_runFrame:function(u,g){var _=this._startPos.add(this._offset.multiplyBy(u));g&&_._round(),Zt(this._el,_),this.fire("step")},_complete:function(){I(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(u){return 1-Math.pow(1-u,this._easeOutPower)}}),Vn=W.extend({options:{crs:Ut,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(u,g){g=S(this,g),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(u),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),g.maxBounds&&this.setMaxBounds(g.maxBounds),g.zoom!==void 0&&(this._zoom=this._limitZoom(g.zoom)),g.center&&g.zoom!==void 0&&this.setView(Ae(g.center),g.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&Ge.any3d&&!Ge.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),jn(this._proxy,Te,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
4345,setView:function(u,g,_){if(g=g===void 0?this._zoom:this._limitZoom(g),u=this._limitCenter(Ae(u),g,this.options.maxBounds),_=_||{},this._stop(),this._loaded&&!_.reset&&_!==!0){_.animate!==void 0&&(_.zoom=i({animate:_.animate},_.zoom),_.pan=i({animate:_.animate,duration:_.duration},_.pan));var M=this._zoom!==g?this._tryAnimatedZoom&&this._tryAnimatedZoom(u,g,_.zoom):this._tryAnimatedPan(u,_.pan);if(M)return clearTimeout(this._sizeTimer),this}return this._resetView(u,g,_.pan&&_.pan.noMoveStart),this},setZoom:function(u,g){return this._loaded?this.setView(this.getCenter(),u,{zoom:g}):(this._zoom=u,this)},zoomIn:function(u,g){return u=u||(Ge.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+u,g)},zoomOut:function(u,g){return u=u||(Ge.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-u,g)},setZoomAround:function(u,g,_){var M=this.getZoomScale(g),V=this.getSize().divideBy(2),ce=u instanceof H?u:this.latLngToContainerPoint(u),Ue=ce.subtract(V).multiplyBy(1-1/M),dt=this.containerPointToLatLng(V.add(Ue));return this.setView(dt,g,{zoom:_})},_getBoundsCenterZoom:function(u,g){g=g||{},u=u.getBounds?u.getBounds():Me(u);var _=ie(g.paddingTopLeft||g.padding||[0,0]),M=ie(g.paddingBottomRight||g.padding||[0,0]),V=this.getBoundsZoom(u,!1,_.add(M));if(V=typeof g.maxZoom=="number"?Math.min(g.maxZoom,V):V,V===1/0)return{center:u.getCenter(),zoom:V};
4345var ce=M.subtract(_).divideBy(2),Ue=this.project(u.getSouthWest(),V),dt=this.project(u.getNorthEast(),V),kt=this.unproject(Ue.add(dt).divideBy(2).add(ce),V);return{center:kt,zoom:V}},fitBounds:function(u,g){if(u=Me(u),!u.isValid())throw new Error("Bounds are not valid.");var _=this._getBoundsCenterZoom(u,g);return this.setView(_.center,_.zoom,g)},fitWorld:function(u){return this.fitBounds([[-90,-180],[90,180]],u)},panTo:function(u,g){return this.setView(u,this._zoom,{pan:g})},panBy:function(u,g){if(u=ie(u).round(),g=g||{},!u.x&&!u.y)return this.fire("moveend");if(g.animate!==!0&&!this.getSize().contains(u))return this._resetView(this.unproject(this.project(this.getCenter()).add(u)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new La,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),g.noMoveStart||this.fire("movestart"),g.animate!==!1){le(this._mapPane,"leaflet-pan-anim");var _=this._getMapPanePos().subtract(u).round();this._panAnim.run(this._mapPane,_,g.duration||.25,g.easeLinearity)}else this._rawPanBy(u),this.fire("move").fire("moveend");return this},flyTo:function(u,g,_){if(_=_||{},_.animate===!1||!Ge.any3d)return this.setView(u,g,_);this._stop();var M=this.project(this.getCenter()),V=this.project(u),ce=this.getSize(),Ue=this._zoom;u=Ae(u),g=g===void 0?Ue:g;var dt=Math.max(ce.x,ce.y),kt=dt*this.getZoomScale(Ue,g),$t=V.distanceTo(M)||1,hn=1.42,Rn=hn*hn;function Kn(fr){var Ul=fr?-1:1,Xx=fr?kt:dt,Zx=kt*kt-dt*dt+Ul*Rn*Rn*$t*$t,Vo=2*Xx*Rn*$t,$o=Zx/Vo,Ko=Math.sqrt($o*$o+1)-$o,zu=Ko<1e-9?-18:Math.log(Ko);return zu}function oa(fr){return(Math.exp(fr)-Math.exp(-fr))/2}function Zr(fr){return(Math.exp(fr)+Math.exp(-fr))/2}function ei(fr){return oa(fr)/Zr(fr)}var za=Kn(0);function Bl(fr){return dt*(Zr(za)/Zr(za+hn*fr))}function Rh(fr){return dt*(Zr(za)*ei(za+hn*fr)-oa(za))/Rn}function ao(fr){return 1-Math.pow(1-fr,1.5)}var Mf=Date.now(),Wo=(Kn(1)-za)/hn,ts=_.duration?1e3*_.duration:1e3*Wo*.8;function Ol(){var fr=(Date.now()-Mf)/ts,Ul=ao(fr)*Wo;fr<=1?(this._flyToFrame=O(Ol,this),this._move(this.unproject(M.add(V.subtract(M).multiplyBy(Rh(Ul)/$t)),Ue),this.getScaleZoom(dt/Bl(Ul),Ue),{flyTo:!0})):this._move(u,g)._moveEnd(!0)}return this._moveStart(!0,_.noMoveStart),Ol.call(this),this},flyToBounds:function(u,g){var _=this._getBoundsCenterZoom(u,g);return this.flyTo(_.center,_.zoom,g)},setMaxBounds:function(u){return u=Me(u),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),u.isValid()?(this.options.maxBounds=u,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(u){var g=this.options.minZoom;return this.options.minZoom=u,this._loaded&&g!==u&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(u):this},setMaxZoom:function(u){var g=this.options.maxZoom;return this.options.maxZoom=u,this._loaded&&g!==u&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,g){this._enforcingBounds=!0;var _=this.getCenter(),M=this._limitCenter(_,this._zoom,Me(u));return _.equals(M)||this.panTo(M,g),this._enforcingBounds=!1,this},panInside:function(u,g){g=g||{};var _=ie(g.paddingTopLeft||g.padding||[0,0]),M=ie(g.paddingBottomRight||g.padding||[0,0]),V=this.project(this.getCenter()),ce=this.project(u),Ue=this.getPixelBounds(),dt=ve([Ue.min.add(_),Ue.max.subtract(M)]),kt=dt.getSize();if(!dt.contains(ce)){this._enforcingBounds=!0;var $t=ce.subtract(dt.getCenter()),hn=dt.extend(ce).getSize().subtract(kt);V.x+=$t.x<0?-hn.x:hn.x,V.y+=$t.y<0?-hn.y:hn.y,this.panTo(this.unproject(V),g),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=i({animate:!1,pan:!0},u===!0?{animate:!0}:u);var g=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var _=this.getSize(),M=g.divideBy(2).round(),V=_.divideBy(2).round(),ce=M.subtract(V);return!ce.x&&!ce.y?this:(u.animate&&u.pan?this.panBy(ce):(u.pan&&this._rawPanBy(ce),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:g,newSize:_}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=i({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var g=o(this._handleGeolocationResponse,this),_=o(this._handleGeolocationError,this);
4345return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(g,_,u):navigator.geolocation.getCurrentPosition(g,_,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var g=u.code,_=u.message||(g===1?"permission denied":g===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:g,message:"Geolocation error: "+_+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var g=u.coords.latitude,_=u.coords.longitude,M=new We(g,_),V=M.toBounds(u.coords.accuracy*2),ce=this._locateOptions;if(ce.setView){var Ue=this.getBoundsZoom(V);this.setView(M,ce.maxZoom?Math.min(Ue,ce.maxZoom):Ue)}var dt={latlng:M,bounds:V,timestamp:u.timestamp};for(var kt in u.coords)typeof u.coords[kt]=="number"&&(dt[kt]=u.coords[kt]);this.fire("locationfound",dt)}},addHandler:function(u,g){if(!g)return this;var _=this[u]=new g(this);return this._handlers.push(_),this.options[u]&&_.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ct(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(I(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)ct(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,g){var _="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),M=pt("div",_,g||this._mapPane);return u&&(this._panes[u]=M),M},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),g=this.unproject(u.getBottomLeft()),_=this.unproject(u.getTopRight());return new pe(g,_)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,g,_){u=Me(u),_=ie(_||[0,0]);var M=this.getZoom()||0,V=this.getMinZoom(),ce=this.getMaxZoom(),Ue=u.getNorthWest(),dt=u.getSouthEast(),kt=this.getSize().subtract(_),$t=ve(this.project(dt,M),this.project(Ue,M)).getSize(),hn=Ge.any3d?this.options.zoomSnap:1,Rn=kt.x/$t.x,Kn=kt.y/$t.y,oa=g?Math.max(Rn,Kn):Math.min(Rn,Kn);return M=this.getScaleZoom(oa,M),hn&&(M=Math.round(M/(hn/100))*(hn/100),M=g?Math.ceil(M/hn)*hn:Math.floor(M/hn)*hn),Math.max(V,Math.min(ce,M))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new H(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,g){var _=this._getTopLeftPoint(u,g);return new Q(_,_.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,g){var _=this.options.crs;return g=g===void 0?this._zoom:g,_.scale(u)/_.scale(g)},getScaleZoom:function(u,g){var _=this.options.crs;g=g===void 0?this._zoom:g;var M=_.zoom(u*_.scale(g));return isNaN(M)?1/0:M},project:function(u,g){return g=g===void 0?this._zoom:g,this.options.crs.latLngToPoint(Ae(u),g)},unproject:function(u,g){return g=g===void 0?this._zoom:g,this.options.crs.pointToLatLng(ie(u),g)},layerPointToLatLng:function(u){var g=ie(u).add(this.getPixelOrigin());return this.unproject(g)},latLngToLayerPoint:function(u){var g=this.project(Ae(u))._round();return g._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(Ae(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(Me(u))},distance:function(u,g){return this.options.crs.distance(Ae(u),Ae(g))},containerPointToLayerPoint:function(u){return ie(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return ie(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var g=this.containerPointToLayerPoint(ie(u));return this.layerPointToLatLng(g)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ae(u)))},mouseEventToContainerPoint:function(u){return zn(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var g=this._container=Qe(u);if(g){if(g._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");
4345jn(g,"scroll",this._onScroll,this),this._containerId=d(g)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ge.any3d,le(u,"leaflet-container"+(Ge.touch?" leaflet-touch":"")+(Ge.retina?" leaflet-retina":"")+(Ge.ielt9?" leaflet-oldie":"")+(Ge.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var g=ot(u,"position");g!=="absolute"&&g!=="relative"&&g!=="fixed"&&g!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Zt(this._mapPane,new H(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(le(u.markerPane,"leaflet-zoom-hide"),le(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,g,_){Zt(this._mapPane,new H(0,0));var M=!this._loaded;this._loaded=!0,g=this._limitZoom(g),this.fire("viewprereset");var V=this._zoom!==g;this._moveStart(V,_)._move(u,g)._moveEnd(V),this.fire("viewreset"),M&&this.fire("load")},_moveStart:function(u,g){return u&&this.fire("zoomstart"),g||this.fire("movestart"),this},_move:function(u,g,_,M){g===void 0&&(g=this._zoom);var V=this._zoom!==g;return this._zoom=g,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),M?_&&_.pinch&&this.fire("zoom",_):((V||_&&_.pinch)&&this.fire("zoom",_),this.fire("move",_)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return I(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){Zt(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[d(this._container)]=this;var g=u?hr:jn;g(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&g(window,"resize",this._onResize,this),Ge.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){I(this._resizeRequest),this._resizeRequest=O(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,g){for(var _=[],M,V=g==="mouseout"||g==="mouseover",ce=u.target||u.srcElement,Ue=!1;ce;){if(M=this._targets[d(ce)],M&&(g==="click"||g==="preclick")&&this._draggableMoved(M)){Ue=!0;break}if(M&&M.listens(g,!0)&&(V&&!ka(ce,u)||(_.push(M),V))||ce===this._container)break;ce=ce.parentNode}return!_.length&&!Ue&&!V&&this.listens(g,!0)&&(_=[this]),_},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var g=u.target||u.srcElement;if(!(!this._loaded||g._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(g))){var _=u.type;_==="mousedown"&&qr(g),this._fireDOMEvent(u,_)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,g,_){if(u.type==="click"){var M=i({},u);M.type="preclick",this._fireDOMEvent(M,M.type,_)}var V=this._findEventTargets(u,g);if(_){for(var ce=[],Ue=0;Ue<_.length;Ue++)_[Ue].listens(g,!0)&&ce.push(_[Ue]);V=ce.concat(V)}if(V.length){g==="contextmenu"&&xn(u);var dt=V[0],kt={originalEvent:u};if(u.type!=="keypress"&&u.type!=="keydown"&&u.type!=="keyup"){var $t=dt.getLatLng&&(!dt._radius||dt._radius<=10);kt.containerPoint=$t?this.latLngToContainerPoint(dt.getLatLng()):this.mouseEventToContainerPoint(u),kt.layerPoint=this.containerPointToLayerPoint(kt.containerPoint),kt.latlng=$t?dt.getLatLng():this.layerPointToLatLng(kt.layerPoint)}for(Ue=0;Ue<V.length;Ue++)if(V[Ue].fire(g,kt,!0),kt.originalEvent._stopped||V[Ue].options.bubblingMouseEvents===!1&&P(this._mouseEvents,g)!==-1)return}},_draggableMoved:function(u){return u=u.dragging&&u.dragging.enabled()?u:this,u.dragging&&u.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var u=0,g=this._handlers.length;u<g;u++)this._handlers[u].disable()},whenReady:function(u,g){return this._loaded?u.call(g||this,{target:this}):this.on("load",u,g),this}
4345,_getMapPanePos:function(){return _n(this._mapPane)||new H(0,0)},_moved:function(){var u=this._getMapPanePos();return u&&!u.equals([0,0])},_getTopLeftPoint:function(u,g){var _=u&&g!==void 0?this._getNewPixelOrigin(u,g):this.getPixelOrigin();return _.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(u,g){var _=this.getSize()._divideBy(2);return this.project(u,g)._subtract(_)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(u,g,_){var M=this._getNewPixelOrigin(_,g);return this.project(u,g)._subtract(M)},_latLngBoundsToNewLayerBounds:function(u,g,_){var M=this._getNewPixelOrigin(_,g);return ve([this.project(u.getSouthWest(),g)._subtract(M),this.project(u.getNorthWest(),g)._subtract(M),this.project(u.getSouthEast(),g)._subtract(M),this.project(u.getNorthEast(),g)._subtract(M)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(u){return this.latLngToLayerPoint(u).subtract(this._getCenterLayerPoint())},_limitCenter:function(u,g,_){if(!_)return u;var M=this.project(u,g),V=this.getSize().divideBy(2),ce=new Q(M.subtract(V),M.add(V)),Ue=this._getBoundsOffset(ce,_,g);return Math.abs(Ue.x)<=1&&Math.abs(Ue.y)<=1?u:this.unproject(M.add(Ue),g)},_limitOffset:function(u,g){if(!g)return u;var _=this.getPixelBounds(),M=new Q(_.min.add(u),_.max.add(u));return u.add(this._getBoundsOffset(M,g))},_getBoundsOffset:function(u,g,_){var M=ve(this.project(g.getNorthEast(),_),this.project(g.getSouthWest
4345(),_)),V=M.min.subtract(u.min),ce=M.max.subtract(u.max),Ue=this._rebound(V.x,-ce.x),dt=this._rebound(V.y,-ce.y);return new H(Ue,dt)},_rebound:function(u,g){return u+g>0?Math.round(u-g)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(g))},_limitZoom:function(u){var g=this.getMinZoom(),_=this.getMaxZoom(),M=Ge.any3d?this.options.zoomSnap:1;return M&&(u=Math.round(u/M)*M),Math.max(g,Math.min(_,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ne(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,g){var _=this._getCenterOffset(u)._trunc();return(g&&g.animate)!==!0&&!this.getSize().contains(_)?!1:(this.panBy(_,g),!0)},_createAnimProxy:function(){var u=this._proxy=pt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(g){var _=ut,M=this._proxy.style[_];Xt(this._proxy,this.project(g.center,g.zoom),this.getZoomScale(g.zoom,1)),M===this._proxy.style[_]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ct(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),g=this.getZoom();Xt(this._proxy,this.project(u,g),this.getZoomScale(g,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,g,_){if(this._animatingZoom)return!0;if(_=_||{},!this._zoomAnimated||_.animate===!1||this._nothingToAnimate()||Math.abs(g-this._zoom)>this.options.zoomAnimationThreshold)return!1;var M=this.getZoomScale(g),V=this._getCenterOffset(u)._divideBy(1-1/M);return _.animate!==!0&&!this.getSize().contains(V)?!1:(O(function(){this._moveStart(!0,_.noMoveStart||!1)._animateZoom(u,g,!0)},this),!0)},_animateZoom:function(u,g,_,M){this._mapPane&&(_&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=g,le(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:g,noUpdate:M}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Ne(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Za(u,g){return new Vn(u,g)}var sa=U.extend({options:{position:"topright"},initialize:function(u){S(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var g=this._map;return g&&g.removeControl(this),this.options.position=u,g&&g.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var g=this._container=this.onAdd(u),_=this.getPosition(),M=u._controlCorners[_];return le(g,"leaflet-control"),_.indexOf("bottom")!==-1?M.insertBefore(g,M.firstChild):M.appendChild(g),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ct(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),di=function(u){return new sa(u)};Vn.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},g="leaflet-",_=this._controlContainer=pt("div",g+"control-container",this._container);function M(V,ce){var Ue=g+V+" "+g+ce;u[V+ce]=pt("div",Ue,_)}M("top","left"),M("top","right"),M("bottom","left"),M("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)ct(this._controlCorners[u]);ct(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}
4345);var Bo=sa.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,g,_,M){return _<M?-1:M<_?1:0}},initialize:function(u,g,_){S(this,_),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var M in u)this._addLayer(u[M],M);for(M in g)this._addLayer(g[M],M,!0)},onAdd:function(u){this._initLayout(),this._update(),this._map=u,u.on("zoomend",this._checkDisabledLayers,this);for(var g=0;g<this._layers.length;g++)this._layers[g].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(u){return sa.prototype.addTo.call(this,u),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(u,g){return this._addLayer(u,g),this._map?this._update():this},addOverlay:function(u,g){return this._addLayer(u,g,!0),this._map?this._update():this},removeLayer:function(u){u.off("add remove",this._onLayerChange,this);var g=this._getLayer(d(u));return g&&this._layers.splice(this._layers.indexOf(g),1),this._map?this._update():this},expand:function(){le(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var u=this._map.getSize().y-(this._container.offsetTop+50);return u<this._section.clientHeight?(le(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=u+"px"):Ne(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Ne(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var u="leaflet-control-layers",g=this._container=pt("div",u),_=this.options.collapsed;g.setAttribute("aria-haspopup",!0),yn(g),Wn(g);var M=this._section=pt("section",u+"-list");_&&(this._map.on("click",this.collapse,this),jn(g,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var V=this._layersLink=pt("a",u+"-toggle",g);V.href="#",V.title="Layers",V.setAttribute("role","button"),jn(V,{keydown:function(ce){ce.keyCode===13&&this._expandSafely()},click:function(ce){xn(ce),this._expandSafely()}},this),_||this.expand(),this._baseLayersList=pt("div",u+"-base",M),this._separator=pt("div",u+"-separator",M),this._overlaysList=pt("div",u+"-overlays",M),g.appendChild(M)},_getLayer:function(u){for(var g=0;g<this._layers.length;g++)if(this._layers[g]&&d(this._layers[g].layer)===u)return this._layers[g]},_addLayer:function(u,g,_){this._map&&u.on("add remove",this._onLayerChange,this),this._layers.push({layer:u,name:g,overlay:_}),this.options.sortLayers&&this._layers.sort(o(function(M,V){return this.options.sortFunction(M.layer,V.layer,M.name,V.name)},this)),this.options.autoZIndex&&u.setZIndex&&(this._lastZIndex++,u.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Vt(this._baseLayersList),Vt(this._overlaysList),this._layerControlInputs=[];var u,g,_,M,V=0;for(_=0;_<this._layers.length;_++)M=this._layers[_],this._addItem(M),g=g||M.overlay,u=u||!M.overlay,V+=M.overlay?0:1;return this.options.hideSingleBase&&(u=u&&V>1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=g&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var g=this._getLayer(d(u.target)),_=g.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;_&&this._map.fire(_,g)},_createRadioElement:function(u,g){var _='<input type="radio" class="leaflet-control-layers-selector" name="'+u+'"'+(g?' checked="checked"':"")+"/>",M=document.createElement("div");return M.innerHTML=_,M.firstChild},_addItem:function(u){var g=document.createElement("label"),_=this._map.hasLayer(u.layer),M;u.overlay?(M=document.createElement("input"),M.type="checkbox",M.className="leaflet-control-layers-selector",M.defaultChecked=_):M=this._createRadioElement("leaflet-base-layers_"+d(this),_),this._layerControlInputs.push(M),M.layerId=d(u.layer),jn(M,"click",this._onInputClick,this);var V=document.createElement("span");V.innerHTML=" "+u.name;var ce=document.createElement("span");g.appendChild(ce),ce.appendChild(M),ce.appendChild(V);var Ue=u.overlay?this._overlaysList:this._baseLayersList;return Ue.appendChild(g),this._checkDisabledLayers(),g},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,g,_,M=[],V=[];this._handlingClick=!0;for(var ce=u.length-1;ce>=0;ce--)g=u[ce],_=this._getLayer(g.layerId).layer,g.checked?M.push(_):g.checked||V.push(_);for(ce=0;ce<V.length;ce++)this._map.hasLayer(V[ce])&&this._map.removeLayer(V[ce]);for(ce=0;ce<M.length;ce++)this._map.hasLayer(M[ce])||this._map.addLayer(M[ce]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var u=this._layerControlInputs,g,_,M=this._map.getZoom(),V=u.length-1;V>=0;V--)g=u[V],_=this._getLayer(g.layerId).layer,g.disabled=_.options.minZoom!==void 0&&M<_.options.minZoom||_.options.maxZoom!==void 0&&M>_.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,jn(u,"click",xn),this.expand();var g=this;setTimeout(function(){hr(u,"click",xn),g._preventClick=!1})}}),Xs=function(u,g,_){return new Bo(u,g,_)},Ia=sa.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(u){var g="leaflet-control-zoom",_=pt("div",g+" leaflet-bar"),M=this.options;return this._zoomInButton=this._createButton(M.zoomInText,M.zoomInTitle,g+"-in",_,this._zoomIn),this._zoomOutButton=this._createButton(M.zoomOutText,M.zoomOutTitle,g+"-out",_,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),_},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(u.shiftKey?3:1))},_zoomOut:function(u){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,g,_,M,V){var ce=pt("a",_,M);return ce.innerHTML=u,ce.href="#",ce.title=g,ce.setAttribute("role","button"),ce.setAttribute("aria-label",g),yn(ce),jn(ce,"click",Mn),jn(ce,"click",V,this),jn(ce,"click",this._refocusOnMap,this),ce},_updateDisabled:function(){var u=this._map,g="leaflet-disabled";Ne(this._zoomInButton,g),Ne(this._zoomOutButton,g),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMin
4345Zoom())&&(le(this._zoomOutButton,g),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(le(this._zoomInButton,g),this._zoomInButton.setAttribute("aria-disabled","true"))}});Vn.mergeOptions({zoomControl:!0}),Vn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ia,this.addControl(this.zoomControl))});var ps=function(u){return new Ia(u)},Or=sa.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var g="leaflet-control-scale",_=pt("div",g),M=this.options;return this._addScales(M,g+"-line",_),u.on(M.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),_},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,g,_){u.metric&&(this._mScale=pt("div",g,_)),u.imperial&&(this._iScale=pt("div",g,_))},_update:function(){var u=this._map,g=u.getSize().y/2,_=u.distance(u.containerPointToLatLng([0,g]),u.containerPointToLatLng([this.options.maxWidth,g]));this._updateScales(_)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var g=this._getRoundNum(u),_=g<1e3?g+" m":g/1e3+" km";this._updateScale(this._mScale,_,g/u)},_updateImperial:function(u){var g=u*3.2808399,_,M,V;g>5280?(_=g/5280,M=this._getRoundNum(_),this._updateScale(this._iScale,M+" mi",M/_)):(V=this._getRoundNum(g),this._updateScale(this._iScale,V+" ft",V/g))},_updateScale:function(u,g,_){u.style.width=Math.round(this.options.maxWidth*_)+"px",u.innerHTML=g},_getRoundNum:function(u){var g=Math.pow(10,(Math.floor(u)+"").length-1),_=u/g;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:1,g*_}}),Ba=function(u){return new Or(u)},Oo='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Oa=sa.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ge.inlineSvg?Oo+" ":"")+"Leaflet</a>"},initialize:function(u){S(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=pt("div","leaflet-control-attribution"),yn(this._container);for(var g in u._layers)u._layers[g].getAttribution&&this.addAttribution(u._layers[g].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var g in this._attributions)this._attributions[g]&&u.push(g);var _=[];this.options.prefix&&_.push(this.options.prefix),u.length&&_.push(u.join(", ")),this._container.innerHTML=_.join(' <span aria-hidden="true">|</span> ')}}});Vn.mergeOptions({attributionControl:!0}),Vn.addInitHook(function(){this.options.attributionControl&&new Oa().addTo(this)});var gs=function(u){return new Oa(u)};sa.Layers=Bo,sa.Zoom=Ia,sa.Scale=Or,sa.Attribution=Oa,di.layers=Xs,di.zoom=ps,di.scale=Ba,di.attribution=gs;var Xr=U.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Xr.addTo=function(u,g){return u.addHandler(g,this),this};var Xi={Events:Y},hi=Ge.touch?"touchstart mousedown":"mousedown",Tr=W.extend({options:{clickTolerance:3},initialize:function(u,g,_,M){S(this,M),this._element=u,this._dragStartTarget=g||u,this._preventOutline=_},enable:function(){this._enabled||(jn(this._dragStartTarget,hi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Tr._dragging===this&&this.finishDrag(!0),hr(this._dragStartTarget,hi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!St(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){Tr._dragging===this&&this.finishDrag();return}if(!(Tr._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(Tr._dragging=this,this._preventOutline&&qr(this._element),qi(),rn(),!this._moving)){this.fire("down");var g=u.touches?u.touches[0]:u,_=ui(this._element);this._startPoint=new H(g.clientX,g.clientY),this._startPos=_n(this._element),this._parentScale=Ea(_);var M=u.type==="mousedown";jn(document,M?"mousemove":"touchmove",this._onMove,this),jn(document,M?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var g=u.touches&&u.touches.length===1?u.touches[0]:u,_=new H(g.clientX,g.clientY)._subtract(this._startPoint);!_.x&&!_.y||Math.abs(_.x)+Math.abs(_.y)<this.options.clickTolerance||(_.x/=this._parentScale.x,_.y/=this._parentScale.y,xn(u),this._moved||(this.fire("dragstart"),this._moved=!0,le(document.body,"leaflet-dragging"),this._lastTarget=u.target||u.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),le(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(_),this._moving=!0,this._lastEvent=u,this._updatePosition())}},_updatePosition:function(){var u={originalEvent:this._lastEvent};this.fire("predrag",u),Zt(this._element,this._newPos),this.fire("drag",u)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(u){Ne(document.body,"leaflet-dragging"),this._lastTarget&&(Ne(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),hr(document,"mousemove touchmove",this._onMove,this),hr(document,"mouseup touchend touchcancel",this._onUp,this),fs(),or();var g=this._moved&&this._moving;this._moving=!1,Tr._dragging=!1,g&&this.fire("dragend",{noInertia:u,distance:this._newPos.distanceTo(this._startPos)})}});function Ua(u,g,_){var M,V=[1,4,2,8],ce,Ue,dt,kt,$t,hn,Rn,Kn;for(ce=0,hn=u.length;ce<hn;ce++)u[ce]._code=Uo(u[ce],g);for(dt=0;dt<4;dt++){for(Rn=V[dt],M=[],ce=0,hn=u.length,Ue=hn-1;ce<hn;Ue=ce++)kt=u[ce],$t=u[Ue],kt._code&Rn?$t._code&Rn||(Kn=Al($t,kt,Rn,g,_),Kn._code=Uo(Kn,g),M.push(Kn)):($t._code&Rn&&(Kn=Al($t,kt,Rn,g,_),Kn._code=Uo(Kn,g),M.push(Kn)),M.push(kt));u=M}return u}function xs(u,g){var _,M,V,ce,Ue,dt,kt,$t,hn;if(!u||u.length===0)throw new Error("latlngs not passed");mi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var Rn=Ae([0,0]),Kn=Me(u),oa=Kn.getNorthWest().distanceTo(Kn.getSouthWest
4345())*Kn.getNorthEast().distanceTo(Kn.getNorthWest());oa<1700&&(Rn=Zs(u));var Zr=u.length,ei=[];for(_=0;_<Zr;_++){var za=Ae(u[_]);ei.push(g.project(Ae([za.lat-Rn.lat,za.lng-Rn.lng])))}for(dt=kt=$t=0,_=0,M=Zr-1;_<Zr;M=_++)V=ei[_],ce=ei[M],Ue=V.y*ce.x-ce.y*V.x,kt+=(V.x+ce.x)*Ue,$t+=(V.y+ce.y)*Ue,dt+=Ue*3;dt===0?hn=ei[0]:hn=[kt/dt,$t/dt];var Bl=g.unproject(ie(hn));return Ae([Bl.lat+Rn.lat,Bl.lng+Rn.lng])}function Zs(u){for(var g=0,_=0,M=0,V=0;V<u.length;V++){var ce=Ae(u[V]);g+=ce.lat,_+=ce.lng,M++}return Ae([g/M,_/M])}var Tu={__proto__:null,clipPolygon:Ua,polygonCenter:xs,centroid:Zs};function Sr(u,g){if(!g||!u.length)return u.slice();var _=g*g;return u=vh(u,_),u=xh(u,_),u}function $n(u,g,_){return Math.sqrt(zo(u,g,_,!0))}function Dr(u,g,_){return zo(u,g,_)}function xh(u,g){var _=u.length,M=typeof Uint8Array<"u"?Uint8Array:Array,V=new M(_);V[0]=V[_-1]=1,Pc(u,V,g,0,_-1);var ce,Ue=[];for(ce=0;ce<_;ce++)V[ce]&&Ue.push(u[ce]);return Ue}function Pc(u,g,_,M,V){var ce=0,Ue,dt,kt;for(dt=M+1;dt<=V-1;dt++)kt=zo(u[dt],u[M],u[V],!0),kt>ce&&(Ue=dt,ce=kt);ce>_&&(g[Ue]=1,Pc(u,g,_,M,Ue),Pc(u,g,_,Ue,V))}function vh(u,g){for(var _=[u[0]],M=1,V=0,ce=u.length;M<ce;M++)Hx(u[M],u[V])>g&&(_.push(u[M]),V=M);return V<ce-1&&_.push(u[ce-1]),_}var jc;function Ni(u,g,_,M,V){var ce=M?jc:Uo(u,_),Ue=Uo(g,_),dt,kt,$t;for(jc=Ue;;){if(!(ce|Ue))return[u,g];if(ce&Ue)return!1;dt=ce||Ue,kt=Al(u,g,dt,_,V),$t=Uo(kt,_),dt===ce?(u=kt,ce=$t):(g=kt,Ue=$t)}}function Al(u,g,_,M,V){var ce=g.x-u.x,Ue=g.y-u.y,dt=M.min,kt=M.max,$t,hn;return _&8?($t=u.x+ce*(kt.y-u.y)/Ue,hn=kt.y):_&4?($t=u.x+ce*(dt.y-u.y)/Ue,hn=dt.y):_&2?($t=kt.x,hn=u.y+Ue*(kt.x-u.x)/ce):_&1&&($t=dt.x,hn=u.y+Ue*(dt.x-u.x)/ce),new H($t,hn,V)}function Uo(u,g){var _=0;return u.x<g.min.x?_|=1:u.x>g.max.x&&(_|=2),u.y<g.min.y?_|=4:u.y>g.max.y&&(_|=8),_}function Hx(u,g){var _=g.x-u.x,M=g.y-u.y;return _*_+M*M}function zo(u,g,_,M){var V=g.x,ce=g.y,Ue=_.x-V,dt=_.y-ce,kt=Ue*Ue+dt*dt,$t;return kt>0&&($t=((u.x-V)*Ue+(u.y-ce)*dt)/kt,$t>1?(V=_.x,ce=_.y):$t>0&&(V+=Ue*$t,ce+=dt*$t)),Ue=u.x-V,dt=u.y-ce,M?Ue*Ue+dt*dt:new H(V,ce)}function mi(u){return!N(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function pf(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),mi(u)}function gf(u,g){var _,M,V,ce,Ue,dt,kt,$t;if(!u||u.length===0)throw new Error("latlngs not passed");mi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var hn=Ae([0,0]),Rn=Me(u),Kn=Rn.getNorthWest().distanceTo(Rn.getSouthWest
4345())*Rn.getNorthEast().distanceTo(Rn.getNorthWest());Kn<1700&&(hn=Zs(u));var oa=u.length,Zr=[];for(_=0;_<oa;_++){var ei=Ae(u[_]);Zr.push(g.project(Ae([ei.lat-hn.lat,ei.lng-hn.lng])))}for(_=0,M=0;_<oa-1;_++)M+=Zr[_].distanceTo(Zr[_+1])/2;if(M===0)$t=Zr[0];else for(_=0,ce=0;_<oa-1;_++)if(Ue=Zr[_],dt=Zr[_+1],V=Ue.distanceTo(dt),ce+=V,ce>M){kt=(ce-M)/V,$t=[dt.x-kt*(dt.x-Ue.x),dt.y-kt*(dt.y-Ue.y)];break}var za=g.unproject(ie($t));return Ae([za.lat+hn.lat,za.lng+hn.lng])}var xf={__proto__:null,simplify:Sr,pointToSegmentDistance:$n,closestPointOnSegment:Dr,clipSegment:Ni,_getEdgeIntersection:Al,_getBitCode:Uo,_sqClosestPointOnSegment:zo,isFlat:mi,_flat:pf,polylineCenter:gf},yh={project:function(u){return new H(u.lng,u.lat)},unproject:function(u){return new We(u.y,u.x)},bounds:new Q([-180,-90],[180,90])},bh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var g=Math.PI/180,_=this.R,M=u.lat*g,V=this.R_MINOR/_,ce=Math.sqrt(1-V*V),Ue=ce*Math.sin(M),dt=Math.tan(Math.PI/4-M/2)/Math.pow((1-Ue)/(1+Ue),ce/2);return M=-_*Math.log(Math.max(dt,1e-10)),new H(u.lng*g*_,M)},unproject:function(u){for(var g=180/Math.PI,_=this.R,M=this.R_MINOR/_,V=Math.sqrt(1-M*M),ce=Math.exp(-u.y/_),Ue=Math.PI/2-2*Math.atan(ce),dt=0,kt=.1,$t;dt<15&&Math.abs(kt)>1e-7;dt++)$t=V*Math.sin(Ue),$t=Math.pow((1-$t)/(1+$t),V/2),kt=Math.PI/2-2*Math.atan(ce*$t)-Ue,Ue+=kt;return new We(Ue*g,u.x*g/_)}},Wx={__proto__:null,LonLat:yh,Mercator:bh,SphericalMercator:bt},Vx=i({},He,{code:"EPSG:3395",projection:bh,transformation:(function(){var u=.5/(Math.PI*bh.R);return zt(u,.5,-u,.5)})()}),vf=i({},He,{code:"EPSG:4326",projection:yh,transformation:zt(1/180,1,-1/180,.5)}),$x=i({},Ce,{projection:yh,transformation:zt(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,g){var _=g.lng-u.lng,M=g.lat-u.lat;return Math.sqrt(_*_+M*M)},infinite:!0});Ce.Earth=He,Ce.EPSG3395=Vx,Ce.EPSG3857=Ut,Ce.EPSG900913=Bt,Ce.EPSG4326=vf,Ce.Simple=$x;var Ti=W.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[d(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[d(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var g=u.target;if(g.hasLayer(this)){if(this._map=g,this._zoomAnimated=g._zoomAnimated,this.getEvents){var _=this.getEvents();g.on(_,this),this.once("remove",function(){g.off(_,this)},this)}this.onAdd(g),this.fire("add"),g.fire("layeradd",{layer:this})}}});Vn.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var g=d(u);return this._layers[g]?this:(this._layers[g]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var g=d(u);return this._layers[g]?(this._loaded&&u.onRemove(this),delete this._layers[g],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return d(u)in this._layers},eachLayer:function(u,g){for(var _ in this._layers)u.call(g,this._layers[_]);return this},_addLayers:function(u){u=u?N(u)?u:[u]:[];for(var g=0,_=u.length;g<_;g++)this.addLayer(u[g])},_addZoomLimit:function(u){(!isNaN(u.options.maxZoom)||!isNaN(u.options.minZoom))&&(this._zoomBoundLayers[d(u)]=u,this._updateZoomLevels())},_removeZoomLimit:function(u){var g=d(u);this._zoomBoundLayers[g]&&(delete this._zoomBoundLayers[g],this._updateZoomLevels())},_updateZoomLevels:function(){var u=1/0,g=-1/0,_=this._getZoomSpan();for(var M in this._zoomBoundLayers){var V=this._zoomBoundLayers[M].options;u=V.minZoom===void 0?u:Math.min(u,V.minZoom),g=V.maxZoom===void 0?g:Math.max(g,V.maxZoom)}
4345this._layersMaxZoom=g===-1/0?void 0:g,this._layersMinZoom=u===1/0?void 0:u,_!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qs=Ti.extend({initialize:function(u,g){S(this,g),this._layers={};var _,M;if(u)for(_=0,M=u.length;_<M;_++)this.addLayer(u[_])},addLayer:function(u){var g=this.getLayerId(u);return this._layers[g]=u,this._map&&this._map.addLayer(u),this},removeLayer:function(u){var g=u in this._layers?u:this.getLayerId(u);return this._map&&this._layers[g]&&this._map.removeLayer(this._layers[g]),delete this._layers[g],this},hasLayer:function(u){var g=typeof u=="number"?u:this.getLayerId(u);return g in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(u){var g=Array.prototype.slice.call(arguments,1),_,M;for(_ in this._layers)M=this._layers[_],M[u]&&M[u].apply(M,g);return this},onAdd:function(u){this.eachLayer(u.addLayer,u)},onRemove:function(u){this.eachLayer(u.removeLayer,u)},eachLayer:function(u,g){for(var _ in this._layers)u.call(g,this._layers[_]);return this},getLayer:function(u){return this._layers[u]},getLayers:function(){var u=[];return this.eachLayer(u.push,u),u},setZIndex:function(u){return this.invoke("setZIndex",u)},getLayerId:function(u){return d(u)}}),Lc=function(u,g){return new Qs(u,g)},vs=Qs.extend({addLayer:function(u){return this.hasLayer(u)?this:(u.addEventParent(this),Qs.prototype.addLayer.call(this,u),this.fire("layeradd",{layer:u}))},removeLayer:function(u){return this.hasLayer(u)?(u in this._layers&&(u=this._layers[u]),u.removeEventParent(this),Qs.prototype.removeLayer.call(this,u),this.fire("layerremove",{layer:u})):this},setStyle:function(u){return this.invoke("setStyle",u)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var u=new pe;for(var g in this._layers){var _=this._layers[g];u.extend(_.getBounds?_.getBounds():_.getLatLng())}return u}}),yf=function(u,g){return new vs(u,g)},Go=U.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(u){S(this,u)},createIcon:function(u){return this._createIcon("icon",u)},createShadow:function(u){return this._createIcon("shadow",u)},_createIcon:function(u,g){var _=this._getIconUrl(u);if(!_){if(u==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var M=this._createImg(_,g&&g.tagName==="IMG"?g:null);return this._setIconStyles(M,u),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),M},_setIconStyles:function(u,g){var _=this.options,M=_[g+"Size"];typeof M=="number"&&(M=[M,M]);var V=ie(M),ce=ie(g==="shadow"&&_.shadowAnchor||_.iconAnchor||V&&V.divideBy(2,!0));u.className="leaflet-marker-"+g+" "+(_.className||""),ce&&(u.style.marginLeft=-ce.x+"px",u.style.marginTop=-ce.y+"px"),V&&(u.style.width=V.x+"px",u.style.height=V.y+"px")},_createImg:function(u,g){return g=g||document.createElement("img"),g.src=u,g},_getIconUrl:function(u){return Ge.retina&&this.options[u+"RetinaUrl"]||this.options[u+"Url"]}});function bf(u){return new Go(u)}var Nl=Go.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(u){return typeof Nl.imagePath!="string"&&(Nl.imagePath=this._detectIconPath()),(this.options.imagePath||Nl.imagePath)+Go.prototype._getIconUrl.call(this,u)},_stripUrl:function(u){var g=function(_,M,V){var ce=M.exec(_);return ce&&ce[V]};return u=g(u,/^url\((['"])?(.+)\1\)$/,2),u&&g(u,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var u=pt("div","leaflet-default-icon-path",document.body),g=ot(u,"background-image")||ot(u,"backgroundImage");if(document.body.removeChild(u),g=this._stripUrl(g),g)return g;var _=document.querySelector('link[href$="leaflet.css"]');return _?_.href.substring(0,_.href.length-11-1):""}}),wh=Xr.extend({initialize:function(u){this._marker=u},addHooks:function(){var u=this._marker._icon;this._draggable||(this._draggable=new Tr(u,u,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),le(u,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Ne(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(u){var g=this._marker,_=g._map,M=this._marker.options.autoPanSpeed,V=this._marker.options.autoPanPadding,ce=_n(g._icon),Ue=_.getPixelBounds(),dt=_.getPixelOrigin(),kt=ve(Ue.min._subtract(dt).add(V),Ue.max._subtract(dt).subtract(V));if(!kt.contains(ce)){var $t=ie((Math.max(kt.max.x,ce.x)-kt.max.x)/(Ue.max.x-kt.max.x)-(Math.min(kt.min.x,ce.x)-kt.min.x)/(Ue.min.x-kt.min.x),(Math.max(kt.max.y,ce.y)-kt.max.y)/(Ue.max.y-kt.max.y)-(Math.min(kt.min.y,ce.y)-kt.min.y)/(Ue.min.y-kt.min.y)).multiplyBy(M);_.panBy($t,{animate:!1}),this._draggable._newPos._add($t),this._draggable._startPos._add($t),Zt(g._icon,this._draggable._newPos),this._onDrag(u),this._panRequest=O(this._adjustPan.bind(this,u))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(u){this._marker.options.autoPan&&(I(this._panRequest),this._panRequest=O(this._adjustPan.bind(this,u)))},_onDrag:function(u){var g=this._marker,_=g._shadow,M=_n(g._icon),V=g._map.layerPointToLatLng(M);_&&Zt(_,M),g._latlng=V,u.latlng=V,u.oldLatLng=this._oldLatLng,g.fire("move",u).fire("drag",u)},_onDragEnd:function(u){I(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",u)}}),ys=Ti.extend({options:{icon:new Nl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(u,g){S(this,g),this._latlng=Ae(u)}
vendor: 2,710 bytes, line 4345
4345,onAdd:function(u){this._zoomAnimated=this._zoomAnimated&&u.options.markerZoomAnimation,this._zoomAnimated&&u.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(u){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&u.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(u){var g=this._latlng;return this._latlng=Ae(u),this.update(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},setZIndexOffset:function(u){return this.options.zIndexOffset=u,this.update()},getIcon:function(){return this.options.icon},setIcon:function(u){return this.options.icon=u,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var u=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(u)}return this},_initIcon:function(){var u=this.options,g="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),_=u.icon.createIcon(this._icon),M=!1;_!==this._icon&&(this._icon&&this._removeIcon(),M=!0,u.title&&(_.title=u.title),_.tagName==="IMG"&&(_.alt=u.alt||"")),le(_,g),u.keyboard&&(_.tabIndex="0",_.setAttribute("role","button")),this._icon=_,u.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&jn(_,"focus",this._panOnFocus,this);var V=u.icon.createShadow(this._shadow),ce=!1;V!==this._shadow&&(this._removeShadow(),ce=!0),V&&(le(V,g),V.alt=""),this._shadow=V,u.opacity<1&&this._updateOpacity(),M&&this.getPane().appendChild(this._icon),this._initInteraction(),V&&ce&&this.getPane(u.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&hr(this._icon,"focus",this._panOnFocus,this),ct(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ct(this._shadow),this._shadow=null},_setPos:function(u){this._icon&&Zt(this._icon,u),this._shadow&&Zt(this._shadow,u),this._zIndex=u.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(u){this._icon&&(this._icon.style.zIndex=this._zIndex+u)},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center).round();this._setPos(g)},_initInteraction:function(){if(this.options.interactive&&(le(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),wh)
vendor: 4,975 bytes, line 4345
4345){var u=this.options.draggable;this.dragging&&(u=this.dragging.enabled(),this.dragging.disable()),this.dragging=new wh(this),u&&this.dragging.enable()}},setOpacity:function(u){return this.options.opacity=u,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var u=this.options.opacity;this._icon&&xt(this._icon,u),this._shadow&&xt(this._shadow,u)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var u=this._map;if(u){var g=this.options.icon.options,_=g.iconSize?ie(g.iconSize):ie(0,0),M=g.iconAnchor?ie(g.iconAnchor):ie(0,0);u.panInside(this._latlng,{paddingTopLeft:M,paddingBottomRight:_.subtract(M)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Kx(u,g){return new ys(u,g)}var eo=Ti.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(u){this._renderer=u.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(u){return S(this,u),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&u&&Object.prototype.hasOwnProperty.call(u,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Mu=eo.extend({options:{fill:!0,radius:10},initialize:function(u,g){S(this,g),this._latlng=Ae(u),this._radius=this.options.radius},setLatLng:function(u){var g=this._latlng;return this._latlng=Ae(u),this.redraw(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(u){return this.options.radius=this._radius=u,this.redraw()},getRadius:function(){return this._radius},setStyle:function(u){var g=u&&u.radius||this._radius;return eo.prototype.setStyle.call(this,u),this.setRadius(g),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var u=this._radius,g=this._radiusY||u,_=this._clickTolerance(),M=[u+_,g+_];this._pxBounds=new Q(this._point.subtract(M),this._point.add(M))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(u){return u.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function wf(u,g){return new Mu(u,g)}var Ru=Mu.extend({initialize:function(u,g,_){if(typeof g=="number"&&(g=i({},_,{radius:g})),S(this,g),this._latlng=Ae(u),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(u){return this._mRadius=u,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var u=[this._radius,this._radiusY||this._radius];return new pe(this._map.layerPointToLatLng(this._point.subtract(u)),this._map.layerPointToLatLng(this._point.add(u)))},setStyle:eo.prototype.setStyle,_project:function(){var u=this._latlng.lng,g=this._latlng.lat,_=this._map,M=_.options.crs;if(M.distance===He.distance){var V=Math.PI/180,ce=this._mRadius/He.R/V,Ue=_.project([g+ce,u]),dt=_.project([g-ce,u]),kt=Ue.add(dt).divideBy(2),$t=_.unproject(kt).lat,hn=Math.acos((Math.cos(ce*V)-Math.sin(g*V)*Math.sin($t*V))/(Math.cos(g*V)*Math.cos($t*V)))/V;(isNaN(hn)||hn===0)&&(hn=ce/Math.cos(Math.PI/180*g)),this._point=kt.subtract(_.getPixelOrigin()),this._radius=isNaN(hn)?0:kt.x-_.project([$t,u-hn]).x,this._radiusY=kt.y-Ue.y}else{var Rn=M.unproject(M.project(this._latlng).subtract([this._mRadius,0]));this._point=_.latLngToLayerPoint(this._latlng),this._radius=this._point.x-_.latLngToLayerPoint(Rn).x}this._updateBounds()}});function Ic(u,g,_){return new Ru(u,g,_)}var Qa=eo.extend({options:{smoothFactor:1,noClip:!1},initialize:function(u,g){S(this,g),this._setLatLngs(u)},getLatLngs:function(){return this._latlngs},setLatLngs:function(u){return this._setLatLngs(u),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(u){for(var g=1/0,_=null,M=zo,V,ce,Ue=0,dt=this._parts.length;Ue<dt;Ue++)for(var kt=this._parts[Ue],$t=1,hn=kt.length;$t<hn;$t++){V=kt[$t-1],ce=kt[$t];var Rn=M(u,V,ce,!0);Rn<g&&(g=Rn,_=M(u,V,ce))}return _&&(_.distance=Math.sqrt(g)),_}
4345,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return gf(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(u,g){return g=g||this._defaultShape(),u=Ae(u),g.push(u),this._bounds.extend(u),this.redraw()},_setLatLngs:function(u){this._bounds=new pe,this._latlngs=this._convertLatLngs(u)},_defaultShape:function(){return mi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(u){for(var g=[],_=mi(u),M=0,V=u.length;M<V;M++)_?(g[M]=Ae(u[M]),this._bounds.extend(g[M])):g[M]=this._convertLatLngs(u[M]);return g},_project:function(){var u=new Q;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,u),this._bounds.isValid()&&u.isValid()&&(this._rawPxBounds=u,this._updateBounds())},_updateBounds:function(){var u=this._clickTolerance(),g=new H(u,u);this._rawPxBounds&&(this._pxBounds=new Q([this._rawPxBounds.min.subtract(g),this._rawPxBounds.max.add(g)]))},_projectLatlngs:function(u,g,_){var M=u[0]instanceof We,V=u.length,ce,Ue;if(M){for(Ue=[],ce=0;ce<V;ce++)Ue[ce]=this._map.latLngToLayerPoint(u[ce]),_.extend(Ue[ce]);g.push(Ue)}else for(ce=0;ce<V;ce++)this._projectLatlngs(u[ce],g,_)},_clipPoints:function(){var u=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}var g=this._parts,_,M,V,ce,Ue,dt,kt;for(_=0,V=0,ce=this._rings.length;_<ce;_++)for(kt=this._rings[_],M=0,Ue=kt.length;M<Ue-1;M++)dt=Ni(kt[M],kt[M+1],u,M,!0),dt&&(g[V]=g[V]||[],g[V].push(dt[0]),(dt[1]!==kt[M+1]||M===Ue-2)&&(g[V].push(dt[1]),V++))}},_simplifyPoints:function(){for(var u=this._parts,g=this.options.smoothFactor,_=0,M=u.length;_<M;_++)u[_]=Sr(u[_],g)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(u,g){var _,M,V,ce,Ue,dt,kt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(_=0,ce=this._parts.length;_<ce;_++)for(dt=this._parts[_],M=0,Ue=dt.length,V=Ue-1;M<Ue;V=M++)if(!(!g&&M===0)&&$n(u,dt[V],dt[M])<=kt)return!0;return!1}});function Yx(u,g){return new Qa(u,g)}Qa._flat=pf;var bs=Qa.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
4345,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return xs(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(u){var g=Qa.prototype._convertLatLngs.call(this,u),_=g.length;return _>=2&&g[0]instanceof We&&g[0].equals(g[_-1])&&g.pop(),g},_setLatLngs:function(u){Qa.prototype._setLatLngs.call(this,u),mi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return mi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,g=this.options.weight,_=new H(g,g);if(u=new Q(u.min.subtract(_),u.max.add(_)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var M=0,V=this._rings.length,ce;M<V;M++)ce=Ua(this._rings[M],u,!0),ce.length&&this._parts.push(ce)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(u){var g=!1,_,M,V,ce,Ue,dt,kt,$t;if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(ce=0,kt=this._parts.length;ce<kt;ce++)for(_=this._parts[ce],Ue=0,$t=_.length,dt=$t-1;Ue<$t;dt=Ue++)M=_[Ue],V=_[dt],M.y>u.y!=V.y>u.y&&u.x<(V.x-M.x)*(u.y-M.y)/(V.y-M.y)+M.x&&(g=!g);return g||Qa.prototype._containsPoint.call(this,u,!0)}});function qx(u,g){return new bs(u,g)}var Zi=vs.extend({initialize:function(u,g){S(this,g),this._layers={},u&&this.addData(u)},addData:function(u){var g=N(u)?u:u.features,_,M,V;if(g){for(_=0,M=g.length;_<M;_++)V=g[_],(V.geometries||V.geometry||V.features||V.coordinates)&&this.addData(V);return this}var ce=this.options;if(ce.filter&&!ce.filter(u))return this;var Ue=Tl(u,ce);return Ue?(Ue.feature=Iu(u),Ue.defaultOptions=Ue.options,this.resetStyle(Ue),ce.onEachFeature&&ce.onEachFeature(u,Ue),this.addLayer(Ue)):this},resetStyle:function(u){return u===void 0?this.eachLayer(this.resetStyle,this):(u.options=i({},u.defaultOptions),this._setLayerStyle(u,this.options.style),this)},setStyle:function(u){return this.eachLayer(function(g){this._setLayerStyle(g,u)},this)},_setLayerStyle:function(u,g){u.setStyle&&(typeof g=="function"&&(g=g(u.feature)),u.setStyle(g))}});function Tl(u,g){var _=u.type==="Feature"?u.geometry:u,M=_?_.coordinates:null,V=[],ce=g&&g.pointToLayer,Ue=g&&g.coordsToLatLng||Pu,dt,kt,$t,hn;if(!M&&!_)return null;switch(_.type){case"Point":return dt=Ue(M),Du(ce,u,dt,g);case"MultiPoint":for($t=0,hn=M.length;$t<hn;$t++)dt=Ue(M[$t]),V.push(Du(ce,u,dt,g));return new vs(V);case"LineString":case"MultiLineString":return kt=Bc(M,_.type==="LineString"?0:1,Ue),new Qa(kt,g);case"Polygon":case"MultiPolygon":return kt=Bc(M,_.type==="Polygon"?1:2,Ue),new bs(kt,g);case"GeometryCollection":for($t=0,hn=_.geometries.length;$t<hn;$t++){var Rn=Tl({geometry:_.geometries[$t],type:"Feature",properties:u.properties},g);Rn&&V.push(Rn)}return new vs(V);case"FeatureCollection":for($t=0,hn=_.features.length;$t<hn;$t++){var Kn=Tl(_.features[$t],g);Kn&&V.push(Kn)}return new vs(V);default:throw new Error("Invalid GeoJSON object.")}}function Du(u,g,_,M){return u?u(g,_):new ys(_,M&&M.markersInheritOptions&&M)}function Pu(u){return new We(u[1],u[0],u[2])}function Bc(u,g,_){for(var M=[],V=0,ce=u.length,Ue;V<ce;V++)Ue=g?Bc(u[V],g-1,_):(_||Pu)(u[V]),M.push(Ue);return M}function ju(u,g){return u=Ae(u),u.alt!==void 0?[b(u.lng,g),b(u.lat,g),b(u.alt,g)]:[b(u.lng,g),b(u.lat,g)]}function Lu(u,g,_,M){for(var V=[],ce=0,Ue=u.length;ce<Ue;ce++)V.push(g?Lu(u[ce],mi(u[ce])?0:g-1,_,M):ju(u[ce],M));return!g&&_&&V.length>0&&V.push(V[0].slice()),V}function Ml(u,g){return u.feature?i({},u.feature,{geometry:g}):Iu(g)}function Iu(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var Sh={toGeoJSON:function(u){return Ml(this,{type:"Point",coordinates:ju(this.getLatLng(),u)})}};ys.include(Sh),Ru.include(Sh),Mu.include(Sh),Qa.include({toGeoJSON:function(u){var g=!mi(this._latlngs),_=Lu(this._latlngs,g?1:0,!1,u);return Ml(this,{type:(g?"Multi":"")+"LineString",coordinates:_})}}),bs.include({toGeoJSON:function(u){var g=!mi(this._latlngs),_=g&&!mi(this._latlngs[0]),M=Lu(this._latlngs,_?2:g?1:0,!0,u);return g||(M=[M]),Ml(this,{type:(_?"Multi":"")+"Polygon",coordinates:M})}}),Qs.include({toMultiPoint:function(u){var g=[];return this.eachLayer(function(_){g.push(_.toGeoJSON(u).geometry.coordinates)}),Ml(this,{type:"MultiPoint",coordinates:g})},toGeoJSON:function(u){var g=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(g==="MultiPoint")return this.toMultiPoint(u);var _=g==="GeometryCollection",M=[];return this.eachLayer(function(V){if(V.toGeoJSON){var ce=V.toGeoJSON(u);if(_)M.push(ce.geometry);else{var Ue=Iu(ce);Ue.type==="FeatureCollection"?M.push.apply(M,Ue.features):M.push(Ue)}}}),_?Ml(this,{geometries:M,type:"GeometryCollection"}):{type:"FeatureCollection",features:M}}});function Sf(u,g){return new Zi(u,g)}var Mi=Sf,to=Ti.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,g,_){this._url=u,this._bounds=Me(g),S(this,_)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(le(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ct(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&sn(this._image),this},bringToBack:function(){return this._map&&cn(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=Me(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",g=this._image=u?this._url:pt("img");if(le(g,"leaflet-image-layer"),this._zoomAnimated&&le(g,"leaflet-zoom-animated"),this.options.className&&le(g,this.options.className),g.onselectstart=p,g.onmousemove=p,g.onload=o(this.fire,this,"load"),g.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=g.src;return}g.src=this._url,g.alt=this.options.alt},_animateZoom:function(u){var g=this._map.getZoomScale(u.zoom),_=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;Xt(this._image,_,g)},_reset:function(){var u=this._image,g=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),_=g.getSize();Zt(u,g.min),u.style.width=_.x+"px",u.style.height=_.y+"px"},_updateOpacity:function(){xt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),Ff=function(u,g,_){return new to(u,g,_)},Fh=to.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
4345ine:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",g=this._image=u?this._url:pt("video");if(le(g,"leaflet-image-layer"),this._zoomAnimated&&le(g,"leaflet-zoom-animated"),this.options.className&&le(g,this.options.className),g.onselectstart=p,g.onmousemove=p,g.onloadeddata=o(this.fire,this,"load"),u){for(var _=g.getElementsByTagName("source"),M=[],V=0;V<_.length;V++)M.push(_[V].src);this._url=_.length>0?M:[g.src];return}N(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(g.style,"objectFit")&&(g.style.objectFit="fill"),g.autoplay=!!this.options.autoplay,g.loop=!!this.options.loop,g.muted=!!this.options.muted,g.playsInline=!!this.options.playsInline;for(var ce=0;ce<this._url.length;ce++){var Ue=pt("source");Ue.src=this._url[ce],g.appendChild(Ue)}}});function Cf(u,g,_){return new Fh(u,g,_)}var Ch=to.extend({_initImage:function(){var u=this._image=this._url;le(u,"leaflet-image-layer"),this._zoomAnimated&&le(u,"leaflet-zoom-animated"),this.options.className&&le(u,this.options.className),u.onselectstart=p,u.onmousemove=p}});function _h(u,g,_){return new Ch(u,g,_)}var Qi=Ti.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(u,g){u&&(u instanceof We||N(u))?(this._latlng=Ae(u),S(this,g)):(S(this,u),this._source=g),this.options.content&&(this._content=this.options.content)},openOn:function(u){return u=arguments.length?u:this._source._map,u.hasLayer(this)||u.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(u){return this._map?this.close():(arguments.length?this._source=u:u=this._source,this._prepareOpen(),this.openOn(u._map)),this},onAdd:function(u){this._zoomAnimated=u._zoomAnimated,this._container||this._initLayout(),u._fadeAnimated&&xt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),u._fadeAnimated&&xt(this._container,1),this.bringToFront(),this.options.interactive&&(le(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(u){u._fadeAnimated?(xt(this._container,0),this._removeTimeout=setTimeout(o(ct,void 0,this._container),200)):ct(this._container),this.options.interactive&&(Ne(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(u){return this._latlng=Ae(u),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(u){return this._content=u,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var u={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&sn(this._container),this},bringToBack:function(){return this._map&&cn(this._container),this},_prepareOpen:function(u){var g=this._source;if(!g._map)return!1;if(g instanceof vs){g=null;var _=this._source._layers;for(var M in _)if(_[M]._map){g=_[M];break}if(!g)return!1;this._source=g}if(!u)if(g.getCenter)u=g.getCenter();else if(g.getLatLng)u=g.getLatLng();else if(g.getBounds)u=g.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(u),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var u=this._contentNode,g=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof g=="string")u.innerHTML=g;else{for(;u.hasChildNodes();)u.removeChild(u.firstChild);u.appendChild(g)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var u=this._map.latLngToLayerPoint(this._latlng),g=ie(this.options.offset),_=this._getAnchor();this._zoomAnimated?Zt(this._container,u.add(_)):g=g.add(u).add(_);var M=this._containerBottom=-g.y,V=this._containerLeft=-Math.round(this._containerWidth/2)+g.x;this._container.style.bottom=M+"px",this._container.style.left=V+"px"}},_getAnchor:function(){return[0,0]}});Vn.include({_initOverlay:function(u,g,_,M){var V=g;return V instanceof u||(V=new u(M).setContent(g)),_&&V.setLatLng(_),V}}),Ti.include({_initOverlay:function(u,g,_,M){var V=_;return V instanceof u?(S(V,M),V._source=this):(V=g&&!M?g:new u(M,this),V.setContent(_)),V}});var Bu=Qi.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(u){return u=arguments.length?u:this._source._map,!u.hasLayer(this)&&u._popup&&u._popup.options.autoClose&&u.removeLayer(u._popup),u._popup=this,Qi.prototype.openOn.call(this,u)},onAdd:function(u){Qi.prototype.onAdd.call(this,u),u.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof eo||this._source.on("preclick",Sn))},onRemove:function(u){Qi.prototype.onRemove.call(this,u),u.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof eo||this._source.off("preclick",Sn))},getEvents:function(){var u=Qi.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(u.preclick=this.close),this.options.keepInView&&
4345(u.moveend=this._adjustPan),u},_initLayout:function(){var u="leaflet-popup",g=this._container=pt("div",u+" "+(this.options.className||"")+" leaflet-zoom-animated"),_=this._wrapper=pt("div",u+"-content-wrapper",g);if(this._contentNode=pt("div",u+"-content",_),yn(g),Wn(this._contentNode),jn(g,"contextmenu",Sn),this._tipContainer=pt("div",u+"-tip-container",g),this._tip=pt("div",u+"-tip",this._tipContainer),this.options.closeButton){var M=this._closeButton=pt("a",u+"-close-button",g);M.setAttribute("role","button"),M.setAttribute("aria-label","Close popup"),M.href="#close",M.innerHTML='<span aria-hidden="true">&#215;</span>',jn(M,"click",function(V){xn(V),this.close()},this)}},_updateLayout:function(){var u=this._contentNode,g=u.style;g.width="",g.whiteSpace="nowrap";var _=u.offsetWidth;_=Math.min(_,this.options.maxWidth),_=Math.max(_,this.options.minWidth),g.width=_+1+"px",g.whiteSpace="",g.height="";var M=u.offsetHeight,V=this.options.maxHeight,ce="leaflet-popup-scrolled";V&&M>V?(g.height=V+"px",le(u,ce)):Ne(u,ce),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),_=this._getAnchor();Zt(this._container,g.add(_))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,g=parseInt(ot(this._container,"marginBottom"),10)||0,_=this._container.offsetHeight+g,M=this._containerWidth,V=new H(this._containerLeft,-_-this._containerBottom);V._add(_n(this._container));var ce=u.layerPointToContainerPoint(V),Ue=ie(this.options.autoPanPadding),dt=ie(this.options.autoPanPaddingTopLeft||Ue),kt=ie(this.options.autoPanPaddingBottomRight||Ue),$t=u.getSize(),hn=0,Rn=0;ce.x+M+kt.x>$t.x&&(hn=ce.x+M-$t.x+kt.x),ce.x-hn-dt.x<0&&(hn=ce.x-dt.x),ce.y+_+kt.y>$t.y&&(Rn=ce.y+_-$t.y+kt.y),ce.y-Rn-dt.y<0&&(Rn=ce.y-dt.y),(hn||Rn)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([hn,Rn]))}},_getAnchor:function(){return ie(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Rl=function(u,g){return new Bu(u,g)};Vn.mergeOptions({closePopupOnClick:!0}),Vn.include({openPopup:function(u,g,_){return this._initOverlay(Bu,u,g,_).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),Ti.include({bindPopup:function(u,g){return this._popup=this._initOverlay(Bu,this._popup,u,g),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof vs||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){Mn(u);var g=u.layer||u.target;if(this._popup._source===g&&!(g instanceof eo)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=g,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var Dl=Qi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){Qi.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){Qi.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=Qi.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",g=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=pt("div",g),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+
4345d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var g,_,M=this._map,V=this._container,ce=M.latLngToContainerPoint(M.getCenter()),Ue=M.layerPointToContainerPoint(u),dt=this.options.direction,kt=V.offsetWidth,$t=V.offsetHeight,hn=ie(this.options.offset),Rn=this._getAnchor();dt==="top"?(g=kt/2,_=$t):dt==="bottom"?(g=kt/2,_=0):dt==="center"?(g=kt/2,_=$t/2):dt==="right"?(g=0,_=$t/2):dt==="left"?(g=kt,_=$t/2):Ue.x<ce.x?(dt="right",g=0,_=$t/2):(dt="left",g=kt+(hn.x+Rn.x)*2,_=$t/2),u=u.subtract(ie(g,_,!0)).add(hn).add(Rn),Ne(V,"leaflet-tooltip-right"),Ne(V,"leaflet-tooltip-left"),Ne(V,"leaflet-tooltip-top"),Ne(V,"leaflet-tooltip-bottom"),le(V,"leaflet-tooltip-"+dt),Zt(V,u)},_updatePosition:function(){var u=this._map.latLngToLayerPoint(this._latlng);this._setPosition(u)},setOpacity:function(u){this.options.opacity=u,this._container&&xt(this._container,u)},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center);this._setPosition(g)},_getAnchor:function(){return ie(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Oc=function(u,g){return new Dl(u,g)};Vn.include({openTooltip:function(u,g,_){return this._initOverlay(Dl,u,g,_).openOn(this),this},closeTooltip:function(u){return u.close(),this}}),Ti.include({bindTooltip:function(u,g){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Dl,this._tooltip,u,g),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(u){if(!(!u&&this._tooltipHandlersAdded)){var g=u?"off":"on",_={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?_.add=this._openTooltip:(_.mouseover=this._openTooltip,_.mouseout=this.closeTooltip,_.click=this._openTooltip,this._map?this._addFocusListeners():_.add=this._addFocusListeners),this._tooltip.options.sticky&&(_.mousemove=this._moveTooltip),this[g](_),this._tooltipHandlersAdded=!u}},openTooltip:function(u){return this._tooltip&&(this instanceof vs||(this._tooltip._source=this),this._tooltip._prepareOpen(u)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(u){return this._tooltip&&this._tooltip.setContent(u),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(u){var g=typeof u.getElement=="function"&&u.getElement();g&&(jn(g,"focus",function(){this._tooltip._source=u,this.openTooltip()},this),jn(g,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(u){var g=typeof u.getElement=="function"&&u.getElement();g&&g.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(u){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var g=this;this._map.once("moveend",function(){g._openOnceFlag=!1,g._openTooltip(u)});return}this._tooltip._source=u.layer||u.target,this.openTooltip(this._tooltip.options.sticky?u.latlng:void 0)}},_moveTooltip:function(u){var g=u.latlng,_,M;this._tooltip.options.sticky&&u.originalEvent&&(_=this._map.mouseEventToContainerPoint(u.originalEvent),M=this._map.containerPointToLayerPoint(_),g=this._map.layerPointToLatLng(M)),this._tooltip.setLatLng(g)}});var Ou=Go.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(u){var g=u&&u.tagName==="DIV"?u:document.createElement("div"),_=this.options;if(_.html instanceof Element?(Vt(g),g.appendChild(_.html)):g.innerHTML=_.html!==!1?_.html:"",_.bgPos){var M=ie(_.bgPos);g.style.backgroundPosition=-M.x+"px "+-M.y+"px"}return this._setIconStyles(g,"icon"),g},createShadow:function(){return null}});function _f(u){return new Ou(u)}Go.Default=Nl;var no=Ti.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ge.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(u){S(this,u)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(u){u._addZoomLimit(this)},onRemove:function(u){this._removeAllTiles(),ct(this._container),u._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(sn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(cn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(u){return this.options.opacity=u,this._updateOpacity(),this},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var u=this._clampZoom(this._map.getZoom());u!==this._tileZoom&&(this._tileZoom=u,this._updateLevels()),this._update()}return this},getEvents:function(){var u={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=m(this._onMoveEnd,this.options.updateInterval,this)),u.move=this._onMove),this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},createTile:function(){return document.createElement("div")},getTileSize:function(){var u=this.options.tileSize;return u instanceof H?u:new H(u,u)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(u){for(var g=this.getPane().children,_=-u(-1/0,1/0),M=0,V=g.length,ce;M<V;M++)ce=g[M].style.zIndex,g[M]!==this._container&&ce&&(_=u(_,+ce));isFinite(_)&&(this.options.zIndex=_+u(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ge.ielt9){xt(this._container,this.options.opacity);var u=+new Date,g=!1,_=!1;for(var M in this._tiles){var V=this._tiles[M];if(!(!V.current||!V.loaded)){var ce=Math.min(1,(u-V.loaded)/200);xt(V.el,ce),ce<1?g=!0:(V.active?_=!0:this._onOpaqueTile(V),V.active=!0)}}_&&!this._noPrune&&this._pruneTiles(),g&&(I(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=pt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var u=this._tileZoom,g=this.options.maxZoom;if(u!==void 0){for(var _ in this._levels)_=Number(_),this._levels[_].el.children.length||_===u?(this._levels[_].el.style.zIndex=g-Math.abs(u-_),this._onUpdateLevel(_)):(ct(this._levels[_].el),this._removeTilesAtZoom(_),this._onRemoveLevel(_),delete this._levels[_]);var M=this._levels[u],V=this._map;return M||(M=this._levels[u]={},M.el=pt("div","leaflet-tile-container leaflet-zoom-animated",this._container),M.el.style.zIndex=g,M.origin=V.project(V.unproject(V.getPixelOrigin()),u).round(),M.zoom=u,this._setZoomTransform(M,V.getCenter(),V.getZoom()),p(M.el.offsetWidth),this._onCreateLevel(M)),this._level=M,M}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var u,g,_=this._map.getZoom();if(_>this.options.maxZoom||_<this.options.minZoom){this._removeAllTiles();return}for(u in this._tiles)g=this._tiles[u],g.retain=g.current;for(u in this._tiles)if(g=this._tiles[u],g.current&&!g.active){var M=g.coords;this._retainParent(M.x,M.y,M.z,M.z-5)||this._retainChildren(M.x,M.y,M.z,M.z+2)}for(u in this._tiles)this._tiles[u].retain||this._removeTile(u)}},_removeTilesAtZoom:function(u){for(var g in this._tiles)this._tiles[g].coords.z===u&&this._removeTile(g)},_removeAllTiles:function(){for(var u in this._tiles)this._removeTile(u)},_invalidateAll:function(){for(var u in this._levels)ct(this._levels[u].el),this._onRemoveLevel(Number(u)),delete this._levels[u];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(u,g,_,M){var V=Math.floor(u/2),ce=Math.floor(g/2),Ue=_-1,dt=new H(+V,+ce);dt.z=+Ue;var kt=this._tileCoordsToKey(dt),$t=this._tiles[kt];return $t&&$t.active?($t.retain=!0,!0):($t&&$t.loaded&&($t.retain=!0),Ue>M?this._retainParent(V,ce,Ue,M):!1)},_retainChildren:function(u,g,_,M){for(var V=2*u;V<2*u+2;V++)for(var ce=2*g;ce<2*g+2;ce++){var Ue=new H(V,ce);Ue.z=_+1;var dt=this._tileCoordsToKey(Ue),kt=this._tiles[dt];if(kt&&kt.active){kt.retain=!0;continue}else kt&&kt.loaded&&(kt.retain=!0);_+1<M&&this._retainChildren(V,ce,_+1,M)}},_resetView:function(u){var g=u&&(u.pinch||u.flyTo);
4345this._setView(this._map.getCenter(),this._map.getZoom(),g,g)},_animateZoom:function(u){this._setView(u.center,u.zoom,!0,u.noUpdate)},_clampZoom:function(u){var g=this.options;return g.minNativeZoom!==void 0&&u<g.minNativeZoom?g.minNativeZoom:g.maxNativeZoom!==void 0&&g.maxNativeZoom<u?g.maxNativeZoom:u},_setView:function(u,g,_,M){var V=Math.round(g);this.options.maxZoom!==void 0&&V>this.options.maxZoom||this.options.minZoom!==void 0&&V<this.options.minZoom?V=void 0:V=this._clampZoom(V);var ce=this.options.updateWhenZooming&&V!==this._tileZoom;(!M||ce)&&(this._tileZoom=V,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),V!==void 0&&this._update(u),_||this._pruneTiles(),this._noPrune=!!_),this._setZoomTransforms(u,g)},_setZoomTransforms:function(u,g){for(var _ in this._levels)this._setZoomTransform(this._levels[_],u,g)},_setZoomTransform:function(u,g,_){var M=this._map.getZoomScale(_,u.zoom),V=u.origin.multiplyBy(M).subtract(this._map._getNewPixelOrigin(g,_)).round();Ge.any3d?Xt(u.el,V,M):Zt(u.el,V)},_resetGrid:function(){var u=this._map,g=u.options.crs,_=this._tileSize=this.getTileSize(),M=this._tileZoom,V=this._map.getPixelWorldBounds(this._tileZoom);V&&(this._globalTileRange=this._pxBoundsToTileRange(V)),this._wrapX=g.wrapLng&&!this.options.noWrap&&[Math.floor(u.project([0,g.wrapLng[0]],M).x/_.x),Math.ceil(u.project([0,g.wrapLng[1]],M).x/_.y)],this._wrapY=g.wrapLat&&!this.options.noWrap&&[Math.floor(u.project([g.wrapLat[0],0],M).y/_.x),Math.ceil(u.project([g.wrapLat[1],0],M).y/_.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(u){var g=this._map,_=g._animatingZoom?Math.max(g._animateToZoom,g.getZoom()):g.getZoom(),M=g.getZoomScale(_,this._tileZoom),V=g.project(u,this._tileZoom).floor(),ce=g.getSize().divideBy(M*2);return new Q(V.subtract(ce),V.add(ce))},_update:function(u){var g=this._map;if(g){var _=this._clampZoom(g.getZoom());if(u===void 0&&(u=g.getCenter()),this._tileZoom!==void 0){var M=this._getTiledPixelBounds(u),V=this._pxBoundsToTileRange(M),ce=V.getCenter(),Ue=[],dt=this.options.keepBuffer,kt=new Q(V.getBottomLeft().subtract([dt,-dt]),V.getTopRight().add([dt,-dt]));if(!(isFinite(V.min.x)&&isFinite(V.min.y)&&isFinite(V.max.x)&&isFinite(V.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var $t in this._tiles){var hn=this._tiles[$t].coords;(hn.z!==this._tileZoom||!kt.contains(new H(hn.x,hn.y)))&&(this._tiles[$t].current=!1)}if(Math.abs(_-this._tileZoom)>1){this._setView(u,_);return}for(var Rn=V.min.y;Rn<=V.max.y;Rn++)for(var Kn=V.min.x;Kn<=V.max.x;Kn++){var oa=new H(Kn,Rn);if(oa.z=this._tileZoom,!!this._isValidTile(oa)){var Zr=this._tiles[this._tileCoordsToKey(oa)];Zr?Zr.current=!0:Ue.push(oa)}}if(Ue.sort(function(za,Bl){return za.distanceTo(ce)-Bl.distanceTo(ce)}),Ue.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ei=document.createDocumentFragment();for(Kn=0;Kn<Ue.length;Kn++)this._addTile(Ue[Kn],ei);this._level.el.appendChild(ei)}}}},_isValidTile:function(u){var g=this._map.options.crs;if(!g.infinite){var _=this._globalTileRange;if(!g.wrapLng&&(u.x<_.min.x||u.x>_.max.x)||!g.wrapLat&&(u.y<_.min.y||u.y>_.max.y))return!1}if(!this.options.bounds)return!0;var M=this._tileCoordsToBounds(u);return Me(this.options.bounds).overlaps(M)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var g=this._map,_=this.getTileSize(),M=u.scaleBy(_),V=M.add(_),ce=g.unproject(M,u.z),Ue=g.unproject(V,u.z);return[ce,Ue]},_tileCoordsToBounds:function(u){var g=this._tileCoordsToNwSe(u),_=new pe(g[0],g[1]);return this.options.noWrap||(_=this._map.wrapLatLngBounds(_)),_},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var g=u.split(":"),_=new H(+g[0],+g[1]);return _.z=+g[2],_},_removeTile:function(u){var g=this._tiles[u];g&&(ct(g.el),delete this._tiles[u],this.fire("tileunload",{tile:g.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){le(u,"leaflet-tile");var g=this.getTileSize();u.style.width=g.x+"px",u.style.height=g.y+"px",u.onselectstart=p,u.onmousemove=p,Ge.ielt9&&this.options.opacity<1&&xt(u,this.options.opacity)},_addTile:function(u,g){var _=this._getTilePos(u),M=this._tileCoordsToKey(u),V=this.createTile(this._wrapCoords(u),o(this._tileReady,this,u));this._initTile(V),this.createTile.length<2&&O(o(this._tileReady,this,u,null,V)),Zt(V,_),this._tiles[M]={el:V,coords:u,current:!0},g.appendChild(V),this.fire("tileloadstart",{tile:V,coords:u})},_tileReady:function(u,g,_){g&&this.fire("tileerror",{error:g,tile:_,coords:u});var M=this._tileCoordsToKey(u);_=this._tiles[M],_&&(_.loaded=+new Date,this._map._fadeAnimated?(xt(_.el,0),I(this._fadeFrame),this._fadeFrame=O(this._updateOpacity,this)):(_.active=!0,this._pruneTiles()),g||(le(_.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:_.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ge.ielt9||!this._map._fadeAnimated?O(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var g=new H(this._wrapX?f(u.x,this._wrapX):u.x,this._wrapY?f(u.y,this._wrapY):u.y);return g.z=u.z,g},_pxBoundsToTileRange:function(u){var g=this.getTileSize();return new Q(u.min.unscaleBy(g).floor(),u.max.unscaleBy(g).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function Pl(u){return new no(u)}var ro=no.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,g){this._url=u,g=S(this,g),g.detectRetina&&Ge.retina&&g.maxZoom>0?(g.tileSize=Math.floor(g.tileSize/2),g.zoomReverse?(g.zoomOffset--,g.minZoom=Math.min(g.maxZoom,g.minZoom+1)):(g.zoomOffset++,g.maxZoom=Math.max(g.minZoom,g.maxZoom-1)),g.minZoom=Math.max(0,g.minZoom)):g.zoomReverse?g.minZoom=Math.min(g.maxZoom,g.minZoom):g.maxZoom=Math.max(g.minZoom,g.maxZoom),typeof g.subdomains=="string"&&(g.subdomains=g.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,g){return this._url===u&&g===void 0&&(g=!0),this._url=u,g||this.redraw(),this},createTile:function(u,g){var _=document.createElement("img");return jn(_,"load",o(this._tileOnLoad,this,g,_)),jn(_,"error",o(this._tileOnError,this,g,_)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(_.referrerPolicy=this.options.referrerPolicy),_.alt="",_.src=this.getTileUrl(u),_},getTileUrl:function(u){var g={r:Ge.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var _=this._globalTileRange.max.y-u.y;this.options.tms&&(g.y=_),g["-y"]=_}return A(this._url,i(g,this.options))},_tileOnLoad:function(u,g){Ge.ielt9?setTimeout(o(u,this,null,g),0):u(null,g)},_tileOnError:function(u,g,_){var M=this.options.errorTileUrl;M&&g.getAttribute("src")!==M&&(g.src=M),u(_,g)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,g=this.options.maxZoom,_=this.options.zoomReverse,M=this.options.zoomOffset;return _&&(u=g-u),u+M},_getSubdomain:function(u){var g=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[g]},_abortLoading:function(){var u,g;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(g=this._tiles[u].el,g.onload=p,g.onerror=p,!g.complete)){g.src=z;var _=this._tiles[u].coords;ct(g),delete this._tiles[u],this.fire("tileabort",{tile:g,coords:_})}},_removeTile:function(u){var g=this._tiles[u];if(g)return g.el.setAttribute("src",z),no.prototype._removeTile.call(this,u)},_tileReady:function(u,g,_){if(!(!this._map||_&&_.getAttribute("src")===z))return no.prototype._tileReady.call(this,u,g,_)}});function Eh(u,g){return new ro(u,g)}var Uc=ro.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,g){this._url=u;var _=i({},this.defaultWmsParams);for(var M in g)M in this.options||(_[M]=g[M]);g=S(this,g);var V=g.detectRetina&&Ge.retina?2:1,ce=this.getTileSize();_.width=ce.x*V,_.height=ce.y*V,this.wmsParams=_},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var g=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[g]=this._crs.code,ro.prototype.onAdd.call(this,u)},getTileUrl:function(u){var g=this._tileCoordsToNwSe(u),_=this._crs,M=ve(_.project(g[0]),_.project(g[1])),V=M.min,ce=M.max,Ue=(this._wmsVersion>=1.3&&this._crs===vf?[V.y,V.x,ce.y,ce.x]:[V.x,V.y,ce.x,ce.y]).join(","),dt=ro.prototype.getTileUrl.call(this,u);return dt+F(this.wmsParams,dt,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Ue},setParams:function(u,g){return i(this.wmsParams,u),g||this.redraw(),this}});function Ef(u,g){return new Uc(u,g)}ro.WMS=Uc,Eh.wms=Ef;var es=Ti.extend({options:{padding:.1},initialize:function(u){S(this,u),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),le(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,g){var _=this._map.getZoomScale(g,this._zoom),M=this._map.getSize().multiplyBy(.5+this.options.padding),V=this._map.project(this._center,g),ce=M.multiplyBy(-_).add(V).subtract(this._map._getNewPixelOrigin(u,g));Ge.any3d?Xt(this._container,ce,_):Zt(this._container,ce)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,g=this._map.getSize(),_=this._map.containerPointToLayerPoint(g.multiplyBy(-u)).round();
4345this._bounds=new Q(_,_.add(g.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),kh=es.extend({options:{tolerance:0},getEvents:function(){var u=es.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){es.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");jn(u,"mousemove",this._onMouseMove,this),jn(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),jn(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){I(this._redrawRequest),delete this._ctx,ct(this._container),hr(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var g in this._layers)u=this._layers[g],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){es.prototype._update.call(this);var u=this._bounds,g=this._container,_=u.getSize(),M=Ge.retina?2:1;Zt(g,u.min),g.width=M*_.x,g.height=M*_.y,g.style.width=_.x+"px",g.style.height=_.y+"px",Ge.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){es.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[d(u)]=u;var g=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=g),this._drawLast=g,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var g=u._order,_=g.next,M=g.prev;_?_.prev=M:this._drawLast=M,M?M.next=_:this._drawFirst=_,delete u._order,delete this._layers[d(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var g=u.options.dashArray.split(/[, ]+/),_=[],M,V;for(V=0;V<g.length;V++){if(M=Number(g[V]),isNaN(M))return;_.push(M)}u.options._dashArray=_}else u.options._dashArray=u.options.dashArray},_requestRedraw:function(u){this._map&&(this._extendRedrawBounds(u),this._redrawRequest=this._redrawRequest||O(this._redraw,this))},_extendRedrawBounds:function(u){if(u._pxBounds){var g=(u.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Q,this._redrawBounds.extend(u._pxBounds.min.subtract([g,g])),this._redrawBounds.extend(u._pxBounds.max.add([g,g]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var u=this._redrawBounds;if(u){var g=u.getSize();this._ctx.clearRect(u.min.x,u.min.y,g.x,g.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var u,g=this._redrawBounds;if(this._ctx.save(),g){var _=g.getSize();this._ctx.beginPath(),this._ctx.rect(g.min.x,g.min.y,_.x,_.y),this._ctx.clip()}this._drawing=!0;for(var M=this._drawFirst;M;M=M.next)u=M.layer,(!g||u._pxBounds&&u._pxBounds.intersects(g))&&u._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(u,g){if(this._drawing){var _,M,V,ce,Ue=u._parts,dt=Ue.length,kt=this._ctx;if(dt){for(kt.beginPath(),_=0;_<dt;_++){for(M=0,V=Ue[_].length;M<V;M++)ce=Ue[_][M],kt[M?"lineTo":"moveTo"](ce.x,ce.y);g&&kt.closePath()}this._fillStroke(kt,u)}}},_updateCircle:function(u){if(!(!this._drawing||u._empty())){var g=u._point,_=this._ctx,M=Math.max(Math.round(u._radius),1),V=(Math.max(Math.round(u._radiusY),1)||M)/M;V!==1&&(_.save(),_.scale(1,V)),_.beginPath(),_.arc(g.x,g.y/V,M,0,Math.PI*2,!1),V!==1&&_.restore(),this._fillStroke(_,u)}},_fillStroke:function(u,g){var _=g.options;_.fill&&(u.globalAlpha=_.fillOpacity,u.fillStyle=_.fillColor||_.color,u.fill(_.fillRule||"evenodd")),_.stroke&&_.weight!==0&&(u.setLineDash&&u.setLineDash(g.options&&g.options._dashArray||[]),u.globalAlpha=_.opacity,u.lineWidth=_.weight,u.strokeStyle=_.color,u.lineCap=_.lineCap,u.lineJoin=_.lineJoin,u.stroke())},_onClick:function(u){for(var g=this._map.mouseEventToLayerPoint(u),_,M,V=this._drawFirst;V;V=V.next)_=V.layer,_.options.interactive&&_._containsPoint(g)&&(!(u.type==="click"||u.type==="preclick")||!this._map._draggableMoved(_))&&(M=_);this._fireEvent(M?[M]:!1,u)},_onMouseMove:function(u){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var g=this._map.mouseEventToLayerPoint(u);this._handleMouseHover(u,g)}},_handleMouseOut:function(u){var g=this._hoveredLayer;g&&(Ne(this._container,"leaflet-interactive"),this._fireEvent([g],u,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(u,g){if(!this._mouseHoverThrottled){for(var _,M,V=this._drawFirst;V;V=V.next)_=V.layer,_.options.interactive&&_._containsPoint(g)&&(M=_);M!==this._hoveredLayer&&(this._handleMouseOut(u),M&&(le(this._container,"leaflet-interactive"),this._fireEvent([M],u,"mouseover"),this._hoveredLayer=M)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,u),this._mouseHoverThrottled=!0,setTimeout(o(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(u,g,_){this._map._fireDOMEvent(g,_||g.type,u)},_bringToFront:function(u){var g=u._order;if(g){var _=g.next,M=g.prev;if(_)_.prev=M;else return;M?M.next=_:_&&(this._drawFirst=_),g.prev=this._drawLast,this._drawLast.next=g,g.next=null,this._drawLast=g,this._requestRedraw(u)}},_bringToBack:function(u){var g=u._order;if(g){var _=g.next,M=g.prev;if(M)M.next=_;else return;_?_.prev=M:M&&(this._drawLast=M),g.prev=null,g.next=this._drawFirst,this._drawFirst.prev=g,this._drawFirst=g,this._requestRedraw(u)}}});function Ah(u){return Ge.canvas?new kh(u):null}var jl=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(u){return document.createElement("<lvml:"+u+' class="lvml">')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),kf={_initContainer:function(){this._container=pt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(es.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var g=u._container=jl("shape");le(g,"leaflet-vml-shape "+(this.options.className||"")),g.coordsize="1 1",u._path=jl("path"),g.appendChild(u._path),this._updateStyle(u),this._layers[d(u)]=u},_addPath:function(u){var g=u._container;
4345this._container.appendChild(g),u.options.interactive&&u.addInteractiveTarget(g)},_removePath:function(u){var g=u._container;ct(g),u.removeInteractiveTarget(g),delete this._layers[d(u)]},_updateStyle:function(u){var g=u._stroke,_=u._fill,M=u.options,V=u._container;V.stroked=!!M.stroke,V.filled=!!M.fill,M.stroke?(g||(g=u._stroke=jl("stroke")),V.appendChild(g),g.weight=M.weight+"px",g.color=M.color,g.opacity=M.opacity,M.dashArray?g.dashStyle=N(M.dashArray)?M.dashArray.join(" "):M.dashArray.replace(/( *, *)/g," "):g.dashStyle="",g.endcap=M.lineCap.replace("butt","flat"),g.joinstyle=M.lineJoin):g&&(V.removeChild(g),u._stroke=null),M.fill?(_||(_=u._fill=jl("fill")),V.appendChild(_),_.color=M.fillColor||M.color,_.opacity=M.fillOpacity):_&&(V.removeChild(_),u._fill=null)},_updateCircle:function(u){var g=u._point.round(),_=Math.round(u._radius),M=Math.round(u._radiusY||_);this._setPath(u,u._empty()?"M0 0":"AL "+g.x+","+g.y+" "+_+","+M+" 0,"+65535*360)},_setPath:function(u,g){u._path.v=g},_bringToFront:function(u){sn(u._container)},_bringToBack:function(u){cn(u._container)}},Ri=Ge.vml?jl:re,Ho=es.extend({_initContainer:function(){this._container=Ri("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ri("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ct(this._container),hr(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){es.prototype._update.call(this);var u=this._bounds,g=u.getSize(),_=this._container;(!this._svgSize||!this._svgSize.equals(g))&&(this._svgSize=g,_.setAttribute("width",g.x),_.setAttribute("height",g.y)),Zt(_,u.min),_.setAttribute("viewBox",[u.min.x,u.min.y,g.x,g.y].join(" ")),this.fire("update")}},_initPath:function(u){var g=u._path=Ri("path");u.options.className&&le(g,u.options.className),u.options.interactive&&le(g,"leaflet-interactive"),this._updateStyle(u),this._layers[d(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){ct(u._path),u.removeInteractiveTarget(u._path),delete this._layers[d(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var g=u._path,_=u.options;g&&(_.stroke?(g.setAttribute("stroke",_.color),g.setAttribute("stroke-opacity",_.opacity),g.setAttribute("stroke-width",_.weight),g.setAttribute("stroke-linecap",_.lineCap),g.setAttribute("stroke-linejoin",_.lineJoin),_.dashArray?g.setAttribute("stroke-dasharray",_.dashArray):g.removeAttribute("stroke-dasharray"),_.dashOffset?g.setAttribute("stroke-dashoffset",_.dashOffset):g.removeAttribute("stroke-dashoffset")):g.setAttribute("stroke","none"),_.fill?(g.setAttribute("fill",_.fillColor||_.color),g.setAttribute("fill-opacity",_.fillOpacity),g.setAttribute("fill-rule",_.fillRule||"evenodd")):g.setAttribute("fill","none"))},_updatePoly:function(u,g){this._setPath(u,wt(u._parts,g))},_updateCircle:function(u){var g=u._point,_=Math.max(Math.round(u._radius),1),M=Math.max(Math.round(u._radiusY),1)||_,V="a"+_+","+M+" 0 1,0 ",ce=u._empty()?"M0 0":"M"+(g.x-_)+","+g.y+V+_*2+",0 "+V+-_*2+",0 ";this._setPath(u,ce)},_setPath:function(u,g){u._path.setAttribute("d",g)},_bringToFront:function(u){sn(u._path)},_bringToBack:function(u){cn(u._path)}});Ge.vml&&Ho.include(kf);function Uu(u){return Ge.svg||Ge.vml?new Ho(u):null}Vn.include({getRenderer:function(u){var g=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return g||(g=this._renderer=this._createRenderer()),this.hasLayer(g)||this.addLayer(g),g},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var g=this._paneRenderers[u];return g===void 0&&(g=this._createRenderer({pane:u}),this._paneRenderers[u]=g),g},_createRenderer:function(u){return this.options.preferCanvas&&Ah(u)||Uu(u)}});var Af=bs.extend({initialize:function(u,g){bs.prototype.initialize.call(this,this._boundsToLatLngs(u),g)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))}
vendor: 5,997 bytes, line 4345
4345,_boundsToLatLngs:function(u){return u=Me(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function Jx(u,g){return new Af(u,g)}Ho.create=Ri,Ho.pointsToPath=wt,Zi.geometryToLayer=Tl,Zi.coordsToLatLng=Pu,Zi.coordsToLatLngs=Bc,Zi.latLngToCoords=ju,Zi.latLngsToCoords=Lu,Zi.getFeature=Ml,Zi.asFeature=Iu,Vn.mergeOptions({boxZoom:!0});var Ll=Xr.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){jn(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){hr(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ct(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),rn(),qi(),this._startPoint=this._map.mouseEventToContainerPoint(u),jn(document,{contextmenu:Mn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=pt("div","leaflet-zoom-box",this._container),le(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var g=new Q(this._point,this._startPoint),_=g.getSize();Zt(this._box,g.min),this._box.style.width=_.x+"px",this._box.style.height=_.y+"px"},_finish:function(){this._moved&&(ct(this._box),Ne(this._container,"leaflet-crosshair")),or(),fs(),hr(document,{contextmenu:Mn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var g=new pe(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(g).fire("boxzoomend",{boxZoomBounds:g})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Vn.addInitHook("addHandler","boxZoom",Ll),Vn.mergeOptions({doubleClickZoom:!0});var Nf=Xr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var g=this._map,_=g.getZoom(),M=g.options.zoomDelta,V=u.originalEvent.shiftKey?_-M:_+M;g.options.doubleClickZoom==="center"?g.setZoom(V):g.setZoomAround(u.containerPoint,V)}});Vn.addInitHook("addHandler","doubleClickZoom",Nf),Vn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Nh=Xr.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new Tr(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}le(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ne(this._map._container,"leaflet-grab"),Ne(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var g=Me(this._map.options.maxBounds);this._offsetLimit=ve(this._map.latLngToContainerPoint(g.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(g.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var g=this._lastTime=+new Date,_=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(_),this._times.push(g),this._prunePositions(g)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),g=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=g.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,g){return u-(u-g)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),g=this._offsetLimit;u.x<g.min.x&&(u.x=this._viscousLimit(u.x,g.min.x)),u.y<g.min.y&&(u.y=this._viscousLimit(u.y,g.min.y)),u.x>g.max.x&&(u.x=this._viscousLimit(u.x,g.max.x)),u.y>g.max.y&&(u.y=this._viscousLimit(u.y,g.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,g=Math.round(u/2),_=this._initialWorldOffset,M=this._draggable._newPos.x,V=(M-g+_)%u+g-_,ce=(M+g+_)%u-g-_,Ue=Math.abs(V+_)<Math.abs(ce+_)?V:ce;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=Ue},_onDragEnd:function(u){var g=this._map,_=g.options,M=!_.inertia||u.noInertia||this._times.length<2;if(g.fire("dragend",u),M)g.fire("moveend");else{this._prunePositions(+new Date);var V=this._lastPos.subtract(this._positions[0]),ce=(this._lastTime-this._times[0])/1e3,Ue=_.easeLinearity,dt=V.multiplyBy(Ue/ce),kt=dt.distanceTo([0,0]),$t=M
4345ath.min(_.inertiaMaxSpeed,kt),hn=dt.multiplyBy($t/kt),Rn=$t/(_.inertiaDeceleration*Ue),Kn=hn.multiplyBy(-Rn/2).round();!Kn.x&&!Kn.y?g.fire("moveend"):(Kn=g._limitOffset(Kn,g.options.maxBounds),O(function(){g.panBy(Kn,{duration:Rn,easeLinearity:Ue,noMoveStart:!0,animate:!0})}))}}});Vn.addInitHook("addHandler","dragging",Nh),Vn.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Th=Xr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(u){this._map=u,this._setPanDelta(u.options.keyboardPanDelta),this._setZoomDelta(u.options.zoomDelta)},addHooks:function(){var u=this._map._container;u.tabIndex<=0&&(u.tabIndex="0"),jn(u,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),hr(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var u=document.body,g=document.documentElement,_=u.scrollTop||g.scrollTop,M=u.scrollLeft||g.scrollLeft;this._map._container.focus(),window.scrollTo(M,_)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(u){var g=this._panKeys={},_=this.keyCodes,M,V;for(M=0,V=_.left.length;M<V;M++)g[_.left[M]]=[-1*u,0];for(M=0,V=_.right.length;M<V;M++)g[_.right[M]]=[u,0];for(M=0,V=_.down.length;M<V;M++)g[_.down[M]]=[0,u];for(M=0,V=_.up.length;M<V;M++)g[_.up[M]]=[0,-1*u]},_setZoomDelta:function(u){var g=this._zoomKeys={},_=this.keyCodes,M,V;for(M=0,V=_.zoomIn.length;M<V;M++)g[_.zoomIn[M]]=u;for(M=0,V=_.zoomOut.length;M<V;M++)g[_.zoomOut[M]]=-u},_addHooks:function(){jn(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){hr(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(u){if(!(u.altKey||u.ctrlKey||u.metaKey)){var g=u.keyCode,_=this._map,M;if(g in this._panKeys){if(!_._panAnim||!_._panAnim._inProgress)if(M=this._panKeys[g],u.shiftKey&&(M=ie(M).multiplyBy(3)),_.options.maxBounds&&(M=_._limitOffset(ie(M),_.options.maxBounds)),_.options.worldCopyJump){var V=_.wrapLatLng(_.unproject(_.project(_.getCenter()).add(M)));_.panTo(V)}else _.panBy(M)}else if(g in this._zoomKeys)_.setZoom(_.getZoom()+(u.shiftKey?3:1)*this._zoomKeys[g]);else if(g===27&&_._popup&&_._popup.options.closeOnEscapeKey)_.closePopup();else return;Mn(u)}}});Vn.addInitHook("addHandler","keyboard",Th),Vn.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var yr=Xr.extend({addHooks:function(){jn(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){hr(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(u){var g=qn(u),_=this._map.options.wheelDebounceTime;this._delta+=g,this._lastMousePos=this._map.mouseEventToContainerPoint(u),this._startTime||(this._startTime=+new Date);var M=Math.max(_-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),M),Mn(u)},_performZoom:function(){var u=this._map,g=u.getZoom(),_=this._map.options.zoomSnap||0;u._stop();var M=this._delta/(this._map.options.wheelPxPerZoomLevel*4),V=4*Math.log(2/(1+Math.exp(-Math.abs(M))))/Math.LN2,ce=_?Math.ceil(V/_)*_:V,Ue=u._limitZoom(g+(this._delta>0?ce:-ce))-g;this._delta=0,this._startTime=null,Ue&&(u.options.scrollWheelZoom==="center"?u.setZoom(g+Ue):u.setZoomAround(this._lastMousePos,g+Ue))}});Vn.addInitHook("addHandler","scrollWheelZoom",yr);var Mh=600;Vn.mergeOptions({tapHold:Ge.touchNative&&Ge.safari&&Ge.mobile,tapTolerance:15});var zc=Xr.extend({addHooks:function(){jn(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){hr(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var g=u.touches[0];this._startPos=this._newPos=new H(g.clientX,g.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(jn(document,"touchend",xn),jn(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",g))},this),Mh),jn(document,"touchend touchcancel contextmenu",this._cancel,this),jn(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){hr(document,"touchend",xn),hr(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),hr(document,"touchend touchcancel contextmenu",this._cancel,this),hr(document,"touchmove",this._onMove,this)},_onMove:function(u){var g=u.touches[0];this._newPos=new H(g.clientX,g.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,g){var _=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:g.screenX,screenY:g.screenY,clientX:g.clientX,clientY:g.clientY});_._simulated=!0,g.target.dispatchEvent(_)}});Vn.addInitHook("addHandler","tapHold",zc),Vn.mergeOptions({touchZoom:Ge.touch,bounceAtZoomLimits:!0});var Il=Xr.extend({addHooks:function(){le(this._map._container,"leaflet-touch-zoom"),jn(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ne(this._map._container,"leaflet-touch-zoom"),hr(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var g=this._map;if(!(!u.touches||u.touches.length!==2||g._animatingZoom||this._zooming)){var _=g.mouseEventToContainerPoint(u.touches[0]),M=g.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=g.getSize()._divideBy(2),this._startLatLng=g.containerPointToLatLng(this._centerPoint),g.options.touchZoom!=="center"&&(this._pinchStartLatLng=g.containerPointToLatLng(_.add(M)._divideBy(2))),this._startDist=_.distanceTo(M),this._startZoom=g.getZoom(),this._moved=!1,this._zooming=!0,g._stop(),jn(document,"touchmove",this._onTouchMove,this),jn(document,"touchend touchcancel",this._onTouchEnd,this),xn(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var g=this._map,_=g.mouseEventToContainerPoint(u.touches[0]),M=g.mouseEventToContainerPoint(u.touches[1]),V=_.distanceTo(M)/this._startDist;if(this._zoom=g.getScaleZoom(V,this._startZoom),!g.options.bounceAtZoomLimits&&(this._zoom<g.getMinZoom()&&V<1||this._zoom>g.getMaxZoom()&&V>1)&&(this._zoom=g._limitZoom(this._zoom)),g.options.touchZoom==="center"){if(this._center=this._startLatLng,V===1)return}else{var ce=_._add(M)._divideBy(2)._subtract(this._centerPoint);if(V===1&&ce.x===0&&ce.y===0)return;this._center=g.unproject(g.project(this._pinchStartLatLng,this._zoom).subtract(ce),this._zoom)}this._moved||(g._moveStart(!0,!1),this._moved=!0),I(this._animRequest);var Ue=o(g._move,g,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=O(Ue,this,!0),xn(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,I(this._animRequest),hr(document,"touchmove",this._onTouchMove,this),hr(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Vn.addInitHook("addHandler","touchZoom",Il),Vn.BoxZoom=Ll,Vn.DoubleClickZoom=Nf,Vn.Drag=Nh,Vn.Ke
4345yboard=Th,Vn.ScrollWheelZoom=yr,Vn.TapHold=zc,Vn.TouchZoom=Il,n.Bounds=Q,n.Browser=Ge,n.CRS=Ce,n.Canvas=kh,n.Circle=Ru,n.CircleMarker=Mu,n.Class=U,n.Control=sa,n.DivIcon=Ou,n.DivOverlay=Qi,n.DomEvent=Ji,n.DomUtil=ja,n.Draggable=Tr,n.Evented=W,n.FeatureGroup=vs,n.GeoJSON=Zi,n.GridLayer=no,n.Handler=Xr,n.Icon=Go,n.ImageOverlay=to,n.LatLng=We,n.LatLngBounds=pe,n.Layer=Ti,n.LayerGroup=Qs,n.LineUtil=xf,n.Map=Vn,n.Marker=ys,n.Mixin=Xi,n.Path=eo,n.Point=H,n.PolyUtil=Tu,n.Polygon=bs,n.Polyline=Qa,n.Popup=Bu,n.PosAnimation=La,n.Projection=Wx,n.Rectangle=Af,n.Renderer=es,n.SVG=Ho,n.SVGOverlay=Ch,n.TileLayer=ro,n.Tooltip=Dl,n.Transformation=Rt,n.Util=j,n.VideoOverlay=Fh,n.bind=o,n.bounds=ve,n.canvas=Ah,n.circle=Ic,n.circleMarker=wf,n.control=di,n.divIcon=_f,n.extend=i,n.featureGroup=yf,n.geoJSON=Sf,n.geoJson=Mi,n.gridLayer=Pl,n.icon=bf,n.imageOverlay=Ff,n.latLng=Ae,n.latLngBounds=Me,n.layerGroup=Lc,n.map=Za,n.marker=Kx,n.point=ie,n.polygon=qx,n.polyline=Yx,n.popup=Rl,n.rectangle=Jx,n.setOptions=S,n.stamp=d,n.svg=Uu,n.svgOverlay=_h,n.tileLayer=Eh,n.tooltip=Oc,n.transformation=zt,n.version=a,n.videoOverlay=Cf;var Tf=window.L;n.noConflict=function(){return window.L=Tf,this},window.L=n}))})(vm,vm.exports)),vm.exports}var Dc=XM();const ZM=Kg(Dc);function QM(t){return t.split(" ").filter(Boolean)}function e4(t,e){QM(e).forEach(n=>{Dc.DomUtil.addClass(t,n)})}function t4(t,e){QM(e).forEach(n=>{Dc.DomUtil.removeClass(t,n)})}function dq(t,e,n){t!=null&&n!==e&&(e!=null&&e.length>0&&t4(t,e),n!=null&&n.length>0&&e4(t,n))}function mf(t,e,n){return Object.freeze({instance:t,context:e,container:n})}function gh(t,e){return e==null?function(a,i){const s=x.useRef();return s.current||(s.current=t(a,i)),s}:function(a,i){const s=x.useRef();s.current||(s.current=t(a,i));const o=x.useRef(a),{instance:c}=s.current;return x.useEffect(function(){o.current!==a&&(e(c,a,o.current),o.current=a)},[c,a,i]),s}}function nS(t,e){x.useEffect(function(){return(e.layerContainer??e.map).addLayer(t.instance),function(){e.layerContainer?.removeLayer(t.instance),e.map.removeLayer(t.instance)}},[e,t])}function rS(t){return function(n){const a=df(),i=t(hf(n,a),a);return Xw(a.map,n.attribution),Bx(i.current,n.eventHandlers),nS(i.current,a),i}}function n4(t,e){const n=x.useRef();x.useEffect(function(){if(e.pathOptions!==n.current){const i=e.pathOptions??{};t.instance.setStyle(i),n.current=i}},[t,e])}function r4(t){return function(n){const a=df(),i=t(hf(n,a),a);return Bx(i.current,n.eventHandlers),nS(i.current,a),n4(i.current,n),i}}function hq(t){function e(i,s){return mf(t(i),s)}const n=gh(e),a=qM(n);return tS(a)}function a4(t,e){const n=gh(t,e),a=rS(n);return eS(a)}function i4(t,e){const n=gh(t),a=JM(n,e);return YM(a)}function mq(t,e){const n=gh(t,e),a=r4(n);return eS(a)}function s4(t,e){const n=gh(t,e),a=rS(n);return tS(a)}function o4(t,e,n){const{opacity:a,zIndex:i}=e;a!=null&&a!==n.opacity&&t.setOpacity(a),i!=null&&i!==n.zIndex&&t.setZIndex(i)}function fq(t,e,n){e.bounds instanceof Dc.LatLngBounds&&e.bounds!==n.bounds&&t.setBounds(e.bounds),e.opacity!=null&&e.opacity!==n.opacity&&t.setOpacity(e.opacity),e.zIndex!=null&&e.zIndex!==n.zIndex&&t.setZIndex(e.zIndex)}const pq=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_VERSION:VM,LeafletContext:Zw,LeafletProvider:Qw,addClassName:e4,createContainerComponent:eS,createControlComponent:hq,createControlHook:qM,createDivOverlayComponent:YM,createDivOverlayHook:JM,createElementHook:gh,createElementObject:mf,createLayerComponent:a4,createLayerHook:rS,createLeafComponent:tS,createLeafletContext:$M,createOverlayComponent:i4,createPathComponent:mq,createPathHook:r4,createTileLayerComponent:s4,extendContext:KM,removeClassName:t4,updateCircle:cq,updateClassName:dq,updateGridLayer:o4,updateMediaOverlay:fq,useAttribution:Xw,useEventHandlers:Bx,useLayerLifecycle:nS,useLeafletContext:df,usePathOptions:n4,withPane:hf},Symbol.toStringTag,{value:"Module"}));function s1(){return s1=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},s1.apply(this,arguments)}
4345function gq({bounds:t,boundsOptions:e,center:n,children:a,className:i,id:s,placeholder:o,style:c,whenReady:d,zoom:m,...f},p){const[b]=x.useState({className:i,id:s,style:c}),[v,C]=x.useState(null);x.useImperativeHandle(p,()=>v?.map??null,[v]);const S=x.useCallback(w=>{if(w!==null&&v===null){const A=new Dc.Map(w,f);n!=null&&m!=null?A.setView(n,m):t!=null&&A.fitBounds(t,e),d!=null&&A.whenReady(d),C($M(A))}},[]);x.useEffect(()=>()=>{v?.map.remove()},[v]);const F=v?Jt.createElement(Qw,{value:v},a):o??null;return Jt.createElement("div",s1({},b,{ref:S}),F)}const xq=x.forwardRef(gq),vq=a4(function({position:e,...n},a){const i=new Dc.Marker(e,n);return mf(i,KM(a,{overlayContainer:i}))},function(e,n,a){n.position!==a.position&&e.setLatLng(n.position),n.icon!=null&&n.icon!==a.icon&&e.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==a.zIndexOffset&&e.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==a.opacity&&e.setOpacity(n.opacity),e.dragging!=null&&n.draggable!==a.draggable&&(n.draggable===!0?e.dragging.enable():e.dragging.disable())}),yq=i4(function(e,n){const a=new Dc.Popup(e,n.overlayContainer);return mf(a,n)},function(e,n,{position:a},i){x.useEffect(function(){const{instance:o}=e;function c(m){m.popup===o&&(o.update(),i(!0))}function d(m){m.popup===o&&i(!1)}return n.map.on({popupopen:c,popupclose:d}),n.overlayContainer==null?(a!=null&&o.setLatLng(a),o.openOn(n.map)):n.overlayContainer.bindPopup(o),function(){n.map.off({popupopen:c,popupclose:d}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(o)}},[e,n,i,a])}),bq=s4(function({url:e,...n},a){const i=new Dc.TileLayer(e,hf(n,a));return mf(i,a)},function(e,n,a){o4(e,n,a);const{url:i}=n;i!=null&&i!==a.url&&e.setUrl(i)});var co={};const wq=Yg(pq);var ym={exports:{}},Sq=ym.exports,O_;function Fq(){return O_||(O_=1,(function(t,e){(function(n,a){a(e)})(Sq,function(n){var a=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(s){L.Util.setOptions(this,s),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var o=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,o?this._withAnimation:this._noAnimation),this._markerCluster=o?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(s){if(s instanceof L.LayerGroup)return this.addLayers([s]);if(!s.getLatLng)return this._nonPointGroup.addLayer(s),this.fire("layeradd",{layer:s}),this;if(!this._map)return this._needsClustering.push(s),this.fire("layeradd",{layer:s}),this;if(this.hasLayer(s))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(s,this._maxZoom),this.fire("layeradd",{layer:s}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var o=s,c=this._zoom;if(s.__parent)for(;o.__parent._zoom>=c;)o=o.__parent;return this._currentShownBounds.contains(o.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(s,o):this._animationAddLayerNonAnimated(s,o)),this},removeLayer:function(s){return s instanceof L.LayerGroup?this.removeLayers([s]):s.getLatLng?this._map?s.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(s)),this._removeLayer(s,!0),this.fire("layerremove",{layer:s}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),s.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(s)&&(this._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,s)&&this.hasLayer(s)&&this._needsRemoving.push({layer:s,latlng:s._latlng}),this.fire("layerremove",{layer:s}),this):(this._nonPointGroup.removeLayer(s),this.fire("layerremove",{layer:s}),this)},addLayers:function(s,o){if(!L.Util.isArray(s))return this.addLayer(s);var c=this._featureGroup,d=this._nonPointGroup,m=this.options.chunkedLoading,f
4345=this.options.chunkInterval,p=this.options.chunkProgress,b=s.length,v=0,C=!0,S;if(this._map){var F=new Date().getTime(),w=L.bind(function(){var N=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();v<b;v++){if(m&&v%200===0){var P=new Date().getTime()-N;if(P>f)break}if(S=s[v],S instanceof L.LayerGroup){C&&(s=s.slice(),C=!1),this._extractNonGroupLayers(S,s),b=s.length;continue}if(!S.getLatLng){d.addLayer(S),o||this.fire("layeradd",{layer:S});continue}if(!this.hasLayer(S)&&(this._addLayer(S,this._maxZoom),o||this.fire("layeradd",{layer:S}),S.__parent&&S.__parent.getChildCount()===2)){var z=S.__parent.getAllChildMarkers(),D=z[0]===S?z[1]:z[0];c.removeLayer(D)}}p&&p(v,b,new Date().getTime()-F),v===b?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(w,this.options.chunkDelay)},this);w()}else for(var A=this._needsClustering;v<b;v++){if(S=s[v],S instanceof L.LayerGroup){C&&(s=s.slice(),C=!1),this._extractNonGroupLayers(S,s),b=s.length;continue}if(!S.getLatLng){d.addLayer(S);continue}this.hasLayer(S)||A.push(S)}return this},removeLayers:function(s){var o,c,d=s.length,m=this._featureGroup,f=this._nonPointGroup,p=!0;if(!this._map){for(o=0;o<d;o++){if(c=s[o],c instanceof L.LayerGroup){p&&(s=s.slice(),p=!1),this._extractNonGroupLayers(c,s),d=s.length;continue}this._arraySplice(this._needsClustering,c),f.removeLayer(c),this.hasLayer(c)&&this._needsRemoving.push({layer:c,latlng:c._latlng}),this.fire("layerremove",{layer:c})}return this}if(this._unspiderfy){this._unspiderfy();var b=s.slice(),v=d;for(o=0;o<v;o++){if(c=b[o],c instanceof L.LayerGroup){this._extractNonGroupLayers(c,b),v=b.length;continue}this._unspiderfyLayer(c)}}for(o=0;o<d;o++){if(c=s[o],c instanceof L.LayerGroup){p&&(s=s.slice(),p=!1),this._extractNonGroupLayers(c,s),d=s.length;continue}if(!c.__parent){f.removeLayer(c),this.fire("layerremove",{layer:c});continue}this._removeLayer(c,!0,!0),this.fire("layerremove",{layer:c}),m.hasLayer(c)&&(m.removeLayer(c),c.clusterShow&&c.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(s){s.off(this._childMarkerEventHandlers,this),delete s.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var s=new L.LatLngBounds;this._topClusterLevel&&s.extend(this._topClusterLevel._bounds);for(var o=this._needsClustering.length-1;o>=0;o--)s.extend(this._needsClustering[o].getLatLng());return s.extend(this._nonPointGroup.getBounds()),s},eachLayer:function(s,o){var c=this._needsClustering.slice(),d=this._needsRemoving,m,f,p;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(c),f=c.length-1;f>=0;f--){for(m=!0,p=d.length-1;p>=0;p--)if(d[p].layer===c[f]){m=!1;break}m&&s.call(o,c[f])}this._nonPointGroup.eachLayer(s,o)},getLayers:function(){var s=[];return this.eachLayer(function(o){s.push(o)}),s},getLayer:function(s){var o=null;return s=parseInt(s,10),this.eachLayer(function(c){L.stamp(c)===s&&(o=c)}),o},hasLayer:function(s){if(!s)return!1;var o,c=this._needsClustering;for(o=c.length-1;o>=0;o--)if(c[o]===s)return!0;for(c=this._needsRemoving,o=c.length-1;o>=0;o--)if(c[o].layer===s)return!1;return!!(s.__parent&&s.__parent._group===this)||this._nonPointGroup.hasLayer(s)},zoomToShowLayer:function(s,o){var c=this._map;typeof o!="function"&&(o=function(){});var d=function(){(c.hasLayer(s)||c.hasLayer(s.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",d,this),this.off("animationend",d,this),c.hasLayer(s)?o():s.__parent._icon&&(this.once("spiderfied",o,this),s.__parent.spiderfy()))};s._icon&&this._map.getBounds().contains(s.getLatLng())?o():s.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",d,this),this._map.panTo(s.getLatLng())):(this._map.on("moveend",d,this),this.on("animationend",d,this),s.__parent.zoomToBounds())},onAdd:function(s){this._map=s;var o,c,d;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";
4345for(this._featureGroup.addTo(s),this._nonPointGroup.addTo(s),this._gridClusters||this._generateInitialClusters(),this._maxLat=s.options.crs.projection.MAX_LATITUDE,o=0,c=this._needsRemoving.length;o<c;o++)d=this._needsRemoving[o],d.newlatlng=d.layer._latlng,d.layer._latlng=d.latlng;for(o=0,c=this._needsRemoving.length;o<c;o++)d=this._needsRemoving[o],this._removeLayer(d.layer,!0),d.layer._latlng=d.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),c=this._needsClustering,this._needsClustering=[],this.addLayers(c,!0)},onRemove:function(s){s.off("zoomend",this._zoomEnd,this),s.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(s){for(var o=s;o&&!o._icon;)o=o.__parent;return o||null},_arraySplice:function(s,o){for(var c=s.length-1;c>=0;c--)if(s[c]===o)return s.splice(c,1),!0},_removeFromGridUnclustered:function(s,o){for(var c=this._map,d=this._gridUnclustered,m=Math.floor(this._map.getMinZoom());o>=m&&d[o].removeObject(s,c.project(s.getLatLng(),o));o--);},_childMarkerDragStart:function(s){s.target.__dragStart=s.target._latlng},_childMarkerMoved:function(s){if(!this._ignoreMove&&!s.target.__dragStart){var o=s.target._popup&&s.target._popup.isOpen();this._moveChild(s.target,s.oldLatLng,s.latlng),o&&s.target.openPopup()}},_moveChild:function(s,o,c){s._latlng=o,this.removeLayer(s),s._latlng=c,this.addLayer(s)},_childMarkerDragEnd:function(s){var o=s.target.__dragStart;delete s.target.__dragStart,o&&this._moveChild(s.target,o,s.target._latlng)},_removeLayer:function(s,o,c){var d=this._gridClusters,m=this._gridUnclustered,f=this._featureGroup,p=this._map,b=Math.floor(this._map.getMinZoom());o&&this._removeFromGridUnclustered(s,this._maxZoom);var v=s.__parent,C=v._markers,S;for(this._arraySplice(C,s);v&&(v._childCount--,v._boundsNeedUpdate=!0,!(v._zoom<b));)o&&v._childCount<=1?(S=v._markers[0]===s?v._markers[1]:v._markers[0],d[v._zoom].removeObject(v,p.project(v._cLatLng,v._zoom)),m[v._zoom].addObject(S,p.project(S.getLatLng(),v._zoom)),this._arraySplice(v.__parent._childClusters,v),v.__parent._markers.push(S),S.__parent=v.__parent,v._icon&&(f.removeLayer(v),c||f.addLayer(S))):v._iconNeedsUpdate=!0,v=v.__parent;delete s.__parent},_isOrIsParent:function(s,o){for(;o;){if(s===o)return!0;o=o.parentNode}return!1},fire:function(s,o,c){if(o&&o.layer instanceof L.MarkerCluster){if(o.originalEvent&&this._isOrIsParent(o.layer._icon,o.originalEvent.relatedTarget))return;s="cluster"+s}L.FeatureGroup.prototype.fire.call(this,s,o,c)},listens:function(s,o){return L.FeatureGroup.prototype.listens.call(this,s,o)||L.FeatureGroup.prototype.listens.call(this,"cluster"+s,o)},_defaultIconCreateFunction:function(s){var o=s.getChildCount(),c=" marker-cluster-";return o<10?c+="small":o<100?c+="medium":c+="large",new L.DivIcon({html:"<div><span>"+o+"</span></div>",className:"marker-cluster"+c,iconSize:new L.Point(40,40)})},_bindEvents:function(){var s=this._map,o=this.options.spiderfyOnMaxZoom,c=this.options.showCoverageOnHover,d=this.options.zoomToBoundsOnClick,m=this.options.spiderfyOnEveryZoom;(o||d||m)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),c&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),s.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(s){var o=s.layer,c=o;if(!(s.type==="clusterkeypress"&&s.originalEvent&&s.originalEvent.keyCode!==13)){for(;c._childClusters.length===1;)c=c._childClusters[0];c._zoom===this._maxZoom&&c._childCount===o._childCount&&this.options.spiderfyOnMaxZoom?o.spiderfy():this.options.zoomToBoundsOnClick&&o.zoomToBounds(),this.options.spiderfyOnEveryZoom&&o.spiderfy(),s.originalEvent&&s.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(s){var o=this._map;this._inZoomAnimation||(this._shownPolygon&&o.removeLayer(this._shownPolygon),s.layer.getChildCount()>2&&s.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(s.layer.getConvexHull(),this.options.polygonOptions),o.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var s=this.options.spiderfyOnMaxZoom,o=this.options.showCoverageOnHover,c=this.options.zoomToBoundsOnClick,d=this.options.spiderfyOnEveryZoom,m=this._map;(s||c||d)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),o&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),m.off("zoomend",this._hideCoverage,this))}
4345,_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var s=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,s),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),s),this._currentShownBounds=s}},_generateInitialClusters:function(){var s=Math.ceil(this._map.getMaxZoom()),o=Math.floor(this._map.getMinZoom()),c=this.options.maxClusterRadius,d=c;typeof c!="function"&&(d=function(){return c}),this.options.disableClusteringAtZoom!==null&&(s=this.options.disableClusteringAtZoom-1),this._maxZoom=s,this._gridClusters={},this._gridUnclustered={};for(var m=s;m>=o;m--)this._gridClusters[m]=new L.DistanceGrid(d(m)),this._gridUnclustered[m]=new L.DistanceGrid(d(m));this._topClusterLevel=new this._markerCluster(this,o-1)},_addLayer:function(s,o){var c=this._gridClusters,d=this._gridUnclustered,m=Math.floor(this._map.getMinZoom()),f,p;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(s),s.on(this._childMarkerEventHandlers,this);o>=m;o--){f=this._map.project(s.getLatLng(),o);var b=c[o].getNearObject(f);if(b){b._addChild(s),s.__parent=b;return}if(b=d[o].getNearObject(f),b){var v=b.__parent;v&&this._removeLayer(b,!1);var C=new this._markerCluster(this,o,b,s);c[o].addObject(C,this._map.project(C._cLatLng,o)),b.__parent=C,s.__parent=C;var S=C;for(p=o-1;p>v._zoom;p--)S=new this._markerCluster(this,p,S),c[p].addObject(S,this._map.project(b.getLatLng(),p));v._addChild(S),this._removeFromGridUnclustered(b,o);return}d[o].addObject(s,f)}this._topClusterLevel._addChild(s),s.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(s){s instanceof L.MarkerCluster&&s._iconNeedsUpdate&&s._updateIcon()})},_enqueue:function(s){this._queue.push(s),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var s=0;s<this._queue.length;s++)this._queue[s].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var s=Math.round(this._map._zoom);this._processQueue(),this._zoom<s&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,s)):this._zoom>s?(this._animationStart(),this._animationZoomOut(this._zoom,s)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(s){var o=this._maxLat;return o!==void 0&&(s.getNorth()>=o&&(s._northEast.lat=1/0),s.getSouth()<=-o&&(s._southWest.lat=-1/0)),s},_animationAddLayerNonAnimated:function(s,o){if(o===s)this._featureGroup.addLayer(s);else if(o._childCount===2){o._addToMap();var c=o.getAllChildMarkers();this._featureGroup.removeLayer(c[0]),this._featureGroup.removeLayer(c[1])}else o._updateIcon()},_extractNonGroupLayers:function(s,o){var c=s.getLayers(),d=0,m;for(o=o||[];d<c.length;d++){if(m=c[d],m instanceof L.LayerGroup){this._extractNonGroupLayers(m,o);continue}o.push(m)}return o},_overrideMarkerIcon:function(s){var o=s.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[s]}});return o}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(s,o){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),s),this._topClusterLevel._recursivelyAddChildrenToMap(null,o,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(s,o){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),s),this._topClusterLevel._recursivelyAddChildrenToMap(null,o,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(s,o){this._animationAddLayerNonAnimated(s,o)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(s,o){var c=this._getExpandedVisibleBounds(),d=this._featureGroup,m=Math.floor(this._map.getMinZoom()),f;this._ignoreMove=!0,this._topClusterLevel._recursively(c,s,m,function(p){var b=p._latlng,v=p._markers,C;for(c.contains(b)||(b=null),p._isSingleParent()&&s+1===o?(d.removeLayer(p),p._recursivelyAddChildrenToMap(null,o,c)):(p.clusterHide(),p._recursivelyAddChildrenToMap(b,o,c)),f=v.length-1;f>=0;f--)C=v[f],c.contains(C._latlng)||d.removeLayer(C)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(c,o),d.eachLayer(function(p){!(p instanceof L.MarkerCluster)&&p._icon&&p.clusterShow()}),this._topClusterLevel._recursively(c,s,o,function(p){p._recursivelyRestoreChildPositions(o)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(c,s,m,function(p){d.removeLayer(p),p.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(s,o){this._animationZoomOutSingle(this._topClusterLevel,s-1,o),this._topClusterLevel._recursivelyAddChildrenToMap(null,o,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),s,this._getExpandedVisibleBounds())},_animationAddLayer:function(s,o){var c=this,d=this._featureGroup;d.addLayer(s),o!==s&&(o._childCount>2?(o._updateIcon(),this._forceLayout(),this._animationStart(),s._setPos(this._map.latLngToLayerPoint(o.getLatLng())),s.clusterHide(),this._enqueue(function(){d.removeLayer(s),s.clusterShow(),c._animationEnd()})):(this._forceLayout(),c._animationStart(),c._animationZoomOutSingle(o,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(s,o,c){var d=this._getExpandedVisibleBounds(),m=Math.floor(this._map.getMinZoom());s._recursivelyAnimateChildrenInAndAddSelfToMap(d,m,o+1,c);var f=this;this._forceLayout(),s._recursivelyBecomeVisible(d,c),this._enqueue(function(){if(s._childCount===1){var p=s._markers[0];this._ignoreMove=!0,p.setLatLng(p.getLatLng()),this._ignoreMove=!1,p.clusterShow&&p.clusterShow()}else s._recursively(d,c,m,function(b){b._recursivelyRemoveChildrenFromMap(d,m,o+1)});f._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(s){return new L.MarkerClusterGroup(s)};
4345var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(s,o,c,d){L.Marker.prototype.initialize.call(this,c?c._cLatLng||c.getLatLng():new L.LatLng(0,0),{icon:this,pane:s.options.clusterPane}),this._group=s,this._zoom=o,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,c&&this._addChild(c),d&&this._addChild(d)},getAllChildMarkers:function(s,o){s=s||[];for(var c=this._childClusters.length-1;c>=0;c--)this._childClusters[c].getAllChildMarkers(s,o);for(var d=this._markers.length-1;d>=0;d--)o&&this._markers[d].__dragStart||s.push(this._markers[d]);return s},getChildCount:function(){return this._childCount},zoomToBounds:function(s){for(var o=this._childClusters.slice(),c=this._group._map,d=c.getBoundsZoom(this._bounds),m=this._zoom+1,f=c.getZoom(),p;o.length>0&&d>m;){m++;var b=[];for(p=0;p<o.length;p++)b=b.concat(o[p]._childClusters);o=b}d>m?this._group._map.setView(this._latlng,m):d<=f?this._group._map.setVie
4345w(this._latlng,f+1):this._group._map.fitBounds(this._bounds,s)},getBounds:function(){var s=new L.LatLngBounds;return s.extend(this._bounds),s},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(s,o){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(s),s instanceof L.MarkerCluster?(o||(this._childClusters.push(s),s.__parent=this),this._childCount+=s._childCount):(o||this._markers.push(s),this._childCount++),this.__parent&&this.__parent._addChild(s,!0)},_setClusterCenter:function(s){this._cLatLng||(this._cLatLng=s._cLatLng||s._latlng)},_resetBounds:function(){var s=this._bounds;s._southWest&&(s._southWest.lat=1/0,s._southWest.lng=1/0),s._northEast&&(s._northEast.lat=-1/0,s._northEast.lng=-1/0)},_recalculateBounds:function(){var s=this._markers,o=this._childClusters,c=0,d=0,m=this._childCount,f,p,b,v;if(m!==0){for(this._resetBounds(),f=0;f<s.length;f++)b=s[f]._latlng,this._bounds.extend(b),c+=b.lat,d+=b.lng;for(f=0;f<o.length;f++)p=o[f],p._boundsNeedUpdate&&p._recalculateBounds(),this._bounds.extend(p._bounds),b=p._wLatLng,v=p._childCount,c+=b.lat*v,d+=b.lng*v;this._latlng=this._wLatLng=new L.LatLng(c/m,d/m),this._boundsNeedUpdate=!1}},_addToMap:function(s){s&&(this._backupLatlng=this._latlng,this.setLatLng(s)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(s,o,c){this._recursively(s,this._group._map.getMinZoom(),c-1,function(d){var m=d._markers,f,p;for(f=m.length-1;f>=0;f--)p=m[f],p._icon&&(p._setPos(o),p.clusterHide())},function(d){var m=d._childClusters,f,p;for(f=m.length-1;f>=0;f--)p=m[f],p._icon&&(p._setPos(o),p.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(s,o,c,d){this._recursively(s,d,o,function(m){m._recursivelyAnimateChildrenIn(s,m._group._map.latLngToLayerPoint(m.getLatLng()).round(),c),m._isSingleParent()&&c-1===d?(m.clusterShow(),m._recursivelyRemoveChildrenFromMap(s,o,c)):m.clusterHide(),m._addToMap()})},_recursivelyBecomeVisible:function(s,o){this._recursively(s,this._group._map.getMinZoom(),o,null,function(c){c.clusterShow()})},_recursivelyAddChildrenToMap:function(s,o,c){this._recursively(c,this._group._map.getMinZoom()-1,o,function(d){if(o!==d._zoom)for(var m=d._markers.length-1;m>=0;m--){var f=d._markers[m];c.contains(f._latlng)&&(s&&(f._backupLatlng=f.getLatLng(),f.setLatLng(s),f.clusterHide&&f.clusterHide()),d._group._featureGroup.addLayer(f))}},function(d){d._addToMap(s)})},_recursivelyRestoreChildPositions:function(s){for(var o=this._markers.length-1;o>=0;o--){var c=this._markers[o];c._backupLatlng&&(c.setLatLng(c._backupLatlng),delete c._backupLatlng)}if(s-1===this._zoom)for(var d=this._childClusters.length-1;d>=0;d--)this._childClusters[d]._restorePosition();else for(var m=this._childClusters.length-1;m>=0;m--)this._childClusters[m]._recursivelyRestoreChildPositions(s)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(s,o,c,d){var m,f;this._recursively(s,o-1,c-1,function(p){for(f=p._markers.length-1;f>=0;f--)m=p._markers[f],(!d||!d.contains(m._latlng))&&(p._group._featureGroup.removeLayer(m),m.clusterShow&&m.clusterShow())},function(p){for(f=p._childClusters.length-1;f>=0;f--)m=p._childClusters[f],(!d||!d.contains(m._latlng))&&(p._group._featureGroup.removeLayer(m),m.clusterShow&&m.clusterShow())})},_recursively:function(s,o,c,d,m){var f=this._childClusters,p=this._zoom,b,v;if(o<=p&&(d&&d(this),m&&p===c&&m(this)),p<o||p<c)for(b=f.length-1;b>=0;b--)v=f[b],v._boundsNeedUpdate&&v._recalculateBounds(),s.intersects(v._bounds)&&v._recursively(s,o,c,d,m)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var s=this.options.opacity;return this.setOpacity(0),this.options.opacity=s,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(s){this._cellSize=s,this._sqCellSize=s*s,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(s,o){var c=this._getCoord(o.x),d=this._getCoord(o.y),m=this._grid,f=m[d]=m[d]||{},p=f[c]=f[c]||[],b=L.Util.stamp(s);this._objectPoint[b]=o,p.push(s)},updateObject:function(s,o){this.removeObject(s),this.addObject(s,o)},removeObject:function(s,o){var c=this._getCoord(o.x),d=this._getCoord(o.y),m=this._grid,f=m[d]=m[d]||{},p=f[c]=f[c]||[],b,v;for(delete this._objectPoint[L.Util.stamp(s)],b=0,v=p.length;b<v;b++)if(p[b]===s)return p.splice(b,1),v===1&&delete f[c],!0},eachObject:function(s,o){var c,d,m,f,p,b,v,C=this._grid;for(c in C){p=C[c];for(d in p)for(b=p[d],m=0,f=b.length;m<f;m++)v=s.call(o,b[m]),v&&(m--,f--)}},getNearObject:function(s){var o=this._getCoord(s.x),c=this._getCoord(s.y),d,m,f,p,b,v,C,S,F=this._objectPoint,w=this._sqCellSize,A=null;for(d=c-1;d<=c+1;d++)if(p=this._grid[d],p){for(m=o-1;m<=o+1;m++)if(b=p[m],b)for(f=0,v=b.length;f<v;f++)C=b[f],S=this._sqDist(F[L.Util.stamp(C)],s),(S<w||S<=w&&A===null)&&(w=S,A=C)}return A},_getCoord:function(s){var o=Math.floor(s/this._cellSize);return isFinite(o)?o:s},_sqDist:function(s,o){var c=o.x-s.x,d=o.y-s.y;return c*c+d*d}},(function(){L.QuickHull={getDistant:function(s,o){var c=o[1].lat-o[0].lat,d=o[0].lng-o[1].lng;return d*(s.lat-o[0].lat)+c*(s.lng-o[0].lng)},findMostDistantPointFromBaseLine:function(s,o){var c=0,d=null,m=[],f,p,b;for(f=o.length-1;f>=0;f--){if(p=o[f],b=this.getDistant(p,s),b>0)m.push(p);else continue;b>c&&(c=b,d=p)}return{maxPoint:d,newPoints:m}},buildConvexHull:function(s,o){var c=[],d=this.findMostDistantPointFromBaseLine(s,o);return d.maxPoint?(c=c.concat(this.buildConvexHull([s[0],d.maxPoint],d.newPoints)),c=c.concat(this.buildConvexHull([d.maxPoint,s[1]],d.newPoints)),c):[s[0]]},getConvexHull:function(s){var o=!1,c=!1,d=!1,m=!1,f=null,p=null,b=null,v=null,C=null,S=null,F;for(F=s.length-1;F>=0;F--){var w=s[F];(o===!1||w.lat>o)&&(f=w,o=w.lat),(c===!1||w.lat<c)&&(p=w,c=w.lat),(d===!1||w.lng>d)&&(b=w,d=w.lng),(m===!1||w.lng<m)&&(v=w,m=w.lng)}c!==o?(S=p,C=f):(S=v,C=b);var A=[].concat(this.buildConvexHull([S,C],s),this.buildConvexHull([C,S],s)
vendor: 4,458 bytes, line 4345
4345);return A}}})(),L.MarkerCluster.include({getConvexHull:function(){var s=this.getAllChildMarkers(),o=[],c,d;for(d=s.length-1;d>=0;d--)c=s[d].getLatLng(),o.push(c);return L.QuickHull.getConvexHull(o)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var s=this.getAllChildMarkers(null,!0),o=this._group,c=o._map,d=c.latLngToLayerPoint(this._latlng),m;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?m=this._group.options.spiderfyShapePositions(s.length,d):s.length>=this._circleSpiralSwitchover?m=this._generatePointsSpiral(s.length,d):(d.y+=10,m=this._generatePointsCircle(s.length,d)),this._animationSpiderfy(s,m)}},unspiderfy:function(s){this._group._inZoomAnimation||(this._animationUnspiderfy(s),this._group._spiderfied=null)},_generatePointsCircle:function(s,o){var c=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+s),d=c/this._2PI,m=this._2PI/s,f=[],p,b;for(d=Math.max(d,35),f.length=s,p=0;p<s;p++)b=this._circleStartAngle+p*m,f[p]=new L.Point(o.x+d*Math.cos(b),o.y+d*Math.sin(b))._round();return f},_generatePointsSpiral:function(s,o){var c=this._group.options.spiderfyDistanceMultiplier,d=c*this._spiralLengthStart,m=c*this._spiralFootSeparation,f=c*this._spiralLengthFactor*this._2PI,p=0,b=[],v;for(b.length=s,v=s;v>=0;v--)v<s&&(b[v]=new L.Point(o.x+d*Math.cos(p),o.y+d*Math.sin(p))._round()),p+=m/d+v*5e-4,d+=f/p;return b},_noanimationUnspiderfy:function(){var s=this._group,o=s._map,c=s._featureGroup,d=this.getAllChildMarkers(null,!0),m,f;for(s._ignoreMove=!0,this.setOpacity(1),f=d.length-1;f>=0;f--)m=d[f],c.removeLayer(m),m._preSpiderfyLatlng&&(m.setLatLng(m._preSpiderfyLatlng),delete m._preSpiderfyLatlng),m.setZIndexOffset&&m.setZIndexOffset(0),m._spiderLeg&&(o.removeLayer(m._spiderLeg),delete m._spiderLeg);s.fire("unspiderfied",{cluster:this,markers:d}),s._ignoreMove=!1,s._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(s,o){var c=this._group,d=c._map,m=c._featureGroup,f=this._group.options.spiderLegPolylineOptions,p,b,v,C;for(c._ignoreMove=!0,p=0;p<s.length;p++)C=d.layerPointToLatLng(o[p]),b=s[p],v=new L.Polyline([this._latlng,C],f),d.addLayer(v),b._spiderLeg=v,b._preSpiderfyLatlng=b._latlng,b.setLatLng(C),b.setZIndexOffset&&b.setZIndexOffset(1e6),m.addLayer(b);this.setOpacity(.3),c._ignoreMove=!1,c.fire("spiderfied",{cluster:this,markers:s})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(s,o){var c=this,d=this._group,m=d._map,f=d._featureGroup,p=this._latlng,b=m.latLngToLayerPoint(p),v=L.Path.SVG,C=L.extend({},this._group.options.spiderLegPolylineOptions),S=C.opacity,F,w,A,N,P,z;for(S===void 0&&(S=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),v?(C.opacity=0,C.className=(C.className||"")+" leaflet-cluster-spider-leg"):C.opacity=S,d._ignoreMove=!0,F=0;F<s.length;F++)w=s[F],z=m.layerPointToLatLng(o[F]),A=new L.Polyline([p,z],C),m.addLayer(A),w._spiderLeg=A,v&&(N=A._path,P=N.getTotalLength()+.1,N.style.strokeDasharray=P,N.style.strokeDashoffset=P),w.setZIndexOffset&&w.setZIndexOffset(1e6),w.clusterHide&&w.clusterHide(),f.addLayer(w),w._setPos&&w._setPos(b);for(d._forceLayout(),d._animationStart(),F=s.length-1;F>=0;F--)z=m.layerPointToLatLng(o[F]),w=s[F],w._preSpiderfyLatlng=w._latlng,w.setLatLng(z),w.clusterShow&&w.clusterShow(),v&&(A=w._spiderLeg,N=A._path,N.style.strokeDashoffset=0,A.setStyle({opacity:S}));this.setOpacity(.3),d._ignoreMove=!1,setTimeout(function(){d._animationEnd(),d.fire("spiderfied",{cluster:c,markers:s})},200)},_animationUnspiderfy:function(s){var o=this,c=this._group,d=c._map,m=c._featureGroup,f=s?d._latLngToNewLayerPoint(this._latlng,s.zoom,s.center):d.latLngToLayerPoint(this._latlng),p=this.getAllChildMarkers(null,!0),b=L.Path.SVG,v,C,S,F,w,A;for(c._ignoreMove=!0,c._animationStart(),this.setOpacity(1),C=p.length-1;C>=0;C--)v=p[C],v._preSpiderfyLatlng&&(v.closePopup(),v.setLatLng(v._preSpiderfyLatlng),delete v._preSpiderfyLatlng,A=!0,v._setPos&&(v._setPos(f),A=!1),v.clusterHide&&(v.clusterHide(),A=!1),A&&m.removeLayer(v),b&&(S=v._spiderLeg,F=S._path,w=F.getTotalLength()+.1,F.style.strokeDashoffset=w,S.setStyle({opacity:0}
vendor: 4,442 bytes, line 4345
4345)));c._ignoreMove=!1,setTimeout(function(){var N=0;for(C=p.length-1;C>=0;C--)v=p[C],v._spiderLeg&&N++;for(C=p.length-1;C>=0;C--)v=p[C],v._spiderLeg&&(v.clusterShow&&v.clusterShow(),v.setZIndexOffset&&v.setZIndexOffset(0),N>1&&m.removeLayer(v),d.removeLayer(v._spiderLeg),delete v._spiderLeg);c._animationEnd(),c.fire("unspiderfied",{cluster:o,markers:p})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(s){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(s))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(s){this._spiderfied&&this._spiderfied.unspiderfy(s)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(s){s._spiderLeg&&(this._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow(),s.setZIndexOffset&&s.setZIndexOffset(0),this._map.removeLayer(s._spiderLeg),delete s._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(s){return s?s instanceof L.MarkerClusterGroup?s=s._topClusterLevel.getAllChildMarkers():s instanceof L.LayerGroup?s=s._layers:s instanceof L.MarkerCluster?s=s.getAllChildMarkers():s instanceof L.Marker&&(s=[s]):s=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(s),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(s),this},_flagParentsIconsNeedUpdate:function(s){var o,c;for(o in s)for(c=s[o].__parent;c;)c._iconNeedsUpdate=!0,c=c.__parent},_refreshSingleMarkerModeMarkers:function(s){var o,c;for(o in s)c=s[o],this.hasLayer(c)&&c.setIcon(this._overrideMarkerIcon(c))}}),L.Marker.include({refreshIconOptions:function(s,o){var c=this.options.icon;return L.setOptions(c,s),this.setIcon(c),o&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),n.MarkerClusterGroup=a,n.MarkerCluster=i,Object.defineProperty(n,"__esModule",{value:!0})})})(ym,ym.exports)),ym.exports}const Cq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sX
4345FYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",_q=Object.freeze(Object.defineProperty({__proto__:null,default:Cq},Symbol.toStringTag,{value:"Module"})),Eq=Yg(_q),kq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",Aq=Object.freeze(Object.defineProperty({__proto__:null,default:kq},Symbol.toStringTag,{value:"Module"})),Nq=Yg(Aq),Tq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxIm
4345NQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",Mq=Object.freeze(Object.defineProperty({__proto__:null,default:Tq},Symbol.toStringTag,{value:"Module"})),Rq=Yg(Mq);var U_;function Dq(){if(U_)return co;U_=1;var t=co&&co.__assign||function(){return t=Object.assign||function(m){for(var f,p=1,b=arguments.length;p<b;p++){f=arguments[p];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(m[v]=f[v])}return m},t.apply(this,arguments)},e=co&&co.__rest||function(m,f){var p={};for(var b in m)Object.prototype.hasOwnProperty.call(m,b)&&f.indexOf(b)<0&&(p[b]=m[b]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,b=Object.getOwnPropertySymbols(m);v<b.length;v++)f.indexOf(b[v])<0&&Object.prototype.propertyIsEnumerable.call(m,b[v])&&(p[b[v]]=m[b[v]]);return p},n=co&&co.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(co,"__esModule",{value:!0});var a=wq,i=n(XM());Fq(),delete i.default.Icon.Default.prototype._getIconUrl,i.default.Icon.Default.mergeOptions({iconRetinaUrl:Eq.default,iconUrl:Nq.default,shadowUrl:Rq.default});function s(m){var f={},p={};m.children;var b=e(m,["children"]);return Object.entries(b).forEach(function(v){var C,S,F=v[0],w=v[1];F.startsWith("on")?p=t(t({},p),(C={},C[F]=w,C)):f=t(t({},f),(S={},S[F]=w,S))}),{clusterProps:f,clusterEvents:p}}function o(m,f){var p=s(m),b=p.clusterProps,v=p.clusterEvents,C=new i.default.MarkerClusterGroup(b);return Object.entries(v).forEach(function(S){var F=S[0],w=S[1],A="cluster".concat(F.substring(2).toLowerCase());C.on(A,w)}),(0,a.createElementObject)(C,(0,a.extendContext)(f,{layerContainer:C}))}var c=function(m,f,p){},d=(0,a.createPathComponent)(o,c);return co.default=d,co}var Pq=Dq();const jq=Kg(Pq),l4={"united states":[39.8,-98.5],canada:[56.1,-106.3],"united kingdom":[54,-2],australia:[-25.3,133.8],india:[20.6,78.9],germany:[51.2,10.4],france:[46.6,2.2],italy:[41.9,12.5],spain:[40.5,-3.7],netherlands:[52.1,5.3],portugal:[39.4,-8.2],finland:[61.9,25.7],"united arab emirates":[23.4,53.8],israel:[31,34.9],nigeria:[9.1,8.7],egypt:[26.8,30.8],thailand:[15.9,100.9],denmark:[56.3,9.5],"czech republic":[49.8,15.5],colombia:[4.6,-74.3],sweden:[60.1,18.6],malaysia:[4.2,101.9],greece:[39.1,21.8],romania:[45.9,24.9],malta:[35.9,14.4],brazil:[-14.2,-51.9],mexico:[23.6,-102.5],argentina:[-38.4,-63.6],japan:[36.2,138.3],singapore:[1.4,103.8],austria:[47.5,14.6],"hong kong":[22.3,114.2],norway:[60.5,8.5],"new zealand":[-40.9,174.9],turkey:[39.9,32.9],china:[35.9,104.2],"south korea":[35.9,127.8],ireland:[53.1,-8],switzerland:[46.8,8.2],belgium:[50.5,4.5],poland:[51.9,19.1],"south africa":[-30.6,22.9],philippines:[12.9,121.8],indonesia:[-.8,113.9],pakistan:[30.4,69.3],bangladesh:[23.7,90.4],vietnam:[14.1,108.3],kenya:[-0,37.9],morocco:[31.8,-7.1],peru:[-9.2,-75],chile:[-35.7,-71.5],ukraine:[48.4,31.2],hungary:[47.2,19.5],croatia:[45.1,15.2],serbia:[44,21],bulgaria:[42.7,25.5],slovakia:[48.7,19.7],latvia:[56.9,24.1],lithuania:[55.2,23.9],estonia:[58.6,25],iceland:[64.1,-18],luxembourg:[49.8,6.1],"costa rica":[9.7,-83.8],panama:[8.5,-80.8],taiwan:[23.7,121]},vy={AL:[32.3,-86.9],alabama:[32.3,-86.9],AK:[64.2,-152.5],alaska:[64.2,-152.5],AZ:[34,-111.1],arizona:[34,-111.1],AR:[35.2,-91.8],arkansas:[35.2,-91.8],CA:[36.8,-119.4],california:[36.8,-119.4],CO:[39.1,-105.4],colorado:[39.1,-105.4],CT:[41.6,-72.7],connecticut:[41.6,-72.7],DE:[38.9,-75.5],delaware:[38.9,-75.5],FL:[27.6,-81.5],florida:[27.6,-81.5],GA:[32.2,-83.6],georgia:[32.2,-83.6],HI:[19.9,-155.6],hawaii:[19.9,-155.6],ID:[44.1,-114.7],idaho:[44.1,-114.7],IL:[40.3,-89],illinois:[40.3,-89],IN:[40.3,-86.1],indiana:[40.3,-86.1],IA:[41.9,-93.1],iowa:[41.9,-93.1],KS:[39,-98.5],kansas:[39,-98.5],KY:[37.8,-84.3],kentucky:[37.8,-84.3],LA:[30.5,-91.2],louisiana:[30.5,-91.2],ME:[45.3,-69.4],maine:[45.3,-69.4],MD:[39,-76.6],maryland:[39,-76.6],MA:[42.4,-71.4],massachusetts:[42.4,-71.4],MI:[44.3,-85.6],michigan:[44.3,-85.6],MN:[46.7,-94.7],minnesota:[46.7,-94.7],MS:[32.3,-89.4],mississippi:[32.3,-89.4],MO:[37.9,-91.8],missouri:[37.9,-91.8],MT:[46.9,-110.4],montana:[46.9,-110.4],NE:[41.1,-98.3],nebraska:[41.1,-98.3],NV:[38.8,-116.4],nevada:[38.8,-116.4],NH:[43.2,-71.6],"new hampshire":[43.2,-71.6],NJ:[40.1,-74.5],"new jersey":[40.1,-74.5],NM:[34.5,-105.9],"new mexico":[34.5,-105.9],NY:[43,-75],"new york":[43,-75],NC:[35.8,-79],"north carolina":[35.8,-79],ND:[47.5,-100.5],"north dakota":[47.5,-100.5],OH:[40.4,-82.9],ohio:[40.4,-82.9],OK:[35,-97.1],okla
4345homa:[35,-97.1],OR:[43.8,-120.6],oregon:[43.8,-120.6],PA:[41.2,-77.2],pennsylvania:[41.2,-77.2],RI:[41.6,-71.5],"rhode island":[41.6,-71.5],SC:[33.8,-81.2],"south carolina":[33.8,-81.2],SD:[43.9,-99.9],"south dakota":[43.9,-99.9],TN:[35.5,-86.6],tennessee:[35.5,-86.6],TX:[31.1,-97.6],texas:[31.1,-97.6],UT:[39.3,-111.1],utah:[39.3,-111.1],VT:[44.6,-72.6],vermont:[44.6,-72.6],VA:[37.4,-78.7],virginia:[37.4,-78.7],WA:[47.8,-120.7],washington:[47.8,-120.7],WV:[38.6,-80.6],"west virginia":[38.6,-80.6],WI:[43.8,-88.8],wisconsin:[43.8,-88.8],WY:[43.1,-107.6],wyoming:[43.1,-107.6],DC:[38.9,-77],"district of columbia":[38.9,-77],PR:[18.2,-66.6],"puerto rico":[18.2,-66.6]},Lq={AB:[53.9,-116.6],alberta:[53.9,-116.6],BC:[53.7,-127.6],"british columbia":[53.7,-127.6],MB:[53.8,-98.8],manitoba:[53.8,-98.8],NB:[46.5,-66.2],"new brunswick":[46.5,-66.2],NL:[53.1,-57.7],"newfoundland and labrador":[53.1,-57.7],newfoundland:[53.1,-57.7],NS:[44.7,-63],"nova scotia":[44.7,-63],NT:[64.3,-119.3],"northwest territories":[64.3,-119.3],NU:[70.3,-86],nunavut:[70.3,-86],ON:[51.3,-85.3],ontario:[51.3,-85.3],PE:[46.5,-63.4],"prince edward island":[46.5,-63.4],QC:[52.9,-73.5],quebec:[52.9,-73.5],québec:[52.9,-73.5],SK:[52.9,-106.5],saskatchewan:[52.9,-106.5],YT:[64.3,-135],yukon:[64.3,-135]},Ad={"los angeles, ca":[34.05,-118.24],"los angeles, california":[34.05,-118.24],"san francisco, ca":[37.77,-122.42],"san francisco, california":[37.77,-122.42],"san diego, ca":[32.72,-117.16],"san diego, california":[32.72,-117.16],"san jose, 
4345ca":[37.34,-121.89],"san jose, california":[37.34,-121.89],"sacramento, ca":[38.58,-121.49],"sacramento, california":[38.58,-121.49],"oakland, ca":[37.8,-122.27],"oakland, california":[37.8,-122.27],"irvine, ca":[33.68,-117.83],"irvine, california":[33.68,-117.83],"santa monica, ca":[34.02,-118.49],"santa monica, california":[34.02,-118.49],"pasadena, ca":[34.15,-118.14],"pasadena, california":[34.15,-118.14],"berkeley, ca":[37.87,-122.27],"berkeley, california":[37.87,-122.27],"palo alto, ca":[37.44,-122.14],"palo alto, california":[37.44,-122.14],"long beach, ca":[33.77,-118.19],"long beach, california":[33.77,-118.19],"fresno, ca":[36.74,-119.77],"fresno, california":[36.74,-119.77],"santa barbara, ca":[34.42,-119.7],"santa barbara, california":[34.42,-119.7],"anaheim, ca":[33.84,-117.91],"anaheim, california":[33.84,-117.91],"burbank, ca":[34.18,-118.31],"burbank, california":[34.18,-118.31],"redwood city, ca":[37.49,-122.24],"redwood city, california":[37.49,-122.24],"menlo park, ca":[37.45,-122.18],"menlo park, california":[37.45,-122.18],"mountain view, ca":[37.39,-122.08],"mountain view, california":[37.39,-122.08],"sunnyvale, ca":[37.37,-122.04],"sunnyvale, california":[37.37,-122.04],"santa clara, ca":[37.35,-121.95],"santa clara, california":[37.35,-121.95],"cupertino, ca":[37.32,-122.03],"cupertino, california":[37.32,-122.03],"new york, ny":[40.71,-74.01],"new york, new york":[40.71,-74.01],"new york city, ny":[40.71,-74.01],"brooklyn, ny":[40.68,-73.94],"manhattan, ny":[40.78,-73.97],"queens, ny":[40.73,-73.79],"bronx, ny":[40.84,-73.87],"staten island, ny":[40.58,-74.15],"buffalo, ny":[42.89,-78.88],"rochester, ny":[43.16,-77.61],"albany, ny":[42.65,-73.76],"syracuse, ny":[43.05,-76.15],"houston, tx":[29.76,-95.37],"houston, texas":[29.76,-95.37],"dallas, tx":[32.78,-96.8],"dallas, texas":[32.78,-96.8],"austin, tx":[30.27,-97.74],"austin, texas":[30.27,-97.74],"san antonio, tx":[29.42,-98.49],"san antonio, texas":[29.42,-98.49],"fort worth, tx":[32.76,-97.33],"fort worth, texas":[32.76,-97.33],"el paso, tx":[31.76,-106.44],"el paso, texas":[31.76,-106.44],"plano, tx":[33.02,-96.7],"plano, texas":[33.02,-96.7],"miami, fl":[25.76,-80.19],"miami, florida":[25.76,-80.19],"orlando, fl":[28.54,-81.38],"orlando, florida":[28.54,-81.38],"tampa, fl":[27.95,-82.46],"tampa, florida":[27.95,-82.46],"jacksonville, fl":[30.33,-81.66],"jacksonville, florida":[30.33,-81.66],"st. petersburg, fl":[27.77,-82.64],"fort lauderdale, fl":[26.12,-80.14],"chicago, il":[41.88,-87.63],"chicago, illinois":[41.88,-87.63],"evanston, il":[42.05,-87.69],"naperville, il":[41.79,-88.15],"philadelphia, pa":[39.95,-75.17],"philadelphia, pennsylvania":[39.95,-75.17],"pittsburgh, pa":[40.44,-80],"pittsburgh, pennsylvania":[40.44,-80],"seattle, wa":[47.61,-122.33],"seattle, washington":[47.61,-122.33],"tacoma, wa":[47.25,-122.44],"bellevue, wa":[47.61,-122.2],"redmond, wa":[47.67,-122.12],"kirkland, wa":[47.68,-122.21],"boston, ma":[42.36,-71.06],"boston, massachusetts":[42.36,-71.06],"cambridge, ma":[42.37,-71.11],"cambridge, massachusetts":[42.37,-71.11],"somerville, ma":[42.39,-71.1],"denver, co":[39.74,-104.99],"denver, colorado":[39.74,-104.99],"boulder, co":[40.01,-105.27],"boulder, colorado":[40.01,-105.27],"colorado springs, co":[38.83,-104.82],"portland, or":[45.52,-122.68],"portland, oregon":[45.52,-122.68],"atlanta, ga":[33.75,-84.39],"atlanta, georgia":[33.75,-84.39],"detroit, mi":[42.33,-83.05],"detroit, michigan":[42.33,-83.05],"ann arbor, mi":[42.28,-83.74],"grand rapids, mi":[42.96,-85.66],"phoenix, az":[33.45,-112.07],"phoenix, arizona":[33.45,-112.07],"scottsdale, az":[33.49,-111.93],"tucson, az":[32.22,-110.93],"minneapolis, mn":[44.98,-93.27],"minneapolis, minnesota":[44.98,-93.27],"st. paul, mn":[44.95,-93.09],"charlotte, nc":[35.23,-80.84],"raleigh, nc":[35.78,-78.64],"durham, nc":[35.99,-78.9],"chapel hill, nc":[35.91,-79.05],"richmond, va":[37.54,-77.44],"arlington, va":[38.88,-77.1],"alexandria, va":[38.8,-77.05],"baltimore, md":[39.29,-76.61],"bethesda, md":[38.98,-77.09],"washington, dc":[38.91,-77.04],"columbus, oh":[39.96,-83],"cleveland, oh":[41.5,-81.69],"cincinnati, oh":[39.1,-84.51],"las vegas, nv":[36.17,-115.14],"reno, nv":[39.53,-119.81],"nashville, tn":[36.16,-86.78],"memphis, tn":[35.15,-90.05],"st. louis, mo":[38.63,-90.2],"kansas city, mo":[39.1,-94.58],"indianapolis, in":[39.77,-86.16],"milwaukee, wi":[43.04,-87.91],"madison, wi":[43.07,-89.4],"new haven, ct":[41.31,-72.92],"hartford, ct":[41.76,-72.69],"stamford, ct":[41.05,-73.54],"newark, nj":[40.74,-74.17],"jersey city, nj":[40.73,-74.04],"princeton, nj":[40.35,-74.66],"hoboken, nj":[40.74,-74.03],"s
4345alt lake city, ut":[40.76,-111.89],"salt lake city, utah":[40.76,-111.89],"provo, ut":[40.23,-111.66],"new orleans, la":[29.95,-90.07],"honolulu, hi":[21.31,-157.86],"des moines, ia":[41.59,-93.62],"portland, me":[43.66,-70.26],"charleston, sc":[32.78,-79.93],"savannah, ga":[32.08,-81.09],"albuquerque, nm":[35.08,-106.65],"boise, id":[43.62,-116.21],"toronto, on":[43.65,-79.38],"toronto, ontario":[43.65,-79.38],"ottawa, on":[45.42,-75.7],"ottawa, ontario":[45.42,-75.7],"mississauga, on":[43.59,-79.64],"mississauga, ontario":[43.59,-79.64],"hamilton, on":[43.26,-79.87],"hamilton, ontario":[43.26,-79.87],"london, on":[42.98,-81.25],"london, ontario":[42.98,-81.25],"kitchener, on":[43.45,-80.48],"kitchener, ontario":[43.45,-80.48],"waterloo, on":[43.46,-80.52],"waterloo, ontario":[43.46,-80.52],"windsor, on":[42.32,-83.04],"windsor, ontario":[42.32,-83.04],"montreal, qc":[45.5,-73.57],"montreal, quebec":[45.5,-73.57],"montréal, qc":[45.5,-73.57],"montréal, quebec":[45.5,-73.57],"quebec city, qc":[46.81,-71.21],"quebec city, quebec":[46.81,-71.21],"laval, qc":[45.57,-73.69],"gatineau, qc":[45.48,-75.7],"vancouver, bc":[49.28,-123.12],"vancouver, british columbia":[49.28,-123.12],"victoria, bc":[48.43,-123.37],"victoria, british columbia":[48.43,-123.37],"burnaby, bc":[49.25,-122.95],"surrey, bc":[49.19,-122.85],"kelowna, bc":[49.89,-119.5],"calgary, ab":[51.04,-114.07],"calgary, alberta":[51.04,-114.07],"edmonton, ab":[53.55,-113.49],"edmonton, alberta":[53.55,-113.49],"winnipeg, mb":[49.9,-97.14],"winnipeg, manitoba":[49.9,-97.14],"saskatoon, sk":[52.13,-106.67],"regina, sk":[50.45,-104.62],"halifax, ns":[44.65,-63.57],"halifax, nova scotia":[44.65,-63.57],"fredericton, nb":[45.96,-66.64],"saint john, nb":[45.27,-66.06],"moncton, nb":[46.09,-64.77]},Iq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgO
4345LSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",Bq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",Oq="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxIm
4345NQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete ZM.Icon.Default.prototype._getIconUrl;ZM.Icon.Default.mergeOptions({iconRetinaUrl:Iq,iconUrl:Bq,shadowUrl:Oq});function Uq(t){return l4[t.toLowerCase()]||null}function zq(t,e,n){if(t&&e){const a=`${t.toLowerCase().trim()}, ${e.toLowerCase().trim()}`;if(Ad[a])return Ad[a];const i=`${t.toLowerCase().trim()}, ${e.toUpperCase().trim()}`;if(Ad[i.toLowerCase()])return Ad[i.toLowerCase()]}if(e){const a=e.trim();if(n[a.toUpperCase()])return n[a.toUpperCase()];if(n[a.toLowerCase()])return n[a.toLowerCase()]}return null}function Gq({open:t,onOpenChange:e,members:n,normalizeCountry:a}){const i=x.useMemo(()=>{const c=[];let d=0;for(const S of n){const F=S.preferredName||`${S.firstName||""} ${S.lastName||""}`.trim()||"Unknown",w=(S.country||"").trim(),A=a(w);if(!A){d++;continue}const N=A.toLowerCase(),P=N==="united states",z=N==="canada";let D=null,T=A;if(P||z){const K=P?vy:Lq,B=P?"US":"Canada";D=zq(S.city,S.stateProvince,K),D?T=[S.city,S.stateProvince].filter(Boolean).join(", ")+", "+B:(D=l4[N],T=`${A} (no city/province)`)}else if(D=Uq(A),!D){d++;continue}if(D){const K=()=>(Math.random()-.5)*.3;c.push({lat:D[0]+K(),lng:D[1]+K(),name:F,location:T})}}const m=n.filter(S=>a((S.country||"").trim())?.toLowerCase()==="united states"),f=m.filter(S=>(S.stateProvince||"").trim()),p=m.filter(S=>(S.city||"").trim()),b=m.filter(S=>{const F=(S.city||"").trim(),w=(S.stateProvince||"").trim();if(!F||!w)return!1;const A=`${F.toLowerCase()}, ${w.toLowerCase()}`,N=`${F.toLowerCase()}, ${w.toUpperCase().toLowerCase()}`;return!!(Ad[A]||Ad[N])});console.log(`[MemberMap] US members: ${m.length}, with state: ${f.length}, with city: ${p.length}, city matched: ${b.length}`),console.log(`[MemberMap] ${d} members could not be geocoded, ${c.length} mapped`);const v=m.filter(S=>!(S.stateProvince||"").trim()).slice(0,5);v.length&&console.log("[MemberMap] Sample US members without state:",v.map(S=>({name:S.preferredName||`${S.firstName} ${S.lastName}`,city:S.city,state:S.stateProvince,country:S.country})));const C=m.filter(S=>{const F=(S.stateProvince||"").trim();if(!F)return!1;const w=F.trim();return!(vy[w.toUpperCase()]||vy[w.toLowerCase()])}).slice(0,5);return C.length&&console.log("[MemberMap] US members with unrecognized state:",C.map(S=>({name:S.preferredName||`${S.firstName} ${S.lastName}`,city:S.city,state:S.stateProvince,country:S.country}))),c},[n,a]),s=i.length,o=n.length;return r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"max-w-5xl h-[80vh] flex flex-col p-0",children:[r.jsxs(ha,{className:"px-6 pt-6 pb-2",children:[r.jsx(ma,{children:"Member Map"}),r.jsxs(Fa,{children:[s," of ",o," members mapped (",o-s," without location data)"]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:t&&r.jsxs(xq,{center:[30,0],zoom:2,style:{height:"100%",width:"100%"},scrollWheelZoom:!0,children:[r.jsx(bq,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),r.jsx(jq,{chunkedLoading:!0,maxClusterRadius:40,children:i.map((c,d)=>r.jsx(vq,{position:[c.lat,c.lng],children:r.jsxs(yq,{children:[r.jsx("strong",{children:c.name}),r.jsx("br",{}),c.location]})},d))})]})})]})})}function Hq({open:t,onOpenChange:e,members:n,onMemberUpdate:a}){const{toast:i}=nr(),s=Po(),[o,c]=x.useState({}),[d,m]=x.useState(null),[f,p]=x.useState(!1),[b,v]=x.useState(null);x.useEffect(()=>{t&&!d&&!f&&C()},[t]);const C=async()=>{p(!0),v(null);
4345try{const I=await s("/api/admin/fetchBounces");if(!I.ok){const U=await I.json();throw new Error(U.message||"Failed to fetch inbox bounces")}const j=await I.json();m({memberBounces:j.memberBounces||[],unknownBounces:j.unknownBounces||[]})}catch(I){const j=I instanceof Error?I.message:"Failed to fetch inbox bounces";v(j),console.error("Error fetching inbox bounces:",I)}finally{p(!1)}},S=x.useMemo(()=>n.filter(I=>I.bounces&&Object.keys(I.bounces).length>0).map(I=>{const j=Object.entries(I.bounces||{}),U=j.reduce((W,[,H])=>W+H,0),q=[];if(I.secondaryEmails)for(const W of I.secondaryEmails)q.push({email:W,type:"secondary"});if(I.guildEmail){const W=I.guildEmail.includes("@")?I.guildEmail:`${I.guildEmail}@xrguild.org`;q.push({email:W,type:"guild",status:I.requestedEmail?.status})}const Y=d?.memberBounces.find(W=>W.memberKey===I.memberKey);return{...I,bounceEntries:j,totalBounces:U,alternateEmails:q,inboxBounce:Y}}).sort((I,j)=>j.totalBounces-I.totalBounces),[n,d]),F=x.useMemo(()=>{if(!d)return[];const I=new Set(S.map(j=>j.memberKey));return d.memberBounces.filter(j=>j.memberKey&&!I.has(j.memberKey)).map(j=>{const U=n.find(q=>q.memberKey===j.memberKey);return{...j,member:U}})},[d,S,n]),w=I=>I.preferredName||[I.firstName,I.lastName].filter(Boolean).join(" ")||I.email,A=async(I,j)=>{c(U=>({...U,[I.memberKey]:"swap"}));try{const U=await s("/api/admin/rotateEmail",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:I.memberKey,newPrimaryEmail:j})});if(!U.ok){const Y=await U.json();throw new Error(Y.message||"Failed to swap email")}const q=await U.json();a?.(I.memberKey,{email:q.newPrimaryEmail,secondaryEmails:q.newSecondaryEmails}),i({title:"Email Swapped",description:`Primary email changed to ${q.newPrimaryEmail}`})}catch(U){const q=U instanceof Error?U.message:"Failed to swap email";i({variant:"destructive",title:"Error",description:q})}finally{c(U=>({...U,[I.memberKey]:null}))}},N=async I=>{c(j=>({...j,[I.memberKey]:"test"}));try{const j=await s("/api/admin/sendBounceTest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:I.memberKey})});if(!j.ok){const q=await j.json();throw new Error(q.message||"Failed to send test email")}const U=await j.json();if(a?.(I.memberKey,{bounceTestResult:{status:U.immediateError?"error":"sent",timestamp:new Date().toISOString(),error:U.immediateError,testedEmail:U.testedEmail,ccEmails:U.testResult?.ccEmails}}),U.immediateError)i({variant:"destructive",title:"Send Failed",description:U.immediateError});else{const q=U.testResult?.ccEmails?.length||0;i({title:"Test Email Sent",description:`Sent to ${U.testedEmail}${q>0?` (CC: ${q} alternate${q>1?"s":""})`:""}`})}}catch(j){const U=j instanceof Error?j.message:"Failed to send test email";i({variant:"destructive",title:"Error",description:U})}finally{c(j=>({...j,[I.memberKey]:null}))}},P=async I=>{try{const j=Object.keys(I.bounces||{});for(const U of j)await s("/api/admin/resetBounce",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:I.memberKey,email:U})});a?.(I.memberKey,{bounces:{}}
4345),i({title:"Bounces Cleared",description:`Cleared all bounces for ${w(I)}`})}catch(j){const U=j instanceof Error?j.message:"Failed to clear bounces";i({variant:"destructive",title:"Error",description:U})}},z=async(I,j)=>{c(U=>({...U,[I.memberKey]:"status"}));try{const U=await s("/api/admin/setEmailStatus",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:I.memberKey,status:j})});if(!U.ok){const H=await U.json();throw new Error(H.message||"Failed to set email status")}const q=await U.json();a?.(I.memberKey,{emailStatus:j});const Y=j==="bounced"?"marked as bounced":"restored to valid",W=q.groupsRemoved?.length>0?` (removed from ${q.groupsRemoved.length} group${q.groupsRemoved.length>1?"s":""})`:"";i({title:j==="bounced"?"Email Marked Bounced":"Email Restored",description:`${w(I)} ${Y}${W}`})}catch(U){const q=U instanceof Error?U.message:"Failed to set email status";i({variant:"destructive",title:"Error",description:q})}finally{c(U=>({...U,[I.memberKey]:null}))}},D=I=>{if(!I)return null;const j=T(I.timestamp);switch(I.status){case"sent":return r.jsxs("span",{className:"text-green-600 text-xs flex items-center gap-1",children:[r.jsx(us,{className:"h-3 w-3"}),"Sent ",j,I.ccEmails&&I.ccEmails.length>0&&r.jsxs("span",{className:"text-muted-foreground",children:["(CC: ",I.ccEmails.length,")"]})]});case"error":return r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("span",{className:"text-red-600 text-xs flex items-center gap-1 cursor-help",children:[r.jsx(po,{className:"h-3 w-3"}),"Failed ",j]})}),r.jsx(Ir,{children:r.jsx("p",{className:"text-xs max-w-xs",children:I.error})})]})});case"bounce-confirmed":return r.jsxs("span",{className:"text-orange-600 text-xs flex items-center gap-1",children:[r.jsx(po,{className:"h-3 w-3"}),"Bounced ",j]});case"pending":return r.jsxs("span",{className:"text-muted-foreground text-xs flex items-center gap-1",children:[r.jsx(on,{className:"h-3 w-3 animate-spin"}),"Pending..."]});default:return null}},T=I=>{const j=Date.now()-new Date(I).getTime(),U=Math.floor(j/6e4),q=Math.floor(j/36e5),Y=Math.floor(j/864e5);return Y>0?`${Y}d ago`:q>0?`${q}h ago`:U>0?`${U}m ago`:"just now"},K=I=>{switch(I){case"mailbox-not-found":return"Mailbox not found";case"mailbox-full":return"Mailbox full";case"blocked":return"Blocked/Spam";case"temporary":return"Temporary failure";case"invalid-address":return"Invalid address";default:return"Unknown"}},B=S.length,k=F.length,O=d?.unknownBounces.length||0;return r.jsx(Sa,{open:t,onOpenChange:e,children:r.jsxs(da,{className:"max-w-4xl max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs(ha,{children:[r.jsxs(ma,{className:"flex items-center gap-2",children:["Bounce Management",r.jsx(Fe,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:C,disabled:f,children:r.jsx(Rr,{className:`h-4 w-4 ${f?"animate-spin":""}`})})]}),r.jsxs(Fa,{children:[B," recorded bounce",B!==1?"s":"",k>0&&`, ${k} from inbox`,O>0&&`, ${O} unknown`,". Click an alternate email to make it the primary."]})]}),r.jsxs("div",{className:"overflow-y-auto flex-1 -mx-6 px-6 space-y-6",children:[b&&r.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 text-sm text-red-700",children:[r.jsx(po,{className:"h-4 w-4 inline mr-2"}),b]}),S.length>0&&r.jsxs("section",{children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2 flex items-center gap-2",children:[r.jsx(Cr,{className:"h-4 w-4"}),"Recorded Bounces (",S.length,")"]}),r.jsx("div",{className:"space-y-2",children:S.map(I=>{const j=o[I.memberKey];return r.jsxs("div",{className:"border rounded-lg p-3 flex items-center gap-4",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"font-medium truncate flex items-center gap-2",children:[w(I),I.emailStatus==="bounced"&&r.jsx("span",{className:"text-xs bg-red-100 text-red-700 px-1.5 py-0.5 rounded",children:"BOUNCED"})]}),r.jsx("div",{className:"text-sm text-muted-foreground truncate",children:I.email}),r.jsx("div",{className:"mt-1 space-y-0.5",children:I.bounceEntries.map(([U,q])=>r.jsxs("div",{className:"text-xs text-red-600",children:[U,": ",q," bounce",q!==1?"s":"",U!==I.email&&r.jsx("span",{className:"text-muted-foreground ml-1",children:"(old email)"})]},U))}),I.inboxBounce&&r.jsxs("div",{className:"mt-1 text-xs text-orange-600 flex items-center gap-1",children:[r.jsx(xF,{className:"h-3 w-3"}),"Inbox: ",K(I.inboxBounce.reason)," (",T(I.inboxBounce.date),")"]}),I.alternateEmails.length>0&&r.jsx("div",{className:"mt-1 space-y-0.5",children:I.alternateEmails.map(U=>r.jsx("div",{className:"text-xs",children:U.type==="secondary"?r.jsx("button",{className:"text-green-600 hover:text-green-800 hover:underline cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>A(I,U.email),disabled:j==="swap",children:j==="swap"?r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(on,{className:"h-3 w-3 animate-spin"}),U.email]}):r.jsxs(r.Fragment,{children:["↔ ",U.email]})}):r.jsxs("span",{className:"text-blue-600",children:[U.email,U.status&&U.status!=="verified"&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(",U.status,")"]}),r.jsx("span",{className:"text-muted-foreground ml-1",children:"(guild)"})]})},U.email))}),I.bounceTestResult&&r.jsx("div",{className:"mt-1",children:D(I.bounceTestResult)})]}),r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-2xl font-bold text-red-600",children:I.totalBounces}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"bounces"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[I.linkedIn&&r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx(Fe,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>{const U=I.linkedIn?.startsWith("http")?I.linkedIn:`https://linkedin.com/in/${I.linkedIn}`;window.open(U,"_blank")},children:r.jsx(C1,{className:"h-4 w-4 text-blue-600"})})}),r.jsx(Ir,{children:"View LinkedIn profile"})]})}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx(Fe,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:j==="test",onClick:()=>N(I),children:j==="test"?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsx(tx,{className:"h-4 w-4"})})}),r.jsxs(Ir,{children:["Send test to ",I.email,I.alternateEmails.length>0&&r.jsxs(r.Fragment,{children:[" (CC: ",I.alternateEmails.length," alternate",I.alternateEmails.length>
43451?"s":"",")"]})]})]})}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsx(Fe,{variant:"outline",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-red-600",onClick:()=>P(I),children:r.jsx(gr,{className:"h-4 w-4"})})}),r.jsx(Ir,{children:"Clear all bounces"})]})}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:I.emailStatus==="bounced"?r.jsx(Fe,{variant:"outline",size:"icon",className:"h-8 w-8 text-green-600 hover:text-green-800",disabled:j==="status",onClick:()=>z(I,"valid"),children:j==="status"?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsx(AP,{className:"h-4 w-4"})}):r.jsx(Fe,{variant:"outline",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-red-600",disabled:j==="status",onClick:()=>z(I,"bounced"),children:j==="status"?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsx(Ty,{className:"h-4 w-4"})})}),r.jsx(Ir,{children:I.emailStatus==="bounced"?"Restore email (re-add to groups)":"Mark bounced (remove from groups)"})]})})]})]},I.memberKey)})})]}),F.length>0&&r.jsxs("section",{children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2 flex items-center gap-2",children:[r.jsx(xF,{className:"h-4 w-4"}),"Inbox Bounces - Members (",F.length,")"]}),r.jsx("div",{className:"space-y-2",children:F.map(I=>r.jsx("div",{className:"border border-orange-200 bg-orange-50 rounded-lg p-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"font-medium",children:I.memberName}),r.jsx("div",{className:"text-sm text-muted-foreground",children:I.email}),r.jsxs("div",{className:"text-xs text-orange-600 mt-1",children:[K(I.reason)," • ",T(I.date),I.isPrimaryEmail&&" • Primary email",I.isSecondaryEmail&&" • Secondary email",I.isGuildEmail&&" • Guild email"]})]}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("span",{className:"text-xs text-muted-foreground max-w-xs truncate cursor-help",children:[I.snippet.substring(0,80),"..."]})}),r.jsx(Ir,{className:"max-w-md",children:r.jsx("p",{className:"text-xs",children:I.snippet})})]})})]})},I.messageId))})]}),d&&d.unknownBounces.length>0&&r.jsxs("section",{children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2 flex items-center gap-2",children:[r.jsx(po,{className:"h-4 w-4"}),"Inbox Bounces - Unknown (",d.unknownBounces.length,")"]}),r.jsx("div",{className:"space-y-2",children:d.unknownBounces.map(I=>r.jsx("div",{className:"border border-gray-200 bg-gray-50 rounded-lg p-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"font-medium text-muted-foreground",children:I.email}),r.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[K(I.reason)," • ",T(I.date)]})]}),r.jsx(Lr,{children:r.jsxs(Gr,{children:[r.jsx(Hr,{asChild:!0,children:r.jsxs("span",{className:"text-xs text-muted-foreground max-w-xs truncate cursor-help",children:[I.snippet.substring(0,80),"..."]})}),r.jsx(Ir,{className:"max-w-md",children:r.jsx("p",{className:"text-xs",children:I.snippet})})]})})]})},I.messageId))})]}),S.length===0&&F.length===0&&!d?.unknownBounces.length&&r.jsx("p",{className:"text-muted-foreground text-center py-8",children:f?r.jsxs("span",{className:"flex items-center justify-center gap-2",children:[r.jsx(on,{className:"h-4 w-4 animate-spin"}),"Checking inbox for bounces..."]}):"No bounced emails found"})]})]})})}function Wq(){const t=_r(),{toast:e}=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,logout:s}=ia(),o=Po(),[c,d]=x.useState([]),[m,f]=x.useState(!0),[p,b]=x.useState(!1),[v,C]=x.useState(!1),[S,F]=x.useState(null),[w,A]=x.useState(!1),[N,P]=x.useState(null),[z,D]=x.useState(new Set),[T,K]=x.useState(new Set),[B,k]=x.useState(!1),[O,I]=x.useState(null),[j,U]=x.useState(!1),[q,Y]=x.useState(!1),[W,H]=x.useState(!1),[J,ie]=x.useState(null),[Q,ve]=x.useState(new Set),[pe,Me]=x.useState("all"),[We,Ae]=x.useState("all"),[Ce,He]=x.useState(new Set),[Ct,bt]=x.useState(!1),Rt=jx({onReload:async()=>{try{b(!0);const X=await o("/api/admin/refreshCache",{method:"POST"});if(!X.ok)throw new Error("Failed to refresh cache");const ke=await X.json();d(ke.members||[]),D(new Set(ke.invalidNames||[])),K(new Set(ke.activatedHandles||[])),e({title:"Cache Refreshed",de
4345scription:`Loaded ${ke.members?.length||0} members from database`})}finally{b(!1)}}});if(!n)return null;const zt=X=>{const ke=X.donationStatus?.amount||0,De=X.donationStatus?.frequency?.toLowerCase()||"once";return De==="monthly"?ke*12:ke},Ut=()=>{const X=c.filter(Le=>Le.donationStatus?.isDonor),ke=["Preferred Name","Donor Badge Public","Name Public","Annualized Amount","Last Donation"],De=X.map(Le=>{const fe=Le.preferredName||`${Le.firstName||""} ${Le.lastName||""}`.trim()||Le.email,Se=Le.public?.donation?"Yes":"No",Be=Le.public?.name||Le.publicProfile?"Yes":"No",Ze=zt(Le),ue=Le.donationStatus?.lastDonation?new Date(Le.donationStatus.lastDonation).toLocaleDateString():"";return[(je=>je.includes(",")||je.includes('"')||je.includes(`
4346`)?`"${je.replace(/"/g,'""')}"`:je)(fe),Se,Be,Ze.toFixed(2),ue].join(",")}),oe=[ke.join(","),...De].join(`
4347`),te=new Blob([oe],{type:"text/csv"}),ye=URL.createObjectURL(te),Re=document.createElement("a");Re.href=ye,Re.download=`xrguild-donors-${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(Re),Re.click(),document.body.removeChild(Re),URL.revokeObjectURL(ye),e({title:"CSV Downloaded",description:`Exported ${X.length} donors to CSV`})},Bt=async()=>{const X=document.createElement("input");X.type="file",X.accept=".csv",X.onchange=async ke=>{const De=ke.target.files?.[0];if(De)try{const oe=await De.text();e({title:"Analyzing...",description:"Parsing transactions CSV..."});const te=await o("/api/admin/donors/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({csvContent:oe})});if(!te.ok)throw new Error("Preview failed");const ye=await te.json();I(ye),k(!0)}catch(oe){e({variant:"destructive",title:"Import Failed",description:oe.message})}},X.click()},re=async(X,ke=[])=>{try{const De=await o("/api/admin/donors/apply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({changes:X,manualLinks:ke})});if(!De.ok)throw new Error("Apply failed");const oe=await De.json();e({title:"Import Complete",description:`${oe.updated} members updated${oe.errors?`, ${oe.errors} errors`:""}`}),k(!1),I(null),jt(!0)}
4347catch(De){e({variant:"destructive",title:"Apply Failed",description:De.message})}},wt=async X=>{try{return await navigator.clipboard.writeText(X),console.log("Clipboard: writeText succeeded"),!0}catch(De){console.log("Clipboard: writeText failed, trying execCommand",De)}const ke=document.createElement("textarea");ke.value=X,ke.style.position="fixed",ke.style.top="0",ke.style.left="0",ke.style.width="2em",ke.style.height="2em",ke.style.padding="0",ke.style.border="none",ke.style.outline="none",ke.style.boxShadow="none",ke.style.background="transparent",document.body.appendChild(ke),ke.focus(),ke.select();try{const De=document.execCommand("copy");if(document.body.removeChild(ke),De)return console.log("Clipboard: execCommand succeeded"),!0;console.log("Clipboard: execCommand returned false")}catch(De){document.body.removeChild(ke),console.log("Clipboard: execCommand threw",De)}return console.log("Clipboard: all methods failed, showing alert"),alert(`Copy this list manually:
4348
4349${X}`),!0},Nt=async()=>{try{const X=await o("/api/admin/donors/all");if(!X.ok)throw new Error("Failed to fetch donors");const ke=await X.json(),De=ke.donors||[],oe=ke.unlisted||0;let te=De.map(Re=>Re.name).join(`
4350`);if(oe>0&&(te+=`
4351(${oe} unlisted)`),await wt(te)){const Re=oe>0?`${De.length} all-time public donor names (${oe} unlisted)`:`${De.length} all-time public donor names`;e({title:"Copied to Clipboard",description:Re})}else e({variant:"destructive",title:"Error",description:"Failed to copy to clipboard"})}catch(X){e({variant:"destructive",title:"Error",description:X.message})}},vt=async()=>{try{const X=await o("/api/admin/donors/recent");if(!X.ok)throw new Error("Failed to fetch recent donors");const ke=await X.json(),De=ke.donors||[],oe=ke.unlisted||0;let te=De.map(Re=>Re.name).join(`
4352`);if(oe>0&&(te+=`
4353(${oe} unlisted)`),await wt(te)){const Re=oe>0?`${De.length} recent public donors, ${oe} unlisted (last 12 months)`:`${De.length} recent public donor names (last 12 months)`;e({title:"Copied to Clipboard",description:Re})}else e({variant:"destructive",title:"Error",description:"Failed to copy to clipboard"})}catch(X){e({variant:"destructive",title:"Error",description:X.message})}},Tt=X=>{const ke=X.trim();if(!ke)return null;const De=ke.toLowerCase();return{us:"United States",usa:"United States","united states":"United States","united states of america":"United States","los angeles":"United States",gb:"United Kingdom",uk:"United Kingdom","united kingdom":"United Kingdom",ca:"Canada",canada:"Canada",au:"Australia",australia:"Australia",in:"India",india:"India",de:"Germany",germany:"Germany",fr:"France",france:"France",it:"Italy",italy:"Italy",es:"Spain",spain:"Spain",nl:"Netherlands","the netherlands":"Netherlands",netherlands:"Netherlands",pt:"Portugal",portugal:"Portugal",fi:"Finland",finland:"Finland",ae:"United Arab Emirates",uae:"United Arab Emirates","united arab emirates":"United Arab Emirates","united arab of emirates":"United Arab Emirates",il:"Israel",israel:"Israel",ng:"Nigeria",nigeria:"Nigeria",eg:"Egypt",egypt:"Egypt",th:"Thailand",thailand:"Thailand",dk:"Denmark",denmark:"Denmark",cz:"Czech Republic","czech republic":"Czech Republic",czechia:"Czech Republic",co:"Colombia",colombia:"Colombia",se:"Sweden",sweden:"Sweden",my:"Malaysia",malaysia:"Malaysia",gr:"Greece",greece:"Greece",ro:"Romania",romania:"Romania",mt:"Malta",malta:"Malta",br:"Brazil",brazil:"Brazil",mx:"Mexico",mexico:"Mexico",ar:"Argentina",argentina:"Argentina",jp:"Japan",japan:"Japan",sg:"Singapore",singapore:"Singapore",at:"Austria",austria:"Austria",hk:"Hong Kong","hong kong":"Hong Kong",no:"Norway",norway:"Norway",nz:"New Zealand","new zealand":"New Zealand",tr:"Turkey",turkey:"Turkey",türkiye:"Turkey",cn:"China",中国:"China",china:"China"}[De]||ke},Wt=()=>{const X=new Map;let ke=0;for(const ye of c){const Re=Tt(ye.country||"");if(!Re){ke++;continue}X.set(Re,(X.get(Re)||0)+1)}const De=[...X.entries()].sort((ye,Re)=>Re[1]-ye[1]),te=De.map(([ye,Re])=>`${ye}: ${Re}`).join(`
4354`)+(ke>0?`
4355(${ke} not specified)`:"");wt(te).then(ye=>{e(ye?{title:"Copied to Clipboard",description:`${De.length} countries, ${c.length-ke} members with country`}:{variant:"destructive",title:"Error",description:"Failed to copy to clipboard"})})},Dt=async()=>{try{const X=await o("/api/admin/volunteers");if(!X.ok)throw new Error("Failed to fetch volunteers");const ke=await X.json(),De=ke.volunteers||[],oe=ke.unlisted||0;let te=De.map(Re=>Re.name).join(`
4356`);if(oe>0&&(te+=`
4357(${oe} unlisted)`),await wt(te)){const Re=oe>0?`${De.length} public volunteers, ${oe} unlisted (* = lead)`:`${De.length} public volunteer names (* = lead)`;e({title:"Copied to Clipboard",description:Re})}else e({variant:"destructive",title:"Error",description:"Failed to copy to clipboard"})}catch(X){e({variant:"destructive",title:"Error",description:X.message})}},jt=async(X=!1,ke=!1)=>{try{b(!0);const te=await o(X?"/api/admin/refreshCache":"/api/admin/members",{method:X?"POST":"GET"});if(!te.ok)throw new Error("Failed to fetch members");const ye=await te.json(),Re=ye.members?.length||0;if(Re===0&&!ke&&!X){console.log("[AdminMembers] Got 0 members, retrying in 2 seconds (cache may not be warmed)..."),setTimeout(()=>jt(!1,!0),2e3);return}d(ye.members||[]),D(new Set(ye.invalidNames||[])),K(new Set(ye.activatedHandles||[])),e({title:X?"Cache Reloaded":"Members Loaded",description:`Loa
4357ded ${Re} members${X?" from database":""}`})}catch(De){if(console.error("Error fetching members:",De),!ke){console.log("[AdminMembers] Retrying fetch in 2 seconds..."),setTimeout(()=>jt(X,!0),2e3);return}e({variant:"destructive",title:"Error",description:De.message||"Failed to load members"})}finally{f(!1),b(!1)}};x.useEffect(()=>{n&&jt()},[n]),x.useEffect(()=>{const X=ke=>{const{memberKey:De,member:oe}=ke.detail;oe&&(d(te=>te.map(ye=>ye.memberKey===De?{...ye,...oe}:ye)),console.log("[AdminMembers] Real-time update received for:",De))};return window.addEventListener("ws-member-updated",X),()=>{window.removeEventListener("ws-member-updated",X)}},[]);const he=async()=>{await s(),e({title:"Logged Out",description:"You have been successfully logged out"}),t("/admin/login")},ee=(X,ke)=>{d(De=>De.map(oe=>oe.email===X?{...oe,...ke}:oe))},ze=(X,ke)=>{d(De=>De.map(oe=>oe.memberKey===X?{...oe,...ke}:oe))},Ve=X=>{const ke=X.requestedEmail?.status,De=!!X.guildEmail;(!ke||ke==="requested")&&!De?(F(X),C(!0)):(P(X),A(!0))},lt=()=>{F(null),C(!0)},qe=async(X,ke)=>{try{const De=await o("/api/admin/incrementBounce",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:X,email:ke})});if(!De.ok){const te=await De.json();throw new Error(te.message||"Failed to increment bounce")}const oe=await De.json();d(te=>te.map(ye=>ye.memberKey===X?{...ye,bounces:{...ye.bounces,[ke]:oe.bounceCount}}:ye)),e({title:"Bounce Recorded",description:`${ke} now has ${oe.bounceCount} bounce${oe.bounceCount===1?"":"s"}`})}catch(De){console.error("Error incrementing bounce:",De),e({variant:"destructive",title:"Error",description:De.message||"Failed to record bounce"})}},It=async(X,ke)=>{try{const De=await o("/api/admin/resetBounce",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:X,email:ke})});if(!De.ok){const oe=await De.json();throw new Error(oe.message||"Failed to reset bounce")}d(oe=>oe.map(te=>{if(te.memberKey===X){const ye=te.bounces||{},{[ke]:Re,...Le}=ye;return{...te,bounces:Object.keys(Le).length>0?Le:{}}}return te})),e({title:"Bounce Reset",description:`Bounce count cleared for ${ke}`})}catch(De){console.error("Error resetting bounce:",De),e({variant:"destructive",title:"Error",description:De.message||"Failed to reset bounce"})}},gt=async(X,ke)=>{try{const De=await o("/api/admin/setTimelineEditor",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:X,isEditor:ke})});if(!De.ok){const oe=await De.json();throw new Error(oe.message||"Failed to set timeline editor")}d(oe=>oe.map(te=>te.memberKey===X?{...te,timelineEditor:ke}:te)),e({title:ke?"Timeline Editor Added":"Timeline Editor Removed",description:`Member ${ke?"can now":"can no longer"} approve timeline edits`})}catch(De){throw console.error("Error setting timeline editor:",De),e({variant:"destructive",title:"Error",description:De.message||"Failed to set timeline editor status"}),De}},Ee=async(X,ke)=>{try{const De=await o("/api/admin/setUseInGrid",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({memberKey:X,useInGrid:ke})});if(!De.ok){const oe=await De.json();throw new Error(oe.message||"Failed to set grid inclusion")}d(oe=>oe.map(te=>te.memberKey===X?{...te,useInGrid:ke}:te))}catch(De){throw console.error("Error setting useInGrid:",De),e({variant:"destructive",title:"Error",description:De.message||"Failed to update grid inclusion"}),De}},Je=async()=>{const X=c.filter(ke=>ke.useInGrid&&ke.profileImageUrl);if(X.length===0){e({variant:"destructive",title:"No images selected",description:'Check the "Use" boxes next to member photos to include them in the grid.'});return}e({title:"Generating Grid",description:`Loading ${X.length} images...`});try{const De=Math.round(9938.823529411766),oe=X.length;let te=1,ye=1/0;for(let ft=1;ft<=oe;ft++){const Mt=Math.ceil(oe/ft),be=7680/ft,Z=De/Mt,it=Math.min(be,Z)/Math.max(be,Z),st=(ft*Mt-oe)/(ft*Mt)+(1-it)*.5;st<ye&&(ye=st,te=ft)}const Re=te,Le=Math.ceil(oe/Re),fe=7680/Re,Se=De/Le,Be="/api/proxy-image?url=",Ze=X.map(ft=>new Promise((Mt,be)=>{const Z=new Image;Z.crossOrigin="anonymous",Z.onload=()=>Mt(Z),Z.onerror=()=>be(new Error(`Failed to load image for ${ft.email}`)),Z.src=Be+encodeURIComponent(ft.profileImageUrl)})),rt=(await Promise.allSettled(Ze)).map((ft,Mt)=>({result:ft,member:X[Mt]})).filter(ft=>ft.result.status==="fulfilled");if(rt.length===0){e({variant:"destructive",title:"No images loaded",description:"All image downloads failed. Check proxy configuration."});return}const je=rt.length;let _t=1,Kt=1/0;for(let ft=1;ft<=je;ft++){const Mt=Math.ceil(je/ft),be=7680/ft,Z=De/Mt,it=Math.min(be,Z)/Math.max(be,Z),st=(ft*Mt-je)/(ft*Mt)+(1-it)*.5;st<Kt&&(Kt=st,_t=ft)}const gn=Math.ceil(je/_t),_e=7680/_t,et=De/gn,Ge=document.createElement("canvas");Ge.width=7680,Ge.height=De;const ht=Ge.getContext("2d");ht.fillStyle="#000000",ht.fillRect(0,0,7680,De),rt.forEach(({result:ft},Mt)=>{const be=ft.value,Z=Mt%_t,it=Math.floor(Mt/_t),we=Z*_e,st=it*et,Lt=be.naturalWi
4357dth/be.naturalHeight,Ot=_e/et;let Et,tt,ge,$;Lt>Ot?($=be.naturalHeight,ge=$*Ot,Et=(be.naturalWidth-ge)/2,tt=0):(ge=be.naturalWidth,$=ge/Ot,Et=0,tt=(be.naturalHeight-$)/2),ht.drawImage(be,Et,tt,ge,$,we,st,_e,et)}),Ge.toBlob(ft=>{if(!ft)return;const Mt=URL.createObjectURL(ft),be=document.createElement("a");be.href=Mt,be.download=`xrguild-profiles-grid-${new Date().toISOString().split("T")[0]}.png`,document.body.appendChild(be),be.click(),document.body.removeChild(be),URL.revokeObjectURL(Mt),e({title:"Grid Generated",description:`${rt.length} photos arranged in ${_t}x${gn} grid (7680x${De}px)`})},"image/png")}catch(ke){console.error("Error generating grid:",ke),e({variant:"destructive",title:"Grid Generation Failed",description:ke.message})}},$e=async()=>{try{H(!0),e({title:"Verifying Google Groups",description:"Comparing database with actual Google Groups membership..."});const X=await o("/api/admin/verify-google-groups");if(!X.ok)throw new Error("Failed to verify Google Groups");const ke=await X.json();ie({checked:ke.checked,discrepancies:ke.discrepancies,details:ke.details||[]});const{discrepancies:De}=ke,oe=`Checked ${ke.checked} members: ${De.errors} errors, ${De.warnings} warnings, ${De.info} info`;De.total===0?e({title:"Verification Complete",description:`${oe}. All in sync!`}):e({title:"Verification Complete",description:oe,variant:De.errors>0?"destructive":"default"})}catch(X){console.error("Error verifying Google Groups:",X),e({variant:"destructive",title:"Verification Failed",description:X.message||"Failed to verify Google Groups"})}finally{H(!1)}},Xe=async()=>{if(!J||Ce.size===0)return;bt(!0);const X=[],ke=[];try{for(const De of Ce){const oe=J.details[De];if(!oe?.group)continue;const te=oe.issue.includes("Wrong email"),ye=oe.issue.includes("opted out"),Re=oe.canRemove,Le=oe.issue.includes("but leads no tracks"),fe=Re||ye||Le,Se=fe?void 0:te&&oe.primaryEmail?oe.primaryEmail:oe.email,Be=fe||te?oe.email:void 0;try{const Ze=await o("/api/admin/fix-group-membership",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Se,group:oe.group,removeOldEmail:Be,skipCacheRefresh:!0})});if(Ze.ok)X.push(De);else{const ue=await Ze.json();ke.push(`${oe.email}: ${ue.message||"Failed"}`)}}catch(Ze){ke.push(`${oe.email}: ${Ze.message}`)}}await o("/api/admin/refresh-google-group-members",{method:"POST"}),X.length>0&&ie(De=>{if(!De)return null;const oe=new Set(X),te=De.details.filter((fe,Se)=>!oe.has(Se));let ye=0,Re=0,Le=0;return te.forEach(fe=>{fe.severity==="error"?ye++:fe.severity==="warning"?Re++:Le++}),{...De,discrepancies:{total:te.length,errors:ye,warnings:Re,info:Le},details:te}}),He(new Set),e({title:"Bulk Fix Complete",description:`Fixed ${X.length} items${ke.length>0?`, ${ke.length} failed`:""}`}),ke.length>0&&console.error("Bulk fix errors:",ke)}catch(De){e({variant:"destructive",title:"Bulk Fix Failed",description:De.message||"An error occurred during bulk fix"})}finally{bt(!1)}};return n?r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 p-8",children:[r.jsx(Lo,{title:"Member Browser",subtitle:"View and manage guild members",adminEmail:a,adminRole:i,onLogout:he,pendingChangesCount:Rt.pendingCount,isWatching:Rt.isWatching,isReloading:Rt.isReloading,onReload:Rt.triggerReload,onWatchChange:X=>Rt.toggleWatch(X)}),r.jsxs("main",{children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[r.jsxs(Ft,{className:"p-6 border-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Members"}),r.jsx("p",{className:"text-3xl font-bold",children:c.length})]}),r.jsx(Fm,{className:"h-8 w-8 text-primary opacity-50"})]}),r.jsxs("div",{className:"mt-3 flex gap-2",children:[r.jsxs(Fe,{variant:"outline",size:"sm",onClick:Wt,className:"text-xs",title:"Copy country breakdown to clipboard",children:["countries (",new Set(c.map(X=>Tt(X.country||"")).filter(Boolean)).size,")"]}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>U(!0),className:"text-xs",title:"Show members on a world map",children:"map"})]})]}),r.jsxs(Ft,{className:"p-6 border-2 border-green-200",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Active Donors"}),r.jsx("p",{className:"text-3xl font-bold text-green-600",children:c.filter(X=>X.donationStatus?.isDonor).length})]}),r.jsx(Fm,{className:"h-8 w-8 text-green-600 opacity-50"})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:Ut,className:"text-xs",children:"Export All"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:Bt,className:"text-xs",children:"Import CSV"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:Nt,className:"text-xs",title:"Copy all-time public donor names to clipboard",children:"all time"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:vt,className:"text-xs text-green-600 hover:text-green-700",title:"Copy last 12 months public donor names to clipboard",children:"last 12 months"})]})]}),r.jsxs(Ft,{className:"p-6 border-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"Public Profiles"}),r.jsx("p",{className:"text-3xl font-bold text-blue-600",children:c.filter(X=>X.publicProfile).length})]}),r.jsx(Fm,{className:"h-8 w-8 text-blue-600 opacity-50"})]}),r.jsxs("div",{className:"mt-3 flex gap-2",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:Dt,className:"text-xs",title:"Copy public volunteer names to clipboard (* = lead)",children:"volunteers"}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:Je,className:"text-xs text-blue-600 hover:text-blue-700",title:`Generate 8K grid image from ${c.filter(X=>X.useInGrid&&X.profileImageUrl).length} approved photos`,children:["grid image (",c.filter(X=>X.useInGrid&&X.profileImageUrl).length,")"]})]})]})]}),r.jsx(Ft,{className:"p-4 mb-6",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-xl font-bold",children:"All Members"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{variant:"outline",onClick:()=>jt(!0),disabled:p,className:"gap-2",children:[r.jsx(Rr,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"Reload"]}),r.jsxs(Fe,{variant:"outline",onClick:lt,className:"gap-2",children:[r.jsx(Cr,{className:"h-4 w-4"}),"Approve Emails"]}
4357),r.jsxs(Fe,{variant:"outline",onClick:$e,disabled:W,className:"gap-2",children:[W?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsx(us,{className:"h-4 w-4"}),W?"Verifying...":"Verify Groups"]}),r.jsxs(Fe,{variant:"outline",onClick:()=>Y(!0),className:"gap-2",title:"Manage bounced emails",children:[r.jsx(ah,{className:"h-4 w-4 text-amber-500"}),"Bounces"]})]})]})}),J&&r.jsxs(Ft,{className:"mb-6",children:[r.jsxs(bn,{className:"pb-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(wn,{className:"text-lg flex items-center gap-2",children:[r.jsx(us,{className:"h-5 w-5"}),"Verification Results"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const X=J.details.filter(oe=>oe.issue.includes("Wrong email")).map(oe=>oe.email);if(X.length===0)return null;const ke=[...new Set(X)],De=`mailto:${ke.join(",")}?subject=Please%20use%20your%20XR%20Guild%20email`;return r.jsxs("a",{href:De,className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:[r.jsx(Cr,{className:"h-4 w-4"}),"Email ",ke.length]})})(),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>ie(null),children:r.jsx(gr,{className:"h-4 w-4"})})]})]}),r.jsxs(Ln,{children:["Checked ",J.checked," members: ",J.discrepancies.errors," errors, ",J.discrepancies.warnings," warnings, ",J.discrepancies.info," info"]})]}),J.details.length>0&&r.jsx(fn,{children:(()=>{const X=J.details,ke={allMembers:X.filter(oe=>oe.group?.includes("all_members")).length,newsletter:X.filter(oe=>oe.group?.includes("newsletter")).length,trackLeads:X.filter(oe=>oe.group?.includes("trackLeads")||oe.group?.includes("track_leads")).length,external:X.filter(oe=>oe.usesGuildEmail===!1&&oe.memberKey!=="system"&&oe.memberKey!=="unknown").length,guildEmail:X.filter(oe=>oe.usesGuildEmail===!0).length},De=X.filter(oe=>{if(pe!=="all"&&(pe==="allMembers"&&!oe.group?.includes("all_members")||pe==="newsletter"&&!oe.group?.includes("newsletter")||pe==="trackLeads"&&!oe.group?.includes("trackLeads")&&!oe.group?.includes("track_leads")))return!1;if(We!=="all"){if(oe.memberKey==="system"||oe.memberKey==="unknown")return!0;if(We==="external"&&oe.usesGuildEmail!==!1||We==="guildEmail"&&oe.usesGuildEmail!==!0)return!1}return!0});return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[r.jsx("span",{className:"text-sm text-muted-foreground self-center mr-2",children:"Group:"}),r.jsxs(Fe,{variant:pe==="all"?"default":"outline",size:"sm",onClick:()=>Me("all"),children:["All (",X.length,")"]}),r.jsxs(Fe,{variant:pe==="allMembers"?"default":"outline",size:"sm",onClick:()=>Me("allMembers"),children:["all_members (",ke.allMembers,")"]}),r.jsxs(Fe,{variant:pe==="newsletter"?"default":"outline",size:"sm",onClick:()=>Me("newsletter"),children:["newsletter (",ke.newsletter,")"]}),r.jsxs(Fe,{variant:pe==="trackLeads"?"default":"outline",size:"sm",onClick:()=>Me("trackLeads"),children:["trackLeads (",ke.trackLeads,")"]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[r.jsx("span",{className:"text-sm text-muted-foreground self-center mr-2",children:"Email:"}),r.jsx(Fe,{variant:We==="all"?"default":"outline",size:"sm",onClick:()=>Ae("all"),children:"All"}),r.jsxs(Fe,{variant:We==="external"?"default":"outline",size:"sm",onClick:()=>Ae("external"),children:["External (",ke.external,")"]}),r.jsxs(Fe,{variant:We==="guildEmail"?"default":"outline",size:"sm",onClick:()=>Ae("guildEmail"),children:["Guild Email (",ke.guildEmail,")"]})]}),r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",De.length," of ",X.length," issues"]}),r.jsxs("div",{className:"flex items-center gap-3",children:[(()=>{const oe=De.filter(Re=>Re.group&&Re.memberKey!=="system"&&(Re.canRemove||Re.memberKey!=="unknown"&&!Re.issue.includes("but not in database")));if(oe.length===0)return null;const te=oe.map(Re=>X.indexOf(Re)),ye=te.every(Re=>Ce.has(Re));return r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ar,{checked:ye,disabled:Ct,onCheckedChange:Re=>{He(Le=>{const fe=new Set(Le);return te.forEach(Se=>{Re?fe.add(Se):fe.delete(Se)}),fe})}}),"Select all (",oe.length,")"]})})(),Ce.size>0&&r.jsx(Fe,{variant:"default",size:"sm",onClick:Xe,disabled:Ct,children:Ct?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"h-3 w-3 animate-spin mr-1"}),"Fixing ",Ce.size,"..."]}):r.jsxs(r.Fragment,{children:["Fix Selected (",Ce.size,")"]})})]})]}),r.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:De.map((oe,te)=>{const ye=X.indexOf(oe);return r.jsx("div",{className:`p-3 rounded-lg border text-sm ${oe.severity==="error"?"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800":oe.severity==="warning"?"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/20 dark:border-yellow-800":"bg-blue-50 border-blue-200 dark:bg-blue-950/20 dark:border-blue-800"}`,children:r.jsxs("div",{className:"flex items-start gap-2",children:[oe.severity==="error"?r.jsx(po,{className:"h-4 w-4 text-red-500 mt-0.5 flex-shrink-0"}):oe.severity==="warning"?r.jsx(po,{className:"h-4 w-4 text-yellow-500 mt-0.5 flex-shrink-0"}):r.jsx(us,{className:"h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium",children:oe.email}),r.jsx("div",{className:"text-muted-foreground",children:oe.issue}),oe.group&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Group: ",oe.group]}),oe.reason&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:["Reason: ",oe.reason]})]}),oe.group&&oe.memberKey!=="system"&&(oe.canRemove||oe.memberKey!=="unknown"&&!oe.issue.includes("but not in database"))&&r.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:r.jsx(ar,{checked:Ce.has(ye),disabled:Ct,onCheckedChange:Re=>{He(Le=>{const fe=new Set(Le);return Re?fe.add(ye):fe.delete(ye),fe})}})})]})},ye)})})]})})()})]}),r.jsx(aq,{members:c,loading:m,onMemberUpdate:ee,onOpenEmailApproval:Ve,onIncrementBounce:qe,onResetBounce:It,onSetTimelineEditor:gt,onSetUseInGrid:Ee,sessionId:sessionStorage.getItem("adminSessionId")||"",adminEmail
4357:a||""}),r.jsx(xM,{open:v,onOpenChange:X=>{C(X),X||F(null)},members:c,invalidNames:z,activatedHandles:T,sessionId:sessionStorage.getItem("adminSessionId")||"",adminEmail:a||"",onApprovalComplete:()=>{jt()},filterMemberKey:S?.memberKey,filterMemberName:S?`${S.firstName||""} ${S.lastName||""}`.trim():void 0}),r.jsx(oq,{open:w,onOpenChange:X=>{A(X),X||P(null)},member:N,sessionId:sessionStorage.getItem("adminSessionId")||"",onActionComplete:X=>{X&&K(new Set(X)),jt()}}),r.jsx(lq,{open:B,onOpenChange:X=>{k(X),X||I(null)},previewData:O,allMembers:c,onApply:re}),r.jsx(Gq,{open:j,onOpenChange:U,members:c,normalizeCountry:Tt}),r.jsx(Hq,{open:q,onOpenChange:Y,members:c,onMemberUpdate:ze})]})]}):null}class z_{children=new Map;memberKeys=new Set}class G_{root=new z_;insert(e,n){e=e.toLowerCase();let a=this.root;for(const i of e)a.children.has(i)||a.children.set(i,new z_),a=a.children.get(i),a.memberKeys.add(n)}search(e){e=e.toLowerCase();let n=this.root;for(const a of e){if(!n.children.has(a))return new Set;n=n.children.get(a)}return n.memberKeys}}class Vq{trie=new G_;members=new Map;buildIndex(e){this.trie=new G_,this.members.clear(),e.forEach(n=>{const a=n.memberKey||n.email;this.members.set(a,n),n.email&&n.email.toLowerCase().split(/[@._-]/).forEach(c=>{c.length>0&&this.trie.insert(c,a)});const i=[];if(n.firstName&&i.push(n.firstName),n.lastName&&i.push(n.lastName),n.preferredName&&i.push(n.preferredName),i.forEach(s=>{s&&s.trim().length>0&&this.trie.insert(s.trim(),a)}),n.firstName&&n.lastName){const s=`${n.firstName} ${n.lastName}`;this.trie.insert(s,a)}})}search(e){if(!e||e.trim().length===0)return[];e=e.trim();const n=e.toLowerCase().split(/\s+/).filter(s=>s.length>0);if(n.length===0)return[];let a=null;for(const s of n){const o=this.trie.search(s);if(a===null?a=o:a=new Set([...a].filter(c=>o.has(c))),a.size===0)return[]}const i=[];return a?.forEach(s=>{const o=this.members.get(s);o&&i.push(o)}),i}getCount(){return this.members.size}getMember(e){return this.members.get(e)}}function $q(t){const e=new Vq;return e.buildIndex(t),e}function Xp(t,e="public",n="full"){if(!t)return"";const a=t.firstName||"",i=t.middleName||"",s=t.lastName||"",o=t.preferredName||"";let c;return n==="first"?c=a:c=[a,i,s].filter(Boolean).join(" "),e==="admin"?o&&o!==a?n==="first"?`${o} (${a})`:`${o} (${c})`:c||t.email||"":o||c||t.email||""}function Kq(){const t=_r(),{toast:e}=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,sessionId:s,logout:o}=ia(),c=Po(),[d,m]=x.useState(!0),[f,p]=x.useState([]),[b,v]=x.useState([]),[C,S]=x.useState(new Set),[F,w]=x.useState(new Set),[A,N]=x.useState(new Set),[P,z]=x.useState({}),[D,T]=x.useState(""),[K,B]=x.useState(new Set),[k,O]=x.useState([]),[I,j]=x.useState({}),[U,q]=x.useState({}),[Y,W]=x.useState(null),[H,J]=x.useState(null),[ie,Q]=x.useState({addToTrack:new Set,addToGroup:new Set}),[ve,pe]=x.useState({}),[Me,We]=x.useState({}),[Ae,Ce]=x.useState(null),[He,Ct]=x.useState(!1),[bt,Rt]=x.useState(!1),[zt,Ut]=x.useState(null),[Bt,re]=x.useState({}),[wt,Nt]=x.useState(null),[vt,Tt]=x.useState(null),[Wt,Dt]=x.useState(!1),[jt,he]=x.useState(Date.now()),ee=jx({onReload:async()=>{if(!(await c("/api/admin/refreshCache",{method:"POST"})).ok)throw new Error("Failed to refresh cache");await Je(),e({title:"Cache Refreshed",description:"Track data reloaded from database"})}});x.useEffect(()=>{n&&i!=="SUPER_ADMIN"&&i!=="SUPPORT_ADMIN"&&t("/admin/dashboard")},[n,i,t]),x.useEffect(()=>{n&&(i==="SUPER_ADMIN"||i==="SUPPORT_ADMIN")&&s&&Je()},[n,i,s]),x.useEffect(()=>{const _e=setInterval(()=>he(Date.now()),1e3);return()=>clearInterval(_e)},[]);const ze=x.useRef(0);x.useEffect(()=>{if(d||f.length===0)return;const _e={"test-10sec":10*1e3,"test-30sec":30*1e3,"test-1min":60*1e3,"test-10min":600*1e3,daily:1440*60*1e3,weekly:10080*60*1e3};f.some(Ge=>{if(!Ge.digestFrequency||Ge.digestFrequency==="none"||!Ge.lastDigestSent)return!1;const ht=_e[Ge.digestFrequency];if(!ht)return!1;const ft=new Date(Ge.lastDigestSent).getTime()+ht;return jt>=ft+2e3})&&jt-ze.current>=3e3&&(ze.current=jt,(async()=>{try{const Ge=await Bg();p(Ge)}catch(Ge){console.warn("[AdminTracks] Failed to poll for digest updates:",Ge)}})())},[d,f,jt]);const Ve=_e=>{if(!_e.digestFrequency||_e.digestFrequency==="none")return"";if(!_e.lastDigestSent)return"Pending";const Ge={"test-10sec":10*1e3,"test-30sec":30*1e3,"test-1min":60*1e3,"test-10min":600*1e3,daily:1440*60*1e3,weekly:10080*60*1e3}[_e.digestFrequency];if(!Ge)return"";const Mt=new Date(_e.lastDigestSent).getTime()+Ge-jt,be=5e3;return Mt<=0?-Mt<be?"Updating...":"Due now":Mt<6e4?`${Math.ceil(Mt/1e3)}s`:Mt<36e5?`${Math.ceil(Mt/6e4)}m`:Mt<864e5?`${Math.floor(Mt/36e5)}h ${Math.floor(Mt%36e5/6e4)}m`:`${Math.floor(Mt/864e5)}d ${Math.floor(Mt%864e5/36e5)}h`},lt=_e=>!_e||_e==="none"?"Off":{"test-10sec":"10s (test)","test-30sec":"30s (test)","test-1min":"1m (test)","test-10min":"10m (test)",daily:"Daily",weekly:"Weekly"}[_e]||_e,qe=async(_e,et=0,Ge=!1)=>{Ge||(Nt(_e),Dt(!0),Tt(null));try{const ht=await c(`/api/admin/digest-preview/${_e}?limit=20&offset=${et}`);
4357if(ht.ok){const ft=await ht.json();ft.success?Tt(Ge&&vt?{...ft,rawEvents:[...vt.rawEvents,...ft.rawEvents],pagination:ft.pagination}:ft):e({variant:"destructive",title:"Error",description:ft.message||"Failed to load digest preview"})}else throw new Error("Failed to fetch digest preview")}catch(ht){console.error("[AdminTracks] Error fetching digest preview:",ht),e({variant:"destructive",title:"Error",description:"Failed to load digest preview"})}finally{Dt(!1)}},It=()=>{if(wt&&vt?.pagination?.hasMore){const _e=vt.rawEvents.length;qe(wt,_e,!0)}},gt=_e=>({req:"Requested",wdr:"Withdrawn",apr:"Approved",jnd:"Joined",lft:"Left",rmd:"Removed",lpr:"Lead Promoted",lrv:"Lead Revoked"})[_e]||_e,Ee=_e=>{switch(_e){case"apr":case"jnd":case"lpr":return"default";case"req":return"secondary";case"lft":case"rmd":case"lrv":return"destructive";case"wdr":return"outline";default:return"secondary"}};if(!n)return null;const Je=async(_e=!1)=>{try{m(!0);let et="";try{const we=await c("/api/admin/config");we.ok&&(et=(await we.json()).trackGroupPrefix||"",T(et))}catch(we){console.warn("Could not load config:",we)}try{const we=await c("/api/admin/sync-track-google-groups");if(we.ok){const st=await we.json();console.log("[AdminTracks] Google Groups validation:",st),st.mismatches&&st.mismatches.length>0&&console.warn("[AdminTracks] Google Group mismatches found:",st.mismatches)}}catch(we){console.warn("Could not validate Google Groups:",we)}const Ge=await Bg();console.log("[AdminTracks] Loaded tracks:",Ge.map(we=>({id:we.id,name:we.name,googleGroup:we.googleGroup}))),p(Ge);const ht={},ft={};Ge.forEach(we=>{if(we.googleGroup){ft[we.id]=we.googleGroup;const st=we.googleGroup.replace("@xrguild.org","");ht[we.id]=st}else{const st=we.name.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");ht[we.id]=st}}),z(ht);const Mt=await c("/api/admin/members");if(!Mt.ok)throw new Error("Failed to fetch members");const be=await Mt.json(),Z=Array.isArray(be.members)?be.members:[];O(Z);const it=Ge.map(we=>({trackId:we.id,trackName:we.name,teamMembers:Z.filter(st=>st.tracks?.includes(we.id)),interestedMembers:Z.filter(st=>st.requestedTracks?.includes(we.id)&&!st.tracks?.includes(we.id)),leads:Z.filter(st=>st.leading?.includes(we.id))}));v(it);try{const we=await c("/api/admin/cached-google-group-members");if(we.ok){const st=await we.json();We(st.groupMembers||{}),Ce(st.lastRefresh?new Date(st.lastRefresh):null),console.log("[AdminTracks] Loaded cached group members:",st.groupCount,"groups");const Lt={};for(const Ot of Ge)if(Ot.googleGroup){const Et=st.groupMembers[Ot.googleGroup];Et&&(Lt[Ot.id]={exists:!0,memberCount:Et.length})}q(Lt)}}catch(we){console.warn("Could not load cached group members:",we)}}catch(et){if(console.error("Error loading admin tracks:",et),!_e){console.log("[AdminTracks] Retrying load in 2 seconds..."),setTimeout(()=>Je(!0),2e3);return}e({variant:"destructive",title:"Error",description:"Failed to load tracks data"})}finally{m(!1)}},$e=async()=>{try{Ct(!0),e({title:"Refreshing...",description:"Fetching Google Group members from Google API"});const _e=await c("/api/admin/refresh-google-group-members",{method:"POST",headers:{"Content-Type":"application/json"}}),et=await _e.json();if(!_e.ok||!et.success)throw new Error(et.message||"Failed to refresh cache");We(et.groupMembers||{}),Ce(et.lastRefresh?new Date(et.lastRefresh):null);const Ge={};for(const ht of f)if(ht.googleGroup){const ft=et.groupMembers[ht.googleGroup];ft&&(Ge[ht.id]={exists:!0,memberCount:ft.length})}q(Ge),e({title:"Cache Refreshed",description:`Updated ${et.groupCount} Google Groups from Google API`})}catch(_e){console.error("[AdminTracks] Error refreshing cache:",_e),e({variant:"destructive",title:"Error",description:_e instanceof Error?_e.message:"Failed to refresh cache"})}finally{Ct(!1)}},Xe=async()=>{try{Rt(!0),Ut(null),e({title:"Syncing Track Groups",description:"Adding missing members to track Google Groups..."});const _e=await c("/api/admin/sync-all-track-groups",{method:"POST"});if(!_e.ok)throw new Error("Failed to sync track groups");const et=await _e.json();Ut({tracksWithGroups:et.tracksWithGroups,membersAdded:et.membersAdded,trackResults:et.trackResults||[]}),et.membersAdded>
43570?e({title:"Sync Complete",description:`Added ${et.membersAdded} members across ${et.tracksWithGroups} track groups`}):e({title:"Sync Complete",description:`All ${et.tracksWithGroups} track groups are already in sync`})}catch(_e){console.error("Error syncing track groups:",_e),e({variant:"destructive",title:"Sync Failed",description:_e.message||"Failed to sync track groups"})}finally{Rt(!1)}},X=_e=>!_e||!Array.isArray(_e)?[]:_e.map(et=>{const Ge=k.find(ht=>ht.memberKey===et);return Ge?Ge.preferredName||Ge.firstName||Ge.email:null}).filter(et=>!!et),ke=(_e,et)=>{if(!et)return!1;const Ge=Me[et];return Ge?Ge.includes(_e.toLowerCase()):!1},De=_e=>{S(et=>{const Ge=new Set(et);return Ge.has(_e)?Ge.delete(_e):Ge.add(_e),Ge})},oe=_e=>{w(et=>{const Ge=new Set(et);return Ge.has(_e)?Ge.delete(_e):Ge.add(_e),Ge})},te=async()=>{await o(),e({title:"Logged Out",description:"You have been successfully logged out"}),t("/admin/login")},ye=x.useMemo(()=>$q(k),[k]),Re=_e=>{const et=I[_e]||"";if(!et||et.trim().length===0)return[];const Ge=ye.search(et),ht=b.find(Mt=>Mt.trackId===_e);if(!ht)return Ge;const ft=new Set([...ht.teamMembers.map(Mt=>Mt.memberKey),...ht.leads.map(Mt=>Mt.memberKey)]);return Ge.filter(Mt=>!ft.has(Mt.memberKey))},Le=(_e,et)=>{const Ge=I[et]||"";return!Ge||Ge.trim().length===0?!1:ye.search(Ge).some(ft=>ft.memberKey===_e.memberKey||ft.email===_e.email)},fe=async(_e,et)=>{try{const Ge=await c("/api/admin/check-track-google-group-exists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({groupEmail:et,trackId:_e})}),ht=await Ge.json();return Ge.ok&&ht.success?(q(ft=>({...ft,[_e]:{exists:ht.exists,memberCount:ht.memberCount,importableCount:ht.importableCount}})),ht.exists):!1}catch(Ge){return console.error("[AdminTracks] Error checking group exists:",Ge),!1}},Se=(_e,et)=>{const Ge=new Blob([et],{type:"text/csv;charset=utf-8;"}),ht=document.createElement("a"),ft=URL.createObjectURL(Ge);ht.setAttribute("href",ft),ht.setAttribute("download",_e),ht.style.visibility="hidden",document.body.appendChild(ht),ht.click(),document.body.removeChild(ht),URL.revokeObjectURL(ft)},Be=async(_e,et)=>{try{N(st=>new Set(st).add(_e)),console.log("[AdminTracks] Fetching Google Group members for backup...");const Ge=await c("/api/admin/get-google-group-members",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({groupEmail:et})}),ht=await Ge.json();if(!Ge.ok||!ht.success)throw new Error(ht.message||"Failed to fetch Google Group members");console.log("[AdminTracks] Generating CSV backup...");const ft=`Email,Role,Backup Date
4358`,Mt=ht.members.map(st=>`${st.email},${st.role},${new Date().toISOString()}`).join(`
4359`),be=ft+Mt,Z=`google-group-backup-${et.replace("@","-")}-${Date.now()}.csv`;Se(Z,be),e({title:"Backup Created",description:`Downloaded backup of ${ht.count} members to ${Z}`}),console.log("[AdminTracks] Importing members to track...");const it=await c("/api/admin/import-from-google-group",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackId:_e,groupEmail:et})}),we=await it.json();if(!it.ok||!we.success)throw new Error(we.message||"Failed to import from Google Group");pe(st=>({...st,[_e]:{addedEmails:we.addedEmails||[],notFoundEmails:we.notFoundEmails||[]}})),e({title:"Import Complete",description:`Added ${we.added} members to track. ${we.alreadyOnTrack} were already members. ${we.notFound} emails not found in database.`}),await Je()}catch(Ge){console.error("[AdminTracks] Error importing from group:",Ge),e({variant:"destructive",title:"Error",description:Ge instanceof Error?Ge.message:"Failed to import from Google Group"})}finally{N(Ge=>{const ht=new Set(Ge);return ht.delete(_e),ht})}},Ze=async(_e,et)=>{try{N(be=>new Set(be).add(_e));const Ge=et||P[_e]||_e,ht=`${D}${Ge}@xrguild.org`;console.log("[AdminTracks] Creating/renaming Google Group:",{trackId:_e,groupName:Ge,groupEmail:ht});
4359const ft=await c("/api/admin/create-track-google-group",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackId:_e,customGroupName:Ge})}),Mt=await ft.json();if(!ft.ok||!Mt.success)throw console.error("[AdminTracks] Failed to create Google Group:",Mt),new Error(Mt.message||"Failed to create Google Group");p(be=>be.map(Z=>Z.id===_e?{...Z,googleGroup:Mt.googleGroup}:Z)),e({title:"Success",description:`Google Group created: ${Mt.googleGroup}`})}catch(Ge){console.error("[AdminTracks] Error creating Google Group:",Ge),e({variant:"destructive",title:"Error",description:Ge instanceof Error?Ge.message:"Failed to create Google Group"})}finally{N(Ge=>{const ht=new Set(Ge);return ht.delete(_e),ht})}},ue=async(_e,et)=>{try{N(ft=>new Set(ft).add(_e)),console.log("[AdminTracks] Deleting Google Group:",{trackId:_e,groupEmail:et});const Ge=await c("/api/admin/delete-track-google-group",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackId:_e})}),ht=await Ge.json();if(!Ge.ok||!ht.success)throw console.error("[AdminTracks] Failed to delete Google Group:",ht),new Error(ht.message||"Failed to delete Google Group");p(ft=>ft.map(Mt=>Mt.id===_e?{...Mt,googleGroup:void 0}:Mt)),e({title:"Success",description:`Google Group ${et} deleted`})}catch(Ge){console.error("[AdminTracks] Error deleting Google Group:",Ge),e({variant:"destructive",title:"Error",description:Ge instanceof Error?Ge.message:"Failed to delete Google Group"})}finally{N(Ge=>{const ht=new Set(Ge);return ht.delete(_e),ht})}},rt=async(_e,et)=>{try{N(Mt=>new Set(Mt).add(_e)),console.log("[AdminTracks] Importing track members to Google Group:",{trackId:_e,groupEmail:et});const Ge=await c("/api/admin/import-members-to-google-group",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackId:_e,groupEmail:et})}),ht=await Ge.json();if(!Ge.ok||!ht.success)throw console.error("[AdminTracks] Failed to import members to Google Group:",ht),new Error(ht.message||"Failed to import members to Google Group");ht.failedEmails&&ht.failedEmails.length>0&&console.log("[AdminTracks] Failed to add these emails:",ht.failedEmails),ht.failedEmails&&ht.failedEmails.length>0?re(Mt=>({...Mt,[_e]:ht.failedEmails})):re(Mt=>{const be={...Mt};return delete be[_e],be});let ft=`Added ${ht.added} members to Google Group. ${ht.alreadyInGroup} were already members.`;ht.errors>0&&ht.failedEmails&&ht.failedEmails.length>0&&(ft+=` ${ht.errors} failed - see red icons next to emails.`),e({title:"Import Complete",description:ft,duration:ht.errors>0?8e3:5e3}),await $e()}catch(Ge){console.error("[AdminTracks] Error importing members to Google Group:",Ge),e({variant:"destructive",title:"Error",description:Ge instanceof Error?Ge.message:"Failed to import members to Google Group"})}finally{N(Ge=>{const ht=new Set(Ge);return ht.delete(_e),ht})}},je=async(_e,et)=>{const Ge=`${_e}-${et}-add`;try{if(B(Mt=>new Set(Mt).add(Ge)),!(await c("/api/admin/approveTrack",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_e,trackId:et})})).ok)throw new Error("Failed to add member to track");e({title:"Success",description:"Member added to track"});
4359const ft=k.find(Mt=>Mt.email===_e);ft&&(v(Mt=>Mt.map(be=>{if(be.trackId!==et)return be;const Z={...ft,tracks:[...ft.tracks||[],et]};return{...be,teamMembers:[...be.teamMembers,Z]}})),O(Mt=>Mt.map(be=>be.email===_e?{...be,tracks:[...be.tracks||[],et]}:be))),j(Mt=>({...Mt,[et]:""}))}catch(ht){console.error("[AdminTracks] Error adding to track:",ht),e({variant:"destructive",title:"Error",description:ht instanceof Error?ht.message:"Failed to add member to track"})}finally{B(ht=>{const ft=new Set(ht);return ft.delete(Ge),ft})}},_t=async(_e,et)=>{const Ge=`${_e}-${et}-remove`;try{if(B(ft=>new Set(ft).add(Ge)),!(await c("/api/admin/removeTrack",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_e,trackId:et})})).ok)throw new Error("Failed to remove member from track");e({title:"Success",description:"Member removed from track"}),v(ft=>ft.map(Mt=>Mt.trackId!==et?Mt:{...Mt,teamMembers:Mt.teamMembers.filter(be=>be.email!==_e),leads:Mt.leads.filter(be=>be.email!==_e)}))}catch(ht){console.error("[AdminTracks] Error removing from track:",ht),e({variant:"destructive",title:"Error",description:ht instanceof Error?ht.message:"Failed to remove member from track"})}finally{B(ht=>{const ft=new Set(ht);return ft.delete(Ge),ft})}},Kt=async(_e,et)=>{const Ge=`${_e}-${et}-promote`;try{if(B(ft=>new Set(ft).add(Ge)),!(await c("/api/admin/promoteTrackLead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_e,trackId:et})})).ok)throw new Error("Failed to promote member to lead");e({title:"Success",description:"Member promoted to track lead"}),v(ft=>ft.map(Mt=>{if(Mt.trackId!==et)return Mt;const be=Mt.teamMembers.find(it=>it.email===_e);if(!be)return Mt;const Z={...be,leading:[...be.leading||[],et]};return{...Mt,leads:[...Mt.leads,Z]}}))}catch(ht){console.error("[AdminTracks] Error promoting to lead:",ht),e({variant:"destructive",title:"Error",description:ht instanceof Error?ht.message:"Failed to promote member to lead"})}finally{B(ht=>{const ft=new Set(ht);return ft.delete(Ge),ft})}},gn=async(_e,et)=>{const Ge=`${_e}-${et}-revoke`;try{if(B(ft=>new Set(ft).add(Ge)),!(await c("/api/admin/revokeTrackLead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_e,trackId:et})})).ok)throw new Error("Failed to revoke lead status");e({title:"Success",description:"Lead status revoked (member remains on track)"}),v(ft=>ft.map(Mt=>{if(Mt.trackId!==et)return Mt;const be=Mt.leads.find(it=>it.email===_e);if(!be)return Mt;const Z={...be,leading:(be.leading||[]).filter(it=>it!==et)};return{...Mt,leads:Mt.leads.filter(it=>it.email!==_e),teamMembers:Mt.teamMembers.some(it=>it.email===_e)?Mt.teamMembers.map(it=>it.email===_e?Z:it):[...Mt.teamMembers,Z]}}))}catch(ht){console.error("[AdminTracks] Error revoking lead status:",ht),e({variant:"destructive",title:"Error",description:ht instanceof Error?ht.message:"Failed to revoke lead status"})}finally{B(ht=>{const ft=new Set(ht);return ft.delete(Ge),ft})}};return n?r.jsx("div",{className:"min-h-screen bg-background p-8",children:r.jsxs("div",{className:"max-w-7xl mx-auto",children:[r.jsx(Lo,{title:"Track Overview",subtitle:"View all tracks as if you were a track lead on every track",adminEmail:a,adminRole:i,onLogout:te,pendingChangesCount:ee.pendingCount,isWatching:ee.isWatching,isReloading:ee.isReloading,onReload:ee.triggerReload,onWatchChange:_e=>ee.toggleWatch(_e)}),r.jsxs("div",{className:"mb-6 flex items-center justify-between p-4 bg-muted/30 rounded-lg border",children:[r.jsx("div",{className:"flex items-center gap-4",children:r.jsx("div",{className:"text-sm text-muted-foreground",children:Ae?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-medium",children:"Google Groups cached:"})," ",Ae.toLocaleTimeString(),r.jsxs("span",{className:"text-xs ml-2",children:["(",Object.keys(Me).length," groups)"]})]}):r.jsx("span",{children:"Google Groups not cached yet"})})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>Je(),disabled:d,children:[d?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(Rr,{className:"h-4 w-4 mr-2"}),"Refresh"]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:Xe,disabled:bt||d,children:[bt?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(na,{className:"h-4 w-4 mr-2"}),bt?"Syncing...":"Sync Track Groups"]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:$e,disabled:He||d,children:[He?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(Rr,{className:"h-4 w-4 mr-2"}),"Refresh from Google"]})]})]}),zt&&r.jsxs(Ft,{className:"mb-6",children:[r.jsxs(bn,{className:"pb-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs(wn,{className:"text-lg flex items-center gap-2",children:[r.jsx(na,{className:"h-5 w-5"}),"Sync Results"]}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>Ut(null),children:r.jsx(gr,{className:"h-4 w-4"})})]}),r.jsxs(Ln,{children:["Synced ",zt.tracksWithGroups," track groups, added ",zt.membersAdded," members"]})]}),zt.trackResults.length>0&&r.jsx(fn,{children:r.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:zt.trackResults.map((_e,et)=>r.jsxs("div",{className:`p-3 rounded-lg border text-sm ${_e.added>0?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-gray-50 border-gray-200 dark:bg-gray-950/20 dark:border-gray-800"}`,children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"font-medium",children:_e.trackName}),r.jsxs("div",{className:"text-muted-foreground text-xs",children:[_e.membersInTrack," members, ",_e.alreadyInGroup," already synced",_e.added>0&&r.jsxs("span",{className:"text-green-600 dark:text-green-400 ml-2",children:["+",_e.added," added"]})]})]}),_e.inGroupNotTrack&&_e.inGroupNotTrack.length>
43590&&r.jsxs("div",{className:"text-xs text-amber-600 dark:text-amber-400 mt-1",children:["In Google Group but not track: ",_e.inGroupNotTrack.join(", ")]}),_e.errors.length>0&&r.jsxs("div",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["Errors: ",_e.errors.join(", ")]})]},et))})})]}),d?r.jsx(Ft,{children:r.jsx(fn,{className:"pt-6",children:r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(on,{className:"h-8 w-8 animate-spin text-primary"})})})}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-3",children:r.jsx(wn,{className:"text-sm font-medium",children:"Total Tracks"})}),r.jsx(fn,{children:r.jsx("div",{className:"text-2xl font-bold",children:f.length})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-3",children:r.jsx(wn,{className:"text-sm font-medium",children:"Total Track Leads"})}),r.jsx(fn,{children:r.jsx("div",{className:"text-2xl font-bold",children:new Set(b.flatMap(_e=>_e.leads.map(et=>et.memberKey))).size})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-3",children:r.jsx(wn,{className:"text-sm font-medium",children:"Active Members"})}),r.jsx(fn,{children:r.jsx("div",{className:"text-2xl font-bold",children:new Set(b.flatMap(_e=>[..._e.teamMembers,..._e.leads].map(et=>et.memberKey))).size})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-3",children:r.jsx(wn,{className:"text-sm font-medium",children:"Pending Requests"})}),r.jsx(fn,{children:r.jsx("div",{className:"text-2xl font-bold",children:b.reduce((_e,et)=>_e+et.interestedMembers.length,0)})})]})]}),r.jsx("div",{className:"space-y-4",children:b.map(_e=>{const et=f.find(be=>be.id===_e.trackId),Ge=C.has(_e.trackId),ht=`${D}${_e.trackId}@xrguild.org`,ft=!!et?.googleGroup,Mt=et?.googleGroup||ht;return r.jsxs(Ft,{children:[r.jsx(bn,{className:Ge?"":"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>!Ge&&De(_e.trackId),children:r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(wn,{children:_e.trackName}),r.jsxs(an,{variant:"outline",children:[_e.teamMembers.length," ",_e.teamMembers.length===1?"member":"members"]}),_e.interestedMembers.length>0&&r.jsxs(an,{variant:"secondary",children:[_e.interestedMembers.length," pending"]})]}),et?.pitch&&r.jsx(Ln,{className:"mt-2",children:et.pitch}),r.jsxs("div",{className:"mt-1 text-xs text-muted-foreground flex items-center gap-3 flex-wrap",children:[r.jsxs("span",{className:et?.autoWelcome?"text-green-600 dark:text-green-400":"",children:["Auto-welcome: ",et?.autoWelcome?"On":"Off"]}),r.jsx("span",{children:"•"}),r.jsxs("span",{children:["Est. time: ",et?.minHours??1," hrs/mo"]}),r.jsx("span",{children:"•"}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(S1,{className:"h-3 w-3"}),"Digest: ",lt(et?.digestFrequency),et?.digestFrequency&&et.digestFrequency!=="none"&&r.jsxs("span",{className:"text-primary font-medium ml-1",children:["(",Ve(et),")"]})]}),r.jsxs(Fe,{variant:"ghost",size:"sm",className:"h-5 px-1.5 text-xs",onClick:be=>{be.stopPropagation(),qe(_e.trackId)},children:[r.jsx(Fc,{className:"h-3 w-3 mr-1"}),"Preview"]}),et?.ccList&&Array.isArray(et.ccList)&&et.ccList.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:"•"}),r.jsxs("span",{children:["CC: ",X(et.ccList).join(", ")]})]})]})]}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>De(_e.trackId),children:Ge?r.jsx(gl,{className:"h-4 w-4"}):r.jsx(Ja,{className:"h-4 w-4"})})]})}),Ge&&r.jsx(fn,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[r.jsx(na,{className:"h-4 w-4"}),"Team Members (",_e.teamMembers.length+_e.leads.filter(be=>!_e.teamMembers.some(Z=>Z.memberKey===be.memberKey)).length,")"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Eu,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(un,{placeholder:"Search members...",value:I[_e.trackId]||"",onChange:be=>
4359{j(Z=>({...Z,[_e.trackId]:be.target.value}))},className:"pl-8 w-64"})]}),(()=>{const be=Re(_e.trackId),Z=be.length,it=I[_e.trackId]||"",we=it.trim().length>0,st=Z===1,Lt=`${be[0]?.email}-${_e.trackId}-add`,Ot=K.has(Lt),tt=(we?ye.search(it):[]).length-Z;return r.jsxs(r.Fragment,{children:[we&&Z!==1&&r.jsx(an,{variant:Z===0?"destructive":"secondary",children:Z===0?tt>0?`No new matches (${tt} existing)`:"No matches":`${Z} new matches`}),we&&Z===1&&r.jsxs(an,{variant:"default",className:"bg-green-600",children:["1 match: ",Xp(be[0],"admin")]}),r.jsxs(Fe,{size:"sm",onClick:()=>{st&&be[0]&&je(be[0].email,_e.trackId)},disabled:!st||Ot,children:[Ot?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(bo,{className:"h-4 w-4 mr-2"}),"Add Member"]})]})})()]})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[_e.leads.map(be=>{const Z=`${be.email}-${_e.trackId}-remove`,it=`${be.email}-${_e.trackId}-revoke`,we=K.has(Z),st=K.has(it),Lt=Le(be,_e.trackId);return r.jsxs("div",{className:`p-2 rounded-lg flex items-center justify-between gap-2 ${Lt?"bg-yellow-100 dark:bg-yellow-900/30 border-2 border-yellow-400":"bg-muted"}`,children:[r.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[r.jsx(Ld,{email:be.email,profileImageUrl:be.profileImageUrl,size:"sm"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium truncate",children:Xp(be,"admin")}),r.jsxs("div",{className:"flex flex-col text-sm text-muted-foreground",children:[be.guildEmail&&(()=>{const Ot=be.guildEmail.includes("@")?be.guildEmail:`${be.guildEmail}@xrguild.org`;return r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"truncate",children:Ot}),et?.googleGroup&&(ke(Ot,et.googleGroup)?r.jsx(oi,{className:"h-3 w-3 text-green-500 flex-shrink-0",title:"In Google Group"}):r.jsx("span",{className:"text-xs text-orange-500 flex-shrink-0",title:"Not in Google Group",children:"●"}))]})})(),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:`truncate ${be.guildEmail?"text-muted-foreground/60":""}`,children:be.email}),et?.googleGroup&&(ke(be.email,et.googleGroup)?r.jsx(oi,{className:"h-3 w-3 text-green-500 flex-shrink-0",title:"In Google Group"}):be.guildEmail?null:r.jsx("span",{className:"text-xs text-orange-500 flex-shrink-0",title:"Not in Google Group",children:"●"}))]})]})]})]}),r.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[r.jsxs(Fe,{size:"sm",variant:"outline",onClick:()=>gn(be.email,_e.trackId),disabled:st||we,children:[st?r.jsx(on,{className:"h-3 w-3 mr-1 animate-spin"}):null,"Remove Lead"]}),r.jsxs(Fe,{size:"sm",variant:"destructive",onClick:()=>_t(be.email,_e.trackId),disabled:we||st,children:[we?r.jsx(on,{className:"h-3 w-3 mr-1 animate-spin"}):null,"Remove from Track"]})]})]},be.memberKey)}),_e.teamMembers.filter(be=>!_e.leads.some(Z=>Z.memberKey===be.memberKey)).map(be=>{const Z=`${be.email}-${_e.trackId}-remove`,it=`${be.email}-${_e.trackId}-promote`,we=K.has(Z),st=K.has(it),Lt=Le(be,_e.trackId);return r.jsxs("div",{className:`p-2 rounded-lg flex items-center justify-between gap-2 ${Lt?"bg-yellow-100 dark:bg-yellow-900/30 border-2 border-yellow-400":"bg-muted/50"}`,children:[r.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[r.jsx(Ld,{email:be.email,profileImageUrl:be.profileImageUrl,size:"sm"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium truncate",children:Xp(be,"admin")}),r.jsxs("div",{className:"flex flex-col text-sm text-muted-foreground",children:[be.guildEmail&&(()=>{const Ot=be.guildEmail.includes("@")?be.guildEmail:`${be.guildEmail}@xrguild.org`;return r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"truncate",children:Ot}),et?.googleGroup&&(ke(Ot,et.googleGroup)?r.jsx(oi,{className:"h-3 w-3 text-green-500 flex-shrink-0",title:"In Google Group"}):r.jsx("span",{className:"text-xs text-orange-500 flex-shrink-0",title:"Not in Google Group",children:"●"}))]})})(),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:`truncate ${be.guildEmail?"text-muted-foreground
4359/60":""}`,children:be.email}),et?.googleGroup&&(ke(be.email,et.googleGroup)?r.jsx(oi,{className:"h-3 w-3 text-green-500 flex-shrink-0",title:"In Google Group"}):be.guildEmail?null:r.jsx("span",{className:"text-xs text-orange-500 flex-shrink-0",title:"Not in Google Group",children:"●"}))]})]})]})]}),r.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[r.jsxs(Fe,{size:"sm",variant:"outline",onClick:()=>Kt(be.email,_e.trackId),disabled:st||we,children:[st?r.jsx(on,{className:"h-3 w-3 mr-1 animate-spin"}):null,"Add Lead"]}),r.jsxs(Fe,{size:"sm",variant:"destructive",onClick:()=>_t(be.email,_e.trackId),disabled:we||st,children:[we?r.jsx(on,{className:"h-3 w-3 mr-1 animate-spin"}):null,"Remove from Track"]})]})]},be.memberKey)})]}),_e.teamMembers.length===0&&_e.leads.length===0&&r.jsx("div",{className:"text-center py-6 text-muted-foreground border-2 border-dashed rounded-lg",children:r.jsx("p",{className:"text-sm",children:"No members yet. Use the search above to add members to this track."})})]}),r.jsxs("div",{children:[r.jsxs("h4",{className:"font-semibold mb-3 flex items-center gap-2",children:[r.jsx(Cr,{className:"h-4 w-4"}),"Google Group"]}),r.jsxs("div",{className:"space-y-3",children:[!ft&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Group Name"}),r.jsx(un,{value:P[_e.trackId]||"",onChange:async be=>{const Z=be.target.value.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");if(z(it=>({...it,[_e.trackId]:Z})),Z){const it=et?.googleGroup||`${D}${Z}@xrguild.org`;await fe(_e.trackId,it)}else q(it=>({...it,[_e.trackId]:{exists:!1}}))},placeholder:"group-name",disabled:A.has(_e.trackId),className:"font-mono text-sm"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Resulting Email Address"}),r.jsx("div",{className:"flex items-center h-10 px-3 bg-muted/30 rounded-md border",children:r.jsx("span",{className:"text-sm font-mono",children:et?.googleGroup?et.googleGroup:`${D}${P[_e.trackId]||"group-name"}@xrguild.org`})})]})]}),(()=>{const be=et?.googleGroup||`${D}${P[_e.trackId]||""}@xrguild.org`,Z=U[_e.trackId],it=Z?.exists,we=Z?.memberCount||0,st=Z?.importableCount??we,Lt=A.has(_e.trackId);if(it){const Ot=ve[_e.trackId],Et=!!Ot,tt=st===0;return r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:`p-2 rounded-md border ${tt?"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800":"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"}`,children:r.jsx("p",{className:`text-sm ${tt?"text-green-900 dark:text-green-100":"text-blue-900 dark:text-blue-100"}`,children:tt?r.jsxs(r.Fragment,{children:["✅ This Google Group is synced with the track (",we," member",we!==1?"s":"",")."]}):r.jsxs(r.Fragment,{children:["ℹ️ This Google Group exists with ",we," member",we!==1?"s":"",". ",st," can be imported to track."]})})}),!tt&&r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{onClick:()=>Be(_e.trackId,be),disabled:Lt,size:"sm",variant:"default",children:[Lt?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(na,{className:"h-4 w-4 mr-2"}),"Import ",st," Member",st!==1?"s":""," to Track"]}),r.jsx(Fe,{onClick:()=>{e({title:"Coming Soon",description:"Sync functionality will be available soon"})},disabled:Lt,size:"sm",variant:"outline",children:"Sync (Coming Soon)"})]}),Et&&r.jsxs("div",{className:"p-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md",children:[r.jsx("p",{className:"text-sm text-green-900 dark:text-green-100 mb-2",children:"✅ Import complete! You can now email members:"}),r.jsxs("div",{className:"flex gap-2",children:[Ot.addedEmails&&Ot.addedEmails.length>0&&r.jsxs(Fe,{onClick:()=>{const ge=`mailto:?bcc=${Ot.addedEmails.join(",")}`;window.location.href=ge},size:"sm",variant:"outline",children:[r.jsx(Cr,{className:"h-4 w-4 mr-2"}),"Email Members (",Ot.addedEmails.length,")"]}
4359),Ot.notFoundEmails&&Ot.notFoundEmails.length>0&&r.jsxs(Fe,{onClick:()=>{const ge=`mailto:?bcc=${Ot.notFoundEmails.join(",")}`;window.location.href=ge},size:"sm",variant:"outline",children:[r.jsx(Cr,{className:"h-4 w-4 mr-2"}),"Email Non-Members (",Ot.notFoundEmails.length,")"]})]})]})]})}else return r.jsxs(Fe,{onClick:()=>Ze(_e.trackId),disabled:Lt||!P[_e.trackId],size:"sm",children:[Lt?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(ko,{className:"h-4 w-4 mr-2"}),"Create Group"]})})()]}),ft&&r.jsx("div",{className:"p-3 bg-muted/30 rounded-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Current Group"}),r.jsx("a",{href:`mailto:${Mt}`,className:"text-primary hover:underline font-medium",children:Mt})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{size:"sm",variant:"outline",onClick:()=>rt(_e.trackId,Mt),disabled:A.has(_e.trackId),children:[A.has(_e.trackId)?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):r.jsx(bo,{className:"h-4 w-4 mr-2"}),"Import Members"]}),r.jsxs(Fe,{size:"sm",variant:"destructive",onClick:()=>ue(_e.trackId,Mt),disabled:A.has(_e.trackId),children:[r.jsx(gu,{className:"h-4 w-4 mr-2"}),"Delete Group"]})]})]})})]})]}),_e.interestedMembers.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:["Interested Members (",_e.interestedMembers.length,")"]}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>oe(_e.trackId),children:F.has(_e.trackId)?r.jsx(gl,{className:"h-4 w-4"}):r.jsx(Ja,{className:"h-4 w-4"})})]}),F.has(_e.trackId)&&r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:_e.interestedMembers.map(be=>r.jsxs("div",{className:"p-3 border border-dashed rounded-lg flex items-center gap-3",children:[r.jsx(Ld,{email:be.email,profileImageUrl:be.profileImageUrl,size:"sm"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium truncate",children:Xp(be,"admin")}),r.jsx("div",{className:"text-sm text-muted-foreground truncate",children:be.primaryEmail||be.email})]})]},be.memberKey))})]})]})})]},_e.trackId)})})]}),r.jsx(Sa,{open:!!wt,onOpenChange:_e=>!_e&&Nt(null),children:r.jsxs(da,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(ha,{children:[r.jsxs(ma,{className:"flex items-center gap-2",children:[r.jsx(Fc,{className:"h-5 w-5"}),"Digest Preview: ",vt?.track?.name||"Loading..."]}),r.jsx(Fa,{children:"This is a preview of what would be sent. No email is sent and no state is changed."})]}),Wt&&!vt?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(on,{className:"h-8 w-8 animate-spin text-primary"})}):vt?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[r.jsxs(an,{variant:vt.queueInfo?.totalEvents>0?"default":"secondary",children:[vt.queueInfo?.totalEvents||0," events in queue"]}),r.jsxs(an,{variant:vt.queueInfo?.pendingCount>0?"default":"outline",children:[vt.queueInfo?.pendingCount||0," pending"]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Frequency: ",lt(vt.track?.digestFrequency)]}),vt.nextDigestAt&&r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Next due: ",new Date(vt.nextDigestAt).toLocaleString()]}),vt.track?.lastDigestSent&&r.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last sent: ",new Date(vt.track.lastDigestSent).toLocaleString()]})]}),vt.rawEvents&&vt.rawEvents.length>0?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("h4",{className:"font-semibold text-sm flex items-center justify-between",children:[r.jsx("span",{children:"Recent Events (newest first)"}),r.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["Showing ",vt.rawEvents.length," of ",vt.pagination?.totalCount||0]})]}),r.jsx("div",{className:"space-y-1 max-h-72 overflow-y-auto border rounded-lg p-2",children:vt.rawEvents.map((_e,et)=>{const Ge=vt.memberDetails?.[_e.m];return r.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted/50 text-sm",children:[r.jsx("span",{className:"text-xs text-muted-foreground w-24 flex-shrink-0",children:new Date(_e.ts).toLocaleStr
4359ing(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),r.jsx(an,{variant:Ee(_e.t),className:"text-xs py-0 w-24 justify-center flex-shrink-0",children:gt(_e.t)}),r.jsx("span",{className:"flex-1 min-w-0 truncate",children:Ge?.name||_e.m.slice(0,12)+"..."}),Ge?.email&&r.jsx("span",{className:"text-xs text-muted-foreground truncate max-w-32",children:Ge.email}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["by ",_e.a===null?"self":Ge?.actorEmail||`admin#${_e.a}`]})]},`${_e.ts}-${et}`)})}),vt.pagination?.hasMore&&r.jsx("div",{className:"flex justify-center pt-2",children:r.jsxs(Fe,{variant:"outline",size:"sm",onClick:It,disabled:Wt,children:[Wt?r.jsx(on,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Load 20 more"]})})]}):r.jsx("div",{className:"p-4 text-center text-muted-foreground border rounded-lg",children:"No events in queue. Changes will appear here when members join, leave, or are promoted/revoked."}),vt.auditLogs&&vt.auditLogs.length>0&&r.jsxs("div",{className:"p-4 bg-blue-50 dark:bg-blue-950/20 rounded-lg border border-blue-200 dark:border-blue-800",children:[r.jsxs("h4",{className:"font-semibold text-sm mb-2",children:["Audit Trail (",vt.auditLogs.length," entries):"]}),r.jsx("div",{className:"space-y-1 text-sm max-h-32 overflow-y-auto",children:vt.auditLogs.map((_e,et)=>r.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:new Date(_e.timestamp).toLocaleTimeString()}),r.jsx(an,{variant:"outline",className:"text-xs py-0",children:_e.action}),r.jsxs("span",{children:["by ",_e.actorEmail]}),_e.memberName&&r.jsxs("span",{className:"text-muted-foreground",children:["→ ",_e.memberName]})]},et))})]}),vt.emailBody&&r.jsxs("details",{className:"space-y-2",children:[r.jsx("summary",{className:"font-semibold text-sm cursor-pointer hover:text-primary",children:"Email Body Preview"}),r.jsx("div",{className:"p-4 bg-white dark:bg-gray-900 rounded-lg border max-h-64 overflow-y-auto",children:r.jsx("pre",{className:"text-xs whitespace-pre-wrap font-mono",children:vt.emailBody})})]})]}):r.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"Failed to load digest preview."})]})})]})}):null}function H_(){const t=_r(),{sessionId:e,user:n}=ia(),a=Po(),{toast:i}=nr(),[s,o]=x.useState([]),[c,d]=x.useState(!1),[m,f]=x.useState(!1),[p,b]=x.useState(!1),[v,C]=x.useState(0),[S,F]=x.useState(!1),[w,A]=x.useState(0),N=n?.role==="SUPER_ADMIN"||n?.role==="SUPPORT_ADMIN";x.useEffect(()=>{N&&P()},[N]),x.useEffect(()=>{if(!p||!N||!e)return;const K=setInterval(async()=>{try{const B=await a(`/api/admin-auth/data-version?sessionId=${e}`);if(!B.ok){console.error("Failed to poll data version");return}const O=(await B.json()).changeCounter;if(v===0){C(O);return}if(O>v){const I=O-v;A(I),F(!0)}}catch(B){console.error("Error polling data version:",B)}},5e3);return()=>clearInterval(K)},[p,N,e,v]);const P=async()=>{try{d(!0);const K=await a("/api/admin-auth/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminSessionId:e,limit:1e3})});if(!K.ok)throw new Error("Failed to load logs");const B=await K.json();o(B.logs||[])}catch(K){i({variant:"destructive",title:"Error",description:K instanceof Error?K.message:"Failed to load logs"})}finally{d(!1)}},z=async()=>{await P();try{const K=await a(`/api/admin-auth/data-version?sessionId=${e}`);if(K.ok){const B=await K.json();C(B.changeCounter)}}catch(K){console.error("Error updating counter after reload:",K)}F(!1),A(0)},D=async()=>{if(!m){f(!0);try{await P(),i({title:"Refreshed",description:"Audit logs have been refreshed"})}finally{f(!1)}}},T=()=>
4359{try{const K=["Timestamp","Actor Email","Actor Type","Action","IP Address","Device","Details"],B=s.map(U=>[new Date(U.timestamp).toISOString(),U.actorEmail||U.adminEmail,U.actorType||"admin",U.action,U.ipAddress,U.device||"",JSON.stringify(U.details||{})]),k=[K.join(","),...B.map(U=>U.map(q=>`"${q}"`).join(","))].join(`
4360`),O=new Blob([k],{type:"text/csv"}),I=URL.createObjectURL(O),j=document.createElement("a");j.href=I,j.download=`audit-logs-${new Date().toISOString()}.csv`,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(I),i({title:"Exported",description:"Audit logs exported successfully"})}catch{i({variant:"destructive",title:"Export Failed",description:"Failed to export audit logs"})}};return N?r.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[r.jsx(Lo,{title:"Admin Service Logs",subtitle:"Admin authentication and permission changes (last 1000 entries)",adminEmail:n?.email,adminRole:n?.role,onLogout:async()=>{t("/admin/login")}}),r.jsxs("div",{className:"flex justify-end items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"watch-page",checked:p,onCheckedChange:K=>b(K)}),r.jsx(Ht,{htmlFor:"watch-page",className:"text-sm cursor-pointer",children:"Watch this page"})]}),r.jsxs(Fe,{onClick:T,variant:"outline",disabled:s.length===0,children:[r.jsx(F1,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),r.jsxs(Fe,{onClick:D,variant:"outline",disabled:m,children:[r.jsx(Rr,{className:`w-4 h-4 mr-2 ${m?"animate-spin":""}`}),m?"Refreshing...":"Refresh"]})]}),S&&r.jsx("div",{className:"fixed top-4 right-4 z-50 max-w-md",children:r.jsx(Ft,{className:"border-primary shadow-lg",children:r.jsx(fn,{className:"p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(u3,{className:"w-5 h-5 text-primary flex-shrink-0"}),r.jsx("div",{className:"flex-1",children:r.jsxs("p",{className:"text-sm font-medium",children:[w," ",w===1?"update":"updates"," since last refresh"]})}),r.jsx(Fe,{onClick:z,size:"sm",className:"ml-2",children:"Reload"})]})})})}),r.jsx(bM,{logs:s,loading:c,title:"Admin Service Activity",description:"Authentication, passkey registration, role changes, and admin permission updates. Use the search box to find specific events.",showEventFilters:!0,maxHeight:"calc(100vh - 300px)"})]}):r.jsx("div",{className:"max-w-7xl mx-auto p-6",children:r.jsxs("div",{className:"text-center py-12",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),r.jsx("p",{className:"text-gray-600 mt-2",children:"Only SUPER_ADMIN and SUPPORT_ADMIN can view audit logs"}),r.jsx(Fe,{onClick:()=>t("/admin/dashboard"),className:"mt-4",children:"Back to Dashboard"})]})})}const cc=[{value:"TRACK_MEMBER_APPROVED",label:"Member Approved",color:"bg-green-100 text-green-800",icon:bo},{value:"TRACK_MEMBER_REMOVED",label:"Member Removed",color:"bg-red-100 text-red-800",icon:Cm},{value:"TRACK_MEMBER_JOINED",label:"Member Joined",color:"bg-blue-100 text-blue-800",icon:bo},{value:"TRACK_MEMBER_LEFT",label:"Member Left",color:"bg-orange-100 text-orange-800",icon:Cm},{value:"TRACK_REQUESTED",label:"Track Requested",color:"bg-cyan-100 text-cyan-800",icon:bo},{value:"TRACK_REQUEST_WITHDRAWN",label:"Request Withdrawn",color:"bg-gray-100 text-gray-800",icon:Cm},{value:"TRACK_LEAD_PROMOTED",label:"Lead Promoted",color:"bg-purple-100 text-purple-800",icon:fF},{value:"TRACK_LEAD_REVOKED",label:"Lead Revoked",color:"bg-yellow-100 text-yellow-800",icon:fF},{value:"TRACK_INFO_UPDATED",label:"Track Updated",color:"bg-indigo-100 text-indigo-800",icon:_P},{value:"TRACK_EMAIL_SENT",label:"Email Sent",color:"bg-pink-100 text-pink-800",icon:Cr}],Yq={admin:"Admin",track_lead:"Track Lead",member:"Member",system:"System"};function qq(){const t=_r(),{sessionId:e,user:n}=ia(),a=Po(),{toast:i}=nr(),[s,o]=x.useState([]),[c,d]=x.useState(!1),[m,f]=x.useState(!1),[p,b]=x.useState(""),[v,C]=x.useState("all"),[S,F]=x.useState(new Set(cc.map(j=>j.value))),w=x.useMemo(()=>{const j=new Map;return s.forEach(U=>{U.trackId&&U.trackName&&j.set(U.trackId,U.trackName)}),Array.from(j.entries()).sort((U,q)=>U[1].localeCompare(q[1]))},[s]),A=n?.role==="SUPER_ADMIN"||n?.role==="SUPPORT_ADMIN"||n?.role==="TRACK_LEAD";x.useEffect(()=>{A&&N()},[A]);const N=async()=>{try{d(!0);const j=await a("/api/admin/track-audit-logs?limit=500");if(!j.ok)throw new Error("Failed to load track activity logs");const U=await j.json();o(U.logs||[])}catch(j){i({variant:"destructive",title:"Error",description:j instanceof Error?j.message:"Failed to load logs"})}finally{d(!1)}}
4360,P=async()=>{if(!m){f(!0);try{await N(),i({title:"Refreshed",description:"Track activity logs have been refreshed"})}finally{f(!1)}}},z=()=>{try{const j=["Timestamp","Track","Action","Actor Type","Actor Email","Member","Member Email","Details"],U=s.map(J=>[new Date(J.timestamp).toISOString(),J.trackName,J.action,J.actorType,J.actorEmail,J.memberName||"",J.memberEmail||"",JSON.stringify(J.details||{})]),q=[j.join(","),...U.map(J=>J.map(ie=>`"${ie}"`).join(","))].join(`
4361`),Y=new Blob([q],{type:"text/csv"}),W=URL.createObjectURL(Y),H=document.createElement("a");H.href=W,H.download=`track-activity-${new Date().toISOString()}.csv`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(W),i({title:"Exported",description:"Track activity logs exported successfully"})}catch{i({variant:"destructive",title:"Export Failed",description:"Failed to export logs"})}},D=j=>{const U=new Set(S);U.has(j)?U.delete(j):U.add(j),F(U)},T=()=>{S.size===cc.length?F(new Set):F(new Set(cc.map(j=>j.value)))},K=x.useMemo(()=>{let j=s;if(j=j.filter(U=>S.has(U.action)),v!=="all"&&(j=j.filter(U=>U.trackId===v)),p.trim()){const U=p.toLowerCase();j=j.filter(q=>!!(q.actorEmail?.toLowerCase().includes(U)||q.memberEmail?.toLowerCase().includes(U)||q.memberName?.toLowerCase().includes(U)||q.trackName?.toLowerCase().includes(U)))}return j},[s,p,v,S]),B=j=>cc.find(q=>q.value===j)?.color||"bg-gray-100 text-gray-800",k=j=>cc.find(q=>q.value===j)?.label||j,O=j=>{if(!j)return null;const U=[];let q=j,Y=0;for(;q.length>0;){const W=q.match(/^\[-(.+?)-\]/);if(W){U.push(r.jsx("span",{className:"line-through text-red-400 dark:text-red-300 px-0.5",children:W[1]},Y++)),q=q.substring(W[0].length);continue}const H=q.match(/^\[\+(.+?)\+\]/);if(H){U.push(r.jsx("span",{className:"text-green-600 dark:text-green-400 font-medium px-0.5",children:H[1]},Y++)),q=q.substring(H[0].length);continue}const J=q.search(/\[-|\[\+/);if(J===-1){U.push(r.jsx("span",{children:q},Y++));break}else U.push(r.jsx("span",{children:q.substring(0,J)},Y++)),q=q.substring(J)}return r.jsx(r.Fragment,{children:U})},I=j=>{const U=j.actorEmail||"Unknown",q=Yq[j.actorType]||j.actorType,Y=j.memberName||j.memberEmail||"unknown member";switch(j.action){case"TRACK_MEMBER_APPROVED":return`${q} (${U}) approved ${Y}`;case"TRACK_MEMBER_REMOVED":return`${q} (${U}) removed ${Y}`;case"TRACK_MEMBER_JOINED":return`${Y} joined via ${j.details?.source||"auto-welcome"}`;case"TRACK_MEMBER_LEFT":return`${Y} left voluntarily`;case"TRACK_REQUESTED":return`${Y} requested to join`;case"TRACK_REQUEST_WITHDRAWN":return`${Y} withdrew their request`;case"TRACK_LEAD_PROMOTED":return`${q} (${U}) promoted ${Y} to track lead`;case"TRACK_LEAD_REVOKED":return`${q} (${U}) revoked track lead status from ${Y}`;case"TRACK_INFO_UPDATED":const W=j.details?.field||"settings";return`${q} (${U}) updated ${W}`;case"TRACK_EMAIL_SENT":const H=j.details?.recipientCount||0,J=j.details?.subject?`"${j.details.subject}"`:"";return`${q} (${U}) sent email to ${H} recipient${H!==1?"s":""} ${J}`;default:return`${U} performed ${j.action}`}};return A?r.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[r.jsx(Lo,{title:"Track Activity",subtitle:"Track membership and configuration changes",adminEmail:n?.email,adminRole:n?.role,onLogout:async()=>{t("/admin/login")}}),r.jsxs("div",{className:"flex justify-end items-center gap-4",children:[r.jsxs(Fe,{onClick:z,variant:"outline",disabled:s.length===0,children:[r.jsx(F1,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),r.jsxs(Fe,{onClick:P,variant:"outline",disabled:m,children:[r.jsx(Rr,{className:`w-4 h-4 mr-2 ${m?"animate-spin":""}`}),m?"Refreshing...":"Refresh"]})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(na,{className:"w-5 h-5"}),"Track Membership Changes"]}),r.jsx(Ln,{children:"Members joining or leaving tracks, lead promotions, and settings updates. Shows who made each change and when."}),r.jsxs("div",{className:"flex flex-wrap gap-4 mt-4",children:[r.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[r.jsx(Eu,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),r.jsx(un,{placeholder:"Search by name, email, or track...",value:p,onChange:j=>b(j.target.value),className:"pl-10"})]}),r.jsxs(Sl,{value:v,onValueChange:C,children:[r.jsx(To,{className:"w-[200px]",children:r.jsx(Fl,{placeholder:"All Tracks"})}),r.jsxs(Mo,{children:[r.jsx(ta,{value:"all",children:"All Tracks"}),w.map(([j,U])=>r.jsx(ta,{value:j,children:U},j))]})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:T,className:`h-7 text-xs ${S.size===cc.length?"bg-green-600 text-white hover:bg-green-700 border-green-600":"border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:"All"}),cc.map(j=>r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>
4361D(j.value),className:`h-7 text-xs ${S.has(j.value)?"bg-green-600 text-white hover:bg-green-700 border-green-600":"border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:j.label},j.value))]}),r.jsxs("div",{className:"text-sm text-muted-foreground mt-2",children:["Showing ",K.length," of ",s.length," entries"]})]}),r.jsx(fn,{children:c?r.jsx("p",{className:"text-center text-gray-500 py-4",children:"Loading..."}):r.jsxs("div",{className:"space-y-2 overflow-y-auto",style:{maxHeight:"calc(100vh - 450px)"},children:[K.map((j,U)=>r.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 text-sm hover:bg-gray-100 dark:hover:bg-gray-750 transition-colors",children:[r.jsxs("div",{className:"flex justify-between items-start gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx(an,{className:B(j.action),children:k(j.action)}),r.jsx(an,{variant:"secondary",className:"text-xs",children:j.trackName}),r.jsx("span",{className:"text-muted-foreground",children:I(j)})]}),r.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[j.memberEmail&&r.jsx(Ld,{email:j.memberEmail,displayName:j.memberName,size:"sm"}),r.jsx("div",{className:"text-right text-xs text-muted-foreground whitespace-nowrap",children:new Date(j.timestamp).toLocaleString()})]})]}),j.action==="TRACK_INFO_UPDATED"&&j.details?.diff&&r.jsx("div",{className:"text-xs mt-1 font-mono bg-muted px-2 py-1 rounded",children:O(j.details.diff)}),j.details&&Object.keys(j.details).length>0&&j.action!=="TRACK_INFO_UPDATED"&&r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:JSON.stringify(j.details)})]},U)),K.length===0&&!c&&r.jsx("p",{className:"text-center text-gray-500 py-8",children:p||v!=="all"||S.size<cc.length?"No logs match your filters":"No track activity logs found yet. Changes will appear here as they happen."})]})})]})]}):r.jsx("div",{className:"max-w-7xl mx-auto p-6",children:r.jsxs("div",{className:"text-center py-12",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Access Denied"}),r.jsx("p",{className:"text-gray-600 mt-2",children:"You don't have permission to view track activity logs"}),r.jsx(Fe,{onClick:()=>t("/admin/dashboard"),className:"mt-4",children:"Back to Dashboard"})]})})}function Jq({memberEmail:t,sessionId:e}){const{toast:n}=nr(),[a,i]=x.useState([]),[s,o]=x.useState(""),[c,d]=x.useState(""),[m,f]=x.useState(!1),[p,b]=x.useState(!0),[v,C]=x.useState(!1),[S,F]=x.useState(!1),[w,A]=x.useState("preview"),[N,P]=x.useState(!1),[z,D]=x.useState(""),[T,K]=x.useState(""),[B,k]=x.useState(!1),[O,I]=x.useState(""),[j,U]=x.useState(""),[q,Y]=x.useState(!1),W=a.find(pe=>pe.templateId===s);x.useEffect(()=>{H()},[]),x.useEffect(()=>{W&&(d(W.emailText),f(W.ccTrackLeads??!1))},[W]);const H=async()=>{b(!0);try{const pe=await fetch("/api/admin/email-templates",{headers:{"X-Session-ID":e}}),Me=await pe.json();pe.ok&&Me.success?(i(Me.templates),Me.templates.length>0&&!s&&o(Me.templates[0].templateId)):n({title:"Error",description:"Failed to load email templates",variant:"destructive"})}catch(pe){console.error("Error fetching templates:",pe),n({title:"Error",description:"An error occurred while loading templates",variant:"destructive"})}finally{b(!1)}},J=async()=>{if(s){C(!0);try{const pe=await fetch(`/api/admin/email-templates/${s}`,{method:"PUT",headers:{"Content-Type":"application/json","X-Session-ID":e},body:JSON.stringify({emailText:c,ccTrackLeads:m,lastEditedBy:t})}),Me=await pe.json();pe.ok&&Me.success?(n({title:"Success",description:"Email template updated successfully"}),H()):n({title:"Error",description:Me.message||"Failed to update template",variant:"destructive"})}catch(pe){console.error("Error saving template:",pe),n({title:"Error",description:"An error occurred while saving the template",variant:"destructive"})}finally{C(!1)}}},ie=W&&(c!==W.emailText||m!==(W.ccTrackLeads??!1)),Q=async()=>{if(!(!O||!j)){Y(!0);try{const pe=await fetch("/api/admin/email-templates",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":e},body:JSON.stringify({templateId:O,description:j,createdBy:t})}),Me=await pe.json();pe.ok&&Me.success?(n({title:"Template Created",description:`Template "${O}" created successfully`}),k(!1),I(""),U(""),await H(),o(O)):n({title:"Error",description:Me.message||"Failed to create template",variant:"destructive"})}catch(pe){console.error("Error creating template:",pe),n({title:"Error",description:"An error occurred while creating the template",variant:"destructive"})}finally{Y(!1)}}},ve=async()=>
4361{if(c){F(!0);try{const pe=await fetch("/api/admin/email-templates/test",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":e},body:JSON.stringify({emailText:c,mode:w,adminEmail:t})}),Me=await pe.json();pe.ok&&Me.success?(D(Me.subject),K(Me.body),P(!0),w==="log"?n({title:"Test Email Logged",description:"Email has been written to the log file"}):w==="email"&&n({title:"Test Email Sent",description:`Email sent to ${t}`})):n({title:"Error",description:Me.message||"Failed to test email template",variant:"destructive"})}catch(pe){console.error("Error testing template:",pe),n({title:"Error",description:"An error occurred while testing the template",variant:"destructive"})}finally{F(!1)}}};return p?r.jsx(Ft,{children:r.jsx(fn,{className:"flex items-center justify-center py-8",children:r.jsx(on,{className:"h-6 w-6 animate-spin"})})}):r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Cr,{className:"h-5 w-5"}),r.jsx(wn,{children:"Email Template Editor"})]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>k(!0),children:[r.jsx(ko,{className:"h-4 w-4 mr-1"}),"Add Template"]})]}),r.jsxs(Ln,{children:['Edit email templates that are sent to members. First line is the subject (prefix with "Subject:" if desired). Use variables like ',"{name}",", ","{firstName}",", ","{email}",", etc."]})]}),r.jsxs(fn,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{children:"Select Template"}),r.jsxs(Sl,{value:s,onValueChange:o,children:[r.jsx(To,{children:r.jsx(Fl,{placeholder:"Choose an email template"})}),r.jsx(Mo,{children:a.map(pe=>r.jsxs(ta,{value:pe.templateId,children:[pe.description," ",r.jsxs("span",{className:"text-muted-foreground",children:["(",pe.templateId,")"]})]},pe.templateId))})]})]}),W&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"emailText",children:"Email Content"}),r.jsx(zi,{id:"emailText",value:c,onChange:pe=>d(pe.target.value),className:"min-h-[300px] font-mono text-sm",placeholder:"Subject line on first line, then email body..."}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"First line is the subject. Remaining lines are the email body."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{children:"Available Variables"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{name}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{displayName}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{firstName}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{lastName}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{preferredName}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{email}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{oldEmail}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{newEmail}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{domain}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{guildEmail}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{password}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{loginUrl}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{activationUrl}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{verificationCode}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{trackName}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{trackList}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{leads}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{leadEmails}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{totalHours}"}),r.jsx("code",{className:"px-2 py-1 bg-muted rounded text-xs",children:"{trackPlural}"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2 pt-2 border-t",children:[r.jsx(ar,{id:"ccTrackLeads",checked:m,onCheckedChange:pe=>f(pe===!0)}),r.jsx(Ht,{htmlFor:"ccTrackLeads",className:"cursor-pointer",children:"CC track leads when sending this email"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-1 pt-2 border-t",children:[r.jsxs("p",{children:[r.jsx("strong",{children:"Template ID:"})," ",W.templateId]}),r.jsxs("p",{children:[r.jsx("strong",{children:"Last edited by:"})," ",W.lastEditedBy]}),r.jsxs("p",{children:[r.jsx("strong",{children:"Last modified:"}
4361)," ",new Date(W.Modified).toLocaleString()]})]}),r.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[r.jsx(Ht,{children:"Test Mode"}),r.jsx(kx,{value:w,onValueChange:pe=>A(pe),children:r.jsxs("div",{className:"flex items-center space-x-6",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xl,{value:"preview",id:"mode-preview"}),r.jsx(Ht,{htmlFor:"mode-preview",className:"font-normal cursor-pointer",children:"Preview"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xl,{value:"log",id:"mode-log"}),r.jsx(Ht,{htmlFor:"mode-log",className:"font-normal cursor-pointer",children:"Log"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(xl,{value:"email",id:"mode-email"}),r.jsxs(Ht,{htmlFor:"mode-email",className:"font-normal cursor-pointer",children:["Email (to ",t,")"]})]})]})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview: View rendered email • Log: Write to file • Email: Send to your email"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{onClick:ve,variant:"outline",className:"flex-1",disabled:S,children:[S?r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}):w==="preview"?r.jsx(Fc,{className:"mr-2 h-4 w-4"}):r.jsx(tx,{className:"mr-2 h-4 w-4"}),"Test"]}),r.jsxs(Fe,{onClick:J,disabled:v||!ie,className:"flex-1",children:[v&&r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Template"]})]}),!ie&&r.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"No changes to save"})]})]}),r.jsx(Sa,{open:N,onOpenChange:P,children:r.jsxs(da,{className:"max-w-2xl",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Email Preview"}),r.jsx(Fa,{children:"Preview of how the email will look with sample data"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Ht,{className:"text-sm font-semibold",children:"Subject:"}),r.jsx("p",{className:"mt-1 p-3 bg-muted rounded",children:z})]}),r.jsxs("div",{children:[r.jsx(Ht,{className:"text-sm font-semibold",children:"Body:"}),r.jsx("pre",{className:"mt-1 p-3 bg-muted rounded whitespace-pre-wrap font-sans text-sm",children:T})]})]})]})}),r.jsx(Sa,{open:B,onOpenChange:k,children:r.jsxs(da,{className:"max-w-md",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Add New Email Template"}),r.jsx(Fa,{children:'Create a new email template. The ID should be lowercase with hyphens (e.g., "member-welcome").'})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"newTemplateId",children:"Template ID"}),r.jsx(un,{id:"newTemplateId",value:O,onChange:pe=>I(pe.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:"e.g., guild-email-verification",className:"font-mono"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Lowercase letters, numbers, and hyphens only. This will be the unique identifier."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"newTemplateDescription",children:"Description"}),r.jsx(un,{id:"newTemplateDescription",value:j,onChange:pe=>U(pe.target.value),placeholder:"e.g., Guild Email Verification"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Human-readable name shown in the template selector dropdown."})]})]}),r.jsxs(_o,{children:[r.jsx(Fe,{variant:"outline",onClick:()=>k(!1),children:"Cancel"}),r.jsxs(Fe,{onClick:Q,disabled:q||!O||!j,children:[q&&r.jsx(on,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Template"]})]})]})})]})}function Xq(){const t=_r(),{isAuthenticated:e,adminEmail:n,adminRole:a,sessionId:i,logout:s}=ia();return x.useEffect(()=>{e&&a!=="SUPPORT_ADMIN"&&a!=="SUPER_ADMIN"&&t("/admin")},[e,a,t]),e?r.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 p-8",children:r.jsxs("div",{className:"container mx-auto max-w-4xl",children:[r.jsx(Lo,{title:"Email Templates",subtitle:"Edit automated email templates sent to members",adminEmail:n,adminRole:a,onLogout:s}),r.jsx("main",{children:r.jsx(Jq,{memberEmail:n||"",sessionId:i||""})})]})}):null}var aS="Progress",iS=100,[Zq]=Xa(aS),[Qq,eJ]=Zq(aS),c4=x.forwardRef((t,e)=>{const{__scopeProgress:n,value:a=null,max:i,getValueLabel:s=tJ,...o}=t;(i||i===0)&&!W_(i)&&console.error(nJ(`${i}`,"Progress"));const c=W_(i)?i:iS;a!==null&&!V_(a,c)&&console.error(rJ(`${a}`,"Progress"));const d=V_(a,c)?a:null,m=zg(d)?s(d,c):void 0;return r.jsx(Qq,{scope:n,value:d,max:c,children:r.jsx(Tn.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":zg(d)?d:void 0,"aria-valuetext":m,role:"progressbar","data-state":h4(d,c),"data-value":d??void 0,"data-max":c,...o,ref:e})})});c4.displayName=aS;var u4="ProgressIndicator",d4=x.forwardRef((t,e)=>{const{__scopeProgress:n,...a}=t,i=eJ(u4,n);return r.jsx(Tn.div,{"data-state":h4(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...a,ref:e})});d4.displayName=u4;function tJ(t,e){return`${Math.round(t/e*100)}%`}function h4(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function zg(t){return typeof t=="number"}function W_(t){return zg(t)&&!isNaN(t)&&t>0}function V_(t,e){return zg(t)&&!isNaN(t)&&t<=e&&t>=0}function nJ(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${iS}\`.`}function rJ(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
4362  - a positive number
4363  - less than the value passed to \`max\` (or ${iS} if no \`max\` prop is set)
4364  - \`null\` or \`undefined\` if the progress is indeterminate.
4365
4366Defaulting to \`null\`.`}var m4=c4,aJ=d4;const f4=x.forwardRef(({className:t,value:e,...n},a)=>r.jsx(m4,{ref:a,className:ln("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:r.jsx(aJ,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));
4366f4.displayName=m4.displayName;var iJ=[{name:"Aegean Airlines",iataCode:"A3"},{name:"Aeroflot",iataCode:"SU"},{name:"Aerolineas Argentinas",iataCode:"AR"},{name:"Aeromexico",iataCode:"AM"},{name:"Air Algerie",iataCode:"AH"},{name:"Air Arabia",iataCode:"G9"},{name:"Air Canada",iataCode:"AC"},{name:"Air China",iataCode:"CA"},{name:"Air Europa",iataCode:"UX"},{name:"Air France",iataCode:"AF"},{name:"Air India",iataCode:"AI"},{name:"Air Mauritius",iataCode:"MK"},{name:"Air New Zealand",iataCode:"NZ"},{name:"Air Niugini",iataCode:"PX"},{name:"Air Tahiti",iataCode:"VT"},{name:"Air Tahiti Nui",iataCode:"TN"},{name:"Air Transat",iataCode:"TS"},{name:"AirAsia X",iataCode:"D7"},{name:"AirAsia",iataCode:"AK"},{name:"Aircalin",iataCode:"SB"},{name:"Alaska Airlines",iataCode:"AS"},{name:"Alitalia",iataCode:"AZ"},{name:"All Nippon Airways",iataCode:"NH"},{name:"Allegiant Air",iataCode:"G4"},{name:"American Airlines",iataCode:"AA"},{name:"Asiana Airlines",iataCode:"OZ"},{name:"Avianca",iataCode:"AV"},{name:"Azul Linhas Aereas Brasileiras",iataCode:"AD"},{name:"Azur Air",iataCode:"ZF"},{name:"Beijing Capital Airlines",iataCode:"JD"},{name:"Boliviana de Aviacion",iataCode:"OB"},{name:"British Airways",iataCode:"BA"},{name:"Cathay Pacific",iataCode:"CX"},{name:"Cebu Pacific Air",iataCode:"5J"},{name:"China Airlines",iataCode:"CI"},{name:"China Eastern Airlines",iataCode:"MU"},{name:"China Southern Airlines",iataCode:"CZ"},{name:"Condor",iataCode:"DE"},{name:"Copa Airlines",iataCode:"CM"},{name:"Delta Air Lines",iataCode:"DL"},{name:"Easyfly",iataCode:"VE"},{name:"EasyJet",iataCode:"U2"},{name:"EcoJet",iataCode:"8J"},{name:"Egyptair",iataCode:"MS"},{name:"El Al",iataCode:"LY"},{name:"Emirates Airlines",iataCode:"EK"},{name:"Ethiopian Airlines",iataCode:"ET"},{name:"Etihad Airways",iataCode:"EY"},{name:"EVA Air",iataCode:"BR"},{name:"Fiji Airways",iataCode:"FJ"},{name:"Finnair",iataCode:"AY"},{name:"Flybondi",iataCode:"FO"},{name:"Flydubai",iataCode:"FZ"},{name:"FlySafair",iataCode:"FA"},{name:"Frontier Airlines",iataCode:"F9"},{name:"Garuda Indonesia",iataCode:"GA"},{name:"Go First",iataCode:"G8"},{name:"Gol Linhas Aereas Inteligentes",iataCode:"G3"},{name:"Hainan Airlines",iataCode:"HU"},{name:"Hawaiian Airlines",iataCode:"HA"},{name:"IndiGo Airlines",iataCode:"6E"},{name:"Japan Airlines",iataCode:"JL"},{name:"Jeju Air",iataCode:"7C"},{name:"Jet2",iataCode:"LS"},{name:"JetBlue Airways",iataCode:"B6"},{name:"JetSMART",iataCode:"JA"},{name:"Juneyao Airlines",iataCode:"HO"},{name:"Kenya Airways",iataCode:"KQ"},{name:"KLM Royal Dutch Airlines",iataCode:"KL"},{name:"Korean Air",iataCode:"KE"},{name:"Kulula.com",iataCode:"MN"},{name:"LATAM Airlines",iataCode:"LA"},{name:"Lion Air",iataCode:"JT"},{name:"LOT Polish Airlines",iataCode:"LO"},{name:"Lufthansa",iataCode:"LH"},{name:"Libyan Airlines",iataCode:"LN"},{name:"Linea Aerea Amaszonas",iataCode:"Z8"},{name:"Malaysia Airlines",iataCode:"MH"},{name:"Nordwind Airlines",iataCode:"N4"},{name:"Norwegian Air Shuttle",iataCode:"DY"},{name:"Oman Air",iataCode:"WY"},{name:"Pakistan International Airlines",iataCode:"PK"},{name:"Pegasus Airlines",iataCode:"PC"},{name:"Philippine Airlines",iataCode:"PR"},{name:"Qantas Group",iataCode:"QF"},{name:"Qatar Airways",iataCode:"QR"},{name:"Republic Airways",iataCode:"YX"},{name:"Royal Air Maroc",iataCode:"AT"},{name:"Ryanair",iataCode:"FR"},{name:"S7 Airlines",iataCode:"S7"},{name:"SAS",iataCode:"SK"},{name:"Satena",iataCode:"9R"},{name:"Saudia",iataCode:"SV"},{name:"Shandong Airlines",iataCode:"SC"},{name:"Sichuan Airlines",iataCode:"3U"},{name:"Singapore Airlines",iataCode:"SQ"},{name:"Sky Airline",iataCode:"H2"},{name:"SkyWest Airlines",iataCode:"OO"},{name:"South African Airways",iataCode:"SA"},{name:"Southwest Airlines",iataCode:"WN"},{name:"SpiceJet",iataCode:"SG"},{name:"Spirit Airlines",iataCode:"NK"},{name:"Spring Airlines",iataCode:"9C"},{name:"SriLankan Airlines",iataCode:"UL"},{name:"Star Peru",iataCode:"2I"},{name:"Sun Country Airlines",iataCode:"SY"},{name:"SunExpress",iataCode:"XQ"},{name:"TAP Air Portugal",iataCode:"TP"},{name:"Thai AirAsia",iataCode:"FD"},{name:"Thai Airways",iataCode:"TG"},{name:"TUI Airways",iataCode:"BY"},{name:"Tunisair",iataCode:"TU"},{name:"Turkish Airlines",iataCode:"TK"},{name:"Ukraine International",iataCode:"PS"},{name:"United Airlines",iataCode:"UA"},{name:"Ural Airlines",iataCode:"U6"},{name:"VietJet Air",iataCode:"VJ"},{name:"Vietnam Airlines",iataCode:"VN"},{name:"Virgin Atlantic Airways",iataCode:"VS"},{name:"Virgin Australia",iataCode:"VA"},{name:"VivaAerobus",iataCode:"VB"},{name:"VOEPASS Linhas Aereas",iataCode:"2Z"},{name:"Volaris",iataCode:"Y4"},{name:"WestJet",iataCode:"WS"},{name:"Wingo",iataCode:"P5"},{name:"Wizz Air",iataCode:"W6"}],sJ=[{name:"Aerospatiale/BAC Concorde",iataTypeCode:"SSC"},{name:"Airbus A300",iataTypeCode:"AB3"},{name:"Airbus A310",iataTypeCode:"310"},{name:"Airbus A310-200",iataTypeCode:"312"},{name:"Airbus A310-300",iataTypeCode:"313"},{name:"Airbus A318",iataTypeCode:"318"},{name:"Airbus A319",iataTypeCode:"319"},{name:"Airbus A319neo",iataTypeCode:"31N"},{name:"Airbus A320",iataTypeCode:"320"},{name:"Airbus A320neo",iataTypeCode:"32N"},{name:"Airbus A321",iataTypeCode:"321"},{name:"Airbus A321neo",iataTypeCode:"32Q"},{name:"Airbus A330",iataTypeCode:"330"},{name:"Airbus A330-200",iataTypeCode:"332"},{name:"Airbus A330-300",iataTypeCode:"333"},{name:"Airbus A330-800neo",iataTypeCode:"338"},{name:"Airbus A330-900neo",iataTypeCode:"339"},{name:"Airbus A340",iataTypeCode:"340"},{name:"Airbus A340-200",iataTypeCode:"342"},{name:"Airbus A340-300",iataTypeCode:"343"},{name:"Airbus A340-500",iataTypeCode:"345"},{name:"Airbus A340-600",iataTypeCode:"346"},{name:"Airbus A350",iataTypeCode:"350"},{name:"Airbus A350-900",iataTypeCode:"359"},{name:"Airbus A350-1000",iataTypeCode:"351"},{name:"Airbus A380",iataTypeCode:"380"},{name:"Airbus A380-800",iataTypeCode:"388"},{name:"Antonov An-12",iataTypeCode:"ANF"},{name:"Antonov An-24",iataTypeCode:"AN4"},{name:"Antonov An-26",iataTypeCode:"A26"},{name:"Antonov An-28",iataTypeCode:"A28"},{name:"Antonov An-30",iataTypeCode:"A30"},{name:"Antonov An-32",iataTypeCode:"A32"},{name:"Antonov An-72",iataTypeCode:"AN7"},{name:"Antonov An-124 Ruslan",iataTypeCode:"A4F"},{name:"Antonov An-140",iataTypeCode:"A40"},{name:"Antonov An-148",iataTypeCode:"A81"},{name:"Antonov An-158",iataTypeCode:"A58"},{name:"Antonov An-225 Mriya",iataTypeCode:"A5F"},{name:"Boeing 707",iataTypeCode:"703"},{name:"Boeing 717",iataTypeCode:"717"},{name:"Boeing 720B",iataTypeCode:"B72"},{name:"Boeing 727",iataTypeCode:"727"},{name:"Boeing 727-100",iataTypeCode:"721"},{name:"Boeing 727-200",iataTypeCode:"722"},{name:"Boeing 737 MAX 7",iataTypeCode:"7M7"},{name:"Boeing 737 MAX 8",iataTypeCode:"7M8"},{name:"Boeing 737 MAX 9",iataTypeCode:"7M9"},{name:"Boeing 737 MAX 10",iataTypeCode:"7MJ"},{name:"Boeing 737",iataTypeCode:"737"},{name:"Boeing 737-100",iataTypeCode:"731"},{name:"Boeing 737-200",iataTypeCode:"732"},{name:"Boeing 737-300",iataTypeCode:"733"},{name:"Boeing 737-400",iataTypeCode:"734"},{name:"Boeing 737-500",iataTypeCode:"735"},{name:"Boeing 737-600",iataTypeCode:"736"},{name:"Boeing 737-700",iataTypeCode:"73G"},{name:"Boeing 737-800",iataTypeCode:"738"},{name:"Boeing 737-900",iataTypeCode:"739"},{name:"Boeing 747",iataTypeCode:"747"},{name:"Boeing 747-100",iataTypeCode:"741"},{name:"Boeing 747-200",iataTypeCode:"742"},{name:"Boeing 747-300",iataTypeCode:"743"},{name:"Boeing 747-400",iataTypeCode:"744"},{name:"Boeing 747-400D",iataTypeCode:"74J"},{name:"Boeing 747-8",iataTypeCode:"748"},{name:"Boeing 747SP",iataTypeCode:"74L"},{name:"Boeing 747SR",iataTypeCode:"74R"},{name:"Boeing 757",iataTypeCode:"757"},{name:"Boeing 757-200",iataTypeCode:"752"},{name:"Boeing 757-300",iataTypeCode:"753"},{name:"Boeing 767",iataTypeCode:"767"},{name:"Boeing 767-200",iataTypeCode:"762"},{name:"Boeing 767-300",iataTypeCode:"763"},{name:"Boeing 767-400",iataTypeCode:"764"},{name:"Boeing 777",iataTypeCode:"777"},{name:"Boeing 777-200",iataTypeCode:"772"},{name:"Boeing 777-200LR",iataTypeCode:"77L"},{name:"Boeing 777-300",iataTypeCode:"773"},{name:"Boeing 777-300ER",iataTypeCode:"77W"},{name:"Boeing 787",iataTypeCode:"787"},{name:"Boeing 787-8",iataTypeCode:"788"},{name:"Boeing 787-9",iataTypeCode:"789"},{name:"Boeing 787-10",iataTypeCode:"781"},{name:"Canadair Challenger",iataTypeCode:"CCJ"},{name:"Canadair CL-44",iataTypeCode:"CL4"},{name:"Canadair Regional Jet 100",iataTypeCode:"CR1"},{name:"Canadair Regional Jet 200",iataTypeCode:"CR2"},{name:"Canadair Regional Jet 700",iataTypeCode:"CR7"}
4366,{name:"Canadair Regional Jet 705",iataTypeCode:"CRA"},{name:"Canadair Regional Jet 900",iataTypeCode:"CR9"},{name:"Canadair Regional Jet 1000",iataTypeCode:"CRK"},{name:"De Havilland Canada DHC-2 Beaver",iataTypeCode:"DHP"},{name:"De Havilland Canada DHC-2 Turbo-Beaver",iataTypeCode:"DHR"},{name:"De Havilland Canada DHC-3 Otter",iataTypeCode:"DHL"},{name:"De Havilland Canada DHC-4 Caribou",iataTypeCode:"DHC"},{name:"De Havilland Canada DHC-6 Twin Otter",iataTypeCode:"DHT"},{name:"De Havilland Canada DHC-7 Dash 7",iataTypeCode:"DH7"},{name:"De Havilland Canada DHC-8-100 Dash 8 / 8Q",iataTypeCode:"DH1"},{name:"De Havilland Canada DHC-8-200 Dash 8 / 8Q",iataTypeCode:"DH2"},{name:"De Havilland Canada DHC-8-300 Dash 8 / 8Q",iataTypeCode:"DH3"},{name:"De Havilland Canada DHC-8-400 Dash 8Q",iataTypeCode:"DH4"},{name:"De Havilland DH.104 Dove",iataTypeCode:"DHD"},{name:"De Havilland DH.114 Heron",iataTypeCode:"DHH"},{name:"Douglas DC-3",iataTypeCode:"D3F"},{name:"Douglas DC-6",iataTypeCode:"D6F"},{name:"Douglas DC-8-50",iataTypeCode:"D8T"},{name:"Douglas DC-8-62",iataTypeCode:"D8L"},{name:"Douglas DC-8-72",iataTypeCode:"D8Q"},{name:"Douglas DC-9-10",iataTypeCode:"D91"},{name:"Douglas DC-9-20",iataTypeCode:"D92"},{name:"Douglas DC-9-30",iataTypeCode:"D93"},{name:"Douglas DC-9-40",iataTypeCode:"D94"},{name:"Douglas DC-9-50",iataTypeCode:"D95"},{name:"Douglas DC-10",iataTypeCode:"D10"},{name:"Douglas DC-10-10",iataTypeCode:"D1X"},{name:"Douglas DC-10-30",iataTypeCode:"D1Y"},{name:"Embraer 170",iataTypeCode:"E70"},{name:"Embraer 175",iataTypeCode:"E75"},{name:"Embraer 190",iataTypeCode:"E90"},{name:"Embraer 195",iataTypeCode:"E95"},{name:"Embraer E190-E2",iataTypeCode:"290"},{name:"Embraer E195-E2",iataTypeCode:"295"},{name:"Embraer EMB.110 Bandeirante",iataTypeCode:"EMB"},{name:"Embraer EMB.120 Brasilia",iataTypeCode:"EM2"},{name:"Embraer Legacy 600",iataTypeCode:"ER3"},{name:"Embraer Phenom 100",iataTypeCode:"EP1"},{name:"Embraer Phenom 300",iataTypeCode:"EP3"},{name:"Embraer RJ135",iataTypeCode:"ER3"},{name:"Embraer RJ140",iataTypeCode:"ERD"},{name:"Embraer RJ145 Amazon",iataTypeCode:"ER4"},{name:"Ilyushin IL18",iataTypeCode:"IL8"},{name:"Ilyushin IL62",iataTypeCode:"IL6"},{name:"Ilyushin IL76",iataTypeCode:"IL7"},{name:"Ilyushin IL86",iataTypeCode:"ILW"},{name:"Ilyushin IL96-300",iataTypeCode:"I93"},{name:"Ilyushin IL114",iataTypeCode:"I14"},{name:"Lockheed L-182 / 282 / 382 (L-100) Hercules",iataTypeCode:"LOH"},{name:"Lockheed L-188 Electra",iataTypeCode:"LOE"},{name:"Lockheed L-1011 Tristar",iataTypeCode:"L10"},{name:"Lockheed L-1049 Super Constellation",iataTypeCode:"L49"},{name:"McDonnell Douglas MD11",iataTypeCode:"M11"},{name:"McDonnell Douglas MD80",iataTypeCode:"M80"},{name:"McDonnell Douglas MD81",iataTypeCode:"M81"},{name:"McDonnell Douglas MD82",iataTypeCode:"M82"},{name:"McDonnell Douglas MD83",iataTypeCode:"M83"},{name:"McDonnell Douglas MD87",iataTypeCode:"M87"},{name:"McDonnell Douglas MD88",iataTypeCode:"M88"},{name:"McDonnell Douglas MD90",iataTypeCode:"M90"},{name:"Sukhoi Superjet 100-95",iataTypeCode:"SU9"},{name:"Tupolev Tu-134",iataTypeCode:"TU3"},{name:"Tupolev Tu-154",iataTypeCode:"TU5"},{name:"Tupolev Tu-204",iataTypeCode:"T20"},{name:"Yakovlev Yak-40",iataTypeCode:"YK4"},{name:"Yakovlev Yak-42",iataTypeCode:"YK2"}],oJ=[{name:"Adelaide International Airport",iataCode:"ADL"},{name:"Adolfo Suarez Madrid-Barajas Airport",iataCode:"MAD"},{name:"Aeroparque Jorge Newbery Airport",iataCode:"AEP"},{name:"Afonso Pena International Airport",iataCode:"CWB"},{name:"Alfonso Bonilla Aragon International Airport",iataCode:"CLO"},{name:"Amsterdam Airport Schiphol",iataCode:"AMS"},{name:"Arturo Merino Benitez International Airport",iataCode:"SCL"},{name:"Auckland International Airport",iataCode:"AKL"},{name:"Beijing Capital International Airport",iataCode:"PEK"},{name:"Belem Val de Cans International Airport",iataCode:"BEL"},{name:"Belo Horizonte Tancredo Neves International Airport",iataCode:"CNF"},{name:"Berlin-Tegel Airport",iataCode:"TXL"},{name:"Bole International Airport",iataCode:"ADD"},{name:"Brasilia-Presidente Juscelino Kubitschek International Airport",iataCode:"BSB"},{name:"Brisbane International Airport",iataCode:"BNE"},{name:"Brussels Airport",iataCode:"BRU"},{name:"Cairns Airport",iataCode:"CNS"},{name:"Cairo International Airport",iataCode:"CAI"},{name:"Canberra Airport",iataCode:"CBR"},{name:"Capetown International Airport",iataCode:"CPT"},{name:"Charles de Gaulle International Airport",iataCode:"CDG"},{name:"Charlotte Douglas International Airport",iataCode:"CLT"},{name:"Chengdu Shuangliu International Airport",iataCode:"CTU"},{name:"Chhatrapati Shivaji International Airport",iataCode:"BOM"},{name:"Chicago O'Hare International Airport",iataCode:"ORD"},{name:"Chongqing Jiangbei International Airport",iataCode:"CKG"},{name:"Christchurch International Airport",iataCode:"CHC"},{name:"Copenhagen Kastrup Airport",iataCode:"CPH"},{name:"Dallas Fort Worth International Airport",iataCode:"DFW"},{name:"Daniel K. Inouye International Airport",iataCode:"HNL"},{name:"Denver International Airport",iataCode:"DEN"},{name:"Don Mueang International Airport",iataCode:"DMK"},{name:"Dubai International Airport",iataCode:"DXB"},{name:"Dublin Airport",iataCode:"DUB"},{name:"Dusseldorf Airport",iataCode:"DUS"},{name:"El Dorado International Airport",iataCode:"BOG"},{name:"Eleftherios Venizelos International Airport",iataCode:"ATH"},{name:"Faa'a International Airport",iataCode:"PPT"},{name:"Fort Lauderdale Hollywood International Airport",iataCode:"FLL"},{name:"Fortaleza Pinto Martins International Airport",iataCode:"FOR"},{name:"Frankfurt am Main Airport",iataCode:"FRA"},{name:"George Bush Intercontinental Houston Airport",iataCode:"IAH"},{name:"Gold Coast Airport",iataCode:"OOL"},{name:"Guarulhos - Governador Andre Franco Montoro International Airport",iataCode:"GRU"},{name:"Hartsfield-Jackson Atlanta International Airport",iataCode:"ATL"},{name:"Helsinki Vantaa Airport",iataCode:"HEL"},{name:"Hobart International Airport",iataCode:"HBA"},{name:"Hong Kong International Airport",iataCode:"HKG"},{name:"Houari Boumediene Airport",iataCode:"ALG"},{name:"Hurgada International Airport",iataCode:"HRG"},{name:"Incheon International Airport",iataCode:"ICN"},{name:"Indira Gandhi International Airport",iataCode:"DEL"},{name:"Istanbul Airport",iataCode:"IST"},{name:"Jacksons International Airport",iataCode:"POM"},{name:"Jeju International Airport",iataCode:"CJU"},{name:"John F Kennedy International Airport",iataCode:"JFK"},{name:"Jorge Chavez International Airport",iataCode:"LIM"},{name:"Jose Maria Cordova International Airport",iataCode:"MDE"},{name:"Josep Tarradellas Barcelona-El Prat Airport",iataCode:"BCN"},{name:"Kahului Airport",iataCode:"OGG"},{name:"King Abdulaziz International Airport",iataCode:"JED"},{name:"Kuala Lumpur International Airport",iataCode:"KUL"},{name:"Kunming Changshui International Airport",iataCode:"KMG"},{name:"La Tontouta International Airport",iataCode:"NOU"},{name:"Leonardo da Vinci-Fiumicino Airport",iataCode:"FCO"},{name:"London Heathrow Airport",iataCode:"LHR"},{name:"Los Angeles International Airport",iataCode:"LAX"},{name:"McCarran International Airport",iataCode:"LAS"},{name:"Melbourne International Airport",iataCode:"MEL"},{name:"Mexico City International Airport",iataCode:"MEX"},{name:"Miami International Airport",iataCode:"MIA"},{name:"Ministro Pistarini International Airport",iataCode:"EZE"},{name:"Minneapolis-St Paul International/Wold-Chamberlain Airport",iataCode:"MSP"},{name:"Mohammed V International Airport",iataCode:"CMN"},{name:"Moscow Domodedovo Airport",iataCode:"DME"},{name:"Munich Airport",iataCode:"MUC"},{name:"Murtala Muhammed International Airport",iataCode:"LOS"},{name:"Nadi International Airport",iataCode:"NAN"},{name:"Nairobi Jomo Kenyatta International Airport",iataCode:"NBO"},{name:"Narita International Airport",iataCode:"NRT"},{name:"Newark Liberty International Airport",iataCode:"EWR"},{name:"Ninoy Aquino International Airport",iataCode:"MNL"},{name:"Noumea Magenta Airport",iataCode:"GEA"},{name:"O. R. Tambo International Airport",iataCode:"JNB"},{name:"Orlando International Airport",iataCode:"MCO"},{name:"Oslo Lufthavn",iataCode:"OSL"},{name:"Perth Airport",iataCode:"PER"},{name:"Phoenix Sky Harbor International Airport",iataCode:"PHX"},{name:"Recife Guararapes-Gilberto Freyre International Airport",iataCode:"REC"},{name:"Rio de Janeiro Galeao International Airport",iataCode:"GIG"},{name:"Salgado Filho International Airport",iataCode:"POA"},{name:"Salvador Deputado Luis Eduardo Magalhaes International Airport",iataCode:"SSA"},{name:"San Francisco International Airport",iataCode:"SFO"},{name:"Santos Dumont Airport",iataCode:"SDU"},{name:"Sao Paulo-Congonhas Airport",iataCode:"CGH"},{name:"Seattle Tacoma International Airport",iataCode:"SEA"},{name:"Shanghai Hongqiao International Airport",iataCode:"SHA"},{name:"Shanghai Pudong International Airport",iataCode:"PVG"},{name:"Shenzhen Bao'an International Airport",iataCode:"SZX"},{name:"Sheremetyevo International Airport",iataCode:"SVO"}
4366,{name:"Singapore Changi Airport",iataCode:"SIN"},{name:"Soekarno-Hatta International Airport",iataCode:"CGK"},{name:'Stockholm-Arlanda Airport"',iataCode:"ARN"},{name:"Suvarnabhumi Airport",iataCode:"BKK"},{name:"Sydney Kingsford Smith International Airport",iataCode:"SYD"},{name:"Taiwan Taoyuan International Airport",iataCode:"TPE"},{name:"Tan Son Nhat International Airport",iataCode:"SGN"},{name:"Tokyo Haneda International Airport",iataCode:"HND"},{name:"Toronto Pearson International Airport",iataCode:"YYZ"},{name:"Tunis Carthage International Airport",iataCode:"TUN"},{name:"Vancouver International Airport",iataCode:"YVR"},{name:"Vienna International Airport",iataCode:"VIE"},{name:"Viracopos International Airport",iataCode:"VCP"},{name:"Vnukovo International Airport",iataCode:"VKO"},{name:"Wellington International Airport",iataCode:"WLG"},{name:"Xi'an Xianyang International Airport",iataCode:"XIY"},{name:"Zhukovsky International Airport",iataCode:"ZIA"},{name:"Zurich Airport",iataCode:"ZRH"}],lJ={airline:iJ,airplane:sJ,airport:oJ},cJ=lJ,uJ=["American black bear","Asian black bear","Brown bear","Giant panda","Polar bear","Sloth bear","Spectacled bear","Sun bear"],dJ=["Abert's Towhee","Acadian Flycatcher","Acorn Woodpecker","Alder Flycatcher","Aleutian Tern","Allen's Hummingbird","Altamira Oriole","American Avocet","American Bittern","American Black Duck","American Coot","American Crow","American Dipper","American Golden-Plover","American Goldfinch","American Kestrel","American Oystercatcher","American Pipit","American Redstart","American Robin","American Tree Sparrow","American White Pelican","American Wigeon","American Woodcock","Ancient Murrelet","Anhinga","Anna's Hummingbird","Antillean Nighthawk","Antillean Palm Swift","Aplomado Falcon","Arctic Loon","Arctic Tern","Arctic Warbler","Ash-throated Flycatcher","Ashy Storm-Petrel","Asian Brown Flycatcher","Atlantic Puffin","Audubon's Oriole","Audubon's Shearwater","Aztec Thrush","Azure Gallinule","Bachman's Sparrow","Bachman's Warbler","Bahama Mockingbird","Bahama Swallow","Bahama Woodstar","Baikal Teal","Baird's Sandpiper","Baird's Sparrow","Bald Eagle","Baltimore Oriole","Bananaquit","Band-rumped Storm-Petrel","Band-tailed Gull","Band-tailed Pigeon","Bank Swallow","Bar-tailed Godwit","Barn Owl","Barn Swallow","Barnacle Goose","Barred Owl","Barrow's Goldeneye","Bay-breasted Warbler","Bean Goose","Bell's Vireo","Belted Kingfisher","Bendire's Thrasher","Berylline Hummingbird","Bewick's Wren","Bicknell's Thrush","Black Catbird","Black Guillemot","Black Noddy","Black Oystercatcher","Black Phoebe","Black Rail","Black Rosy-Finch","Black Scoter","Black Skimmer","Black Storm-Petrel","Black Swift","Black Tern","Black Turnstone","Black Vulture","Black-and-white Warbler","Black-backed Wagtail","Black-backed Woodpecker","Black-bellied Plover","Black-bellied Whistling-Duck","Black-billed Cuckoo","Black-billed Magpie","Black-browed Albatross","Black-capped Chickadee","Black-capped Gnatcatcher","Black-capped Petrel","Black-capped Vireo","Black-chinned Hummingbird","Black-chinned Sparrow","Black-crowned Night-Heron","Black-faced Grassquit","Black-footed Albatross","Black-headed Grosbeak","Black-headed Gull","Black-legged Kittiwake","Black-necked Stilt","Black-tailed Gnatcatcher","Black-tailed Godwit","Black-tailed Gull","Black-throated Blue Warbler","Black-throated Gray Warbler","Black-throated Green Warbler","Black-throated Sparrow","Black-vented Oriole","Black-vented Shearwater","Black-whiskered Vireo","Black-winged Stilt","Blackburnian Warbler","Blackpoll Warbler","Blue Bunting","Blue Grosbeak","Blue Grouse","Blue Jay","Blue Mockingbird","Blue-footed Booby","Blue-gray Gnatcatcher","Blue-headed Vireo","Blue-throated Hummingbird","Blue-winged Teal","Blue-winged Warbler","Bluethroat","Boat-tailed Grackle","Bobolink","Bohemian Waxwing","Bonaparte's Gull","Boreal Chickadee","Boreal Owl","Botteri's Sparrow","Brambling","Brandt's Cormorant","Brant","Brewer's Blackbird","Brewer's Sparrow","Bridled Tern","Bridled Titmouse","Bristle-thighed Curlew","Broad-billed Hummingbird","Broad-billed Sandpiper","Broad-tailed Hummingbird","Broad-winged Hawk","Bronzed Cowbird","Brown Booby","Brown Creeper","Brown Jay","Brown Noddy","Brown Pelican","Brown Shrike","Brown Thrasher","Brown-capped Rosy-Finch","Brown-chested Martin","Brown-crested Flycatcher","Brown-headed Cowbird","Brown-headed Nuthatch","Budgerigar","Buff-bellied Hummingbird","Buff-breasted Flycatcher","Buff-breasted Sandpiper","Buff-collared Nightjar","Bufflehead","Buller's Shearwater","Bullock's Oriole","Bumblebee Hummingbird","Burrowing Owl","Bushtit","Cactus Wren","California Condor","California Gnatcatcher","California Gull","California Quail","California Thrasher","California Towhee","Calliope Hummingbird","Canada Goose","Canada Warbler","Canvasback","Canyon Towhee","Canyon Wren","Cape May Warbler","Caribbean Elaenia","Carolina Chickadee","Carolina Parakeet","Carolina Wren","Caspian Tern","Cassin's Auklet","Cassin's Finch","Cassin's Kingbird","Cassin's Sparrow","Cassin's Vireo","Cattle Egret","Cave Swallow","Cedar Waxwing","Cerulean Warbler","Chestnut-backed Chickadee","Chestnut-collared Longspur","Chestnut-sided Warbler","Chihuahuan Raven","Chimney Swift","Chinese Egret","Chipping Sparrow","Chuck-will's-widow","Chukar","Cinnamon Hummingbird","Cinnamon Teal","Citrine Wagtail","Clapper Rail","Clark's Grebe","Clark's Nutcracker","Clay-colored Robin","Clay-colored Sparrow","Cliff Swallow","Colima Warbler","Collared Forest-Falcon","Collared Plover","Common Black-Hawk","Common Chaffinch","Common Crane","Common Cuckoo","Common Eider","Common Goldeneye","Common Grackle","Common Greenshank","Common Ground-Dove","Common House-Martin","Common Loon","Common Merganser","Common Moorhen","Common Murre","Common Nighthawk","Common Pauraque","Common Pochard","Common Poorwill","Common Raven","Common Redpoll","Common Ringed Plover","Common Rosefinch","Common S
4366andpiper","Common Snipe","Common Swift","Common Tern","Common Yellowthroat","Connecticut Warbler","Cook's Petrel","Cooper's Hawk","Cordilleran Flycatcher","Corn Crake","Cory's Shearwater","Costa's Hummingbird","Couch's Kingbird","Crane Hawk","Craveri's Murrelet","Crescent-chested Warbler","Crested Auklet","Crested Caracara","Crested Myna","Crimson-collared Grosbeak","Crissal Thrasher","Cuban Martin","Curlew Sandpiper","Curve-billed Thrasher","Dark-eyed Junco","Dickcissel","Double-crested Cormorant","Double-striped Thick-knee","Dovekie","Downy Woodpecker","Dunlin","Dusky Flycatcher","Dusky Thrush","Dusky Warbler","Dusky-capped Flycatcher","Eared Grebe","Eared Trogon","Eastern Bluebird","Eastern Kingbird","Eastern Meadowlark","Eastern Phoebe","Eastern Screech-Owl","Eastern Towhee","Eastern Wood-Pewee","Elegant Tern","Elegant Trogon","Elf Owl","Emperor Goose","Eskimo Curlew","Eurasian Blackbird","Eurasian Bullfinch","Eurasian Collared-Dove","Eurasian Coot","Eurasian Curlew","Eurasian Dotterel","Eurasian Hobby","Eurasian Jackdaw","Eurasian Kestrel","Eurasian Oystercatcher","Eurasian Siskin","Eurasian Tree Sparrow","Eurasian Wigeon","Eurasian Woodcock","Eurasian Wryneck","European Golden-Plover","European Starling","European Storm-Petrel","European Turtle-Dove","Evening Grosbeak","Eyebrowed Thrush","Falcated Duck","Fan-tailed Warbler","Far Eastern Curlew","Ferruginous Hawk","Ferruginous Pygmy-Owl","Field Sparrow","Fieldfare","Fish Crow","Five-striped Sparrow","Flame-colored Tanager","Flammulated Owl","Flesh-footed Shearwater","Florida Scrub-Jay","Fork-tailed Flycatcher","Fork-tailed Storm-Petrel","Fork-tailed Swift","Forster's Tern","Fox Sparrow","Franklin's Gull","Fulvous Whistling-Duck","Gadwall","Gambel's Quail","Garganey","Gila Woodpecker","Gilded Flicker","Glaucous Gull","Glaucous-winged Gull","Glossy Ibis","Golden Eagle","Golden-cheeked Warbler","Golden-crowned Kinglet","Golden-crowned Sparrow","Golden-crowned Warbler","Golden-fronted Woodpecker","Golden-winged Warbler","Grace's Warbler","Grasshopper Sparrow","Gray Bunting","Gray Catbird","Gray Flycatcher","Gray Hawk","Gray Jay","Gray Kingbird","Gray Partridge","Gray Silky-flycatcher","Gray Vireo","Gray Wagtail","Gray-breasted Martin","Gray-cheeked Thrush","Gray-crowned Rosy-Finch","Gray-crowned Yellowthroat","Gray-headed Chickadee","Gray-spotted Flycatcher","Gray-tailed Tattler","Great Auk","Great Black-backed Gull","Great Blue Heron","Great Cormorant","Great Crested Flycatcher","Great Egret","Great Frigatebird","Great Gray Owl","Great Horned Owl","Great Kiskadee","Great Knot","Great Skua","Great Spotted Woodpecker","Great-tailed Grackle","Greater Flamingo","Greater Pewee","Greater Prairie-chicken","Greater Roadrunner","Greater Scaup","Greater Shearwater","Greater White-fronted Goose","Greater Yellowlegs","Green Heron","Green Jay","Green Kingfisher","Green Sandpiper","Green Violet-ear","Green-breasted Mango","Green-tailed Towhee","Green-winged Teal","Greenish Elaenia","Groove-billed Ani","Gull-billed Tern","Gyrfalcon","Hairy Woodpecker","Hammond's Flycatcher","Harlequin Duck","Harris's Hawk","Harris's Sparrow","Hawfinch","Heermann's Gull","Henslow's Sparrow","Hepatic Tanager","Herald Petrel","Hermit Thrush","Hermit Warbler","Herring Gull","Himalayan Snowcock","Hoary Redpoll","Hooded Merganser","Hooded Oriole","Hooded Warbler","Hook-billed Kite","Hoopoe","Horned Grebe","Horned Lark","Horned Puffin","House Finch","House Sparrow","House Wren","Hudsonian Godwit","Hutton's Vireo","Iceland Gull","Inca Dove","Indigo Bunting","Island Scrub-Jay","Ivory Gull","Ivory-billed Woodpecker","Jabiru","Jack Snipe","Jungle Nightjar","Juniper Titmouse","Kentucky Warbler","Key West Quail-Dove","Killdeer","King Eider","King Rail","Kirtland's Warbler","Kittlitz's Murrelet","La Sagra's Flycatcher","Labrador Duck","Ladder-backed Woodpecker","Lanceolated Warbler","Lapland Longspur","Large-billed Tern","Lark Bunting","Lark Sparrow","Laughing Gull","Lawrence's Goldfinch","Laysan Albatross","Lazuli Bunting","Le Conte's Sparrow","Le Conte's Thrasher","Leach's Storm-Petrel","Least Auklet","Least Bittern","Least Flycatcher","Least Grebe","Least Sandpiper","Least Storm-Petrel","Least Tern","Lesser Black-backed Gull","Lesser Frigatebird","Lesser Goldfinch","Lesser Nighthawk","Lesser Prairie-chicken","Lesser Scaup","Lesser White-fronted Goose","Lesser Yellowlegs","Lewis's Woodpecker","Limpkin","Lincoln's Sparrow","Little Blue Heron","Little Bunting","Little Curlew","Little Egret","Little Gull","Little Ringed Plover","Little Shearwater","Little Stint","Loggerhead Kingbird","Loggerhead Shrike","Long-billed Curlew","Long-billed Dowitcher","Long-billed Murrelet","Long-billed Thrasher","Long-eared Owl","Long-tailed Jaeger","Long-toed Stint","Louisiana Waterthrush","Lucifer Hummingbird","Lucy's Warbler","MacGillivray's Warbler","Magnificent Frigatebird","Magnificent Hummingbird","Magnolia Warbler","Mallard","Mangrove Cuckoo","Manx Shearwater","Marbled Godwit","Marbled Murrelet","Marsh Sandpiper","Marsh Wren","Masked Booby","Masked Duck","Masked Tityra","McCown's Longspur","McKay's Bunting","Merlin","Mew Gull","Mexican Chickadee","Mexican Jay","Middendorff's Grasshopper-Warbler","Mississippi Kite","Mongolian Plover","Monk Parakeet","Montezuma Quail","Mottled Duck","Mottled Owl","Mottled Petrel","Mountain Bluebird","Mountain Chickadee","Mountain Plover","Mountain Quail","Mourning Dove","Mourning Warbler","Mugimaki Flycatcher","Murphy's Petrel","Muscovy Duck","Mute Swan","Narcissus Flycatcher","Nashville Warbler","Nelson's Sharp-tailed Sparrow","Neotropic Cormorant","Northern Beardless-Tyrannulet","Northern Bobwhite","Northern Cardinal","Northern Flicker","Northern Fulmar","Northern Gannet","Northern Goshawk","Northern Harrier","Northern Hawk Owl","Northern Jacana","Northern Lapwing","Northern Mockingbird","Northern Parula","Northern Pintail","Northern Pygmy-Owl","Northern Rough-winged Swallow","Northern Saw-whet Owl","Northern Shoveler","Northern Shrike","Northern Waterthrush","Northern Wheatear","Northwestern Crow","Nuttall's Woodpecker","Nutting's Flycatcher","Oak Titmouse","Oldsquaw","Olive Sparrow","Olive Warbler","Olive-backed Pipit","Olive-sided Flycatcher","Orange-crowned Warbler","Orchard Oriole","Oriental Cuckoo","Oriental Greenfinch","Oriental Pratincole","Oriental Scops-Owl","Oriental Turtle-Dove","Osprey","Ovenbird","Pacific Golden-Plover","Pacific Loon","Pacific-slope Flycatcher","Paint-billed Crake","Painted Bunting","Painted Redstart","Pallas's Bunting","Palm Warbler","Parakeet Auklet","Parasitic Jaeger","Passenger Pigeon","Pechora Pipit","Pectoral Sandpiper","Pelagic Cormorant","Peregrine Falcon","Phainopepla","Philadelphia Vireo","Pied-billed Grebe","Pigeon Guillemot","Pileated Woodpecker","Pin-tailed Snipe","Pine Bunting","Pine Grosbeak","Pine Siskin","Pine Warbler","Pink-footed Goose","Pink-footed Shearwater","Pinyon Jay","Piping Plover","Plain Chachalaca","Plain-capped Starthroat","Plumbeous Vireo","Pomarine Jaeger","Prairie Falcon","Prairie Warbler","Prothonotary Warbler","Purple Finch","Purple Gallinule","Purple Martin","Purple Sandpiper","Pygmy Nuthatch","Pyrrhuloxia","Razorbill","Red Crossbill","Red Knot","Red Phalarope","Red-bellied Woodpecker","Red-billed Pigeon","Red-billed Tropicbird","Red-breasted Flycatcher","Red-breasted Merganser","Red-breasted Nuthatch","Red-breasted Sapsucker","Red-cockaded Woodpecker","Red-crowned Parrot","Red-eyed Vireo","Red-faced Cormorant","Red-faced Warbler","Red-flanked Bluetail","Red-footed Booby","Red-headed Woodpecker","Red-legged Kittiwake","Red-naped Sapsucker","Red-necked Grebe","Red-necked Phalarope","Red-necked Stint","Red-shouldered Hawk","Red-tailed Hawk","Red-tailed Tropicbird","Red-throated Loon","Red-throated Pipit","Red-whiskered Bulbul","Red-winged Blackbird","Reddish Egret","Redhead","Redwing","Reed Bunting","Rhinoceros Auklet","Ring-billed Gull","Ring-necked Duck","Ring-necked Pheasant","Ringed Kingfisher","Roadside Hawk","Rock Dove","Rock Ptarmigan","Rock Sandpiper","Rock Wren","Rose-breasted Grosbeak","Rose-throated Becard","Roseate Spoonbill","Roseate Tern","Ross's Goose","Ross's Gull","Rough-legged Hawk","Royal Tern","Ruby-crowned Kinglet","Ruby-throated Hummingbird","Ruddy Duck","Ruddy Ground-Dove","Ruddy Quail-Dove","Ruddy Turnstone","Ruff","Ruffed Grouse","Rufous Hummingbird","Rufous-backed Robin","Rufous-capped Warbler","Rufous-crowned Sparrow","Rufous-winged Sparrow","Rustic Bunting","Rusty Blackbird","Sabine's Gull","Sage Grouse","Sage Sparrow","Sage Thrasher","Saltmarsh Sharp-tailed Sparrow","Sanderling","Sandhill Crane","Sandwich Tern","S
4366avannah Sparrow","Say's Phoebe","Scaled Quail","Scaly-naped Pigeon","Scarlet Ibis","Scarlet Tanager","Scissor-tailed Flycatcher","Scott's Oriole","Seaside Sparrow","Sedge Wren","Semipalmated Plover","Semipalmated Sandpiper","Sharp-shinned Hawk","Sharp-tailed Grouse","Sharp-tailed Sandpiper","Shiny Cowbird","Short-billed Dowitcher","Short-eared Owl","Short-tailed Albatross","Short-tailed Hawk","Short-tailed Shearwater","Shy Albatross","Siberian Accentor","Siberian Blue Robin","Siberian Flycatcher","Siberian Rubythroat","Sky Lark","Slate-throated Redstart","Slaty-backed Gull","Slender-billed Curlew","Smew","Smith's Longspur","Smooth-billed Ani","Snail Kite","Snow Bunting","Snow Goose","Snowy Egret","Snowy Owl","Snowy Plover","Solitary Sandpiper","Song Sparrow","Sooty Shearwater","Sooty Tern","Sora","South Polar Skua","Southern Martin","Spectacled Eider","Spoonbill Sandpiper","Spot-billed Duck","Spot-breasted Oriole","Spotted Dove","Spotted Owl","Spotted Rail","Spotted Redshank","Spotted Sandpiper","Spotted Towhee","Sprague's Pipit","Spruce Grouse","Stejneger's Petrel","Steller's Eider","Steller's Jay","Steller's Sea-Eagle","Stilt Sandpiper","Stonechat","Streak-backed Oriole","Streaked Shearwater","Strickland's Woodpecker","Stripe-headed Tanager","Sulphur-bellied Flycatcher","Summer Tanager","Surf Scoter","Surfbird","Swainson's Hawk","Swainson's Thrush","Swainson's Warbler","Swallow-tailed Kite","Swamp Sparrow","Tamaulipas Crow","Tawny-shouldered Blackbird","Temminck's Stint","Tennessee Warbler","Terek Sandpiper","Thayer's Gull","Thick-billed Kingbird","Thick-billed Murre","Thick-billed Parrot","Thick-billed Vireo","Three-toed Woodpecker","Townsend's Solitaire","Townsend's Warbler","Tree Pipit","Tree Swallow","Tricolored Blackbird","Tricolored Heron","Tropical Kingbird","Tropical Parula","Trumpeter Swan","Tufted Duck","Tufted Flycatcher","Tufted Puffin","Tufted Titmouse","Tundra Swan","Turkey Vulture","Upland Sandpiper","Varied Bunting","Varied Thrush","Variegated Flycatcher","Vaux's Swift","Veery","Verdin","Vermilion Flycatcher","Vesper Sparrow","Violet-crowned Hummingbird","Violet-green Swallow","Virginia Rail","Virginia's Warbler","Wandering Albatross","Wandering Tattler","Warbling Vireo","Wedge-rumped Storm-Petrel","Wedge-tailed Shearwater","Western Bluebird","Western Grebe","Western Gull","Western Kingbird","Western Meadowlark","Western Reef-Heron","Western Sandpiper","Western Screech-Owl","Western Scrub-Jay","Western Tanager","Western Wood-Pewee","Whimbrel","Whip-poor-will","Whiskered Auklet","Whiskered Screech-Owl","Whiskered Tern","White Ibis","White Wagtail","White-breasted Nuthatch","White-cheeked Pintail","White-chinned Petrel","White-collared Seedeater","White-collared Swift","White-crowned Pigeon","White-crowned Sparrow","White-eared Hummingbird","White-eyed Vireo","White-faced Ibis","White-faced Storm-Petrel","White-headed Woodpecker","White-rumped Sandpiper","White-tailed Eagle","White-tailed Hawk","White-tailed Kite","White-tailed Ptarmigan","White-tailed Tropicbird","White-throated Needletail","White-throated Robin","White-throated Sparrow","White-throated Swift","White-tipped Dove","White-winged Crossbill","White-winged Dove","White-winged Parakeet","White-winged Scoter","White-winged Tern","Whooper Swan","Whooping Crane","Wild Turkey","Willet","Williamson's Sapsucker","Willow Flycatcher","Willow Ptarmigan","Wilson's Phalarope","Wilson's Plover","Wilson's Storm-Petrel","Wilson's Warbler","Winter Wren","Wood Duck","Wood Sandpiper","Wood Stork","Wood Thrush","Wood Warbler","Worm-eating Warbler","Worthen's Sparrow","Wrentit","Xantus's Hummingbird","Xantus's Murrelet","Yellow Bittern","Yellow Grosbeak","Yellow Rail","Yellow Wagtail","Yellow Warbler","Yellow-bellied Flycatcher","Yellow-bellied Sapsucker","Yellow-billed Cuckoo","Yellow-billed Loon","Yellow-billed Magpie","Yellow-breasted Bunting","Yellow-breasted Chat","Yellow-crowned Night-Heron","Yellow-eyed Junco","Yellow-faced Grassquit","Yellow-footed Gull","Yellow-green Vireo","Yellow-headed Blackbird","Yellow-legged Gull","Yellow-nosed Albatross","Yellow-rumped Warbler","Yellow-throated Vireo","Yellow-throated Warbler","Yucatan Vireo","Zenaida Dove","Zone-tailed Hawk"],hJ=["Abyssinian","American Bobtail","American Curl","American Shorthair","American Wirehair","Balinese","Bengal","Birman","Bombay","British Shorthair","Burmese","Chartreux","Chausie","Cornish Rex","Devon Rex","Donskoy","Egyptian Mau","
4366Exotic Shorthair","Havana","Highlander","Himalayan","Japanese Bobtail","Korat","Kurilian Bobtail","LaPerm","Maine Coon","Manx","Minskin","Munchkin","Nebelung","Norwegian Forest Cat","Ocicat","Ojos Azules","Oriental","Persian","Peterbald","Pixiebob","Ragdoll","Russian Blue","Savannah","Scottish Fold","Selkirk Rex","Serengeti","Siamese","Siberian","Singapura","Snowshoe","Sokoke","Somali","Sphynx","Thai","Tonkinese","Toyger","Turkish Angora","Turkish Van"],mJ=["Amazon River Dolphin","Arnoux's Beaked Whale","Atlantic Humpbacked Dolphin","Atlantic Spotted Dolphin","Atlantic White-Sided Dolphin","Australian Snubfin Dolphin","Australian humpback Dolphin","Blue Whale","Bottlenose Dolphin","Bryde’s whale","Burrunan Dolphin","Chilean Dolphin","Chinese River Dolphin","Chinese White Dolphin","Clymene Dolphin","Commerson’s Dolphin","Costero","Dusky Dolphin","False Killer Whale","Fin Whale","Fraser’s Dolphin","Ganges River Dolphin","Guiana Dolphin","Heaviside’s Dolphin","Hector’s Dolphin","Hourglass Dolphin","Humpback whale","Indo-Pacific Bottlenose Dolphin","Indo-Pacific Hump-backed Dolphin","Irrawaddy Dolphin","Killer Whale (Orca)","La Plata Dolphin","Long-Beaked Common Dolphin","Long-finned Pilot Whale","Longman's Beaked Whale","Melon-headed Whale","Northern Rightwhale Dolphin","Omura’s whale","Pacific White-Sided Dolphin","Pantropical Spotted Dolphin","Peale’s Dolphin","Pygmy Killer Whale","Risso’s Dolphin","Rough-Toothed Dolphin","Sei Whale","Short-Beaked Common Dolphin","Short-finned Pilot Whale","Southern Bottlenose Whale","Southern Rightwhale Dolphin","Sperm Whale","Spinner Dolphin","Striped Dolphin","Tucuxi","White-Beaked Dolphin"],fJ=["Aberdeen Angus","Abergele","Abigar","Abondance","Abyssinian Shorthorned Zebu","Aceh","Achham","Adamawa","Adaptaur","Afar","Africangus","Afrikaner","Agerolese","Alambadi","Alatau","Albanian","Albera","Alderney","Alentejana","Aleutian wild cattle","Aliad Dinka","Alistana-Sanabresa","Allmogekor","Alur","American","American Angus","American Beef Friesian","American Brown Swiss","American Milking Devon","American White Park","Amerifax","Amrit Mahal","Amsterdam Island cattle","Anatolian Black","Andalusian Black","Andalusian Blond","Andalusian Grey","Angeln","Angoni","Ankina","Ankole","Ankole-Watusi","Aracena","Arado","Argentine Criollo","Argentine Friesian","Armorican","Arouquesa","Arsi","Asturian Mountain","Asturian Valley","Aubrac","Aulie-Ata","Aure et Saint-Girons","Australian Braford","Australian Brangus","Australian Charbray","Australian Friesian Sahiwal","Australian Lowline","Australian Milking Zebu","Australian Shorthorn","Austrian Simmental","Austrian Yellow","Avileña-Negra Ibérica","Avétonou","Aweil Dinka","Ayrshire","Azaouak","Azebuado","Azerbaijan Zebu","Azores","Bachaur cattle","Baherie cattle","Bakosi cattle","Balancer","Baoule","Bargur cattle","Barrosã","Barzona","Bazadaise","Beef Freisian","Beefalo","Beefmaker","Beefmaster","Begayt","Belgian Blue","Belgian Red","Belgian Red Pied","Belgian White-and-Red","Belmont Red","Belted Galloway","Bernese","Berrenda cattle","Betizu","Bianca Modenese","Blaarkop","Black Angus","Black Baldy","Black Hereford","Blanca Cacereña","Blanco Orejinegro BON","Blonde d'Aquitaine","Blue Albion","Blue Grey","Bohuskulla","Bonsmara","Boran","Boškarin","Braford","Brahman","Brahmousin","Brangus","Braunvieh","Brava","Breed","British Friesian","British White","Brown Carpathian","Brown Caucasian","Brown Swiss","Bue Lingo","Burlina","Bushuyev","Butana cattle","Buša cattle","Cachena","Caldelana","Camargue","Campbell Island cattle","Canadian Speckle Park","Canadienne","Canaria","Canchim","Caracu","Carinthian Blondvieh","Carora","Charbray","Charolais","Chateaubriand","Chiangus","Chianina","Chillingham cattle","Chinese Black Pied","Cholistani","Coloursided White Back","Commercial","Corriente","Corsican cattle","Costeño con Cuernos","Crioulo Lageano","Cárdena Andaluza","Dajal","Dangi cattle","Danish Black-Pied","Danish Jersey","Danish Red","Deep Red cattle","Deoni","Devon","Dexter cattle","Dhanni","Doayo cattle","Doela","Drakensberger","Droughtmaster","Dulong'","Dutch Belted","Dutch Friesian","Dwarf Lulu","Dølafe","East Anatolian Red","Eastern Finncattle","Eastern Red Polled","Enderby Island cattle","English Longhorn","Ennstaler Bergscheck","Estonian Holstein","Estonian Native","Estonian Red cattle","Finncattle","Finnish Ayrshire","Finnish Holstein-Friesian","Fjäll","Fleckvieh","Florida Cracker cattle","Fogera","French Simmental","Fribourgeoise","Friesian Red and White","Fulani Sudanese","Fēng Cattle","Galician Blond","Galloway cattle","Gangatiri","Gaolao","Garvonesa","Gascon cattle","Gelbvieh","Georgian Mountain cattle","German Angus","German Black Pied Dairy","German Black Pied cattle","German Red Pied","Gir","Glan cattle","Gloucester","Gobra","Greek Shorthorn","Greek Steppe","Greyman cattle","Gudali","Guernsey cattle","Guzerá","Hallikar4","Hanwoo","Hariana cattle","Hartón del Valle","Harzer Rotvieh","Hays Converter","Heck cattle","Hereford","Herens","Highland cattle","Hinterwald","Holando-Argentino","Holstein Friesian cattle","Horro","Hungarian Grey","Huáng Cattle","Hybridmaster","Iberian cattle","Icelandic","Illawarra cattle","Improved Red and White","Indo-Brazilian","Irish Moiled","Israeli Holstein","Israeli Red","Istoben cattle","Istrian cattle","Jamaica Black","Jamaica Hope","Jamaica Red","Japanese Brown","Jarmelista","Javari cattle","Jersey cattle","Jutland cattle","Kabin Buri cattle","Kalmyk cattle","Kamphaeng Saen cattle","Kangayam","Kankrej","Karan Swiss","Kasaragod Dwarf cattle","Kathiawadi","Kazakh Whiteheaded","Kenana cattle","Kenkatha cattle","Kerry cattle","Kherigarh","Khillari cattle","Kholomogory","Korat Wagyu","Kostroma cattle","Krishna Valley cattle","Kurgan cattle","Kuri","La Reina cattle","Lakenvelder cattle","Lampurger","Latvian Blue","Latvian Brown","Latvian Danish Red","Lebedyn","Levantina","Limia cattle","Limousin","Limpurger","Lincoln Red","Lineback","Lithuanian Black-and-White","Lithuanian Light Grey","Lithuanian Red","Lithuanian White-Backed","Lohani cattle","Lourdais","Lucerna cattle","Luing","Madagascar Zebu","Madura","Maine-Anjou","Malnad Gidda","Malvi","Mandalong Special","Mantequera Leonesa","Maramureş Brown","Marchigiana","Maremmana","Marinhoa","Maronesa","Masai","Mashona","Menorquina","Mertolenga","Meuse-Rhine-Issel","Mewati","Milking Shorthorn","Minhota","Mirandesa","Mirkadim","Mocăniţă","Mollie","Monchina","Mongolian","Montbéliarde","Morucha","Murboden","Murnau-Werdenfels","Murray Grey","Muturu","N'Dama","Nagori","Negra Andaluza","Nelore","Nguni","Nimari","Normande","North Bengal Grey","Northern Finncattle","Northern Shorthorn","Norweg
4366ian Red","Ongole","Original Simmental","Pajuna","Palmera","Pantaneiro","Parda Alpina","Parthenaise","Pasiega","Pembroke","Philippine Native","Pie Rouge des Plaines","Piedmontese cattle","Pineywoods","Pinzgauer","Pirenaica","Podolac","Podolica","Polish Black-and-White","Polish Red","Poll Shorthorn","Polled Hereford","Polled Shorthorn","Ponwar","Preta","Pulikulam","Punganur","Pustertaler Sprinzen","Qinchaun","Queensland Miniature Boran","RX3","Ramo Grande","Randall","Raramuri Criollo","Rathi","Raya","Red Angus","Red Brangus","Red Chittagong","Red Fulani","Red Gorbatov","Red Holstein","Red Kandhari","Red Mingrelian","Red Poll","Red Polled Østland","Red Sindhi","Retinta","Riggit Galloway","Ringamåla","Rohjan","Romagnola","Romanian Bălţata","Romanian Steppe Gray","Romosinuano","Russian Black Pied","Rätisches Grauvieh","Sahiwal","Salers","Salorn","Sanga","Sanhe","Santa Cruz","Santa Gertrudis","Sayaguesa","Schwyz","Selembu","Senepol","Serbian Pied","Serbian Steppe","Sheko","Shetland","Shorthorn","Siboney de Cuba","Simbrah","Simford","Simmental","Siri","South Devon","Spanish Fighting Bull","Speckle Park","Square Meater","Sussex","Swedish Friesian","Swedish Polled","Swedish Red Pied","Swedish Red Polled","Swedish Red-and-White","Tabapuã","Tarentaise","Tasmanian Grey","Tauros","Telemark","Texas Longhorn","Texon","Thai Black","Thai Fighting Bull","Thai Friesian","Thai Milking Zebu","Tharparkar","Tswana","Tudanca","Tuli","Tulim","Turkish Grey Steppe","Tux-Zillertal","Tyrol Grey","Ukrainian Grey","Umblachery","Valdostana Castana","Valdostana Pezzata Nera","Valdostana Pezzata Rossa","Vaynol","Vechur8","Vestland Fjord","Vestland Red Polled","Vianesa","Volinian Beef","Vorderwald","Vosgienne","Väneko","Waguli","Wagyu","Wangus","Welsh Black","Western Finncattle","White Cáceres","White Fulani","White Lamphun","White Park","Whitebred Shorthorn","Xingjiang Brown","Yakutian","Yanbian","Yanhuang","Yurino","Zebu","Évolène cattle","Żubroń"],pJ=["African Slender-snouted Crocodile","Alligator mississippiensis","American Crocodile","Australian Freshwater Crocodile","Black Caiman","Broad-snouted Caiman","Chinese Alligator","Cuban Crocodile","Cuvier’s Dwarf Caiman","Dwarf Crocodile","Gharial","Morelet’s Crocodile","Mugger Crocodile","New Guinea Freshwater Crocodile","Nile Crocodile","Orinoco Crocodile","Philippine Crocodile","Saltwater Crocodile","Schneider’s Smooth-fronted Caiman","Siamese Crocodile","Spectacled Caiman","Tomistoma","West African Crocodile","Yacare Caiman"],gJ=["Affenpinscher","Afghan Hound","Aidi","Airedale Terrier","Akbash","Akita","Alano Español","Alapaha Blue Blood Bulldog","Alaskan Husky","Alaskan Klee Kai","Alaskan Malamute","Alopekis","Alpine Dachsbracke","American Bulldog","American Bully","American Cocker Spaniel","American English Coonhound","American Foxhound","American Hairless Terrier","American Pit Bull Terrier","American Staffordshire Terrier","American Water Spaniel","Andalusian Hound","Anglo-Français de Petite Vénerie","Appenzeller Sennenhund","Ariegeois","Armant","Armenian Gampr dog","Artois Hound","Australian Cattle Dog","Australian Kelpie","Australian Shepherd","Australian Stumpy Tail Cattle Dog","Australian Terrier","Austrian Black and Tan Hound","Austrian Pinscher","Azawakh","Bakharwal dog","Banjara Hound","Barbado da Terceira","Barbet","Basenji","Basque Shepherd Dog","Basset Artésien Normand","Basset Bleu de Gascogne","Basset Fauve de Bretagne","Basset Hound","Bavarian Mountain Hound","Beagle","Beagle-Harrier","Bearded Collie","Beauceron","Bedlington Terrier","Belgian Shepherd","Bergamasco Shepherd","Berger Picard","Bernese Mountain Dog","Bhotia","Bichon Frisé","Billy","Black Mouth Cur","Black Norwegian Elkhound","Black Russian Terrier","Black and Tan Coonhound","Bloodhound","Blue Lacy","Blue Picardy Spaniel","Bluetick Coonhound","Boerboel","Bohemian Shepherd","Bolognese","Border Collie","Border Terrier","Borzoi","Bosnian Coarse-haired Hound","Boston Terrier","Bouvier des Ardennes","Bouvier des Flandres","Boxer","Boykin Spaniel","Bracco Italiano","Braque Francais","Braque Saint-Germain","Braque d'Auvergne","Braque de l'Ariège","Braque du Bourbonnais","Briard","Briquet Griffon Vendéen","Brittany","Broholmer","Bruno Jura Hound","Brussels Griffon","Bucovina Shepherd Dog","Bull Arab","Bull Terrier","Bulldog","Bullmastiff","Bully Kutta","Burgos Pointer","Cairn Terrier","Campeiro Bulldog","Can de Chira","Canaan Dog","Canadian Eskimo Dog","Cane Corso","Cane Paratore","Cane di Oropa","Cantabrian Water Dog","Cardigan Welsh Corgi","Carea Castellano Manchego","Carolina Dog","Carpathian Shepherd Dog","Catahoula Leopard Dog","Catalan Sheepdog","Caucasian Shepherd Dog","Cavalier King Charles Spaniel","Central Asian Shepherd Dog","Cesky Fousek","Cesky Terrier","Chesapeake Bay Retriever","Chien Français Blanc et Noir","Chien Français Blanc et Orange","Chien Français Tricolore","Chihuahua","Chilean Terrier","Chinese Chongqing Dog","Chinese Crested Dog","Chinook","Chippiparai","Chongqing dog","Chortai","Chow Chow","Cimarrón Uruguayo","Cirneco dell'Etna","Clumber Spaniel","Colombian fino hound","Coton de Tulear","Cretan Hound","Croatian Sheepdog","Curly-Coated Retriever","Cursinu","Czechoslovakian Wolfdog","Cão Fila de São Miguel","Cão da Serra de Aires","Cão de Castro Laboreiro","Cão de Gado Transmontano","Dachshund","Dalmatian","Dandie Dinmont Terrier","Danish-Swedish Farmdog","Denmark Feist","Dingo","Doberman Pinscher","Dogo Argentino","Dogo Guatemalteco","Dogo Sardesco","Dogue Brasileiro","Dogue de Bordeaux","Drentse Patrijshond","Drever","Dunker","Dutch Shepherd","Dutch Smoushond","East European Shepherd","East Siberian Laika","English Cocker Spaniel","English Foxhound","English Mastiff","English Setter","English Shepherd","English Springer Spaniel","English Toy Terrier","Entlebucher Mountain Dog","Estonian Hound","Estrela Mountain Dog","Eurasier","Field Spaniel","Fila Brasileiro","Finnish Hound","Finnish Lapphund","Finnish Spitz","Flat-Coated Retriever","French Bulldog","French Spaniel","Galgo Español","Galician Shepherd Dog","Garafian Shepherd","Gascon Saintongeois","Georgian Shepherd","German Hound","German Longhaired Pointer","German Pinscher","German Roughhaired Pointer","German Shepherd Dog","German Shorthaired Pointer","German Spaniel","German Spitz","German Wirehaired Pointer","Giant Schnauzer","Glen of Imaal Terrier","Golden Retriever","Gordon Setter","Gończy Polski","Grand Anglo-Français Blanc et Noir","Grand Anglo-Français Blanc et Orange","Grand Anglo-Français Tricolore","Grand Basset Griffon Vendéen","Grand Bleu de Gascogne","Grand Griffon Vendéen","Great Dane","Greater Swiss Mountain Dog","Greek Harehound","Greek Shepherd","Greenland Dog","Greyhound","Griffon Bleu de Gascogne","Griffon Fauve de Bretagne","Griffon Nivernais","Gull Dong","Gull Terrier","Hamiltonstövare","Hanover Hound","Harrier","Havanese","Hierran Wolfdog","Hokkaido","Hovawart","Huntaway","Hygen Hound","Hällefors Elkhound","Ibizan Hound","Icelandic Sheepdog","Indian Spitz","Indian pariah dog","Irish Red and White Setter","Irish Setter","Irish Terrier","Irish Water Spaniel","Irish Wolfhound","Istrian Coarse-haired Hound","Istrian Shorthaired Hound","Italian Greyhound","Jack Russell Terrier","Jagdterrier","Japanese Chin","Japanese Spitz","Japanese Terrier","Jindo","Jonangi","Kai Ken","Kaikadi","Kangal Shepherd Dog","Kanni","Karakachan dog","Karelian Bear Dog","Kars","Karst Shepherd","Keeshond","Kerry Beagle","Kerry Blue Terrier","King Charles Spaniel","King Shepherd","Kintamani","Kishu","Kokoni","Kombai","Komondor","Kooikerhondje","Koolie","Koyun dog","Kromfohrländer","Kuchi","Kuvasz","Labrador Retriever","Lagotto Romagnolo","Lakeland Terrier","Lancashire Heeler","Landseer","Lapponian Herder","Large Münsterländer","Leonberger","Levriero Sardo","Lhasa Apso","Lithuanian Hound","Lupo Italiano","Löwchen","Mackenzie River Husky","Magyar agár","Mahratta Greyhound","Maltese","Manchester Terrier","Maremmano-Abruzzese Sheepdog","McNab dog","Miniature American Shepherd","Miniature Bull Terrier","Miniature Fox Terrier","Miniature Pinscher","Miniature Schnauzer","Molossus of Epirus","Montenegrin Mountain Hound","Mountain Cur","Mountain Feist","Mucuchies","Mudhol Hound","Mudi","Neapolitan Mastiff","New Guinea Singing Dog","New Zealand Heading Dog","Newfoundland","Norfolk Terrier","Norrbottenspets","Northern Inuit Dog","Norweg
4366ian Buhund","Norwegian Elkhound","Norwegian Lundehund","Norwich Terrier","Nova Scotia Duck Tolling Retriever","Old Croatian Sighthound","Old Danish Pointer","Old English Sheepdog","Old English Terrier","Olde English Bulldogge","Otterhound","Pachon Navarro","Paisley Terrier","Pampas Deerhound","Papillon","Parson Russell Terrier","Pastore della Lessinia e del Lagorai","Patagonian Sheepdog","Patterdale Terrier","Pekingese","Pembroke Welsh Corgi","Perro Majorero","Perro de Pastor Mallorquin","Perro de Presa Canario","Perro de Presa Mallorquin","Peruvian Inca Orchid","Petit Basset Griffon Vendéen","Petit Bleu de Gascogne","Phalène","Pharaoh Hound","Phu Quoc Ridgeback","Picardy Spaniel","Plott Hound","Plummer Terrier","Podenco Canario","Podenco Valenciano","Pointer","Poitevin","Polish Greyhound","Polish Hound","Polish Lowland Sheepdog","Polish Tatra Sheepdog","Pomeranian","Pont-Audemer Spaniel","Poodle","Porcelaine","Portuguese Podengo","Portuguese Pointer","Portuguese Water Dog","Posavac Hound","Pražský Krysařík","Pshdar Dog","Pudelpointer","Pug","Puli","Pumi","Pungsan Dog","Pyrenean Mastiff","Pyrenean Mountain Dog","Pyrenean Sheepdog","Rafeiro do Alentejo","Rajapalayam","Rampur Greyhound","Rat Terrier","Ratonero Bodeguero Andaluz","Ratonero Mallorquin","Ratonero Murciano de Huerta","Ratonero Valenciano","Redbone Coonhound","Rhodesian Ridgeback","Romanian Mioritic Shepherd Dog","Romanian Raven Shepherd Dog","Rottweiler","Rough Collie","Russian Spaniel","Russian Toy","Russo-European Laika","Saarloos Wolfdog","Sabueso Español","Saint Bernard","Saint Hubert Jura Hound","Saint-Usuge Spaniel","Saluki","Samoyed","Sapsali","Sarabi dog","Sardinian Shepherd Dog","Schapendoes","Schillerstövare","Schipperke","Schweizer Laufhund","Schweizerischer Niederlaufhund","Scottish Deerhound","Scottish Terrier","Sealyham Terrier","Segugio Italiano","Segugio Maremmano","Segugio dell'Appennino","Seppala Siberian Sleddog","Serbian Hound","Serbian Tricolour Hound","Serrano Bulldog","Shar Pei","Shetland Sheepdog","Shiba Inu","Shih Tzu","Shikoku","Shiloh Shepherd","Siberian Husky","Silken Windhound","Silky Terrier","Sinhala Hound","Skye Terrier","Sloughi","Slovakian Wirehaired Pointer","Slovenský Cuvac","Slovenský Kopov","Smalandstövare","Small Greek domestic dog","Small Münsterländer","Smooth Collie","Smooth Fox Terrier","Soft-Coated Wheaten Terrier","South Russian Ovcharka","Spanish Mastiff","Spanish Water Dog","Spinone Italiano","Sporting Lucas Terrier","Stabyhoun","Staffordshire Bull Terrier","Standard Schnauzer","Stephens Stock","Styrian Coarse-haired Hound","Sussex Spaniel","Swedish Elkhound","Swedish Lapphund","Swedish Vallhund","Swedish White Elkhound","Taigan","Taiwan Dog","Tamaskan Dog","Teddy Roosevelt Terrier","Telomian","Tenterfield Terrier","Terrier Brasileiro","Thai Bangkaew Dog","Thai Ridgeback","Tibetan Mastiff","Tibetan Spaniel","Tibetan Terrier","Tornjak","Tosa","Toy Fox Terrier","Toy Manchester Terrier","Transylvanian Hound","Treeing Cur","Treeing Feist","Treeing Tennessee Brindle","Treeing Walker Coonhound","Trigg Hound","Tyrolean Hound","Vikhan","Villano de Las Encartaciones","Villanuco de Las Encartaciones","Vizsla","Volpino Italiano","Weimaraner","Welsh Sheepdog","Welsh Springer Spaniel","Welsh Terrier","West Highland White Terrier","West Siberian Laika","Westphalian Dachsbracke","Wetterhoun","Whippet","White Shepherd","White Swiss Shepherd Dog","Wire Fox Terrier","Wirehaired Pointing Griffon","Wirehaired Vizsla","Xiasi Dog","Xoloitzcuintli","Yakutian Laika","Yorkshire Terrier","Šarplaninac"],xJ=["Alaska pollock","Albacore","Amur catfish","Araucanian herring","Argentine hake","Asari","Asian swamp eel","Atlantic cod","Atlantic herring","Atlantic horse mackerel","Atlantic mackerel","Atlantic menhaden","Atlantic salmon","Bigeye scad","Bigeye tuna","Bighead carp","Black carp","Blood cockle","Blue swimming crab","Blue whiting","Bombay-duck","Bonga shad","California pilchard","Cape horse mackerel","Capelin","Catla","Channel catfish","Chilean jack mackerel","Chinese perch","Chinese softshell turtle","Chub mackerel","Chum salmon","Common carp","Crucian carp","Daggertooth pike conger","European anchovy","European pilchard","European sprat","Filipino Venus","Gazami crab","Goldstripe sardinella","Grass carp","Gulf menhaden","Haddock","Hilsa shad","Indian mackerel","Indian oil sardine","Iridescent shark","Japanese anchovy","Japanese cockle","Japanese common catfish","Japanese flying squid","Japanese jack mackerel","Japanese littleneck","Japanese pilchard","Jumbo flying squid","Kawakawa","Korean bullhead","Largehead hairtail","Longtail tuna","Madeiran sardinella","Mandarin fish","Milkfish","Mrigal carp","Narrow-barred Spanish mackerel","Nile perch","Nile tilapia","North Pacific hake","Northern snakehead","Pacific anchoveta","Pacific cod","Pacific herring","Pacific sand lance","Pacific sandlance","Pacific saury","Pacific thread herring","Peruvian anchoveta","Pink salmon","Pollock","Pond loach","Rainbow trout","Rohu","Round sardinella","Short mackerel","Silver carp","Silver cyprinid","Skipjack tuna","Southern African anchovy","Southern rough shrimp","Whiteleg shrimp","Wuchang bream","Yellow croaker","Yellowfin tuna","Yellowhead catfish","Yellowstripe scad"],vJ=["Abaco Barb","Abtenauer","Abyssinian","Aegidienberger","Akhal-Teke","Albanian Horse","Altai Horse","Altèr Real","American Albino","American Cream Draft","American Indian Horse","American Paint Horse","American Quarter Horse","American Saddlebred","American Warmblood","Andalusian Horse","Andravida Horse","Anglo-Arabian","Anglo-Arabo-Sardo","Anglo-Kabarda","Appaloosa","AraApp
4366aloosa","Arabian Horse","Ardennes Horse","Arenberg-Nordkirchen","Argentine Criollo","Asian wild Horse","Assateague Horse","Asturcón","Augeron","Australian Brumby","Australian Draught Horse","Australian Stock Horse","Austrian Warmblood","Auvergne Horse","Auxois","Azerbaijan Horse","Azteca Horse","Baise Horse","Bale","Balearic Horse","Balikun Horse","Baluchi Horse","Banker Horse","Barb Horse","Bardigiano","Bashkir Curly","Basque Mountain Horse","Bavarian Warmblood","Belgian Half-blood","Belgian Horse","Belgian Warmblood","Bhutia Horse","Black Forest Horse","Blazer Horse","Boerperd","Borana","Boulonnais Horse","Brabant","Brandenburger","Brazilian Sport Horse","Breton Horse","Brumby","Budyonny Horse","Burguete Horse","Burmese Horse","Byelorussian Harness Horse","Calabrese Horse","Camargue Horse","Camarillo White Horse","Campeiro","Campolina","Canadian Horse","Canadian Pacer","Carolina Marsh Tacky","Carthusian Horse","Caspian Horse","Castilian Horse","Castillonnais","Catria Horse","Cavallo Romano della Maremma Laziale","Cerbat Mustang","Chickasaw Horse","Chilean Corralero","Choctaw Horse","Cleveland Bay","Clydesdale Horse","Cob","Coldblood Trotter","Colonial Spanish Horse","Colorado Ranger","Comtois Horse","Corsican Horse","Costa Rican Saddle Horse","Cretan Horse","Criollo Horse","Croatian Coldblood","Cuban Criollo","Cumberland Island Horse","Curly Horse","Czech Warmblood","Daliboz","Danish Warmblood","Danube Delta Horse","Dole Gudbrandsdal","Don","Dongola Horse","Draft Trotter","Dutch Harness Horse","Dutch Heavy Draft","Dutch Warmblood","Dzungarian Horse","East Bulgarian","East Friesian Horse","Estonian Draft","Estonian Horse","Falabella","Faroese","Finnhorse","Fjord Horse","Fleuve","Florida Cracker Horse","Foutanké","Frederiksborg Horse","Freiberger","French Trotter","Friesian Cross","Friesian Horse","Friesian Sporthorse","Furioso-North Star","Galiceño","Galician Pony","Gelderland Horse","Georgian Grande Horse","German Warmblood","Giara Horse","Gidran","Groningen Horse","Gypsy Horse","Hackney Horse","Haflinger","Hanoverian Horse","Heck Horse","Heihe Horse","Henson Horse","Hequ Horse","Hirzai","Hispano-Bretón","Holsteiner Horse","Horro","Hungarian Warmblood","Icelandic Horse","Iomud","Irish Draught","Irish Sport Horse sometimes called Irish Hunter","Italian Heavy Draft","Italian Trotter","Jaca Navarra","Jeju Horse","Jutland Horse","Kabarda Horse","Kafa","Kaimanawa Horses","Kalmyk Horse","Karabair","Karabakh Horse","Karachai Horse","Karossier","Kathiawari","Kazakh Horse","Kentucky Mountain Saddle Horse","Kiger Mustang","Kinsky Horse","Kisber Felver","Kiso Horse","Kladruber","Knabstrupper","Konik","Kundudo","Kustanair","Kyrgyz Horse","Latvian Horse","Lipizzan","Lithuanian Heavy Draught","Lokai","Losino Horse","Lusitano","Lyngshest","M'Bayar","M'Par","Mallorquín","Malopolski","Mangalarga","Mangalarga Marchador","Maremmano","Marismeño Horse","Marsh Tacky","Marwari Horse","Mecklenburger","Menorquín","Messara Horse","Metis Trotter","Mezőhegyesi Sport Horse","Međimurje Horse","Miniature Horse","Misaki Horse","Missouri Fox Trotter","Monchina","Mongolian Horse","Mongolian Wild Horse","Monterufolino","Morab","Morgan Horse","Mountain Pleasure Horse","Moyle Horse","Murakoz Horse","Murgese","Mustang Horse","Mérens Horse","Namib Desert Horse","Nangchen Horse","National Show Horse","Nez Perce Horse","Nivernais Horse","Nokota Horse","Noma","Nonius Horse","Nooitgedachter","Nordlandshest","Noriker Horse","Norman Cob","North American Single-Footer Horse","North Swedish Horse","Norweg
4366ian Coldblood Trotter","Norwegian Fjord","Novokirghiz","Oberlander Horse","Ogaden","Oldenburg Horse","Orlov trotter","Ostfriesen","Paint","Pampa Horse","Paso Fino","Pentro Horse","Percheron","Persano Horse","Peruvian Paso","Pintabian","Pleven Horse","Poitevin Horse","Posavac Horse","Pottok","Pryor Mountain Mustang","Przewalski's Horse","Pura Raza Española","Purosangue Orientale","Qatgani","Quarab","Quarter Horse","Racking Horse","Retuerta Horse","Rhenish German Coldblood","Rhinelander Horse","Riwoche Horse","Rocky Mountain Horse","Romanian Sporthorse","Rottaler","Russian Don","Russian Heavy Draft","Russian Trotter","Saddlebred","Salerno Horse","Samolaco Horse","San Fratello Horse","Sarcidano Horse","Sardinian Anglo-Arab","Schleswig Coldblood","Schwarzwälder Kaltblut","Selale","Sella Italiano","Selle Français","Shagya Arabian","Shan Horse","Shire Horse","Siciliano Indigeno","Silesian Horse","Sokolsky Horse","Sorraia","South German Coldblood","Soviet Heavy Draft","Spanish Anglo-Arab","Spanish Barb","Spanish Jennet Horse","Spanish Mustang","Spanish Tarpan","Spanish-Norman Horse","Spiti Horse","Spotted Saddle Horse","Standardbred Horse","Suffolk Punch","Swedish Ardennes","Swedish Warmblood","Swedish coldblood trotter","Swiss Warmblood","Taishū Horse","Takhi","Tawleed","Tchernomor","Tennessee Walking Horse","Tersk Horse","Thoroughbred","Tiger Horse","Tinker Horse","Tolfetano","Tori Horse","Trait Du Nord","Trakehner","Tsushima","Tuigpaard","Ukrainian Riding Horse","Unmol Horse","Uzunyayla","Ventasso Horse","Virginia Highlander","Vlaamperd","Vladimir Heavy Draft","Vyatka","Waler","Waler Horse","Walkaloosa","Warlander","Warmblood","Welsh Cob","Westphalian Horse","Wielkopolski","Württemberger","Xilingol Horse","Yakutian Horse","Yili Horse","Yonaguni Horse","Zaniskari","Zhemaichu","Zweibrücker","Žemaitukas"],yJ=["Acacia-ants","Acorn-plum gall","Aerial yellowjacket","Africanized honey bee","Allegheny mound ant","Almond stone wasp","Ant","Arboreal ant","Argentine ant","Asian paper wasp","Baldfaced hornet","Bee","Bigheaded ant","Black and yellow mud dauber","Black carpenter ant","Black imported fire ant","Blue horntail woodwasp","Blue orchard bee","Braconid wasp","Bumble bee","Carpenter ant","Carpenter wasp","Chalcid wasp","Cicada killer","Citrus blackfly parasitoid","Common paper wasp","Crazy ant","Cuckoo wasp","Cynipid gall wasp","Eastern Carpenter bee","Eastern yellowjacket","Elm sawfly","Encyrtid wasp","Erythrina gall wasp","Eulophid wasp","European hornet","European imported fire ant","False honey ant","Fire ant","Forest bachac","Forest yellowjacket","German yellowjacket","Ghost ant","Giant ichneumon wasp","Giant resin bee","Giant wood wasp","Golden northern bumble bee","Golden paper wasp","Gouty oak gall","Grass Carrying Wasp","Great black wasp","Great golden digger wasp","Hackberry nipple gall parasitoid","Honey bee","Horned oak gall","Horse guard wasp","Hunting wasp","Ichneumonid wasp","Keyhole wasp","Knopper gall","Large garden bumble bee","Large oak-apple gall","Leafcutting bee","Little fire ant","Little yellow ant","Long-horned bees","Long-legged ant","Macao paper wasp","Mallow bee","Marble gall","Mossyrose gall wasp","Mud-daubers","Multiflora rose seed chalcid","Oak apple gall wasp","Oak rough bulletgall wasp","Oak saucer gall","Oak shoot sawfly","Odorous house ant","Orange-tailed bumble bee","Orangetailed potter wasp","Oriental chestnut gall wasp","Paper wasp","Pavement ant","Pigeon tremex","Pip gall wasp","Prairie yellowjacket","Pteromalid wasp","Pyramid ant","Raspberry Horntail","Red ant","Red carpenter ant","Red harvester ant","Red imported fire ant","Red wasp","Red wood ant","Red-tailed wasp","Reddish carpenter ant","Rough harvester ant","Sawfly parasitic wasp","Scale parasitoid","Silky ant","Sirex woodwasp","Siricid woodwasp","Smaller yellow ant","Southeastern blueberry bee","Southern fire ant","Southern yellowjacket","Sphecid wasp","Stony gall","Sweat bee","Texas leafcutting ant","Tiphiid wasp","Torymid wasp","Tramp ant","Valentine ant","Velvet ant","Vespid wasp","Weevil parasitoid","Western harvester ant","Western paper wasp","Western thatching ant","Western yellowjacket","White-horned horntail","Willow shoot sawfly","Woodwasp","Wool sower gall maker","Yellow Crazy Ant","Yellow and black potter wasp","Yellow-horned horntail"],bJ=["Asiatic Lion","Barbary Lion","Cape lion","Masai Lion","Northeast Congo Lion","Transvaal lion","West African Lion"],wJ=["Ace","Archie","Bailey","Bandit","Bella","Bentley","Bruno","Buddy","Charlie","Coco","Cookie","Cooper","Daisy","Dixie","Finn","Ginger","Gracie","Gus","Hank","Jack","Jax","Joey","Kobe","Leo","Lola","Louie","Lucy","Maggie","Max","Mia","Milo","Molly","Murphey","Nala","Nova","Ollie","Oreo","Rosie","Scout","Stella","Teddy","Tuffy"],SJ=["American","American Chinchilla","American Fuzzy Lop","American Sable","Argente Brun","Belgian Hare","Beveren","Blanc de Hotot","Britannia Petite","Californian","Champagne D’Argent","Checkered Giant","Cinnamon","Crème D’Argent","Dutch","Dwarf Hotot","English Angora","English Lop","English Spot","Flemish Giant","Florida White","French Angora","French Lop","Giant Angora","Giant Chinchilla","Harlequin","Havana","Himalayan","Holland Lop","Jersey Wooly","Lilac","Lionhead","Mini Lop","Mini Rex","Mini Satin","Netherland Dwarf","New Zealand","Palomino","Polish","Rex","Rhinelander","Satin","Satin Angora","Silver","Silver Fox","Silver Marten","Standard Chinchilla","Tan","Thrianta"],FJ=["Abrocoma","Abrocoma schistacea","Aconaemys","Aconaemys porteri","African brush-tailed porcupine","Andean mountain cavy","Argentine tuco-tuco","Ashy chinchilla rat","Asiatic brush-tailed porcupine","Atherurus","Azara's agouti","Azara's tu
4366co-tuco","Bahia porcupine","Bathyergus","Bathyergus janetta","Bathyergus suillus","Bennett's chinchilla rat","Bicolored-spined porcupine","Black agouti","Black dwarf porcupine","Black-rumped agouti","Black-tailed hairy dwarf porcupine","Bolivian chinchilla rat","Bolivian tuco-tuco","Bonetto's tuco-tuco","Brandt's yellow-toothed cavy","Brazilian guinea pig","Brazilian porcupine","Brazilian tuco-tuco","Bridge's degu","Brown hairy dwarf porcupine","Budin's chinchilla rat, A. budini","Cape porcupine","Catamarca tuco-tuco","Cavia","Central American agouti","Chacoan tuco-tuco","Chilean rock rat","Chinchilla","Coendou","Coiban agouti","Colburn's tuco-tuco","Collared tuco-tuco","Common degu","Common yellow-toothed cavy","Conover's tuco-tuco","Coruro","Crested agouti","Crested porcupine","Cryptomys","Cryptomys bocagei","Cryptomys damarensis","Cryptomys foxi","Cryptomys hottentotus","Cryptomys mechowi","Cryptomys ochraceocinereus","Cryptomys zechi","Ctenomys","Cuniculus","Cuscomys","Cuscomys ashanika","Dactylomys","Dactylomys boliviensis","Dactylomys dactylinus","Dactylomys peruanus","Dasyprocta","Domestic guinea pig","Emily's tuco-tuco","Erethizon","Famatina chinchilla rat","Frosted hairy dwarf porcupine","Fukomys","Fukomys amatus","Fukomys anselli","Fukomys bocagei","Fukomys damarensis","Fukomys darlingi","Fukomys foxi","Fukomys ilariae","Fukomys kafuensis","Fukomys mechowii","Fukomys micklemi","Fukomys occlusus","Fukomys ochraceocinereus","Fukomys whytei","Fukomys zechi","Furtive tuco-tuco","Galea","Georychus","Georychus capensis","Golden viscacha-rat","Goya tuco-tuco","Greater guinea pig","Green acouchi","Haig's tuco-tuco","Heliophobius","Heliophobius argenteocinereus","Heterocephalus","Heterocephalus glaber","Highland tuco-tuco","Hystrix","Indian porcupine","Isla Mocha degu","Kalinowski agouti","Kannabateomys","Kannabateomys amblyonyx","Lagidium","Lagostomus","Lewis' tuco-tuco","Long-tailed chinchilla","Long-tailed porcupine","Los Chalchaleros' viscacha-rat","Lowland paca","Magellanic tuco-tuco","Malayan porcupine","Maule tuco-tuco","Mendoza tuco-tuco","Mexican agouti","Mexican hairy dwarf porcupine","Microcavia","Montane guinea pig","Moon-toothed degu","Mottled tuco-tuco","Mountain degu","Mountain paca","Mountain viscacha-rat","Myoprocta","Natterer's tuco-tuco","North American porcupine","Northern viscacha","Octodon","Octodontomys","Octomys","Olallamys","Olallamys albicauda","Olallamys edax","Orinoco agouti","Paraguaian hairy dwarf porcupine","Pearson's tuco-tuco","Peruvian tuco-tuco","Philippine porcupine","Pipanacoctomys","Plains viscacha","Plains viscacha-rat","Porteous' tuco-tuco","Punta de Vacas chinchilla rat","Red acouchi","Red-rumped agouti","Reddish tuco-tuco","Rio Negro tuco-tuco","Robust tuco-tuco","Roosmalen's dwarf porcupine","Rothschild's porcupine","Ruatan Island agouti","Sage's rock rat","Salinoctomys","Salta tuco-tuco","San Luis tuco-tuco","Santa Catarina's guinea pig","Shiny guinea pig","Shipton's mountain cavy","Short-tailed chinchilla","Silky tuco-tuco","Social tuco-tuco","Southern mountain cavy","Southern tuco-tuco","Southern viscacha","Spalacopus","Spix's yellow-toothed cavy","Steinbach's tuco-tuco","Streaked dwarf porcupine","Strong tuco-tuco","Stump-tailed porcupine","Sumatran porcupine","Sunda porcupine","Talas tuco-tuco","Tawny tuco-tuco","Thick-spined porcupine","Tiny tuco-tuco","Trichys","Tucuman tuco-tuco","Tympanoctomys","Uspallata chinchilla rat","White-toothed tuco-tuco","Wolffsohn's viscacha"],CJ=["Abaco Island boa","Aesculapian snake","African beaked snake","African puff adder","African rock python","African twig snake","African wolf snake","Amazon tree boa","Amazonian palm viper","American Vine Snake","American copperhead","Amethystine python","Anaconda","Andaman cat snake","Andaman cobra","Angolan python","Annulated sea snake","Arabian cobra","Arafura file snake","Arizona black rattlesnake","Arizona coral snake","Aruba rattlesnake","Asian Vine Snake, Whip Snake","Asian cobra","Asian keelback","Asian pipe snake","Asp","Asp viper","Assam keelback","Australian copperhead","Australian scrub python","Baird's rat snake","Baja California lyresnake","Ball Python","Ball python","Bamboo pitviper","Bamboo viper","Banded Flying Snake","Banded cat-eyed snake","Banded krait","Banded pitviper","Banded water cobra","Barbour's pit viper","Barred wolf snake","Beaked sea snake","Beauty rat snake","Beddome's cat snake","Beddome's coral snake","Bimini racer","Bird snake","Bismarck ringed python","Black headed python","Black krait","Black mamba","Black rat snake","Black snake","Black tree cobra","Black-banded trinket snake","Black-headed snake","Black-necked cobra","Black-necked spitting cobra","Black-speckled palm-pitviper","Black-striped keelback","Black-tailed horned pit viper","Blanding's tree snake","Blind snake","Blonde hognose snake","Blood python","Blue 
4366krait","Blunt-headed tree snake","Bluntnose viper","Boa","Boa constrictor","Bocourt's water snake","Boelen python","Boiga","Bolivian anaconda","Boomslang","Bornean pitviper","Borneo short-tailed python","Brahminy blind snake","Brazilian coral snake","Brazilian mud Viper","Brazilian smooth snake","Bredl's python","Brongersma's pitviper","Brown snake","Brown spotted pitviper[4]","Brown tree snake","Brown water python","Brown white-lipped python","Buff striped keelback","Bull snake","Burmese keelback","Burmese krait","Burmese python","Burrowing cobra","Burrowing viper","Bush viper","Bushmaster","Buttermilk racer","Calabar python","California kingsnake","Canebrake","Cantil","Cantor's pitviper","Cape cobra","Cape coral snake","Cape gopher snake","Carpet viper","Cascabel","Caspian cobra","Cat snake","Cat-eyed night snake","Cat-eyed snake","Central American lyre snake","Central ranges taipan","Centralian carpet python","Ceylon krait","Chappell Island tiger snake","Checkered garter snake","Checkered keelback","Chicken snake","Chihuahuan ridge-nosed rattlesnake","Children's python","Chinese tree viper","Coachwhip snake","Coastal carpet python","Coastal taipan","Cobra","Collett's snake","Colorado desert sidewinder","Common adder","Common cobra","Common garter snake","Common ground snake","Common keelback","Common lancehead","Common tiger snake","Common worm snake","Congo snake","Congo water cobra","Copperhead","Coral snake","Corn snake","Coronado Island rattlesnake","Cottonmouth","Crossed viper","Crowned snake","Cuban boa","Cuban wood snake","Cyclades blunt-nosed viper","Dauan Island water python","De Schauensee's anaconda","Death Adder","Desert death adder","Desert kingsnake","Desert woma python","Diamond python","Dog-toothed cat snake","Down's tiger snake","Dubois's sea snake","Dumeril's boa","Durango rock rattlesnake","Dusky pigmy rattlesnake","Dusty hognose snake","Dwarf beaked snake","Dwarf boa","Dwarf pipe snake","Dwarf sand adder","Eastern brown snake","Eastern coral snake","Eastern diamondback rattlesnake","Eastern green mamba","Eastern hognose snake","Eastern lyre snake","Eastern mud snake","Eastern racer","Eastern tiger snake","Eastern water cobra","Eastern yellowbelly sad racer","Egg-eater","Egyptian asp","Egyptian cobra","Elegant pitviper","Emerald tree boa","Equatorial spitting cobra","European asp","European smooth snake","Eyelash palm-pitviper","Eyelash pit viper","Eyelash viper","False cobra","False horned viper","False water cobra","Fan-Si-Pan horned pitviper","Fea's viper","Fer-de-lance","Fierce snake","Fifty pacer","Fishing snake","Flat-nosed pitviper","Flinders python","Flying snake","Forest cobra","Forest flame snake","Forsten's cat snake","Fox snake, three species of Pantherophis","Gaboon viper","Garter snake","Giant Malagasy hognose snake","Godman's pit viper","Gold tree cobra","Gold-ringed cat snake","Golden tree snake","Grand Canyon rattlesnake","Grass snake","Gray cat snake","Great Basin rattlesnake","Great Lakes bush viper","Great Plains rat snake","Green anaconda","Green cat-eyed snake","Green mamba","Green palm viper","Green rat snake","Green snake","Green tree pit viper","Green tree python","Grey Lora","Grey-banded kingsnake","Ground snake","Guatemalan palm viper","Guatemalan tree viper","Habu","Habu pit viper","Hagen's pitviper","Hairy bush viper","Halmahera python","Hardwicke's sea snake","Harlequin coral snake","High Woods coral snake","Hill keelback","Himalayan keelback","Hogg Island boa","Hognose snake","Hognosed viper","Honduran palm viper","Hook Nosed Sea Snake","Hopi rattlesnake","Horned adder","Horned desert viper","Horned viper","Horseshoe pitviper","Hundred pacer","Hutton's tree viper","Ikaheka snake","Indian cobra","Indian flying snake","Indian krait","Indian python","Indian tree viper","Indigo snake","Indochinese spitting cobra","Indonesian water python","Inland carpet python","Inland taipan","Jamaican Tree Snake","Jamaican boa","Jan's hognose snake","Japanese forest rat snake","Japanese rat snake","Japanese striped snake","Javan spitting cobra","Jerdon's pitviper","Jumping viper","Jungle carpet python","Kanburian pit viper","Kaulback's lance-headed pitviper","Kayaudi dwarf reticulated python","Kaznakov's viper","Keelback","Kham Plateau pitviper","Khasi Hills keelback","King Island tiger snake","King brown","King cobra","King rat snake","King snake","Krait","Krefft's tiger snake","Lance-headed rattlesnake","Lancehead","Large shield snake","Large-eyed pitviper","Large-scaled tree viper","Leaf viper","Leaf-nosed viper","Lesser black krait","Levant viper","Long-nosed adder","Long-nosed tree snake","Long-nosed viper","Long-nosed whip snake","Long-tailed rattlesnake","Longnosed worm snake","Lora","Lyre snake","Machete savane","Macklot's python","Madagascar ground boa","Madagascar tree boa","Malabar rock pitviper","Malayan krait","Malayan long-glanded coral snake","Malayan pit viper","Malcolm's tree viper","Mamba","Mamushi","Manchurian Black Water Snake","Mandalay cobra","Mandarin rat snake","Mangrove pit viper","Mangrove snake","Mangshan pitviper","Many-banded krait","Many-banded tree snake","Many-horned adder","Many-spotted cat snake","Massasauga rattlesnake","McMahon's viper","Mexican black kingsnake","Mexican green rattlesnake","Mexican hognose snake","Mexican palm-pitviper","Mexican parrot snake","Mexican racer","Mexican vine snake","Mexican west coast rattlesnake","Midget faded rattlesnake","Milk snake","Moccasin snake","Modest keelback","Mojave desert sidewinder","Mojave rattlesnake","Mole viper","Mollucan python","Moluccan flying snake","Montpellier snake","Motuo bamboo pitviper","Mountain adder","Mozambique spitting cobra","Mud adder","Mud snake","Mussurana","Namaqua dwarf adder","Namib dwarf sand adder","Narrowhead Garter Snake","New Guinea carpet python","Nichell snake","Nicobar Island keelback","Nicobar bamboo pitviper","Night snake","Nightingale adder","Nilgiri keelback","Nitsche's bush viper","Nitsche's tree viper","North Philippine cobra","North eastern king snake","Northeastern hill krait","Northern black-tailed rattlesnake","Northern tree snake","Northern water snake","Northern white-lipped python","Northwestern carpet python","Nose-horned viper","Nubian spitting cobra","Oaxacan small-headed rattlesnake","Oenpelli python","Olive python","Olive sea snake","Orange-collared keelback","Ornate flying snake","Palestine viper","Pallas' viper","Palm viper","Papuan python","Paradise flying snake","Parrot snake","Patchnose snake","Paupan taipan","Pelagic sea snake","Peninsula tiger snake","Peringuey's adder","Perrotet's shieldtail snake","Persian rat snake","Philippine cobra","Philippine pitviper","Pine snake","Pipe snake","Pit viper","Pointed-scaled pit viper[5]","Pope's tree viper","Portuguese viper","Prairie kingsnake","Puerto Rican boa","Puff adder","Pygmy python","Python","Queen snake","Racer","Raddysnake","Rainbow boa","Rat snake","Rattler","Rattlesnake","Red blood python","Red diamond rattlesnake","Red spitting cobra","Red-backed rat snake","Red-bellied black snake","Red-headed krait","Red-necked keelback","Red-tailed bamboo pitviper","Red-tailed boa","Red-tailed pipe snake","Reticulated python","Rhinoceros viper","Rhombic night adder","Ribbon snake","Rinkhals","Rinkhals cobra","River jack","Rosy boa","Rough green snake","Rough-scaled bush viper","Rough-scaled python","Rough-scaled tree viper","Royal python","Rubber boa","Rufous beaked snake","Rungwe tree viper","San Francisco garter snake","Sand adder","Sand boa","Savu python","Saw-scaled viper","Scarlet kingsnake","Schlegel's viper","Schultze's pitviper","Sea snake","Sedge viper","Selayer reticulated python","Sharp-nosed viper","Shield-nosed cobra","Shield-tailed snake","Siamese palm viper","Side-striped palm-pitviper","Sidewinder","Sikkim keelback","Sinai desert cobra","Sind krait","Small-eyed snake","Smooth green snake","Smooth snake","Snorkel viper","Snouted cobra","Sonoran sidewinder","South American hognose snake","South eastern corn snake","Southern Indonesian spitting cobra","Southern Pacific rattlesnake","Southern Philippine cobra","Southern black racer","Southern white-lipped python","Southwestern black spitting cobra","Southwestern blackhead snake","Southwestern carpet python","Southwestern speckled rattlesnake","Speckle-bellied keelback","Speckled kingsnake","Spectacled cobra","Spiny bush viper","Spitting cobra","Spotted python","Sri Lankan pit viper","Stejneger's bamboo pitviper","Stiletto snake","Stimson's python","Stoke's sea snake","Storm water cobra","Striped snake","Sumatran short-tailed python","Sumatran tree viper","Sunbeam snake","Taipan","Taiwan cobra","Tan racer","Tancitaran dusky rattlesnake","Tanimbar python","Tasmanian tiger snake","Tawny cat snake","Temple pit viper","Temple viper","Tentacled snake","Texas Coral Snake","Texas blind snake","Texas garter snake","Texas lyre snake","Texas night snake","Thai cobra","Three-lined ground snake","Tibetan bamboo pitviper","Tic polonga","Tiger pit viper","Tiger rattlesnake","Tiger snake","Tigre snake","Timber rattlesnake","Timor python","Titanboa","Tree boa","Tree snake","Tree viper","Trinket snake","Tropical rattlesnake","Twig snake","Twin Headed King Snake","Twin-Barred tree snake","Twin-spotted rat snake","Twin-spotted rattlesnake","Undulated pit viper","Uracoan rattlesnake","Ursini's viper","Urutu","Vine snake","Viper","Viper Adder","Vipera ammodytes","Wagler's pit viper","Wart snake","Water adder","Water moccasin","Water snake","West Indian racer","Western blind snake","Western carpet python","Western coral snake","Western diamondback rattlesnake","Western green mamba","Western ground snake","Western hog-nosed viper","Western mud snake","Western tiger snake","Western woma python","Wetar Island python","Whip snake","White-lipped keelback","White-lipped python","White-lipped tree viper","Wirot's pit viper","Wolf snake","Woma python","Worm snake","Wutu","Wynaad keelback","Yarara","Yellow anaconda","Yellow-banded sea snake","Yellow-bellied sea snake","Yellow-lined palm viper","Yellow-lipped sea snake","Yellow-striped rat snake","Yunnan keelback","Zebra snake","Zebra spitting cobra"],_J=["bat","bear","bee","bird","butterfly","cat","cow","crocodile","deer","dog","dolphin","eagle","elephant","fish","flamingo","fox","frog","gecko","giraffe","gorilla","hamster","hippopotamus","horse","kangaroo","koala","lion","monkey","ostrich","panda","parrot","peacock","penguin","polar bear","rabbit","rhinoceros","sea lion","shark","snake","squirrel","tiger","turtle","
4366whale","wolf","zebra"],EJ={bear:uJ,bird:dJ,cat:hJ,cetacean:mJ,cow:fJ,crocodilia:pJ,dog:gJ,fish:xJ,horse:vJ,insect:yJ,lion:bJ,pet_name:wJ,rabbit:SJ,rodent:FJ,snake:CJ,type:_J},kJ=EJ,AJ=["{{person.name}}","{{company.name}}"],NJ=["Redhold","Treeflex","Trippledex","Kanlam","Bigtax","Daltfresh","Toughjoyfax","Mat Lam Tam","Otcom","Tres-Zap","Y-Solowarm","Tresom","Voltsillam","Biodex","Greenlam","Viva","Matsoft","Temp","Zoolab","Subin","Rank","Job","Stringtough","Tin","It","Home Ing","Zamit","Sonsing","Konklab","Alpha","Latlux","Voyatouch","Alphazap","Holdlamis","Zaam-Dox","Sub-Ex","Quo Lux","Bamity","Ventosanzap","Lotstring","Hatity","Tempsoft","Overhold","Fixflex","Konklux","Zontrax","Tampflex","Span","Namfix","Transcof","Stim","Fix San","Sonair","Stronghold","Fintone","Y-find","Opela","Lotlux","Ronstring","Zathin","Duobam","Keylex"],TJ=["0.#.#","0.##","#.##","#.#","#.#.#"],MJ={author:AJ,name:NJ,version:TJ},RJ=MJ,DJ=["A.A. Milne","Agatha Christie","Alan Moore and Dave Gibbons","Albert Camus","Aldous Huxley","Alexander Pope","Alexandre Dumas","Alice Walker","Andrew Lang","Anne Frank","Anthony Burgess","Anthony Trollope","Antoine de Saint-Exupéry","Anton Chekhov","Anton Pavlovich Chekhov","Arthur Conan Doyle","Arthur Schopenhauer","Aylmer Maude","Ayn Rand","Beatrix Potter","Benjamin Disraeli","Benjamin Jowett","Bernard Shaw","Bertrand Russell","Bhagavanlal Indrajit","Boris Pasternak","Bram Stoker","Brian Evenson","C.E. Brock","C.S. Lewis","Carson McCallers","Charles Dickens","Charles E. Derbyshire","Charlotte Brontë","Charlotte Perkins Gilman","Chinua Achebe","Clifford R. Adams","Constance Garnett","Cormac McCarthy","D.H. Lawrence","Dan Brown","Daniel Defoe","Dante Alighieri","Dashiell Hammett","David Widger","David Wyllie","Dean Koontz","Don DeLillo","E.M. Forster","Edgar Allan Poe","Edgar Rice Burroughs","Elizabeth Cleghorn Gaskell","Elizabeth Von Arnim","Emily Brontë","Erich Remarque","Ernest Hemingway","Evelyn Waugh","F. Scott Fitzgerald","Ford Madox Ford","Frances Hodgson Burnett","Frank Herbert","Frank T. Merrill","Franz Kafka","Friedrich Wilhelm Nietzsche","Fyodor Dostoyevsky","G.K. Chesterton","Gabriel Garcia Marquez","Geoffrey Chaucer","George Eliot","George Grossmith","George Orwell","George R. R. Martin","George Saunders","Grady Ward","Graham Greene","Gustave Doré","Gustave Flaubert","Guy de Maupassant","Günter Grass","H.G. Wells","H.P. Lovecraft","Harper Lee","Harriet Beecher Stowe","Haruki Murakami","Henrik Ibsen","Henry David Thoreau","Henry Fielding","Henry James","Henry Miller","Henry Morley","Herman Melville","Hermann Broch","Homer","Honoré de Balzac","Ian McEwan","Isabel Florence Hapgood","Italo Calvino","J.D. Salinger","J.K. Rowling","J.M. Barrie","J.R.R. Tolkien","Jack Kerouac","Jack London","Jacob Grimm","Jacqueline Crooks","James Baldwin","James Dickey","James Ellroy","James Joyce","James Patterson","Jane Austen","Johann Wolfgang von Goethe","John Bunyan","John Camden Hotten","John Dos Passos","John Green","John Grisham","John Kennedy Toole","John Milton","John Ormsby","John Steinbeck","John Updike","Jonathan Franzen","Jonathan Swift","Joseph Conrad","Joseph Heller","José Rizal","Judy Blume","Jules Verne","Junot Diaz","Karl Marx","Kazuo Ishiguro","Ken Follett","Ken Kesey","Kenneth Grahame","Khaled Hosseini","Kingsley Amis","Kurt Vonnegut","L. Frank Baum","L.M. Montgomery","Laurence Sterne","Leo Tolstoy","Lewis Carroll","Louisa May Alcott","Louise Maude","Malcolm Lowry","Marcel Proust","Margaret Atwood","Margaret Mitchell","Marilynne Robinson","Mark Twain","Martin Amis","Mary Shelley","Michael Chabon","Miguel de Cervantes","Mikhail Bulgakov","Muriel Spark","Nancy Mitford","Nathanael West","Nathaniel Hawthorne","Neil Gaiman","Niccolo Machiavelli","Norman Mailer","Oscar Levy","Oscar Wilde","P.G. Wodehouse","Paulo Coelho","Peter Carey","Philip Pullman","Philip Roth","Plato","R.L. Stine","Rachel Kushner","Ralph Ellison","Ray Bradbury","Raymond Chandler","Richard Wagner","Richard Wright","Richard Yates","Roald Dahl","Robert Graves","Robert Louis Stevenson","Robert Penn Warren","Rudyard Kipling","Salman Rushdie","Samuel Beckett","Samuel Butler","Samuel Richardson","Saul Bellow","Shivaram Parashuram Bhide","Sir Arthur Conan Doyle","Sir Richard Francis Burton","Stendhal","Stephen Hawking","Stephen King","Sun Tzu","Suzanne Collins","T. Smollett","T.S. Eliot","Theodore Alois Buckley","Theodore Dreiser","Thomas Hardy","Thomas Love Peacock","Thomas Mann","Toni Morrison","Truman Capote","V.S. Naipaul","Vance Packard","Vatsyayana","Victor Hugo","Virgil","Virginia Woolf","Vladimir Nabokov","Voltaire","W.G. Sebald","W.K. Marriott","Walker Percy","Walt Whitman","Walter Scott","Wilhelm Grimm","Wilkie Collins","William Faulkner","William Gibson","William Golding","William Makepeace Thackeray","William Shakespeare","Zadie Smith"],PJ=["Audiobook","Ebook","Hardcover","Paperback"],jJ=["Adventure","Biography","Business","Children's Literature","Classic","Comedy","Comic","Detective","Drama","Fantasy","Graphic Novel","Historical Fiction","Horror","Memoir","Mystery","Mythology","Philosophy","Poetry","Psychology","Religion","Romance","Science Fiction","Thriller","Western","Young Adult"],LJ=["Academic Press","Ace Books","Addison-Wesley","Adis International","Airiti Press","Allen Ltd","Andrews McMeel Publishing","Anova Books","Anvil Press Poetry","Applewood Books","Apress","Athabasca University Press","Atheneum Books","Atheneum Publishers","Atlantic Books","Atlas Press","BBC Books","Ballantine Books","Banner of Truth Trust","Bantam Books","Bantam Spectra","Barrie & Jenkins","Basic Books","Belknap Press","Bella Books","Bellevue Literary Press","Berg Publishers","Berkley Books","Bison Books","Black Dog Publishing","Black Library","Black Sparrow Books","Blackie and Son Limited","Blackstaff Press","Blackwell Publishing","Bloodaxe Books","Bloomsbury Publishing Plc","Blue Ribbon Books","Book League of America","Book Works","Booktrope","Borgo Press","Bowes & Bowes","Boydell & Brewer","Breslov Research Institute","Brill","Brimstone Press","Broadview Press","Burns & Oates","Butterworth-Heinemann","Caister Academic Press","Cambridge University Press","Candlewick Press","Canongate Books","Carcanet Press","Carlton Books","Carlton Publishing Group","Carnegie Mellon University Press","Casemate Publishers","Cengage Learning","Central European University Press","Chambers Harrap","Charles Scribner's Sons","Chatto and Windus","Chick Publications","Chronicle Books","Churchill Livingstone","Cisco Press","City Lights Publishers","Cloverdale 
4366Corporation","D. Appleton & Company","D. Reidel","DAW Books","Da Capo Press","Daedalus Publishing","Dalkey Archive Press","Darakwon Press","David & Charles","Dedalus Books","Del Rey Books","E. P. Dutton","ECW Press","Earthscan","Edupedia Publications","Eel Pie Publishing","Eerdmans Publishing","Ellora's Cave","Elsevier","Emerald Group Publishing","Etruscan Press","FabJob","Faber and Faber","Fairview Press","Farrar, Straus & Giroux","Fearless Books","Felony & Mayhem Press","Firebrand Books","Flame Tree Publishing","Focal Press","G-Unit Books","G. P. Putnam's Sons","Gaspereau Press","Gay Men's Press","Gefen Publishing House","George H. Doran Company","George Newnes","George Routledge & Sons","Godwit Press","Golden Cockerel Press","HMSO","Hachette Book Group USA","Hackett Publishing Company","Hamish Hamilton","Happy House","Harcourt Assessment","Harcourt Trade Publishers","Harlequin Enterprises Ltd","Harper & Brothers","Harper & Row","HarperCollins","HarperPrism","HarperTrophy","Harry N. Abrams, Inc.","Harvard University Press","Harvest House","Harvill Press at Random House","Hawthorne Books","Hay House","Haynes Manuals","Heyday Books","Hodder & Stoughton","Hodder Headline","Hogarth Press","Holland Park Press","Holt McDougal","Horizon Scientific Press","Ian Allan Publishing","Ignatius Press","Imperial War Museum","Indiana University Press","J. M. Dent","Jaico Publishing House","Jarrolds Publishing","John Blake Publishing","Karadi Tales","Kensington Books","Kessinger Publishing","Kodansha","Kogan Page","Koren Publishers Jerusalem","Ladybird Books","Leaf Books","Leafwood Publishers","Left Book Club","Legend Books","Lethe Press","Libertas Academica","Liberty Fund","Library of America","Lion Hudson","Macmillan Publishers","Mainstream Publishing","Manchester University Press","Mandrake Press","Mandrake of Oxford","Manning Publications","Manor House Publishing","Mapin Publishing","Marion Boyars Publishers","Mark Batty Publisher","Marshall Cavendish","Marshall Pickering","Martinus Nijhoff Publishers","Mascot Books","Matthias Media","McClelland and Stewart","McFarland & Company","McGraw Hill Financial","McGraw-Hill Education","Medknow Publications","Naiad Press","Nauka","NavPress","New Directions Publishing","New English Library","New Holland Publishers","New Village Press","Newnes","No Starch Press","Nonesuch Press","O'Reilly Media","Oberon Books","Open Court Publishing Company","Open University Press","Orchard Books","Orion Books","Packt Publishing","Palgrave Macmillan","Pan Books","Pantheon Books at Random House","Papadakis Publisher","Parachute Publishing","Parragon","Pathfinder Press","Paulist Press","Pavilion Books","Peace Hill Press","Pecan Grove Press","Pen and Sword Books","Penguin Books","Random House","Reed Elsevier","Reed Publishing","SAGE Publications","Salt Publishing","Sams Publishing","Schocken Books","Scholastic Press","Seagull Books","Secker & Warburg","Shambhala Publications","Shire Books","Shoemaker & Hoard Publishers","Shuter & Shooter Publishers","Sidgwick & Jackson","Signet Books","Simon & Schuster","St. Martin's Press","T & T Clark","Tachyon Publications","Tammi","Target Books","Tarpaulin Sky Press","Tartarus Press","Tate Publishing & Enterprises","Taunton Press","Taylor & Francis","Ten Speed Press","UCL Press","Unfinished Monument Press","United States Government Publishing Office","University of Akron Press","University of Alaska Press","University of California Press","University of Chicago Press","University of Michigan Press","University of Minnesota Press","University of Nebraska Press","Velazquez Press","Verso Books","Victor Gollancz Ltd","Viking Press","Vintage Books","Vintage Books at Random House","Virago Press","Virgin Publishing","Voyager Books","Zed Books","Ziff Davis Media","Zondervan"],IJ=["A Song of Ice and Fire","Anna Karenina","Colonel Race","Discworld","Dune","Harry Potter","Hercule Poirot","His Dark Materials","Jane Austen Murder Mysteries","Little Women","Outlander","Percy Jackson","Sherlock Holmes","The Arc of a Scythe","The Bartimaeus Trilogy","The Border Trilogy","The Chronicles of Narnia","The Dark Tower","The Dresden Files","The Eighth Life","The Foundation Series","The Hitchhiker's Guide to the Galaxy","The Hunger Games","The Infinity Cycle","The Inheritance Cycle","The Lord of the Rings","The Maze Runner","The Prison Healer","The Red Rising Saga","The Southern Reach","The Wheel of Time","Thursday Next Series","Twilight","War and Peace"],BJ=["1984","20,000 Leagues Under the Sea","A Bend in the River","A Brief History of Time","A Clockwork Orange","A Confederacy of Dunces","A Doll's House","A Handful of Dust","A Modest Proposal","A Passage to India","A Portrait of the Artist as a Young Man","A Room with a Vie
4366w","A Study in Scarlet","A Tale of Two Cities","A Wrinkle in Time","Absalom, Absalom!","Adventures of Huckleberry Finn","Alice's Adventures in Wonderland","All Quiet on the Western Front","All the King's Men","American Pastoral","An American Tragedy","And Then There Were None","Animal Farm","Anna Karenina","Anne of Green Gables","Are You There God? It's Me, Margaret","As I Lay Dying","Atlas Shrugged","Atonement","Austerlitz","Beloved","Beyond Good and Evil","Bible","Bleak House","Blood Meridian","Brave New World","Brideshead Revisited","Candide","Carmilla","Catch-22","Charlie and the Chocolate Factory","Charlotte's Web","Clarissa","Cranford","Crime and Punishment","Dao De Jing: A Minimalist Translation","David Copperfield","Deliverance","Don Quixote","Dora","Dr. Zhivago","Dracula","Dubliners","Dune","East of Eden","Emma","Fahrenheit 451","Faust","For Whom the Bell Tolls","Frankenstein","Freakonomics","Go Tell It on the Mountain","Gone with the Wind","Great Expectations","Grimms' Fairy Tales","Gulliver's Travels","Hamlet","Harry Potter and the Sorcerer's Stone","Heart of Darkness","Herzog","His Dark Materials","Hitting the line","Housekeeping","I, Claudius","If on a Winter's Night a Traveler","In Cold Blood","In Search of Lost Time","Invisible Man","It","Jane Eyre","Josefine Mutzenbacher","Jude the Obscure","L.A. Confidential","Leaves of Grass","Les Miserables","Life of Pi","Little Women","Lolita","Long Walk to Freedom","Lord Jim","Lord of the Flies","Lucky Jim","Madame Bovary","Malone Dies","Meditations","Men Without Women","Metamorphosis","Middlemarch","Midnight's Children","Moby Dick","Money","Mrs. Dalloway","My Bondage and My Freedom","My Life","Native Son","Neuromancer","Never Let Me Go","Nightmare Abbey","Nineteen Eighty Four","Nostromo","Notes from the Underground","Of Mice and Men","Oliver Twist","On the Duty of Civil Disobedience","On the Road","One Flew Over the Cuckoo's Nest","One Hundred Years of Solitude","One Thousand and One Nights","Oscar and Lucinda","Pale Fire","Paradise Lost","Peter Pan","Portnoy's Complaint","Pride and Prejudice","Rabbit, Run","Republic","Revolutionary Road","Robinson Crusoe","Romeo and Juliet","Ruth Fielding in Alaska","Scoop","Second Treatise of Government","Slaughterhouse Five","Stories of Anton Chekhov","Sybil","Tess of the d'Urbervilles","The Adventures of Augie March","The Adventures of Huckleberry Finn","The Adventures of Sherlock Holmes","The Adventures of Tom Sawyer","The Aeneid","The Alchemist","The Ambassadors","The Art of War","The Big Sleep","The Black Sheep","The Blue Castle","The Brief Wondrous Life of Oscar Wao","The Brothers Karamazov","The Call of the Wild","The Canterbury Tales","The Catcher in the Rye","The Color Purple","The Complete Works of Edgar Allen Poe","The Corrections","The Count of Monte Cristo","The Day of the Locust","The Diary of a Nobody","The Diary of a Young Girl","The Divine Comedy","The Enchanted April","The Fountainhead","The Golden Bowl","The Golden Notebook","The Good Soldier","The Grapes of Wrath","The Great Gatsby","The Handmaid's Tale","The Heart is a Lonely Hunter","The Heart of the Matter","The Hobbit","The Hound of the Baskervilles","The Idiot","The Iliad","The King in Yellow","The Kite Runner","The Lion, the Witch, and the Wardrobe","The Little Prince","The Lord of the Rings","The Magic Mountain","The Maltese Falcon","The Master and Margarita","The Moviegoer","The Naked and the Dead","The Odyssey","The Old Man and the Sea","The Pickwick Papers","The Picture of Dorian Gray","The Pilgrim's Progress","The Pillars of the Earth","The Plague","The Portrait of a Lady","The Prime of Miss Jean Brodie","The Prince","The Problems of Philosophy","The Prophet","The Pursuit of Love","The Rainbow","The Red and the Black","The Remains of the Day","The Republic","The Scarlet Letter","The Sleepwalkers","The Sound and the Fury","The Stand","The Strange Case of Dr. Jekyll and Mr. Hyde","The Stranger","The Sun Also Rises","The Thirty-Nine Steps","The Three Musketeers","The Time Machine","The Tin Drum","The Trial","The War of the Worlds","The Waste Land","The Way We Live Now","The Wind in the Willows","The Woman in White","The Wonderful Wizard of Oz","The Works of Edgar Allan Poe","The Yellow Wallpaper","Things Fall Apart","Tinker, Tailor, Soldier, Spy","To Kill a Mockingbird","To the Lighthouse","Tom Jones","Treasure Island","Tristram Shandy","Tropic of Cancer","U.S.A. Trilogy","Ulysses","Uncle Tom's Cabin","Under the Volcano","Underworld","Vanity Fair","Walden","War and Peace","Watchmen","Winnie-the-Pooh","Wuthering Heights"],OJ={author:DJ,format:PJ,genre:jJ,publisher:LJ,series:IJ,title:BJ},UJ=OJ,zJ=["###-###-####","(###) ###-####","1-###-###-####","###.###.####"],GJ={formats:zJ},HJ=GJ,WJ=["azure","black","blue","cyan","fuchsia","gold","green","grey","indigo","ivory","lavender","lime","magenta","maroon","mint green","olive","orange","orchid","pink","plum","purple","red","salmon","silver","sky blue","tan","teal","turquoise","violet","white","yellow"],VJ={human:WJ},$J=VJ,KJ=["Automotive","Baby","Beauty","Books","Clothing","Computers","Electronics","Games","Garden","Grocery","Health","Home","Industrial","Jewelry","Kids","Movies","Music","Outdoors","Shoes","Sports","Tools","Toys"],YJ=["Discover the {{animal.type}}-like agility of our {{commerce.product}}, perfect for {{word.adjective}} users","Discover the {{word.adjective}} new {{commerce.product}} with an exciting mix of {{commerce.productMaterial}} ingredients","Ergonomic {{commerce.product}} made with {{commerce.productMaterial}} for all-day {{word.adjective}} support","Experience the {{color.human}} brilliance of our {{commerce.product}}, perfect for {{word.adjective}} environments","Featuring {{science.chemical_element.name}}-enhanced technology, our {{commerce.product}} offers unparalleled {{word.adjective}} performance","Innovative {{commerce.product}} featuring {{word.adjective}} technology and {{commerce.productMaterial}} construction","Introducing the {{location.country}}-inspired {{commerce.product}}, blending {{word.adjective}} style with local craftsmanship","New {{color.human}} {{commerce.product}} with ergonomic design for {{word.adjective}} comfort",'New {{commerce.product}} model with {{number.int({"min": 1, "max": 100})}} GB RAM, {{number.int({"min": 1, "max": 1000})}} GB storage, and {{word.adjective}} features',"Our {{animal.type}}-friendly {{commerce.product}} ensures {{word.adjective}} comfort for your pets","Our {{food.adjective}}-inspired {{commerce.product}} brings a taste of luxury to your {{word.adjective}} lifestyle","Professional-grade {{commerce.product}} perfect for {{word.adjective}} training and recreational use","Savor the {{food.adjective}} essence in our {{commerce.product}}, designed for {{word.adjective}} culinary adventures","Stylish {{commerce.product}} designed to make you stand out with {{word.adjective}} looks","The sleek and {{word.adjective}} {{commerce.product}} comes with {{color.human}} LED lighting for smart functionality","The {{color.human}} {{commerce.product}} combines {{location.country}} aesthetics with {{science.chemical_element.name}}-based durability","The {{company.catchPhrase}} {{commerce.product}} offers reliable performance and {{word.adjective}} design","The {{person.firstName}} {{commerce.product}} is the latest in a series of {{word.adjective}} products from {{company.name}}","{{commerce.productAdjective}} {{commerce.product}} designed with {{commerce.productMaterial}} for {{word.adjective}} performance","{{company.name}}'s most advanced {{commerce.product}} technology increases {{word.adjective}} capabilities"],qJ={adjective:["Awesome","Bespoke","Electronic","Elegant","Ergonomic","Fantastic","Fresh","Frozen","Generic","Gorgeous","Handcrafted","Handmade","Incredible","Intelligent","Licensed","Luxurious","Modern","Oriental","Practical","Recycled","Refined","Rustic","Sleek","Small","Soft","Tasty","Unbranded"],material:["Aluminum","Bamboo","Bronze","Ceramic","Concrete","Cotton","Gold","Granite","Marble","Metal","Plastic","Rubber","Silk","Steel","Wooden"],product:["Bacon","Ball","Bike","Car","Chair","Cheese","Chicken","Chips","Computer","Fish","Gloves","Hat","Keyboard","Mouse","Pants","Pizza","Salad","Sausages","Shirt","Shoes","Soap","Table","Towels","Tuna"]},JJ={department:KJ,product_description:YJ,product_name:qJ},XJ=JJ,ZJ=["AI-driven","Adaptive","Advanced","Automated","Balanced","Business-focused","Centralized","Compatible","Configurable","Cross-platform","Customer-focused","Customizable","Decentralized","Devolved","Digitized","Distributed","Diverse","
4366Enhanced","Ergonomic","Exclusive","Expanded","Extended","Face to face","Focused","Front-line","Fully-configurable","Fundamental","Future-proofed","Grass-roots","Horizontal","Immersive","Implemented","Innovative","Integrated","Intuitive","Managed","Monitored","Multi-tiered","Networked","Open-architected","Open-source","Operative","Optimized","Optional","Organic","Organized","Persevering","Persistent","Phased","Polarised","Proactive","Profit-focused","Profound","Programmable","Progressive","Public-key","Quality-focused","Reactive","Realigned","Reduced","Reverse-engineered","Robust","Seamless","Secured","Self-enabling","Sharable","Smart","Stand-alone","Streamlined","Sustainable","Synchronised","Team-oriented","Total","Triple-buffered","Universal","Upgradable","User-centric","User-friendly","Versatile","Virtual","Visionary"],QJ=["24/7","AI-driven","B2B","B2C","back-end","best-of-breed","bleeding-edge","collaborative","compelling","cross-media","cross-platform","customized","cutting-edge","decentralized","distributed","dynamic","efficient","end-to-end","enterprise","extensible","frictionless","front-end","generative","global","granular","holistic","immersive","impactful","innovative","integrated","interactive","intuitive","killer","leading-edge","magnetic","mission-critical","next-generation","one-to-one","open-source","out-of-the-box","plug-and-play","proactive","quantum","real-time","revolutionary","rich","robust","scalable","seamless","smart","sticky","strategic","sustainable","synergistic","transparent","turn-key","ubiquitous","user-centric","value-added","vertical","viral","virtual","visionary","world-class"],eX=["AI","ROI","applications","architectures","blockchains","channels","communities","content","convergence","deliverables","e-commerce","experiences","functionalities","infrastructures","initiatives","interfaces","large language models","lifetime value","markets","methodologies","metrics","mindshare","models","networks","niches","paradigms","partnerships","platforms","relationships","schemas","smart contracts","solutions","supply-chains","synergies","systems","technologies","users","web services"],tX=["aggregate","architect","benchmark","brand","collaborate","cultivate","deliver","deploy","disintermediate","drive","embrace","empower","enable","engage","engineer","enhance","evolve","expedite","exploit","extend","facilitate","gamify","generate","grow","harness","implement","incentivize","incubate","innovate","integrate","iterate","leverage","maximize","mesh","monetize","optimize","orchestrate","productize","redefine","reinvent","repurpose","revolutionize","scale","seize","simplify","strategize","streamline","syndicate","synthesize","target","transform","transition","unleash","utilize","visualize","whiteboard"],nX=["24 hour","24/7","AI-powered","actuating","analyzing","asymmetric","asynchronous","attitude-oriented","bifurcated","bottom-line","clear-thinking","client-driven","client-server","cloud-native","coherent","cohesive","composite","content-based","context-sensitive","contextually-based","data-driven","dedicated","demand-driven","directional","discrete","disintermediate","dynamic","eco-centric","empowering","encompassing","executive","explicit","exuding","fault-tolerant","fresh-thinking","full-range","global","heuristic","high-level","holistic","homogeneous","human-resource","hybrid","immersive","impactful","incremental","intangible","interactive","intermediate","leading edge","local","logistical","maximized","methodical","mission-critical","mobile","modular","motivating","national","needs-based","neutral","next generation","optimal","optimizing","radical","real-time","reciprocal","regional","resilient","responsive","scalable","secondary","stable","static","sustainable","system-worthy","systematic","systemic","tangible","tertiary","transitional","uniform","user-facing","value-ad
4366ded","well-modulated","zero administration","zero defect","zero tolerance","zero trust"],rX=["Group","Inc","LLC","and Sons"],aX=["{{person.last_name.generic}} - {{person.last_name.generic}}","{{person.last_name.generic}} {{company.legal_entity_type}}","{{person.last_name.generic}}, {{person.last_name.generic}} and {{person.last_name.generic}}"],iX=["ability","access","adapter","algorithm","alliance","analyzer","application","approach","architecture","archive","array","artificial intelligence","attitude","benchmark","budgetary management","capability","capacity","challenge","circuit","collaboration","complexity","concept","conglomeration","contingency","core","customer loyalty","data-warehouse","database","definition","emulation","encoding","encryption","firmware","flexibility","focus group","forecast","frame","framework","function","functionalities","generative AI","hardware","help-desk","hierarchy","hub","implementation","infrastructure","initiative","installation","instruction set","interface","internet solution","intranet","knowledge base","knowledge user","leverage","local area network","matrices","matrix","methodology","microservice","middleware","migration","model","moderator","monitoring","moratorium","neural-net","open architecture","orchestration","paradigm","parallelism","policy","portal","pricing structure","process improvement","product","productivity","project","projection","protocol","service-desk","software","solution","standardization","strategy","structure","success","support","synergy","system engine","task-force","throughput","time-frame","toolset","utilisation","website","workforce"],sX={adjective:ZJ,buzz_adjective:QJ,buzz_noun:eX,buzz_verb:tX,descriptor:nX,legal_entity_type:rX,name_pattern:aX,noun:iX},oX=sX,lX=["avatar","category","comment","createdAt","email","group","id","name","password","phone","status","title","token","updatedAt"],cX={column:lX},uX=cX,dX={wide:["April","August","December","February","January","July","June","March","May","November","October","September"],abbr:["Apr","Aug","Dec","Feb","Jan","Jul","Jun","Mar","May","Nov","Oct","Sep"]},hX={wide:["Friday","Monday","Saturday","Sunday","Thursday","Tuesday","Wednesday"],abbr:["Fri","Mon","Sat","Sun","Thu","Tue","Wed"]},mX={month:dX,weekday:hX},fX=mX,pX=["Auto Loan","Checking","Credit Card","Home Loan","Investment","Money Market","Personal Loan","Savings"],gX=["34##-######-####L","37##-######-####L"],xX=["30[0-5]#-######-###L","36##-######-###L"],vX=["6011-####-####-###L","65##-####-####-###L"],yX=["3528-####-####-###L","3529-####-####-###L","35[3-8]#-####-####-###L"],bX=["2[221-720]-####-####-###L","5[1-5]##-####-####-###L"],wX=["4###########L","4###-####-####-###L"],SX={american_express:gX,diners_club:xX,discover:vX,jcb:yX,mastercard:bX,visa:wX},FX=SX,CX=[{name:"UAE Dirham",code:"AED",symbol:"",numericCode:"784"},{name:"Afghani",code:"AFN",symbol:"؋",numericCode:"971"},{name:"Lek",code:"ALL",symbol:"Lek",numericCode:"008"},{name:"Armenian Dram",code:"AMD",symbol:"",numericCode:"051"},{name:"Netherlands Antillian Guilder",code:"ANG",symbol:"ƒ",numericCode:"532"},{name:"Kwanza",code:"AOA",symbol:"",numericCode:"973"},{name:"Argentine Peso",code:"ARS",symbol:"$",numericCode:"032"},{name:"Australian Dollar",code:"AUD",symbol:"$",numericCode:"036"},{name:"Aruban Guilder",code:"AWG",symbol:"ƒ",numericCode:"533"},{name:"Azerbaijanian Manat",code:"AZN",symbol:"ман",numericCode:"944"},{name:"Convertible Marks",code:"BAM",symbol:"KM",numericCode:"977"},{name:"Barbados Dollar",code:"BBD",symbol:"$",numericCode:"052"},{name:"Taka",code:"BDT",symbol:"",numericCode:"050"},{name:"Bulgarian Lev",code:"BGN",symbol:"лв",numericCode:"975"},{name:"Bahraini Dinar",code:"BHD",symbol:"",numericCode:"048"},{name:"Burundi Franc",code:"BIF",symbol:"",numericCode:"108"},{name:"Bermudian Dollar (customarily known as Bermuda Dollar)",code:"BMD",symbol:"$",numericCode:"060"},{name:"Brunei Dollar",code:"BND",symbol:"$",numericCode:"096"},{name:"Boliviano boliviano",code:"BOB",symbol:"Bs",numericCode:"068"},{name:"Brazilian Real",code:"BRL",symbol:"R$",numericCode:"986"},{name:"Bahamian Dollar",code:"BSD",symbol:"$",numericCode:"044"}
4366,{name:"Pula",code:"BWP",symbol:"P",numericCode:"072"},{name:"Belarusian Ruble",code:"BYN",symbol:"Rbl",numericCode:"933"},{name:"Belize Dollar",code:"BZD",symbol:"BZ$",numericCode:"084"},{name:"Canadian Dollar",code:"CAD",symbol:"$",numericCode:"124"},{name:"Congolese Franc",code:"CDF",symbol:"",numericCode:"976"},{name:"Swiss Franc",code:"CHF",symbol:"CHF",numericCode:"756"},{name:"Chilean Peso",code:"CLP",symbol:"$",numericCode:"152"},{name:"Yuan Renminbi",code:"CNY",symbol:"¥",numericCode:"156"},{name:"Colombian Peso",code:"COP",symbol:"$",numericCode:"170"},{name:"Costa Rican Colon",code:"CRC",symbol:"₡",numericCode:"188"},{name:"Cuban Peso",code:"CUP",symbol:"₱",numericCode:"192"},{name:"Cape Verde Escudo",code:"CVE",symbol:"",numericCode:"132"},{name:"Czech Koruna",code:"CZK",symbol:"Kč",numericCode:"203"},{name:"Djibouti Franc",code:"DJF",symbol:"",numericCode:"262"},{name:"Danish Krone",code:"DKK",symbol:"kr",numericCode:"208"},{name:"Dominican Peso",code:"DOP",symbol:"RD$",numericCode:"214"},{name:"Algerian Dinar",code:"DZD",symbol:"",numericCode:"012"}
4366,{name:"Egyptian Pound",code:"EGP",symbol:"£",numericCode:"818"},{name:"Nakfa",code:"ERN",symbol:"",numericCode:"232"},{name:"Ethiopian Birr",code:"ETB",symbol:"",numericCode:"230"},{name:"Euro",code:"EUR",symbol:"€",numericCode:"978"},{name:"Fiji Dollar",code:"FJD",symbol:"$",numericCode:"242"},{name:"Falkland Islands Pound",code:"FKP",symbol:"£",numericCode:"238"},{name:"Pound Sterling",code:"GBP",symbol:"£",numericCode:"826"},{name:"Lari",code:"GEL",symbol:"",numericCode:"981"},{name:"Cedi",code:"GHS",symbol:"",numericCode:"936"},{name:"Gibraltar Pound",code:"GIP",symbol:"£",numericCode:"292"},{name:"Dalasi",code:"GMD",symbol:"",numericCode:"270"},{name:"Guinea Franc",code:"GNF",symbol:"",numericCode:"324"},{name:"Quetzal",code:"GTQ",symbol:"Q",numericCode:"320"},{name:"Guyana Dollar",code:"GYD",symbol:"$",numericCode:"328"},{name:"Hong Kong Dollar",code:"HKD",symbol:"$",numericCode:"344"},{name:"Lempira",code:"HNL",symbol:"L",numericCode:"340"},{name:"Gourde",code:"HTG",symbol:"",numericCode:"332"},{name:"Forint",code:"HUF",symbol:"Ft",numericCode:"348"},{name:"Rupiah",code:"IDR",symbol:"Rp",numericCode:"360"},{name:"New Israeli Sheqel",code:"ILS",symbol:"₪",numericCode:"376"},{name:"Bhutanese Ngultrum",code:"BTN",symbol:"Nu",numericCode:"064"},{name:"Indian Rupee",code:"INR",symbol:"₹",numericCode:"356"},{name:"Iraqi Dinar",code:"IQD",symbol:"",numericCode:"368"},{name:"Iranian Rial",code:"IRR",symbol:"﷼",numericCode:"364"},{name:"Iceland Krona",code:"ISK",symbol:"kr",numericCode:"352"},{name:"Jamaican Dollar",code:"JMD",symbol:"J$",numericCode:"388"},{name:"Jordanian Dinar",code:"JOD",symbol:"",numericCode:"400"},{name:"Yen",code:"JPY",symbol:"¥",numericCode:"392"},{name:"Kenyan Shilling",code:"KES",symbol:"",numericCode:"404"},{name:"Som",code:"KGS",symbol:"лв",numericCode:"417"},{name:"Riel",code:"KHR",symbol:"៛",numericCode:"116"},{name:"Comoro Franc",code:"KMF",symbol:"",numericCode:"174"},{name:"North Korean Won",code:"KPW",symbol:"₩",numericCode:"408"},{name:"Won",code:"KRW",symbol:"₩",numericCode:"410"},{name:"Kuwaiti Dinar",code:"KWD",symbol:"",numericCode:"414"},{name:"Cayman Islands Dollar",code:"KYD",symbol:"$",numericCode:"136"},{name:"Tenge",code:"KZT",symbol:"лв",numericCode:"398"},{name:"Kip",code:"LAK",symbol:"₭",numericCode:"418"},{name:"Lebanese Pound",code:"LBP",symbol:"£",numericCode:"422"},{name:"Sri Lanka Rupee",code:"LKR",symbol:"₨",numericCode:"144"},{name:"Liberian Dollar",code:"LRD",symbol:"$",numericCode:"430"},{name:"Libyan Dinar",code:"LYD",symbol:"",numericCode:"434"},{name:"Moroccan Dirham",code:"MAD",symbol:"",numericCode:"504"},{name:"Moldovan Leu",code:"MDL",symbol:"",numericCode:"498"},{name:"Malagasy Ariary",code:"MGA",symbol:"",numericCode:"969"},{name:"Denar",code:"MKD",symbol:"ден",numericCode:"807"},{name:"Kyat",code:"MMK",symbol:"",numericCode:"104"},{name:"Tugrik",code:"MNT",symbol:"₮",numericCode:"496"},{name:"Pataca",code:"MOP",symbol:"",numericCode:"446"},{name:"Ouguiya",code:"MRU",symbol:"",numericCode:"929"},{name:"Mauritius Rupee",code:"MUR",symbol:"₨",numericCode:"480"},{name:"Rufiyaa",code:"MVR",symbol:"",numericCode:"462"},{name:"Kwacha",code:"MWK",symbol:"",numericCode:"454"},{name:"Mexican Peso",code:"MXN",symbol:"$",numericCode:"484"},{name:"Malaysian Ringgit",code:"MYR",symbol:"RM",numericCode:"458"},{name:"Metical",code:"MZN",symbol:"MT",numericCode:"943"},{name:"Naira",code:"NGN",symbol:"₦",numericCode:"566"},{name:"Cordoba Oro",code:"NIO",symbol:"C$",numericCode:"558"},{name:"Norwegian Krone",code:"NOK",symbol:"kr",numericCode:"578"},{name:"Nepalese Rupee",code:"NPR",symbol:"₨",numericCode:"524"},{name:"New Zealand Dollar",code:"NZD",symbol:"$",numericCode:"554"},{name:"Rial Omani",code:"OMR",symbol:"﷼",numericCode:"512"},{name:"Balboa",code:"PAB",symbol:"B/.",numericCode:"590"},{name:"Nuevo Sol",code:"PEN",symbol:"S/.",numericCode:"604"},{name:"Kina",code:"PGK",symbol:"",numericCode:"598"},{name:"Philippine Peso",code:"PHP",symbol:"Php",numericCode:"608"},{name:"Pakistan Rupee",code:"PKR",symbol:"₨",numericCode:"586"},{name:"Zloty",code:"PLN",symbol:"zł",numericCode:"985"}
4366,{name:"Guarani",code:"PYG",symbol:"Gs",numericCode:"600"},{name:"Qatari Rial",code:"QAR",symbol:"﷼",numericCode:"634"},{name:"New Leu",code:"RON",symbol:"lei",numericCode:"946"},{name:"Serbian Dinar",code:"RSD",symbol:"Дин.",numericCode:"941"},{name:"Russian Ruble",code:"RUB",symbol:"руб",numericCode:"643"},{name:"Rwanda Franc",code:"RWF",symbol:"",numericCode:"646"},{name:"Saudi Riyal",code:"SAR",symbol:"﷼",numericCode:"682"},{name:"Solomon Islands Dollar",code:"SBD",symbol:"$",numericCode:"090"},{name:"Seychelles Rupee",code:"SCR",symbol:"₨",numericCode:"690"},{name:"Sudanese Pound",code:"SDG",symbol:"",numericCode:"938"},{name:"Swedish Krona",code:"SEK",symbol:"kr",numericCode:"752"},{name:"Singapore Dollar",code:"SGD",symbol:"$",numericCode:"702"},{name:"Saint Helena Pound",code:"SHP",symbol:"£",numericCode:"654"},{name:"Leone",code:"SLE",symbol:"",numericCode:"925"},{name:"Somali Shilling",code:"SOS",symbol:"S",numericCode:"706"},{name:"Surinam Dollar",code:"SRD",symbol:"$",numericCode:"968"},{name:"South Sudanese pound",code:"SSP",symbol:"",numericCode:"728"},{name:"Dobra",code:"STN",symbol:"Db",numericCode:"930"},{name:"Syrian Pound",code:"SYP",symbol:"£",numericCode:"760"},{name:"Lilangeni",code:"SZL",symbol:"",numericCode:"748"},{name:"Baht",code:"THB",symbol:"฿",numericCode:"764"},{name:"Somoni",code:"TJS",symbol:"",numericCode:"972"},{name:"Manat",code:"TMT",symbol:"",numericCode:"934"},{name:"Tunisian Dinar",code:"TND",symbol:"",numericCode:"788"},{name:"Pa'anga",code:"TOP",symbol:"",numericCode:"776"},{name:"Turkish Lira",code:"TRY",symbol:"₺",numericCode:"949"},{name:"Trinidad and Tobago Dollar",code:"TTD",symbol:"TT$",numericCode:"780"},{name:"New Taiwan Dollar",code:"TWD",symbol:"NT$",numericCode:"901"},{name:"Tanzanian Shilling",code:"TZS",symbol:"",numericCode:"834"},{name:"Hryvnia",code:"UAH",symbol:"₴",numericCode:"980"},{name:"Uganda Shilling",code:"UGX",symbol:"",numericCode:"800"},{name:"US Dollar",code:"USD",symbol:"$",numericCode:"840"},{name:"Peso Uruguayo",code:"UYU",symbol:"$U",numericCode:"858"},{name:"Uzbekistan Sum",code:"UZS",symbol:"лв",numericCode:"860"},{name:"Venezuelan bolívar",code:"VES",symbol:"Bs",numericCode:"928"},{name:"Dong",code:"VND",symbol:"₫",numericCode:"704"},{name:"Vatu",code:"VUV",symbol:"",numericCode:"548"},{name:"Tala",code:"WST",symbol:"",numericCode:"882"},{name:"CFA Franc BEAC",code:"XAF",symbol:"",numericCode:"950"},{name:"East Caribbean Dollar",code:"XCD",symbol:"$",numericCode:"951"},{name:"CFA Franc BCEAO",code:"XOF",symbol:"",numericCode:"952"},{name:"CFP Franc",code:"XPF",symbol:"",numericCode:"953"},{name:"Yemeni Rial",code:"YER",symbol:"﷼",numericCode:"886"},{name:"Rand",code:"ZAR",symbol:"R",numericCode:"710"},{name:"Lesotho Loti",code:"LSL",symbol:"",numericCode:"426"},{name:"Namibia Dollar",code:"NAD",symbol:"N$",numericCode:"516"},{name:"Zambian Kwacha",code:"ZMW",symbol:"K",numericCode:"967"},{name:"Zimbabwe Dollar",code:"ZWL",symbol:"",numericCode:"932"}],_X=["A {{finance.transactionType}} for {{finance.currencyCode}} {{finance.amount}} was made at {{company.name}} via card ending ****{{string.numeric(4)}} on account ***{{string.numeric(4)}}.","A {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} occurred at {{company.name}} using a card ending in ****{{string.numeric(4)}} for account ***{{string.numeric(4)}}.","Payment of {{finance.currencyCode}} {{finance.amount}} for {{finance.transactionType}} at {{company.name}}, processed with card ending ****{{string.numeric(4)}} linked to account ***{{string.numeric(4)}}.","Transaction alert: {{finance.transactionType}} at {{company.name}} using card ending ****{{string.numeric(4)}} for an amount of {{finance.currencyCode}} {{finance.amount}} on account ***{{string.numeric(4)}}.","You made a {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} using card ending in ****{{string.numeric(4)}} from account ***{{string.numeric(4)}}.","Your {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} was successful. Charged via card ****{{string.numeric(4)}}
4366 to account ***{{string.numeric(4)}}.","{{finance.transactionType}} at {{company.name}} with a card ending in ****{{string.numeric(4)}} for {{finance.currencyCode}} {{finance.amount}} from account ***{{string.numeric(4)}}.","{{finance.transactionType}} confirmed at {{company.name}} for {{finance.currencyCode}} {{finance.amount}}, card ending in ****{{string.numeric(4)}} associated with account ***{{string.numeric(4)}}.","{{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} charged to account ending in {{string.numeric(4)}} using card ending in ****{{string.numeric(4)}}.","{{finance.transactionType}} processed at {{company.name}} for {{finance.currencyCode}} {{finance.amount}}, using card ending ****{{string.numeric(4)}}. Account: ***{{string.numeric(4)}}.","{{finance.transactionType}} transaction at {{company.name}} using card ending with ****{{string.numeric(4)}} for {{finance.currencyCode}} {{finance.amount}} in account ***{{string.numeric(4)}}."],EX=["deposit","invoice","payment","withdrawal"],kX={account_type:pX,credit_card:FX,currency:CX,transaction_description_pattern:_X,transaction_type:EX},AX=kX,NX=["bitter","creamy","crispy","crunchy","delicious","fluffy","fresh","golden","juicy","moist","rich","salty","savory","smoky","sour","spicy","sweet","tangy","tender","zesty"],TX=["A classic pie filled with delicious {{food.meat}} and {{food.adjective}} {{food.ingredient}}, baked in a {{food.adjective}} pastry crust and topped with a golden-brown lattice.","A delightful tart combining {{food.adjective}} {{food.vegetable}} and sweet {{food.fruit}}, set in a buttery pastry shell and finished with a hint of {{food.spice}}.","A heartwarming {{food.ethnic_category}} soup, featuring fresh {{food.ingredient}} and an aromatic blend of traditional spices.","A robust {{food.adjective}} stew featuring {{food.ethnic_category}} flavors, loaded with {{food.adjective}} meat, {{food.adjective}} vegetables, and a {{food.adjective}}, {{food.adjective}} broth.","A simple {{food.fruit}} pie. No fancy stuff. Just pie.","A slow-roasted {{animal.bird}} with a {{food.adjective}}, {{food.adjective}} exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.","A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.","A succulent {{food.meat}} steak, encased in a {{food.adjective}} {{food.spice}} crust, served with a side of {{food.spice}} mashed {{food.vegetable}}.","An exquisite {{food.meat}} roast, infused with the essence of {{food.fruit}}, slow-roasted to bring out its natural flavors and served with a side of creamy {{food.vegetable}}","Baked {{food.ingredient}}-stuffed {{food.meat}}, seasoned with {{food.spice}} and {{food.adjective}} herbs, accompanied by roasted {{food.vegetable}} medley.","Crispy fried {{food.meat}} bites, seasoned with {{food.spice}} and served with a tangy {{food.fruit}} dipping sauce.","Fresh mixed greens tossed with {{food.spice}}-rubbed {{food.meat}}, {{food.vegetable}}, and a light dressing.","Fresh {{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream","Grilled {{food.meat}} kebabs, marinated in {{food.ethnic_category}} spices and served with a fresh {{food.vegetable}} and {{food.fruit}} salad.","Hearty {{food.ingredient}} and {{food.meat}} stew, slow-cooked with {{food.spice}} and {{food.vegetable}} for a comforting, flavorful meal.","Juicy {{food.meat}}, grilled to your liking and drizzled with a bold {{food.spice}} sauce, served alongside roasted {{food.vegetable}}.","Our {{food.adjective}} {{food.meat}}, slow-cooked to perfection, accompanied by steamed {{food.vegetable}} and a rich, savory gravy.","Tender {{food.meat}} skewers, glazed with a sweet and tangy {{food.fruit}} sauce, served over a bed of fragrant jasmine rice.","Tenderly braised {{food.meat}} in a rich {{food.spice}} and {{food.vegetable}} sauce, served with a side of creamy {{food.vegetable}}.","Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.",'{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":2, "max":4})}} sides.'],MX=["California maki","Peking duck","Philadelphia maki","arepas","barbecue ribs","bruschette with tomato","bunny chow","caes
4366ar salad","caprese salad","cauliflower penne","cheeseburger","chicken fajitas","chicken milanese","chicken parm","chicken wings","chilli con carne","ebiten maki","fettuccine alfredo","fish and chips","french fries with sausages","french toast","hummus","katsu curry","kebab","lasagne","linguine with clams","massaman curry","meatballs with sauce","mushroom risotto","pappardelle alla bolognese","pasta and beans","pasta carbonara","pasta with tomato and basil","pho","pierogi","pizza","poke","pork belly buns","pork sausage roll","poutine","ricotta stuffed ravioli","risotto with seafood","salmon nigiri","scotch eggs","seafood paella","som tam","souvlaki","stinky tofu","sushi","tacos","teriyaki chicken donburi","tiramisù","tuna sashimi","vegetable soup"],RX=["{{food.adjective}} {{food.ethnic_category}} stew","{{food.adjective}} {{food.meat}} with {{food.vegetable}}","{{food.ethnic_category}} {{food.ingredient}} soup","{{food.fruit}} and {{food.fruit}} tart","{{food.fruit}} pie","{{food.fruit}}-glazed {{food.meat}} skewers","{{food.fruit}}-infused {{food.meat}} roast","{{food.ingredient}} and {{food.meat}} pie","{{food.ingredient}}-infused {{food.meat}}","{{food.meat}} steak","{{food.meat}} with {{food.fruit}} sauce","{{food.spice}}-crusted {{food.meat}}","{{food.spice}}-rubbed {{food.meat}} salad","{{food.vegetable}} salad","{{person.first_name.generic}}'s special {{food.ingredient}}"],DX=["Ainu","Albanian","American","Andhra","Anglo-Indian","Arab","Argentine","Armenian","Assyrian","Awadhi","Azerbaijani","Balochi","Bangladeshi","Bashkir","Belarusian","Bengali","Berber","Brazilian","British","Buddhist","Bulgarian","Cajun","Cantonese","Caribbean","Chechen","Chinese","Chinese Islamic","Circassian","Crimean Tatar","Cypriot","Czech","Danish","Egyptian","English","Eritrean","Estonian","Ethiopian","Filipino","French","Georgian","German","Goan","Goan Catholic","Greek","Gujarati","Hyderabad","Indian","Indian Chinese","Indian Singaporean","Indonesian","Inuit","Irish","Italian","Italian-American","Jamaican","Japanese","Jewish - Israeli","Karnataka","Kazakh","Keralite","Korean","Kurdish","Laotian","Latvian","Lebanese","Lithuanian","Louisiana Creole","Maharashtrian","Malay","Malaysian Chinese","Malaysian Indian","Mangalorean","Mediterranean","Mennonite","Mexican","Mordovian","Mughal","Native American","Nepalese","New Mexican","Odia","Pakistani","Parsi","Pashtun","Pennsylvania Dutch","Peranakan","Persian","Peruvian","Polish","Portuguese","Punjabi","Québécois","Rajasthani","Romani","Romanian","Russian","Sami","Serbian","Sindhi","Slovak","Slovenian","Somali","South Indian","Soviet","Spanish","Sri Lankan","Taiwanese","Tamil","Tatar","Texan","Thai","Turkish","Udupi","Ukrainian","Vietnamese","Yamal","Zambian","Zanzibari"],PX=["apple","apricot","aubergine","avocado","banana","berry","blackberry","blood orange","blueberry","bush tomato","butternut pumpkin","cantaloupe","cavalo","cherry","corella pear","cranberry","cumquat","currant","custard apple","custard apples daikon","date","dragonfruit","dried apricot","elderberry","feijoa","fig","fingerlime","goji berry","grape","grapefruit","guava","honeydew melon","incaberry","jarrahdale pumpkin","juniper berry","kiwi fruit","kiwiberry","lemon","lime","longan","loquat","lychee","mandarin","mango","mangosteen","melon","mulberry","nashi pear","nectarine","olive","orange","papaw","papaya","passionfruit","peach","pear","pineapple","plum","pomegranate","prune","rockmelon","snowpea","sprout","starfruit","strawberry","sultana","tangelo","tomato","watermelon"],jX=["achacha","adzuki beans","agar","agave syrup","ajowan seed","albacore tuna","alfalfa","allspice","almond oil","almonds","amaranth","amchur","anchovies","aniseed","annatto seed","apple cider vinegar","apple juice","apple juice concentrate","apples","apricots","arborio rice","arrowroot","artichoke","arugula","asafoetida","asian greens","asian noodles","asparagus","aubergine","avocado","avocado oil","avocado spread","bacon","baking powder","baking soda","balsamic vinegar","bamboo shoots","banana","barberry","barley","barramundi","basil basmati rice","bay leaves","bean shoots","bean sprouts","beans","beef","beef stock","beetroot","berries","besan","black eyed beans","blackberries","blood oranges","blue cheese","blue eye trevalla","blue swimmer crab","blueberries","bocconcini","bok choy","bonito flakes","bonza","borlotti beans","bran","brazil nut","bread","brie","broccoli","broccolini","brown flour","brown mushrooms","brown rice","brown rice vinegar","brussels sprouts","buckwheat","buckwheat flour","buckwheat noodles","bulghur","bush tomato","butter","butter beans","buttermilk","butternut lettuce","butternut pumpkin","cabbage","cacao","cake","calamari","camellia tea oil","camembert","camomile","candle nut","cannellini beans","canola oil","cantaloupe","capers","capsicum","caraway seed","cardamom","carob carrot","carrot","cashews","cassia bark","cauliflower","cavalo","cayenne","celery","celery seed","cheddar","cherries","chestnut","chia seeds","chicken","chicken stock","chickory","chickpea","chilli pepper","chinese cabbage","chinese five spice","chives","choy sum","cinnamon","clams","cloves","cocoa powder","coconut","coconut oil","coconut water","coffee","common cultivated mushrooms","corella pear","coriander leaves","coriander seed","corn oil","corn syrup","corn tortilla","cornichons","cornmeal","cos lettuce","cottage cheese","cous cous","crabs","cranberry","cream","cream cheese","cucumber","cumin","cumquat","currants","curry leaves","curry powder","custard apples","dandelion","dark chocolate","dashi","dates","dill","dragonfruit","dried apricots","dried chinese broccoli","duck","edam","edamame","eggplant","eggs","elderberry","endive","english spinach","enoki mushrooms","extra virgin olive oil","farmed prawns","feijoa","fennel","fennel seeds","fenugreek","feta","figs","file powder","fingerlime","fish sauce","fish stock","flat mushrooms","flathead","flaxseed","flaxseed oil","flounder","flour","freekeh","french eschallots","fresh chillies","fromage blanc","fruit","galangal","garam masala","garlic","goat cheese","goat milk","goji berry","grape seed oil","grapefruit","grapes","green beans","green pepper","green tea","green tea noodles","greenwheat freekeh","gruyere","guava","gula melaka","haloumi","ham","haricot beans","harissa","hazelnut","hijiki","hiramasa kingfish","hokkien noo
4366dles","honey","honeydew melon","horseradish","hot smoked salmon","hummus","iceberg lettuce","incaberries","jarrahdale pumpkin","jasmine rice","jelly","jerusalem artichoke","jewfish","jicama","juniper berries","kale","kangaroo","kecap manis","kenchur","kidney beans","kidneys","kiwi berries","kiwi fruit","kohlrabi","kokam","kombu","koshihikari rice","kudzu","kumera","lamb","lavender flowers","leeks","lemon","lemongrass","lentils","lettuce","licorice","lime leaves","limes","liver","lobster","longan","loquats","lotus root","lychees","macadamia nut","macadamia oil","mace","mackerel","mahi mahi","mahlab","malt vinegar","mandarins","mango","mangosteens","maple syrup","margarine","marigold","marjoram","mastic","melon","milk","milk chocolate","mint","miso","molasses","monkfish","morwong","mountain bread","mozzarella","muesli","mulberries","mullet","mung beans","mussels","mustard","mustard seed","nashi pear","nasturtium","nectarines","nori","nutmeg","nutritional yeast","nuts","oat flour","oatmeal","oats","octopus","okra","olive oil","olives","omega spread","onion","oranges","oregano","oyster mushrooms","oyster sauce","oysters","pandanus leaves","papaw","papaya","paprik","parmesan cheese","parrotfish","parsley","parsnip","passionfruit","pasta","peaches","peanuts","pear","pear juice","pears","peas","pecan nut","pecorino","pepitas","peppercorns","peppermint","peppers","persimmon","pine nut","pineapple","pinto beans","pistachio nut","plums","polenta","pomegranate","poppy seed","porcini mushrooms","pork","potato flour","potatoes","provolone","prunes","pumpkin","pumpkin seed","purple carrot","purple rice","quark","quince","quinoa","radicchio","radish","raisin","raspberry","red cabbage","red lentils","red pepper","red wine","red wine vinegar","redfish","rhubarb","rice flour","rice noodles","rice paper","rice syrup","ricemilk","ricotta","rockmelon","rose water","rosemary","rye","rye bread","safflower oil","saffron","sage","sake","salmon","sardines","sausages","scallops","sea salt","semolina","sesame oil","sesame seeds","shark","shiitake mushrooms","silverbeet","slivered almonds","smoked trout","snapper","snowpea sprouts","snowpeas","soba","sour dough bread","soy","soy beans","soy flour","soy milk","soy sauce","soymilk","spearmint","spelt","spelt bread","spinach","spring onions","sprouts","squash","squid","star anise","star fruit","starfruit","stevia","strawberries","sugar","sultanas","sun-dried tomatoes","sunflower oil","sunflower seeds","sweet chilli sauce","sweet potato","swiss chard","swordfish","szechuan pepperberry","tabasco","tahini","taleggio cheese","tamari","tamarillo","tangelo","tapioca","tapioca flour","tarragon","tea","tea oil","tempeh","thyme","tinned","tofu","tom yum","tomatoes","trout","tuna","turkey","turmeric","turnips","unbleached flour","vanilla beans","vegetable oil","vegetable spaghetti","vegetable stock","vermicelli noodles","vinegar","wakame","walnut","warehou","wasabi","water","watercress","watermelon","wattleseed","wheat","wheatgrass juice","white bread","white flour","white rice","white wine","white wine vinegar","whiting wild rice","wholegrain bread","wholemeal","wholewheat flour","william pear","yeast","yellow papaw","yellowtail kingfish","yoghurt","yogurt","zucchini"],LX=["beef","chicken","crocodile","duck","emu","goose","kangaroo","lamb","ostrich","pigeon","pork","quail","rabbit","salmon","turkey","venison"],IX=["achiote seed","ajwain seed","ajwan seed","allspice","amchoor","anise","anise star","aniseed","annatto seed","arrowroot","asafoetida","baharat","balti masala","balti stir fry mix","basil","bay leaves","bbq","caraway seed","cardamom","cassia","cayenne pepper","celery","chamomile","chervil","chilli","chilli pepper","chillies","china star","chives","cinnamon","cloves","colombo","coriander","cumin","curly leaf parsley","curry","dhansak","dill","fennel seed","fenugreek","fines herbes","five spice","french lavender","galangal","garam masala","garlic","german chamomile","ginger","green cardamom","herbes de provence","jalfrezi","jerk","kaffir leaves","korma","lavender","lemon grass","lemon pepper","lime leaves","liquorice root","mace","mango","marjoram","methi","mint","mustard","nutmeg","onion seed","orange zest","oregano","paprika","parsley","pepper","peppercorns","pimento","piri piri","poppy seed","pot marjoram","poudre de colombo","ras-el-hanout","rice paper","rogan josh","rose baie","rosemary","saffron","sage","sesame seed","spearmint","sumac","sweet basil","sweet laurel","tagine","tandoori masala","tarragon","thyme","tikka masala","turmeric","vanilla","zahtar"],BX=["artichoke","arugula","asian greens","asparagus","bean shoots","bean sprouts","beans","beetroot","bok choy","broccoli","broccolini","brussels sprouts","butternut lettuce","cabbage","capers","carob carrot","carrot","cauliflower","celery","chilli pepper","chinese cabbage","chives","cornichons","cos lettuce","cucumber","dried chinese broccoli","eggplant","endive","english spinach","french eschallots","fresh chillies","garlic","green beans","green pepper","hijiki","iceberg lettuce","jerusalem artichoke","jicama","kale","kohlrabi","leeks","lettuce","okra","onion","parsnip","peas","peppers","potatoes","pumpkin","purple carrot","radicchio","radish","raspberry","red cabbage","red pepper","rhubarb","snowpea sprouts","spinach","squash","sun dried tomatoes","sweet potato","swiss chard","turnips","zucchini"],OX={adjective:NX,description_pattern:TX,dish:MX,dish_pattern:RX,ethnic_category:DX,fruit:PX,ingredient:jX,meat:LX,spice:IX,vegetable:BX},UX=OX,zX=["1080p","auxiliary","back-end","bluetooth","cross-platform","digital","haptic","mobile","multi-byte","neural","online","open-source","optical","primary","redundant","solid state","virtual","wireless"],GX=["backing up","bypassing","calculating","compressing","connecting","copying","generating","hacking","indexing","navigating","overriding","parsing","programming","quantifying","synthesizing","transmitting"],HX=["alarm","application","array","bandwidth","bus","capacitor","card","circuit","driver","feed","firewall","hard drive","
4366interface","matrix","microchip","monitor","panel","pixel","port","program","protocol","sensor","system","transmitter"],WX=["I'll {{verb}} the {{adjective}} {{abbreviation}} {{noun}}, that should {{noun}} the {{abbreviation}} {{noun}}!","If we {{verb}} the {{noun}}, we can get to the {{abbreviation}} {{noun}} through the {{adjective}} {{abbreviation}} {{noun}}!","The {{abbreviation}} {{noun}} is down, {{verb}} the {{adjective}} {{noun}} so we can {{verb}} the {{abbreviation}} {{noun}}!","Try to {{verb}} the {{abbreviation}} {{noun}}, maybe it will {{verb}} the {{adjective}} {{noun}}!","Use the {{adjective}} {{abbreviation}} {{noun}}, then you can {{verb}} the {{adjective}} {{noun}}!","We need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!","You can't {{verb}} the {{noun}} without {{ingverb}} the {{adjective}} {{abbreviation}} {{noun}}!","{{ingverb}} the {{noun}} won't do anything, we need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!"],VX=["back up","bypass","calculate","compress","connect","copy","generate","hack","index","input","navigate","override","parse","program","quantify","reboot","synthesize","transmit"],$X={adjective:zX,ingverb:GX,noun:HX,phrase:WX,verb:VX},KX=$X,YX=["biz","com","info","name","net","org"],qX=["example.com","example.net","example.org"],JX=["gmail.com","hotmail.com","yahoo.com"],XX={domain_suffix:YX,example_email:qX,free_email:JX},ZX=XX,QX=["#####","####","###"],eZ=["Abilene","Akron","Alafaya","Alameda","Albany","Albuquerque","Alexandria","Alhambra","Aliso Viejo","Allen","Allentown","Aloha","Alpharetta","Altadena","Altamonte Springs","Altoona","Amarillo","Ames","Anaheim","Anchorage","Anderson","Ankeny","Ann Arbor","Annandale","Antelope","Antioch","Apex","Apopka","Apple Valley","Appleton","Arcadia","Arden-Arcade","Arecibo","Arlington","Arlington Heights","Arvada","Ashburn","Asheville","Aspen Hill","Atascocita","Athens-Clarke County","Atlanta","Attleboro","Auburn","Augusta-Richmond County","Aurora","Austin","Avondale","Azusa","Bakersfield","Baldwin Park","Baltimore","Barnstable Town","Bartlett","Baton Rouge","Battle Creek","Bayamon","Bayonne","Baytown","Beaumont","Beavercreek","Beaverton","Bedford","Bel Air South","Bell Gardens","Belleville","Bellevue","Bellflower","Bellingham","Bend","Bentonville","Berkeley","Berwyn","Bethesda","Bethlehem","Billings","Biloxi","Binghamton","Birmingham","Bismarck","Blacksburg","Blaine","Bloomington","Blue Springs","Boca Raton","Boise City","Bolingbrook","Bonita Springs","Bossier City","Boston","Bothell","Boulder","Bountiful","Bowie","Bowling Green","Boynton Beach","Bozeman","Bradenton","Brandon","Brentwood","Bridgeport","Bristol","Brockton","Broken Arrow","Brookhaven","Brookline","Brooklyn Park","Broomfield","Brownsville","Bryan","Buckeye","Buena Park","Buffalo","Buffalo Grove","Burbank","Burien","Burke","Burleson","Burlington","Burnsville","Caguas","Caldwell","Camarillo","Cambridge","Camden","Canton","Cape Coral","Carlsbad","Carmel","Carmichael","Carolina","Carrollton","Carson","Carson City","Cary","Casa Grande","Casas Adobes","Casper","Castle Rock","Castro Valley","Catalina Foothills","Cathedral City","Catonsville","Cedar Hill","Cedar Park","Cedar Rapids","Centennial","Centreville","Ceres","Cerritos","Champaign","Chandler","Chapel Hill","Charleston","Charlotte","Charlottesville","Chattanooga","Cheektowaga","Chesapeake","Chesterfield","Cheyenne","Chicago","Chico","Chicopee","Chino","Chino Hills","Chula Vista","Cicero","Cincinnati","Citrus Heights","Clarksville","Clearwater","Cleveland","Cleveland Heights","Clifton","Clovis","Coachella","Coconut Creek","Coeur d'Alene","College Station","Collierville","Colorado Springs","Colton","Columbia","Columbus","Commerce City","Compton","Concord","Conroe","Conway","Coon Rapids","Coral Gables","Coral Springs","Corona","Corpus Christi","Corvallis","Costa Mesa","Council Bluffs","Country Club","Covina","Cranston","Cupertino","Cutler Bay","Cuyahoga Falls","Cypress","Dale City","Dallas","Daly City","Danbury","Danville","Davenport","Davie","Davis","Dayton","Daytona Beach","DeKalb","DeSoto","Dearborn","Dearborn Heights","Decatur","Deerfield Beach","Delano","Delray Beach","Deltona","Denton","Denver","Des Moines","Des Plaines","Detroit","Diamond Bar","Doral","Dothan","Downers Grove","Downey","Draper","Dublin","Dubuque","Duluth","Dundalk","Dunwoody","Durham","
4366Eagan","East Hartford","East Honolulu","East Lansing","East Los Angeles","East Orange","East Providence","Eastvale","Eau Claire","Eden Prairie","Edina","Edinburg","Edmond","El Cajon","El Centro","El Dorado Hills","El Monte","El Paso","Elgin","Elizabeth","Elk Grove","Elkhart","Ellicott City","Elmhurst","Elyria","Encinitas","Enid","Enterprise","Erie","Escondido","Euclid","Eugene","Euless","Evanston","Evansville","Everett","Fairfield","Fall River","Fargo","Farmington","Farmington Hills","Fayetteville","Federal Way","Findlay","Fishers","Flagstaff","Flint","Florence-Graham","Florin","Florissant","Flower Mound","Folsom","Fond du Lac","Fontana","Fort Collins","Fort Lauderdale","Fort Myers","Fort Pierce","Fort Smith","Fort Wayne","Fort Worth","Fountain Valley","Fountainebleau","Framingham","Franklin","Frederick","Freeport","Fremont","Fresno","Frisco","Fullerton","Gainesville","Gaithersburg","Galveston","Garden Grove","Gardena","Garland","Gary","Gastonia","Georgetown","Germantown","Gilbert","Gilroy","Glen Burnie","Glendale","Glendora","Glenview","Goodyear","Grand Forks","Grand Island","Grand Junction","Grand Prairie","Grand Rapids","Grapevine","Great Falls","Greeley","Green Bay","Greensboro","Greenville","Greenwood","Gresham","Guaynabo","Gulfport","Hacienda Heights","Hackensack","Haltom City","Hamilton","Hammond","Hampton","Hanford","Harlingen","Harrisburg","Harrisonburg","Hartford","Hattiesburg","Haverhill","Hawthorne","Hayward","Hemet","Hempstead","Henderson","Hendersonville","Hesperia","Hialeah","Hicksville","High Point","Highland","Highlands Ranch","Hillsboro","Hilo","Hoboken","Hoffman Estates","Hollywood","Homestead","Honolulu","Hoover","Houston","Huntersville","Huntington","Huntington Beach","Huntington Park","Huntsville","Hutchinson","Idaho Falls","Independence","Indianapolis","Indio","Inglewood","Iowa City","Irondequoit","Irvine","Irving","Jackson","Jacksonville","Janesville","Jefferson City","Jeffersonville","Jersey City","Johns Creek","Johnson City","Joliet","Jonesboro","Joplin","Jupiter","Jurupa Valley","Kalamazoo","Kannapolis","Kansas City","Kearny","Keller","Kendale Lakes","Kendall","Kenner","Kennewick","Kenosha","Kent","Kentwood","Kettering","Killeen","Kingsport","Kirkland","Kissimmee","Knoxville","Kokomo","La Crosse","La Habra","La Mesa","La Mirada","Lacey","Lafayette","Laguna Niguel","Lake Charles","Lake Elsinore","Lake Forest","Lake Havasu City","Lake Ridge","Lakeland","Lakeville","Lakewood","Lancaster","Lansing","Laredo","Largo","Las Cruces","Las Vegas","Lauderhill","Lawrence","Lawton","Layton","League City","Lee's Summit","Leesburg","Lehi","Lehigh Acres","Lenexa","Levittown","Lewisville","Lexington-Fayette","Lincoln","Linden","Little Rock","Littleton","Livermore","Livonia","Lodi","Logan","Lombard","Lompoc","Long Beach","Longmont","Longview","Lorain","Los Angeles","Louisville/Jefferson County","Loveland","Lowell","Lubbock","Lynchburg","Lynn","Lynwood","Macon-Bibb County","Madera","Madison","Malden","Manchester","Manhattan","Mansfield","Manteca","Maple Grove","Margate","Maricopa","Marietta","Marysville","Mayaguez","McAllen","McKinney","McLean","Medford","Melbourne","Memphis","Menifee","Mentor","Merced","Meriden","Meridian","Mesa","Mesquite","Metairie","Methuen Town","Miami","Miami Beach","Miami Gardens","Middletown","Midland","Midwest City","Milford","Millcreek","Milpitas","Milwaukee","Minneapolis","Minnetonka","Minot","Miramar","Mishawaka","Mission","Mission Viejo","Missoula","Missouri City","Mobile","Modesto","Moline","Monroe","Montebello","Monterey Park","Montgomery","Moore","Moreno Valley","Morgan Hill","Mount Pleasant","Mount Prospect","Mount Vernon","Mountain Vie
4366w","Muncie","Murfreesboro","Murray","Murrieta","Nampa","Napa","Naperville","Nashua","Nashville-Davidson","National City","New Bedford","New Braunfels","New Britain","New Brunswick","New Haven","New Orleans","New Rochelle","New York","Newark","Newport Beach","Newport News","Newton","Niagara Falls","Noblesville","Norfolk","Normal","Norman","North Bethesda","North Charleston","North Highlands","North Las Vegas","North Lauderdale","North Little Rock","North Miami","North Miami Beach","North Port","North Richland Hills","Norwalk","Novato","Novi","O'Fallon","Oak Lawn","Oak Park","Oakland","Oakland Park","Ocala","Oceanside","Odessa","Ogden","Oklahoma City","Olathe","Olympia","Omaha","Ontario","Orange","Orem","Orland Park","Orlando","Oro Valley","Oshkosh","Overland Park","Owensboro","Oxnard","Palatine","Palm Bay","Palm Beach Gardens","Palm Coast","Palm Desert","Palm Harbor","Palm Springs","Palmdale","Palo Alto","Paradise","Paramount","Parker","Parma","Pasadena","Pasco","Passaic","Paterson","Pawtucket","Peabody","Pearl City","Pearland","Pembroke Pines","Pensacola","Peoria","Perris","Perth Amboy","Petaluma","Pflugerville","Pharr","Philadelphia","Phoenix","Pico Rivera","Pine Bluff","Pine Hills","Pinellas Park","Pittsburg","Pittsburgh","Pittsfield","Placentia","Plainfield","Plano","Plantation","Pleasanton","Plymouth","Pocatello","Poinciana","Pomona","Pompano Beach","Ponce","Pontiac","Port Arthur","Port Charlotte","Port Orange","Port St. Lucie","Portage","Porterville","Portland","Portsmouth","Potomac","Poway","Providence","Provo","Pueblo","Quincy","Racine","Raleigh","Rancho Cordova","Rancho Cucamonga","Rancho Palos Verdes","Rancho Santa Margarita","Rapid City","Reading","Redding","Redlands","Redmond","Redondo Beach","Redwood City","Reno","Renton","Reston","Revere","Rialto","Richardson","Richland","Richmond","Rio Rancho","Riverside","Riverton","Riverview","Roanoke","Rochester","Rochester Hills","Rock Hill","Rockford","Rocklin","Rockville","Rockwall","Rocky Mount","Rogers","Rohnert Park","Rosemead","Roseville","Roswell","Round Rock","Rowland Heights","Rowlett","Royal Oak","Sacramento","Saginaw","Salem","Salina","Salinas","Salt Lake City","Sammamish","San Angelo","San Antonio","San Bernardino","San Bruno","San Buenaventura (Ventura)","San Clemente","San Diego","San Francisco","San Jacinto","San Jose","San Juan","San Leandro","San Luis Obispo","San Marcos","San Mateo","San Rafael","San Ramon","San Tan Valley","Sandy","Sandy Springs","Sanford","Santa Ana","Santa Barbara","Santa Clara","Santa Clarita","Santa Cruz","Santa Fe","Santa Maria","Santa Monica","Santa Rosa","Santee","Sarasota","Savannah","Sayreville","Schaumburg","Schenectady","Scottsdale","Scranton","Seattle","Severn","Shawnee","Sheboygan","Shoreline","Shreveport","Sierra Vista","Silver Spring","Simi Valley","Sioux City","Sioux Falls","Skokie","Smyrna","Somerville","South Bend","South Gate","South Hill","South Jordan","South San Francisco","South Valley","South Whittier","Southaven","Southfield","Sparks","Spokane","Spokane Valley","Spring","Spring Hill","Spring Valley","Springdale","Springfield","St. Charles","St. Clair Shores","St. Cloud","St. George","St. Joseph","St. Louis","St. Louis Park","St. Paul","St. Peters","St. Petersburg","Stamford","State College","Sterling Heights","Stillwater","Stockton","Stratford","Strongsville","Suffolk","Sugar Land","Summerville","Sunnyvale","Sunrise","Sunrise Manor","Surprise","Syracuse","Tacoma","Tallahassee","Tamarac","Tamiami","Tampa","Taunton","Taylor","Taylorsville","Temecula","Tempe","Temple","Terre Haute","Texas City","The Hammocks","The Villages","The Woodlands","Thornton","Thousand Oaks","Tigard","Tinley Park","Titusville","Toledo","Toms River","Tonawanda","Topeka","Torrance","Town 'n' Country","Towson","Tracy","Trenton","Troy","Trujillo Alto","Tuckahoe","Tucson","Tulare","Tulsa","Turlock","Tuscaloosa","Tustin","Twin Falls","Tyler","Union City","University","Upland","Urbana","Urbandale","Utica","Vacaville","Valdosta","Vallejo","Vancouver","Victoria","Victorville","Vineland","Virginia Beach","Visalia","Vista","Waco","Waipahu","Waldorf","Walnut Creek","Waltham","Warner Robins","Warren","Warwick","Was
4366hington","Waterbury","Waterloo","Watsonville","Waukegan","Waukesha","Wauwatosa","Wellington","Wesley Chapel","West Allis","West Babylon","West Covina","West Des Moines","West Hartford","West Haven","West Jordan","West Lafayette","West New York","West Palm Beach","West Sacramento","West Seneca","West Valley City","Westfield","Westland","Westminster","Weston","Weymouth Town","Wheaton","White Plains","Whittier","Wichita","Wichita Falls","Wilmington","Wilson","Winston-Salem","Woodbury","Woodland","Worcester","Wylie","Wyoming","Yakima","Yonkers","Yorba Linda","York","Youngstown","Yuba City","Yucaipa","Yuma"],tZ=["{{location.city_prefix}} {{person.first_name.generic}}{{location.city_suffix}}","{{location.city_prefix}} {{person.first_name.generic}}","{{person.first_name.generic}}{{location.city_suffix}}","{{person.last_name.generic}}{{location.city_suffix}}","{{location.city_name}}"],nZ=["North","East","West","South","New","Lake","Port","Fort"],rZ=["town","ton","land","ville","berg","burgh","boro","borough","bury","view","port","mouth","stad","stead","furt","chester","cester","fort","field","haven","side","shire","worth"],aZ=["Africa","Antarctica","Asia","Australia","Europe","North America","South America"],iZ=["Afghanistan","Aland Islands","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bonaire, Sint Eustatius and Saba","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory (Chagos Archipelago)","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo","Cook Islands","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czechia","Democratic Republic of the Congo","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Faroe Islands","Falkland Islands (Malvinas)","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and McDonald Islands","Holy See (Vatican City State)","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Democratic People's Republic of Korea","Republic of Korea","Kuwait","Kyrgyz Republic","Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libyan Arab Jamahiriya","Liechtenstein","Lithuania","Luxembourg","Macao","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Macedonia","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saint Barthelemy","Saint Helena","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard & Jan Mayen Islands","Sweden","Switzerland","Syrian Arab Republic","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe"],sZ=["Adams County","Calhoun County","Carroll County","Clark County","Clay County","Crawford County","Douglas County","Fayette County","Franklin County","Grant County","Greene County","Hamilton County","Hancock County","Henry County","Jackson County","Jefferson County","Johnson County","Lake County","Lawrence County","Lee County","Lincoln County","Logan County","Madison County","Marion County","Marshall County","Monroe C
4366ounty","Montgomery County","Morgan County","Perry County","Pike County","Polk County","Scott County","Union County","Warren County","Washington County","Wayne County","Avon","Bedfordshire","Berkshire","Borders","Buckinghamshire","Cambridgeshire","Central","Cheshire","Cleveland","Clwyd","Cornwall","County Antrim","County Armagh","County Down","County Fermanagh","County Londonderry","County Tyrone","Cumbria","Derbyshire","Devon","Dorset","Dumfries and Galloway","Durham","Dyfed","East Sussex","Essex","Fife","Gloucestershire","Grampian","Greater Manchester","Gwent","Gwynedd County","Hampshire","Herefordshire","Hertfordshire","Highlands and Islands","Humberside","Isle of Wight","Kent","Lancashire","Leicestershire","Lincolnshire","Lothian","Merseyside","Mid Glamorgan","Norfolk","North Yorkshire","Northamptonshire","Northumberland","Nottinghamshire","Oxfordshire","Powys","Rutland","Shropshire","Somerset","South Glamorgan","South Yorkshire","Staffordshire","Strathclyde","Suffolk","Surrey","Tayside","Tyne and Wear","Warwickshire","West Glamorgan","West Midlands","West Sussex","West Yorkshire","Wiltshire","Worcestershire"],oZ={cardinal:["North","East","South","West"],cardinal_abbr:["N","E","S","W"],ordinal:["Northeast","Northwest","Southeast","Southwest"],ordinal_abbr:["NE","NW","SE","SW"]},lZ=[{name:"Afrikaans",alpha2:"af",alpha3:"afr"},{name:"Azerbaijani",alpha2:"az",alpha3:"aze"},{name:"Maldivian",alpha2:"dv",alpha3:"div"},{name:"Farsi/Persian",alpha2:"fa",alpha3:"fas"},{name:"Latvian",alpha2:"lv",alpha3:"lav"},{name:"Indonesian",alpha2:"id",alpha3:"ind"},{name:"Nepali",alpha2:"ne",alpha3:"nep"},{name:"Thai",alpha2:"th",alpha3:"tha"},{name:"Uzbek",alpha2:"uz",alpha3:"uzb"},{name:"Yoruba",alpha2:"yo",alpha3:"yor"},{name:"Pashto",alpha2:"ps",alpha3:"pus"},{name:"English",alpha2:"en",alpha3:"eng"},{name:"Urdu",alpha2:"ur",alpha3:"urd"},{name:"German",alpha2:"de",alpha3:"deu"},{name:"French",alpha2:"fr",alpha3:"fra"},{name:"Spanish",alpha2:"es",alpha3:"spa"},{name:"Italian",alpha2:"it",alpha3:"ita"},{name:"Dutch",alpha2:"nl",alpha3:"nld"},{name:"Russian",alpha2:"ru",alpha3:"rus"},{name:"Portuguese",alpha2:"pt",alpha3:"por"},{name:"Polish",alpha2:"pl",alpha3:"pol"},{name:"Arabic",alpha2:"ar",alpha3:"ara"},{name:"Japanese",alpha2:"ja",alpha3:"jpn"},{name:"Chinese",alpha2:"zh",alpha3:"zho"},{name:"Hindi",alpha2:"hi",alpha3:"hin"},{name:"Bengali",alpha2:"bn",alpha3:"ben"},{name:"Gujarati",alpha2:"gu",alpha3:"guj"},{name:"Tamil",alpha2:"ta",alpha3:"tam"},{name:"Telugu",alpha2:"te",alpha3:"tel"},{name:"Punjabi",alpha2:"pa",alpha3:"pan"},{name:"Vietnamese",alpha2:"vi",alpha3:"vie"},{name:"Korean",alpha2:"ko",alpha3:"kor"},{name:"Turkish",alpha2:"tr",alpha3:"tur"},{name:"Swedish",alpha2:"sv",alpha3:"swe"},{name:"Greek",alpha2:"el",alpha3:"ell"},{name:"Czech",alpha2:"cs",alpha3:"ces"},{name:"Hungarian",alpha2:"hu",alpha3:"hun"},{name:"Romanian",alpha2:"ro",alpha3:"ron"},{name:"Ukrainian",alpha2:"uk",alpha3:"ukr"},{name:"Norwegian",alpha2:"no",alpha3:"nor"},{name:"Serbian",alpha2:"sr",alpha3:"srp"},{name:"Croatian",alpha2:"hr",alpha3:"hrv"},{name:"Slovak",alpha2:"sk",alpha3:"slk"},{name:"Slovenian",alpha2:"sl",alpha3:"slv"},{name:"Icelandic",alpha2:"is",alpha3:"isl"},{name:"Finnish",alpha2:"fi",alpha3:"fin"},{name:"Danish",alpha2:"da",alpha3:"dan"},{name:"Swahili",alpha2:"sw",alpha3:"swa"},{name:"Bashkir",alpha2:"ba",alpha3:"bak"},{name:"Basque",alpha2:"eu",alpha3:"eus"},{name:"Catalan",alpha2:"ca",alpha3:"cat"},{name:"Galician",alpha2:"gl",alpha3:"glg"},{name:"Esperanto",alpha2:"eo",alpha3:"epo"},{name:"Fijian",alpha2:"fj",alpha3:"fij"},{name:"Malagasy",alpha2:"mg",alpha3:"mlg"},{name:"Maltese",alpha2:"mt",alpha3:"mlt"},{name:"Albanian",alpha2:"sq",alpha3:"sqi"},{name:"Armenian",alpha2:"hy",alpha3:"hye"},{name:"Georgian",alpha2:"ka",alpha3:"kat"},{name:"Macedonian",alpha2:"mk",alpha3:"mkd"},{name:"Kazakh",alpha2:"kk",alpha3:"kaz"},{name:"Haitian Creole",alpha2:"ht",alpha3:"hat"},{name:"Mongolian",alpha2:"mn",alpha3:"mon"},{name:"Kyrgyz",alpha2:"ky",alpha3:"kir"},{name:"Finnish",alpha2:"fi",alpha3:"fin"},{name:"Tagalog",alpha2:"tl",alpha3:"tgl"},{name:"Malay",alpha2:"ms",alpha3:"msa"},{name:"Tajik",alpha2:"tg",alpha3:"tgk"},{name:"Swati",alpha2:"ss",alpha3:"ssw"},{name:"Tatar",alpha2:"tt",alpha3:"tat"},{name:"Zulu",alpha2:"zu",alpha3:"zul"}],cZ=["#####","#####-####"],uZ=["Apt. ###","Suite ###"],dZ=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
4366orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],hZ=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],mZ={normal:"{{location.buildingNumber}} {{location.street}}",full:"{{location.buildingNumber}} {{location.street}} {{location.secondaryAddress}}"},fZ=["10th Street","11th Street","12th Street","13th Street","14th Street","15th Street","16th Street","1st Avenue","1st Street","2nd Avenue","2nd Street","3rd Avenue","3rd Street","4th Avenue","4th Street","5th Avenue","5th Street","6th Avenue","6th Street","7th Avenue","7th Street","8th Avenue","8th Street","9th Street","A Street","Abbey Road","Adams Avenue","Adams Street","Airport Road","Albany Road","Albert Road","Albion Street","Alexandra Road","Alfred Street","Alma Street","Ash Close","Ash Grove","Ash Road","Ash Street","Aspen Close","Atlantic Avenue","Avenue Road","Back Lane","Baker Street","Balmoral Road","Barn Close","Barton Road","Bath Road","Bath Street","Bay Street","Beach Road","Bedford Road","Beech Close","Beech Drive","Beech Grove","Beech Road","Beechwood Avenue","Bell Lane","Belmont Road","Birch Avenue","Birch Close","Birch Grove","Birch Road","Blind Lane","Bluebell Close","Boundary Road","Bramble Close","Bramley Close","Bridge Road","Bridge Street","Broad Lane","Broad Street","Broadway","Broadway Avenue","Broadway Street","Brook Lane","Brook Road","Brook Street","Brookside","Buckingham Road","Cambridge Street","Canal Street","Castle Close","Castle Lane","Castle Road","Castle Street","Cavendish Road","Cedar Avenue","Cedar Close","Cedar Grove","Cedar Road","Cedar Street","Cemetery Road","Center Avenue","Center Road","Center Street","Central Avenue","Central Street","Chapel Close","Chapel Hill","Chapel Road","Chapel Street","Charles Street","Cherry Close","Cherry Street","Cherry Tree Close","Chester Road","Chestnut Close","Chestnut Drive","Chestnut Grove","Chestnut Street","Church Avenue","Church Close","Church Hill","Church Lane","Church Path","Church Road","Church Street","Church View","Church Walk","Claremont Road","Clarence Road","Clarence Street","Clarendon Road","Clark Street","Clay Lane","Cleveland Street","Cliff Road","Clifton Road","Clinton Street","College Avenue","College Street","Columbia Avenue","Commerce Street","Commercial Road","Commercial Street","Common Lane","Coronation Avenue","Coronation Road","County Line Road","County Road","Court Street","Cow Lane","Crescent Road","Cromwell Road","Cross Lane","Cross Street","Crown Street","Cumberland Street","Dale Street","Dark Lane","Davis Street","Depot Street","Derby Road","Derwent Close","Devonshire Road","Division Street","Douglas Road","Duke Street","E 10th Street","E 11th Street","E 12th Street","E 14th Street","E 1st Street","E 2nd Street","E 3rd Street","E 4th Avenue","E 4th Street","E 5th Street","E 6th Avenue","E 6th Street","E 7th Street","E 8th Street","E 9th Street","E Bridge Street","E Broad Street","E Broadway","E Broadway Street","E Cedar Street","E Center Street","E Central Avenue","E Church Street","E Elm Street","E Franklin Street","E Front Street","E Grand Avenue","E High Street","E Jackson Street","E Jefferson Street","E Main","E Main Street","E Maple Street","E Market Street","E North Street","E Oak Street","E Park Avenue","E Pine Street","E River Road","E South Street","E State Street","E Union Street","E Walnut Street","E Washington Avenue","E Washington Street","E Water Street","East Avenue","East Road","East Street","Edward Street","Elm Close","Elm Grove","Elm Road","Elm Street","Euclid Avenue","Fairfield Road","Farm Close","Ferry Road","Field Close","Field Lane","First Avenue","First Street","Fore Street","Forest Avenue","Forest Road","Fourth Avenue","Franklin Avenue","Franklin Road","Franklin Street","Front Street","Frontage Road","Garden Close","Garden Street","George Street","Gladstone Road","Glebe Close","Gloucester Road","Gordon Road","Gordon Street","Grand Avenue","Grange Avenue","Grange Close","Grange Road","Grant Street","Green Close","Green Lane","Green Street","Greenville Road","Greenway","Greenwood Road","Grove Lane","Grove Road","Grove Street","Hall Lane","Hall Street","Harrison Avenue","Harrison Street","Hawthorn Avenue","Hawthorn Close","Hazel Close","Hazel Grove","Heath Road","Heather Close","Henry Street","Heron Close","Hickory Street","High Road","High Street","Highfield Avenue","Highfield Close","Highfield Road","Highland Avenue","Hill Road","Hill Street","Hillside","Hillside Avenue","Hillside Close","Hillside Road","Holly Close","Honeysuckle Close","Howard Road","Howard Street","Jackson Avenue","Jackson Street","James Street","Jefferson Avenue","Jefferson Street","Johnson Street","Jubilee Close","Juniper Close","Kent Road","Kestrel Close","King Street","King's Road","Kingfisher Close","Kings Highway","Kingsway","Laburnum Grove","Lafayette Street","Lake Avenue","Lake Drive","Lake Road","Lake Street","Lancaster Road","Lansdowne Road","Larch Close","Laurel Close","Lawrence Street","Lee Street","Liberty Street","Lime Grove","Lincoln Avenue","Lincoln Highway","Lincoln Road","Lincoln Street","Locust Street","Lodge Close","Lodge Lane","London Road","Long Lane","Low Road","Madison Avenue","Madison Street","Main","Main Avenue","Main Road","Main Street","Main Street E","Main Street N","Main Street S","Main Street W","Manchester Road","Manor Close","Manor Drive","Manor Gardens","Manor Road","Manor Way","Maple Avenue","Maple Close","Maple Drive","Maple Road","Maple Street","Market Place","Market Square","Market Street","Marlborough Road","Marsh Lane","Martin Luther King Boulevard","Martin Luther King Drive","Martin Luther King Jr Boulevard","Mary Street","Mayfield Road","Meadow Close","Meadow Drive","Meadow Lane","Meadow View","Meadow Way","Memorial Drive","Middle Street","Mill Close","Mill Lane","Mill Road","Mill Street","Milton Road","Milton Street","Monroe Street","Moor Lane","Moss Lane","Mount Pleasant","Mount Street","Mulberry Street","N 1st Street","N 2nd Street","N 3rd Street","N 4th Street","N 5th Street","N 6th Street","N 7th Street","N 8th Street","N 9th Street","N Bridge Street","N Broad Street","N Broadway","N Broadway Street","N Cedar Street","N Center Street","N Central Avenue","N Chestnut Street","N Church Street","N College Street","N Court Street","N Division Street","N East Street","N Elm Street","N Franklin Street","N Front Street","N Harrison Street","N High Street","N Jackson Street","N Jefferson Street","N Lincoln Street","N Locust Street","N Main","N Main Avenue","N Main Street","N Maple Street","N Market Street","N Monroe Street","N Oak Street","N Park Street","N Pearl Street","N Pine Street","N Poplar Street","N Railroad Street","N State Street","N Union Street","N Walnut Street","N Washington Avenue","N Washington Street","N Water Street","Nelson Road","Nelson Street","New L
4366ane","New Road","New Street","Newton Road","Nightingale Close","Norfolk Road","North Avenue","North Lane","North Road","North Street","Northfield Road","Oak Avenue","Oak Drive","Oak Lane","Oak Road","Oak Street","Oakfield Road","Oaklands","Old Lane","Old Military Road","Old Road","Old State Road","Orchard Drive","Orchard Lane","Orchard Road","Orchard Street","Oxford Road","Oxford Street","Park Avenue","Park Crescent","Park Drive","Park Lane","Park Place","Park Road","Park Street","Park View","Parkside","Pearl Street","Pennsylvania Avenue","Pine Close","Pine Grove","Pine Street","Pinfold Lane","Pleasant Street","Poplar Avenue","Poplar Close","Poplar Road","Poplar Street","Post Road","Pound Lane","Princes Street","Princess Street","Priory Close","Priory Road","Prospect Avenue","Prospect Place","Prospect Road","Prospect Street","Quarry Lane","Quarry Road","Queen's Road","Railroad Avenue","Railroad Street","Railway Street","Rectory Close","Rectory Lane","Richmond Close","Richmond Road","Ridge Road","River Road","River Street","Riverside","Riverside Avenue","Riverside Drive","Roman Road","Roman Way","Rowan Close","Russell Street","S 10th Street","S 14th Street","S 1st Avenue","S 1st Street","S 2nd Street","S 3rd Street","S 4th Street","S 5th Street","S 6th Street","S 7th Street","S 8th Street","S 9th Street","S Bridge Street","S Broad Street","S Broadway","S Broadway Street","S Center Street","S Central Avenue","S Chestnut Street","S Church Street","S College Street","S Division Street","S East Street","S Elm Street","S Franklin Street","S Front Street","S Grand Avenue","S High Street","S Jackson Street","S Jefferson Street","S Lincoln Street","S Main","S Main Avenue","S Main Street","S Maple Street","S Market Street","S Mill Street","S Monroe Street","S Oak Street","S Park Street","S Pine Street","S Railroad Street","S State Street","S Union Street","S Walnut Street","S Washington Avenue","S Washington Street","S Water Street","S West Street","Salisbury Road","Sandringham Road","Sandy Lane","School Close","School Lane","School Road","School Street","Second Avenue","Silver Street","Skyline Drive","Smith Street","Somerset Road","South Avenue","South Drive","South Road","South Street","South View","Spring Gardens","Spring Street","Springfield Close","Springfield Road","Spruce Street","St Andrew's Road","St Andrews Close","St George's Road","St John's Road","St Mary's Close","St Mary's Road","Stanley Road","Stanley Street","State Avenue","State Line Road","State Road","State Street","Station Road","Station Street","Stoney Lane","Sycamore Avenue","Sycamore Close","Sycamore Drive","Sycamore Street","Talbot Road","Tennyson Road","The Avenue","The Beeches","The Causeway","The Chase","The Coppice","The Copse","The Crescent","The Croft","The Dell","The Drive","The Fairway","The Glebe","The Grange","The Green","The Grove","The Hawthorns","The Lane","The Laurels","The Limes","The Maltings","The Meadows","The Mews","The Mount","The Oaks","The Orchard","The Oval","The Paddock","The Paddocks","The Poplars","The Ridgeway","The Ridings","The Rise","The Sidings","The Spinney","The Square","The Willows","The Woodlands","Third Avenue","Third Street","Tower Road","Trinity Road","Tudor Close","Union Avenue","Union Street","University Avenue","University Drive","Valley Road","Veterans Memorial Drive","Veterans Memorial Highway","Vicarage Close","Vicarage Lane","Vicarage Road","Victoria Place","Victoria Road","Victoria Street","Vine Street","W 10th Street","W 11th Street","W 12th Street","W 14th Street","W 1st Street","W 2nd Street","W 3rd Street","W 4th Avenue","W 4th Street","W 5th Street","W 6th Avenue","W 6th Street","W 7th Street","W 8th Street","W 9th Street","W Bridge Street","W Broad Street","W Broadway","W Broadway Avenue","W Broadway Street","W Center Street","W Central Avenue","W Chestnut Street","W Church Street","W Division Street","W Elm Street","W Franklin Street","W Front Street","W Grand Avenue","W High Street","W Jackson Street","W Jefferson Street","W Lake Street","W Main","W Main Street","W Maple Street","W Market Street","W Monroe Street","W North Street","W Oak Street","W Park Street","W Pine Street","W River Road","W South Street","W State Street","W Union Street","W Walnut Street","W Washington Avenue","W Washington Street","Walnut Close","Walnut Street","Warren Close","Warren Road","Washington Avenue","Washington Boulevard","Was
4366hington Road","Washington Street","Water Lane","Water Street","Waterloo Road","Waterside","Watery Lane","Waverley Road","Well Lane","Wellington Road","Wellington Street","West Avenue","West End","West Lane","West Road","West Street","West View","Western Avenue","Western Road","Westfield Road","Westgate","William Street","Willow Close","Willow Drive","Willow Grove","Willow Road","Willow Street","Windermere Road","Windmill Close","Windmill Lane","Windsor Avenue","Windsor Close","Windsor Drive","Wood Lane","Wood Street","Woodland Close","Woodland Road","Woodlands","Woodlands Avenue","Woodlands Close","Woodlands Road","Woodside","Woodside Road","Wren Close","Yew Tree Close","York Road","York Street"],pZ=["{{person.first_name.generic}} {{location.street_suffix}}","{{person.last_name.generic}} {{location.street_suffix}}","{{location.street_name}}"],gZ=["Alley","Avenue","Branch","Bridge","Brook","Brooks","Burg","Burgs","Bypass","Camp","Canyon","Cape","Causeway","Center","Centers","Circle","Circles","Cliff","Cliffs","Club","Common","Corner","Corners","Course","Court","Courts","Cove","Coves","Creek","Crescent","Crest","Crossing","Crossroad","Curve","Dale","Dam","Divide","Drive","Drives","Estate","Estates","Expressway","Extension","Extensions","Fall","Falls","Ferry","Field","Fields","Flat","Flats","Ford","Fords","Forest","Forge","Forges","Fork","Forks","Fort","Freeway","Garden","Gardens","Gateway","Glen","Glens","Green","Greens","Grove","Groves","Harbor","Harbors","Haven","Heights","Highway","Hill","Hills","Hollow","Inlet","Island","Islands","Isle","Junction","Junctions","Key","Keys","Knoll","Knolls","Lake","Lakes","Land","Landing","Lane","Light","Lights","Loaf","Lock","Locks","Lodge","Loop","Mall","Manor","Manors","Meadow","Meadows","Mews","Mill","Mills","Mission","Motorway","Mount","Mountain","Mountains","Neck","Orchard","Oval","Overpass","Park","Parks","Parkway","Parkways","Pass","Passage","Path","Pike","Pine","Pines","Place","Plain","Plains","Plaza","Point","Points","Port","Ports","Prairie","Radial","Ramp","Ranch","Rapid","Rapids","Rest","Ridge","Ridges","River","Road","Roads","Route","Row","Rue","Run","Shoal","Shoals","Shore","Shores","Skyway","Spring","Springs","Spur","Spurs","Square","Squares","Station","Stravenue","Stream","Street","Streets","Summit","Terrace","Throughway","Trace","Track","Trafficway","Trail","Tunnel","Turnpike","Underpass","Union","Unions","Valley","Valleys","Via","Viaduct","View","Views","Village","Villages","Ville","Vista","Walk","Walks","Wall","Way","Ways","Well","Wells"],xZ={building_number:QX,city_name:eZ,city_pattern:tZ,city_prefix:nZ,city_suffix:rZ,continent:aZ,country:iZ,county:sZ,direction:oZ,language:lZ,postcode:cZ,secondary_address:uZ,state:dZ,state_abbr:hZ,street_address:mZ,street_name:fZ,street_pattern:pZ,street_suffix:gZ},vZ=xZ,yZ=["a","ab","abbas","abduco","abeo","abscido","absconditus","absens","absorbeo","absque","abstergo","absum","abundans","abutor","accedo","accendo","acceptus","accommodo","accusamus","accusantium","accusator","acer","acerbitas","acervus","acidus","acies","acquiro","acsi","ad","adamo","adaugeo","addo","adduco","ademptio","adeo","adeptio","adfectus","adfero","adficio","adflicto","adhaero","adhuc","adicio","adimpleo","adinventitias","adipisci","adipiscor","adiuvo","administratio","admiratio","admitto","admoneo","admoveo","adnuo","adopto","adsidue","adstringo","adsuesco","adsum","adulatio","adulescens","aduro","advenio","adversus","advoco","aedificium","aeger","aegre","aegrotatio","aegrus","aeneus","aequitas","aequus","aer","aestas","aestivus","aestus","aetas","aeternus","ager","aggero","aggredior","agnitio","agnosco","ago","ait","aiunt","alias","alienus","alii","alioqui","aliqua","aliquam","aliquid","alius","allatus","alo","alter","altus","alveus","amaritudo","ambitus","ambulo","amet","amicitia","amiculum","amissio","amita","amitto","amo","amor","amoveo","amplexus","amplitudo","amplus","ancilla","angelus","angulus","angustus","animadverto","animi","animus","annus","anser","ante","antea","antepono","antiquus","aperiam","aperio","aperte","apostolus","apparatus","appello","appono","appositus","approbo","apto","aptus","apud","aqua","ara","aranea","arbitro","arbor","arbustum","arca","arceo","arcesso","architecto","arcus","argentum","argumentum","arguo","arma","armarium","aro","ars","articulus","artificiose","arto","arx","ascisco","ascit","asper","asperiores","aspernatur","aspicio","asporto","assentator","assumenda","astrum","at","atavus","ater","atque","atqui","atrocitas","atrox","attero","attollo","attonbitus","auctor","auctus","audacia","audax","audentia","audeo","audio","auditor","aufero","aureus","aurum","aut","autem","autus","auxilium","avaritia","avarus","aveho","averto","baiulus","balbus","barba","bardus","basium","beatae","beatus","bellicus","bellum","bene","beneficium","benevolentia","benigne","bestia","bibo","bis","blandior","blanditiis","bonus","bos","brevis","cado","caecus","caelestis","caelum","calamitas","calcar","calco","calculus","callide","campana","candidus","canis","canonicus","canto","capillus","capio","capitulus","capto","caput","carbo","carcer","careo","caries","cariosus","caritas","carmen","carpo","carus","casso","caste","casus","catena","caterva","cattus","cauda","causa","caute","caveo","cavus","cedo","celebrer","celer","celo","cena","cenaculum","ceno","censura","centum","cerno","cernuus","certe","certus","cervus","cetera","charisma","chirographum","cibo","cibus","cicuta","cilicium","cimentarius","ciminatio","cinis","circumvenio","cito","civis","civitas","clam","clamo","claro","clarus","claudeo","claustrum","clementia","clibanus","coadunatio","coaegresco","coepi","coerceo","cogito","cognatus","cognomen","cogo","cohaero","cohibeo","cohors","colligo","collum","colo","color","coma","combibo","comburo","comedo","comes","cometes","comis","comitatus","commemoro","comminor","commodi","commodo","communis","comparo","compello","complectus","compono","comprehendo","comptus","conatus","concedo","concido","conculco","condico","conduco","confero","confido","conforto","confugo","congregatio","conicio","coniecto","conitor","coniuratio","conor","conqueror","conscendo","consectetur","consequatur","consequuntur","conservo","considero","conspergo","constans","consuasor","contabesco","contego","contigo","contra","conturbo","conventus","convoco","copia","copiose","cornu","corona","corporis","corpus","correptius","corrigo","corroboro","corrumpo","corrupti","coruscus","cotidie","crapula","cras","crastinus","creator","creber","crebro","credo","creo","creptio","crepusculum","cresco","creta","cribro","crinis","cruciamentum","crudelis","cruentus","crur","crustulum","crux","cubicularis","cubitum","cubo","cui","cuius","culpa","culpo","cultellus","cultura","cum","cumque","cunabula","cunae","cunctatio","cupiditas","cupiditate","cupio","cuppedia","cupressus","cur","cura","curatio","curia","curiositas","curis","curo","curriculum","currus","cursim","curso","cursus","curto","curtus","curvo","custodia","damn
4366atio","damno","dapifer","debeo","debilito","debitis","decens","decerno","decet","decimus","decipio","decor","decretum","decumbo","dedecor","dedico","deduco","defaeco","defendo","defero","defessus","defetiscor","deficio","defleo","defluo","defungo","degenero","degero","degusto","deinde","delectatio","delectus","delego","deleniti","deleo","delibero","delicate","delinquo","deludo","demens","demergo","demitto","demo","demonstro","demoror","demulceo","demum","denego","denique","dens","denuncio","denuo","deorsum","depereo","depono","depopulo","deporto","depraedor","deprecator","deprimo","depromo","depulso","deputo","derelinquo","derideo","deripio","deserunt","desidero","desino","desipio","desolo","desparatus","despecto","dicta","dignissimos","distinctio","dolor","dolore","dolorem","doloremque","dolores","doloribus","dolorum","ducimus","ea","eaque","earum","eius","eligendi","enim","eos","error","esse","est","et","eum","eveniet","ex","excepturi","exercitationem","expedita","explicabo","facere","facilis","fuga","fugiat","fugit","harum","hic","id","illo","illum","impedit","in","incidunt","infit","inflammatio","inventore","ipsa","ipsam","ipsum","iste","itaque","iure","iusto","labore","laboriosam","laborum","laudantium","libero","magnam","magni","maiores","maxime","minima","minus","modi","molestiae","molestias","mollitia","nam","natus","necessitatibus","nemo","neque","nesciunt","nihil","nisi","nobis","non","nostrum","nulla","numquam","occaecati","ocer","odio","odit","officia","officiis","omnis","optio","paens","pariatur","patior","patria","patrocinor","patruus","pauci","paulatim","pauper","pax","peccatus","pecco","pecto","pectus","pecus","peior","pel","perferendis","perspiciatis","placeat","porro","possimus","praesentium","provident","quae","quaerat","quam","quas","quasi","qui","quia","quibusdam","quidem","quis","quisquam","quo","quod","quos","ratione","recusandae","reiciendis","rem","repellat","repellendus","reprehenderit","repudiandae","rerum","saepe","sapiente","sed","sequi","similique","sint","sit","socius","sodalitas","sol","soleo","solio","solitudo","solium","sollers","sollicito","solum","solus","soluta","solutio","solvo","somniculosus","somnus","sonitus","sono","sophismata","sopor","sordeo","sortitus","spargo","speciosus","spectaculum","speculum","sperno","spero","spes","spiculum","spiritus","spoliatio","sponte","stabilis","statim","statua","stella","stillicidium","stipes","stips","sto","strenuus","strues","studio","stultus","suadeo","suasoria","sub","subito","subiungo","sublime","subnecto","subseco","substantia","subvenio","succedo","succurro","sufficio","suffoco","suffragium","suggero","sui","sulum","sum","summa","summisse","summopere","sumo","sumptus","sunt","supellex","super","suppellex","supplanto","suppono","supra","surculus","surgo","sursum","suscipio","suscipit","suspendo","sustineo","suus","synagoga","tabella","tabernus","tabesco","tabgo","tabula","taceo","tactus","taedium","talio","talis","talus","tam","tamdiu","tamen","tametsi","tamisium","tamquam","tandem","tantillus","tantum","tardus","tego","temeritas","temperantia","templum","tempora","tempore","temporibus","temptatio","tempus","tenax","tendo","teneo","tener","tenetur","tenuis","tenus","tepesco","tepidus","ter","terebro","teres","terga","tergeo","tergiversatio","tergo","tergum","termes","terminatio","tero","terra","terreo","territo","terror","tersus","tertius","testimonium","texo","textilis","textor","textus","thalassinus","theatrum","theca","thema","theologus","thermae","thesaurus","thesis","thorax","thymbra","thymum","tibi","timidus","timor","titulus","tolero","tollo","tondeo","tonsor","torqueo","torrens","tot","totam","totidem","toties","totus","tracto","trado","traho","trans","tredecim","tremo","trepide","tres","tribuo","tricesimus","triduana","tripudio","tristis","triumphus","trucido","truculenter","tubineus","tui","tum","tumultus","tunc","turba","turbo","turpis","tutamen","tutis","tyrannus","uberrime","ubi","ulciscor","ullam","ullus","ulterius","ultio","ultra","umbra","umerus","umquam","una","unde","undique","universe","unus","urbanus","urbs","uredo","usitas","usque","ustilo","ustulo","usus","ut","uter","uterque","utilis","utique","utor","utpote","utrimque","utroque","utrum","uxor","vaco","vacuus","vado","vae","valde","valens","valeo","valetudo","validus","vallum","vapulus","varietas","varius","vehemens","vel","velit","velociter","velum","velut","venia","veniam","venio","ventito","ventosus","ventus","venustas","ver","verbera","verbum","vere","verecundia","vereor","vergo","veritas","veritatis","vero","versus","verto","verumtamen","verus","vesco","vesica","vesper","vespillo","vester","vestigium","vestrum","vetus","via","vicinus","vicissitudo","victoria","victus","videlicet","video","viduo","vigilo","vigor","vilicus","vilis","vilitas","villa","vinco","vinculum","vindico","vinitor","vinum","vir","virga","virgo","viridis","viriliter","virtus","vis","viscus","vita","vitae","vitiosus","vitium","vito","vivo","vix","vobis","vociferor","voco","volaticus","volo","volubilis","voluntarius","volup","voluptas","voluptate","voluptatem","voluptates","voluptatibus","voluptatum","volutabrum","volva","vomer","vomica","vomito","vorago","vorax","voro","vos","votum","voveo","vox","vulariter","vulgaris","vulgivagus","vulgo","vulgus","vulnero","vulnus","vulpes","vulticulus","xiphias"],bZ={word:yZ},wZ=bZ,SZ={title:"English",code:"en",language:"en",endonym:"English",dir:"ltr",script:"Latn"},FZ=SZ,CZ=['"Awaken, My Love!"',"(What's The Story) Morning Glory?","- Tragedy +","13 Reasons Why (Season 3)","21st Century Breakdown","30 De Febrero","432 Hz Deep Healing","5-Star","528 Hz Meditation Music","54+1","8 Mile","808s & Heartbreak","9 To 5 And Odd Jobs","A Beautiful Lie","A Day At The Races","A Day Without Rain","A Fever You Can't Sweat Out","A Gangsta's Pain","A Gift & A Curse","A Hard Day's Night","A Head Full Of Dreams","A Kind Of Magic","A Million Ways To Murder","A Moment Apart","A Song For Every Moon","A Thousand Suns","A Winter Romance","ABBA","AI You
4366ngBoy","AJ Tracey","Act One","After Hours","Agent Provocateur","All About You","All I Know So Far: Setlist","All Or Nothing","All Out","All Over The Place","All Stand Together","All The Lost Souls","All The Things I Never Said","All Things Must Pass","Alleen","Alright, Still","Alta Suciedad","America","American Heartbreak","American Teen","And Justice For None","Animal Songs","Another Friday Night","Anything Goes","Ao Vivo Em São Paulo","Ao Vivo No Ibirapuera","Apricot Princess","Aqui E Agora (Ao Vivo)","Arcane League Of Legends","Ardipithecus","Aretha Now","Around The Fur","Arrival","Artist 2.0","As She Pleases","Ascend","Ashlyn","Astro Lounge","At Night, Alone.","At. Long. Last. ASAP","Atlas","Audioslave","Aura","Austin","Awake","Away From The Sun","Ayayay!","Baby On Baby","Back For Everything","Back From The Edge","Back In Black","Back To Black","Back To The Game","Bad","Bahía Ducati","Baila","Barbie The Album","Battleground","Bayou Country","Bcos U Will Never B Free","Be","Be Here Now","Beautiful Mind","Beautiful Thugger Girls","Beautiful Trauma","Beauty And The Beast","Beggars Banquet","Being Funny In A Foreign Language","Berlin Lebt","Berry Is On Top","Best White Noise For Baby Sleep - Loopable With No Fade","Big Baby DRAM","Bigger, Better, Faster, More!","Billy Talent II","Black Star Elephant","Blackout","Blank Face LP","Bleach","Blizzard Of Ozz","Blonde","Blood Sugar Sex Magik","Bloom","Blowin' Your Mind!","Blu Celeste","Blue","Blue Banisters","Blue Hawaii","Blue Neighbourhood","Bluebird Days","Bobby Tarantino","Bobby Tarantino II","Bon Iver","Born Pink","Born To Run","Brand New Eyes","Break The Cycle","Breakfast In America","Breakthrough","Brett Young","Bridge Over Troubled Water","Bright: The Album","Brol","Buds","Buena Vista Social Club","Built On Glass","Bury Me At Makeout Creek","Busyhead","By The Way","CB6","CNCO","California Sunrise","Californication","Call Me Irresponsible","Calm","Camino Palmero","Camp","Caracal","Carbon Fiber Hits","Carnival","Carry On","Cartel De Santa","Certified Lover Boy","Chaaama","Chama Meu Nome","Chapter 1: Snake Oil","Chapter 2: Swamp Savant","Chapter One","Charlie's Angels","Cherry Bomb","Chief","Chocolate Factory","Chosen","Chris Brown","Christina Aguilera","Chromatica","Church","City Of Evil","Clandestino","Clouds","Coco","Collision Course","Colour Vision","Combat Rock","Come Around Sundown","Come Away With Me","Come Home The Kids Miss You","Come What(ever) May","Commando","Common Sense","Communion","Conditions","Confident","Confrontation","Control The Streets, Volume 2","Corinne Bailey Rae","Costello Music","Cottonwood","Covers, Vol. 2","Cozy Tapes Vol. 2: Too Cozy","Crash Talk","Crazy Love","Crazysexycool","Crowded House","Cruisin' With Junior H","Culture","Current Mood","DS2","Dale","Danger Days: The True Lives Of The Fabulous Killjoys","Dangerous Woman","Dangerous: The Double Album","Dark Horse","Day69","Daydream","De Fiesta","De Viaje","DeAnn","Death Race For Love","Delirium","Delta","Demidevil","Depression Cherry","Descendants","Desgenerados Mixtape","Destin","Destiny Fulfilled","Desvelado","Detroit 2","Dex Meets Dexter","Dharma","Die A Legend","Different World","Dig Your Roots","Digital Druglord","Dirt","Disclaimer I / II","Discovery","Disraeli Gears","Disumano","Dizzy Up The Girl","Don't Play That Song","Donda","Donde Quiero Estar","Doo-Wops & Hooligans","Down The Way","Dr. Feelgood","Dream Your Life Away","Dreaming Out Loud","Drip Harder","Drive","Drones","Dropped Outta College","Drowning","Dua Warna Cinta","Dulce Beat","Dusty In Memphis","Dutty Rock","Dying To Live","ENR","East Atlanta Love Letter","Editorial","Edna","El Abayarde","El Amor En Los Tiempos Del Perreo","El Camino","El Comienzo","El Dorado","El Karma","El Mal Querer","El Malo","El Trabajo Es La Suerte","El Viaje De Copperpot","Electric Ladyland","Emotion","En Tus Planes","Endless Summer Vacation","Enter The Wu-Tang (36 Chambers)","Equals (=)","Estrella","Euphoria","Europop","Evermore","Every Kingdom","Everyday Life","Evolve","Expectations","Face Yourself","Facelift","Fallin'","Fancy You","Fantasía","Favourite Worst Nightmare","Fear Of The Dark","Fearless","Feel Something","Feels Like Home","Femme Fatale","Ferxxocalipsis","Fifty Shades Darker","Fifty Shades Freed","Fifty Shades Of Grey","Final (Vol.1)","Finding Beauty In Negative Spaces","Fine Line","First Impressions Of Earth","First Steps","Five Seconds Flat","Folklore","For Emma, Forever Ago","Forajido EP 1","Forever","Forever Young","Formula Of Love: O+T=<3","Free 6lack","Freudian","Frozen II","Full Moon Fever","Funhouse","Funk Wav Bounce
4366s Vol.1","Future History","FutureSex/LoveSounds","Fuzzybrain","Gallery","Gangsta's Paradise","Gemini","Gemini Rights","Generationwhy","Get A Grip","Get Up","Gettin' Old","Girl","Gladiator","Glisten","Globalization","Gloria","Glory Days","God's Project","Gold Skies","Golden","Good Evening","Good Thing","Goodbye Yellow Brick Road","Gossip Columns","Got Your Six","Graceland","Graduation","Grand Champ","Grandson, Vol. 1","Green River","Guerra","Ha*Ash Primera Fila - Hecho Realidad","Haiz","Hamilton","Happy Endings","Harry Styles","Hasta La Raíz","Hatful Of Hollow","Head In The Clouds","Heard It In A Past Life","Heart Shaped World","Heartbeat City","Heartbreak On A Full Moon / Cuffing Season - 12 Days Of Christmas","Heaven Or Hell","Heaven knows","Hellbilly Deluxe","Hellboy","Help!","Her Loss","Here Comes The Cowboy","Hey World","High School Musical","High Tide In The Snake's Nest","Historias De Un Capricornio","Hndrxx","Hombres G (Devuélveme A Mi Chica)","Homerun","Homework","Hot Fuss","Hot Pink","Hot Sauce / Hello Future","Hot Space","Hotel Diablo","Houses Of The Holy","How Big, How Blue, How Beautiful","How I'm Feeling","How To Be Human","How To Save A Life","How To: Friend, Love, Freefall","Hozier","Human","Huncho Jack, Jack Huncho","Hunter Hayes","Hysteria","I Am...Sasha Fierce","I Can't Handle Change","I Met You When I Was 18. (The Playlist)","I Never Liked You","I Never Loved A Man The Way I Love You","I See You","I Think You Think Too Much Of Me","I Used To Know Her","I Used To Think I Could Fly","I'm Comin' Over","Ich & Keine Maske","If You Can Believe Your Eyes & Ears","Il Ballo Della Vita","Ill Communication","Imagination & The Misfit Kid","Imagine","Immortalized","In A Perfect World...","In Colour","In My Own Words","In Rainbows","In Return","In The Lonely Hour","Infest","Innuendo","Inter Shibuya - La Mafia","Interstellar","Is This It","It Was Written","It's Not Me, It's You","It's Only Me","Ivory","JackBoys","Jamie","Jazz","Jibrail & Iblis","Jordi","Jordin Sparks","Jose","Just As I Am","Just Cause Y'all Waited 2","Just Like You","Justified","K-12 / After School","K.I.D.S.","K.O.","K.O.B. Live","KG0516","KOD","Kane Brown","Kid A","Kid Krow","Kids See Ghosts","Kids in Love","Kinks (You Really Got Me)","Know-It-All","Konvicted","Kring","LANY","LM5","La Criatura","La Flaca","La Melodia De La Calle","La Revolucion","Lady Lady","Lady Wood","Langit Mong Bughaw","Las Que No Iban A Salir","Last Day Of Summer","Last Year Was Complicated","Layers","Layover","Lazarus","Led Zeppelin","Left Of The Middle","Leftoverture","Legends Never Die","Let's Skip To The Wedding","Let's Talk About Love","Licensed To Ill","Life In Cartoon Motion","Life Thru A Lens","Lifelines","Like..?","Lil Big Pac","Lil Boat","Lil Boat 2","Lil Boat 3.5","Lil Kiwi","Lil Pump","Limon Y Sal","Listen Without Prejudice","Little Voice","Live On Red Barn Radio I & II","Lo Que Andábamos Buscando","Lofi Fruits Music 2021","London Calling","Los Campeones Del Pueblo","Los Extraterrestres","Los Favoritos 2","Lost","Lost In Love","Loud","Love Sick","Love Story","Love Stuff","Love Yourself: Tear","Lover","Luca Brasi 2: Gangsta Grillz","Lust For Life","Luv Is Rage","M!ssundaztood","Ma Fleur","Made In Lagos","Mafia Bidness","Magazines Or Novels","Mainstream Sellout","Majestic","Make It Big","Make Yourself","Making Mirrors","Mamma Mia! Here We Go Again","Man Of The Woods","Manic","Me And My Gang","Meduza","Meet The Orphans","Meet The Woo","Melim","Mellon Collie And The Infinite Sadness","Melly vs. Melvin","Memories...Do Not Open","Menagerie","Midnights","Minecraft - Volume Alpha","Minutes To Midnight","Mix Pa Llorar En Tu Cuarto","Modo Avión","Monkey Business","Mono.","Montana","Montevallo","Moosetape","Morning View","Motivan2","Moving Pictures","Mr. Davis","Mr. Misunderstood","Mulan","Mura Masa","Music From The Edge Of Heaven","Music Of The Sun","My House","My Kinda Party","My Krazy Life","My Liver Will Handle What My Heart Can't","My Moment","My Own Lane","My Turn","My Worlds","Na Praia (Ao Vivo)","Nakamura","Nation Of Two","Navegando","Need You Now","Neon Future III","Neotheater","Never Trust A Happy Song","New English","News Of The World","Nicole","Night & Day","Nimmerland","Nimrod","Nine Track Mind","No Angel","No Me Pidas Perdón","No More Drama","No Protection","No Strings Attached","No Time To Die","Nobody Is Listening","Non Stop Erotic Cabaret","Non-Fiction","Northsbest","Nostalgia","Nostalgia, Ultra","Notes On A Conditional Form","Now Or Never","O Embaixador (Ao Vivo)","O My Heart","OK Computer","Ocean","Ocean Avenue","Ocean Eyes","Odisea","Oh My My","Oh, What A Life","On The 6","One In A Million","One More Light","One Of These Nights","Open Up And Say...Ahh!","Ordinary Man","Origins","Out Of The Blue","Over It","OzuTochi","PTSD","Pa Las Baby's Y Belikeada","Pa Que Hablen","Pa' Luego Es Tarde","Pa' Otro La 'O","Pablo Honey","Pain Is Love","Pain Is Temporary","Painting Pictures","Palmen Aus Plastik 2","Para Mi Ex","Para Siempre","Partners In Crime","Pawn Shop","Pegasus / Neon Shark VS Pegasus","Pet Sounds","Piece By Piece","Pier Pressure","Pineapple Sunrise","Piseiro 2020 Ao Vivo","Planet Pit","Plans","Play Deep","Playa Saturno","Por Primera Vez","Por Vida","Positions","Post Human: Survival Horror","Poster Girl","Prazer, Eu Sou Ferrugem (Ao Vivo)","Pretty Girls Like Trap Music","Pretty. Odd.","Prince Royce","Prisma","Prometo","Providence","Puberty 2","Punisher","Purgatory","Purple Rain","Que Bendición","Queen Of The Clouds","Quiero Volver","R&G (Rhythm & Gangsta): The Masterpiece","Raise!","Ransom 2","Rapunzel","Rare","Re Mida","Ready To Die","Realer","Rebelde","Reclassified","Recovery","Recuerden Mi Estilo","Reggatta De Blanc","Regulate… G Funk Era","Reik","Reise, Reise","Relapse","Relaxing Piano Lullabies And Natural Sleep Aid For Baby Sleep Music","Religiously. The Album.","Replay","Results May Vary","Revenge","Revolve","Revolver","Ricky Martin","Rien 100 Rien","Ripcord","Rise And Fall, Rage And Grace","Rise Of An Empire","Robin Hood: Prince Of Thieves","Rock N Roll Jesus","Romance","Romances","Ronan","Royal Blood","Rumours","Sad Boyz 4 Life II","San Lucas","Santana World","Saturation III","Sauce Boyz","Savage Mode","Saxobeats","Scarlet","Schwarzes Herz","Seal The Deal & Let's Boogie","Section.80","Segundo Romance","Sehnsucht","Shake The Snow Globe","Shang-Chi And The Legend Of The Ten Rings: The Album","Sheer Heart Attack","Shiesty Season","Shock Value","Shoot For The Stars, Aim For The Moon","Signed Sealed And Delivered","Signos","Silent Alarm","Simplemente Gracias","Sin Bandera","Sing Me A Lullaby, My Sweet Temptation","Sinner","Sirio","Sit Still, Look Pretty","Skin","Slowhand","Smash","Smithereens","Snow Cougar","S
4366ocial Cues","Some Girls","Song Hits From Holiday Inn","Songs For Dads","Songs For The Deaf","Songs For You, Truths For Me","Songs In The Key Of Life","Souled Out","Sounds Of Silence","Soy Como Quiero Ser","Speak Now","Speak Your Mind","Speakerboxxx/The Love Below","Spider-Man: Into The Spider-Verse","Split Decision","Square Up","SremmLife","Starboy","Stay +","Stay Dangerous","Staying At Tamara's","Steppenwolf","Stick Season","Still Bill","Straight Outta Compton","Strange Trails","Stronger","Suavemente","Sublime","Suck It and See","Sucker","Sueños","Sugar","Summer Forever","Summer,","Sunset Season","Sunshine On Leith","Surfer Rosa","Sweet Talker","SweetSexySavage","System Of A Down","TA13OO","Talk That Talk","Talking Heads: 77","Tangled Up","Tango In The Night","Taxi Driver","Taylor Swift","Tell Me It's Real","Ten","Ten Summoner's Tales","Terra Sem Cep (Ao Vivo)","Terral","Testing","Tha Carter III","Thank Me Later","That's Christmas To Me","The Academy","The Adventures Of Bobby Ray","The Album","The Andy Williams Christmas Album","The Aviary","The Balcony","The Battle Of Los Angeles","The Beatles (White Album)","The Beginning","The Better Life","The Big Day","The Book","The Breakfast Club","The Cars","The Colour And The Shape","The Death Of Peace Of Mind","The Diary Of Alicia Keys","The Documentary","The Emancipation Of Mimi","The Eminem Show","The End Of Everything","The Final Countdown","The Forever Story","The Foundation","The Goat","The Golden Child","The Good Parts","The Greatest Showman: Reimagined","The Green Trip","The Hardest Love","The Head And The Heart","The Human Condition","The Infamous","The Lady Killer","The Last Don II","The Lion King","The Lockdown Sessions","The London Sessions","The Lord Of The Rings: The Fellowship Of The Ring","The Lost Boy","The Magic Of Christmas / The Christmas Song","The Marshall Mathers LP","The Martin Garrix Collection","The Melodic Blue","The Mockingbird & The Crow","The Pains Of Growing","The Papercut Chronicles","The Perfect Luv Tape","The Pinkprint","The Predator","The Queen Is Dead","The ReVe Festival: Finale","The Rise And Fall Of Ziggy Stardust And The Spiders From Mars","The Rising Tied","The River","The Stone Roses","The Story Of Us","The Stranger","The Sufferer & The Witness","The Sun's Tirade","The Temptations Sing Smokey","The Time Of Our Lives","The Way It Is","The Wonderful World Of Sam Cooke","The Writing's On The Wall","The Young And The Hopeless","Therapy","Therapy Session","There Is More (Live)","There Is Nothing Left To Lose","These Things Happen","Third Eye Bl
4366ind","This Is Me...Then","This Unruly Mess I've Made","Threat to Survival","Thrill Of The Chase","Time","Timelezz","To Let A Good Thing Die","To Pimp A Butterfly","Toast To Our Differences","Todos Os Cantos, Vol. 1 (Ao Vivo)","Too Hard","Torches X","Total Xanarchy","Toto IV","Toulouse Street","Tourist History","Toxicity","Tragic Kingdom","Tranquility Base Hotel & Casino","Traumazine","Traveler","Tres Hombres","Trip At Knight","Tron: Legacy","True Blue","True Colors","Trustfall","Tu Veneno Mortal","Tudo Em Paz","Ubuntu","Ugly Is Beautiful","Ultra 2021","Una Mattina","Unbroken","Uncovered","Under Pressure","Unsponsored Content","Unstoppable","Unwritten","Urban Flora","Urban Hymns","Use Your Illusion I","Veneer","Versions Of Me","Vibes","Vice Versa","Vices & Virtues","Victory","Vida","Viejo Marihuano","Visualízate","Walk Away","Walk Me Home...","Watch The Throne","Wave","We Broke The Rules","We Love You Tecca","We Love You Tecca 2","Weezer (Green Album)","Welcome To The Madhouse","Westlife","What A Time To Be Alive","What Do You Think About The Car?","What Is Love?","What Makes You Country","What Separates Me From You","What You See Is What You Get / What You See Ain't Always What You Get","When It's Dark Out","When We All Fall Asleep, Where Do We Go?","Where The Light Is","While The World Was Burning","White Pony","Whitney","Who Really Cares","Who You Are","Who's Next","Wide Open","Wilder Mind","Wildfire","Willy And The Poor Boys","Wings / You Never Walk Alone","Wish","Wish You Were Here","Without Warning","Wonder","X&Y","XOXO","Y Que Quede Claro","YBN: The Mixtape","Yo Creo","You Will Regret","Youngblood","Younger Now","Youth"],_Z=["$NOT","$uicideboy$","(G)I-DLE","*NSYNC","2 Chainz","21 Savage","6LACK","? & The Mysterians","A Boogie Wit da Hoodie","A Taste of Honey","A Tribe Called Quest","A-Ha","ABBA","AC/DC","AJ Tracey","ATEEZ","Ace of Base","Adele","Ado","Aerosmith","Agust D","Aitana","Al Dexter & his Troopers","Al Green","Al Jolson","Al Martino","Alan Jackson","Alannah Myles","Alec Benjamin","Alejandro Sanz","Alesso","Alfredo Olivas","Ali Gatie","Alice In Chains","Alina Baraz","All Time Low","All-4-One","All-American Rejects","Alok","America","American Quartet","Amii Stewart","Amitabh Bhattacharya","Ana Castela","Anderson .Paak","Andy Grammer","Angus & Julia Stone","Anirudh Ravichander","Anita Ward","Anitta","Anton Karas","Anuel AA","Arcade Fire","Archie Bell & The Drells","Archies","Aretha Franklin","Arizona Zervas","Armin van Buuren","Arthur Conley","Artie Shaw","Asake","Asees Kaur","Association","Atif Aslam","Audioslave","Aventura","Avril Lavigne","Aya Nakamura","B J Thomas","B.o.B","BLACKPINK","BONES","BROCKHAMPTON","BTS","Baby Keem","Bachman-Turner Overdrive","Backstreet Boys","Bad Bunny","Badshah","Bailey Zimmerman","Banda El Recodo","Barbra Streisand","Barry White","Bazzi","Bebe Rexha","Becky G","Becky Hill","Bee Gees","Ben Bernie","Ben Howard","Ben Selvin","Berlin","Bessie Smith","Bethel Music","Bette Midler","Beyonce","Bibi Blocksberg","Bibi und Tina","BigXthaPlug","Bill Doggett","Bill Haley & his Comets","Bill Withers","Billy Davis Jr","Billy Joel","Billy Paul","Billy Preston","Billy Swan","Birdy","Bizarrap","Blake Shelton","Blur","Bob Marley & The Wailers","Bob Seger","Bobby Darin","Bobby Lewis","Bobby McFerrin","Bobby Vinton","Boney M.","Bonez MC","Bonnie Tyler","Booba","Boston","BoyWithUke","Boyce Avenue","Bradley Cooper","Bread","Brent Faiyaz","Brett Young","Bring Me The Horizon","Britney Spears","Brooks & Dunn","Bruce Channel","Bruno & Marrone","Bryan Adams","Bryce Vine","Buddy Holly","Burna Boy","C. Tangana","CKay","CRO","Camilo","Capital Bra","Captain & Tennille","Cardi B","Carin Leon","Carlos Vives","Carly Simon","Carpenters","Cavetown","Celine Dion","Central Cee","Chaka Khan","Champs","Charlie Rich","Chayanne","Cheat Codes","Cher","Chic","Chicago","Chris Brown","Chris Isaak","Chris Young","Christina Aguilera","Christina Perri","Christopher Cross","Chuck Berry","Ciara","Cigarettes After Sex","Cliff Edwards (Ukelele Ike)","Cody Johnson","Colbie Caillat","Colby O'Donis","Cole Swindell","Coleman Hawkins","Contours","Coolio","Count Basie","Cris Mj","Culture Club","Cyndi Lauper","D-Block Europe","DAY6","DJ Khaled","DJ Luian","DJ Nelson","DMX","DNCE","DaVido","Dadju","Daft Punk","Dan + Shay","Daniel Powter","Danny Ocean","Darius Rucker","Dave","David Bowie","David Guetta","Daya","Dean Martin","Deee-Lite","Deep Purple","Deftones","Demi Lovato","Dennis Lloyd","Denzel Curry","Dermot Kennedy","Desiigner","Devo","Dewa 19","Dexys Midnight Runners","Diddy","Dido","Die drei !!!","Diego & Victor Hugo","Diljit Dosanjh","Dimitri Vegas & Like Mike","Dinah Shore","Dionne Warwick","Dire Straits","Disclosure","Dixie Cups","Doja Cat","Dolly Parton","Don Diablo","Don Henley","Don McLean","Don Omar","Donna 
4366Summer","Donovan","Dr. Dre","Drake","Dreamville","Dua Lipa","EMF","ENHYPEN","Earth, Wind & Fire","Ed Sheeran","Eddie Cantor","Eddie Cochran","Eddy Howard","Edgar Winter Group","Edwin Hawkins Singers","Edwin Starr","El Alfa","Eladio Carrion","Electric Light Orchestra","Elevation Worship","Ella Henderson","Ellie Goulding","Elton John","Elvis Presley","Empire of the Sun","En Vogue","Enrique Iglesias","Eslabon Armado","Ethel Waters","Etta James","Evanescence","Exile","Extreme","Faith Hill","Fall Out Boy","Fanny Brice","Farruko","Fats Domino","Fats Waller","Feid","Felix Jaehn","Fergie","Fetty Wap","Fiersa Besari","Fifth Harmony","Fine Young Cannibals","Five Finger Death Punch","Fleetwood Mac","Flo-Rida","Florence + The Machine","Flume","Foo Fighters","Foreigner","Foster The People","Four Aces","Frank Ocean","Frank Sinatra","Frankie Avalon","Frankie Valli","Fred Astaire","Freda Payne","Freddie Dredd","Freddy Fender","French Montana","Fuerza Regida","Fujii Kaze","Future","G-Eazy","Garfunkel and Oates","Gary Lewis & The Playboys","Gary Numan","Gene Autry","Gene Chandler","Gene Vincent","George Michael","George Strait","Gera MX","Ghost","Ghostemane","Gigi D'Agostino","Gladys Knight & The Pips","Glass Animals","Glee Cast","Gloria Gaynor","Godsmack","Gorillaz","Gotye","Grand Funk Railroad","Green Day","Grouplove","Grupo Firme","Grupo Marca Registrada","Gryffin","Gucci Mane","Guess Who","Gunna","Gusttavo Lima","Guy Mitchell","Gwen Stefani","Gzuz","H.E.R.","HARDY","Hailee Steinfeld","Halsey","Hans Zimmer","Harris Jayaraj","Harry Chapin","Harry James","Harry Nilsson","Harry Styles","Hayley Williams","Herb Alpert","Herman's Hermits","Hillsong UNITED","Hillsong Worship","Hollywood Undead","Honey Cone","Hoobastank","Hues Corporation","I Prevail","ITZY","IVE","Ice Cube","Ice Spice","Iggy Azalea","Imagine Dragons","Incubus","Internet Money","Isaac Hayes","J Geils Band","J. Cole","JAY-Z","JJ Lin","JP Saxe","JVKE","Jack Harlow","Jack Johnson","Jackie Wilson","Jacquees","James Arthur","James Brown","James TW","James Taylor","Jamie Foxx","Janet Jackson","Janis Joplin","Jason Aldean","Jason Mraz","Jay Chou","Jay Sean","Jay Wheeler","Jaymes Young","Jean Knight","Jeezy","Jennifer Lopez","Jennifer Warnes","Jeremih","Jeremy Zucker","Jerry Lee Lewis","Jerry Murad's Harmonicats","Jess Glynne","Jessie J","Jewel","Jimi Hendrix","Jimin","Jimmie Rodgers","Jimmy Dean","Jo Stafford","Joan Jett & The Blackhearts","Joao Gilberto","Joel Corry","John Fred & The Playboy Band","John Legend","John Mayer","John Williams","Johnnie Ray","Johnnie Taylor","Johnny Cash","Johnny Horton","Johnny Mathis","Johnny Mercer","Johnny Nash","Joji","Jon Bellion","Jonas Blue","Jonas Brothers","Joni James","Jorja Smith","Juan Gabriel","Juan Luis Guerra 4.40","Juanes","Juice Newton","Julia Michaels","Justin Bieber","Justin Quiles","KALEO","KAROL G","KAYTRANADA","KK","KSI","KYLE","Kacey Musgraves","Kane Brown","Kanye West","Karan Aujla","Kate Smith","Katy Perry","Kay Kyser","Ke$ha","Kehlani","Kelly Clarkson","Kenny Chesney","Kenny Loggins","Kenny Rogers","Kenshi Yonezu","Kenya Grace","Kevin Gates","Key Glock","Khalid","Kim Carnes","Kim Petras","Kimbra","Kina","King Gnu","Kings of Leon","Kingsmen","Kitty Kallen","Kodak Black","Kodaline","Kollegah","Kool & The Gang","Kungs","Kygo","Kylie Minogue","LE SSERAFIM","LISA","LMFAO","LUDMILLA","La Adictiva Banda San José de Mesillas","La Oreja de Van Gogh","Labrinth","Lady Antebellum","Lady GaGa","Lainey Wilson","Lana Del Rey","Latto","Lauryn Hill","Lauv","League of Legends","Lee Brice","Leon Bridges","Leona Lewis","Lesley Gore","Leslie Odom Jr.","Liam Payne","Lifehouse","Lil Baby","Lil Dicky","Lil Durk","Lil Mosey","Lil Nas X","Lil Pump","Lil Skies","Lil Tjay","Lil Uzi Vert","Lil Yachty","Lil' Kim","Lil' Wayne","Lin-Manuel Miranda","Linkin Park","Lionel Richie","Lipps Inc","Lisa Loeb","Little Peggy March","Little Richard","Lofi Fruits Music","Lord Huron","Los Del Rio","Los Dos Carnales","Los Lobos","Los Temerarios","
4366Los Tigres Del Norte","Los Tucanes De Tijuana","Lou Reed","Loud Luxury","Louis Jordan","Louis Tomlinson","Love Unlimited","Lovin' Spoonful","Luan Santana","Luciano","Luis Miguel","Luis R Conriquez","Lulu","Lunay","Lupe Fiasco","M","MAX","MC Hammer","MC Ryan SP","MKTO","Mabel","Machine Gun Kelly","Madison Beer","Madonna","Mahalini","Major Lazer","Mambo Kingz","Maneskin","Marco Antonio Solís","Margaret Whiting","Maria Becerra","Mario","Mario Lanza","Mark Ronson","Maroon 5","Marshmello","Martin Garrix","Mary Ford","Mary J Blige","Mary J. Blige","Mary Wells","Matoma","Mau y Ricky","Meek Mill","Megadeth","Melanie","Melanie Martinez","Melendi","Men At Work","Metro Boomin","Michael Bublé","Michael Jackson","Michael McDonald","Michael Sembello","Miguel","Mike Posner","Miley Cyrus","Milky Chance","Minnie Riperton","Miracle Tones","Miranda Lambert","Mohit Chauhan","Mon Laferte","Moneybagg Yo","Monsta X","Mora","Morad","Morat","Mother Mother","Motley Crue","Ms. Lauryn Hill","Mumford & Sons","Muse","Mya","Myke Towers","NCT 127","NCT DREAM","NEFFEX","Nadin Amizah","Nancy Sinatra","Nat King Cole","Nate Smith","Natti Natasha","Nayer","Neil Diamond","Neil Sedaka","Nekfeu","Nelly","New Vaudeville Band","Next","Nickelback","Nicki Minaj","Nicki Nicole","Nicky Jam","Nina Simone","Ninho","Nipsey Hussle","Nirvana","Niska","No Doubt","Norah Jones","Normani","OMI","ONE OK ROCK","Oasis","Official HIGE DANdism","Offset","Old Dominion","Oliver Heldens","Olivia Rodrigo","Omah Lay","One Direction","Otis Redding","OutKast","Owl City","P Diddy","P!nk","PLK","PNL","Pamungkas","Passenger","Pat Boone","Patsy Cline","Patti LaBelle","Patti Page","Paul & Paula","Paul Revere & the Raiders","Paul Robeson","Paul Russell","Paul Whiteman","Paula Abdul","Peaches & Herb","Pearl Jam","Pee Wee Hunt","Pee Wee King","Pentatonix","Percy Faith","Percy Sledge","Peso Pluma","Peter Cetera","Peter Gabriel","Peter, Paul & Mary","Pharrell Williams","Pierce The Veil","Pineapple StormTv","Pink Floyd","Pink Sweat$","Piso 21","Pitbull","Plan B","Player","Polo G","Pop Smoke","Portugal. The Man","Pouya","Prince","Prince Royce","Pusha T","Quality Control","Queen","Quinn XCII","R. Kelly","RAF Camora","RAYE","REM","REO Speedwagon","Radiohead","Rag'n'Bone Man","Rage Against The Machine","Rahat Fateh Ali Khan","Rainbow Kitten Surprise","Rammstein","Rauw Alejandro","Ray Charles","Ray Parker Jr","Ray Stevens","Red Foley","Red Hot Chili Peppers","Red Velvet","Regard","Regina Belle","Reik","Rels B","Rema","Ricardo Arjona","Rich The Kid","Rick Astley","Rick Dees & his Cast of Idiots","Rick Ross","Rick Springfield","Ricky Martin","Ricky Nelson","Rihanna","Rita Ora","Ritchie Valens","Rizky Febian","Rob Thomas","Roberta Flack","Robin Schulz","Robin Thicke","Rod Stewart","Rod Wave","Roddy Ricch","Roger Miller","Romeo Santos","Rosemary Clooney","Roxette","Roy Acuff","Roy Orbison","Rudimental","Ruel","Ruth B.","Ryan Lewis","SCH","SEVENTEEN","SWV","Sabaton","Sabrina Carpenter","Sachet Tandon","Sachin-Jigar","Sade","Sam Cooke","Sam Feldt","Sam Hunt","Sam Smith","Sam The Sham & The Pharaohs","Sammy Davis Jr","Sammy Kaye","Santana","Sasha Alex Sloan","Savage Garden","Saweetie","Scorpions","Sean Kingston","Sean Paul","Sebastian Yatra","Sech","Seeb","Sezen Aksu","Sfera Ebbasta","Shaggy","Shania Twain","Shawn Mendes","Sheena Easton","Shinedown","Shubh","Sia","Sid Sriram","Sidhu Moose Wala","Silk","Silver Convention","Simon & Garfunkel","Sinead O'Connor","Sir Mix-a-Lot","Sister Sledge","Ski Mask The Slump God","Skillet","Skrillex","Sleeping At Last","Smokey Robinson","Snoop Dogg","Snow Patrol","Soda Stereo","Sonu Nigam","Sophie Ellis-Bextor","Spencer Davis Group","Spice Girls","Stan Getz","Starland Vocal Band","Stephen Sanchez","Steve Aoki","Steve Lacy","Steve Winwood","Stevie B","Sting","Stormzy","Strawberry Alarm Clock","Stray Kids","Stromae","Sublime","Sum 41","Summer Walker","Supertramp","Survivor","Swedish House Mafia","System Of A Down","T-Pain","T.I.","TAEYEON","TKKG","TLC","TOMORROW X TOGETHER","TOTO","TWICE","Tag Team","Tainy","Tammi Terrell","Tanishk Bagchi","Tate McRae","Taylor Swift","Tears For Fears","Tems","Tennessee Ernie Ford","Terence Trent D'Arby","Teresa Brewer","Terry Jacks","The Ames Brothers","The Animals","The B52s","The Bangles","The Beatles","The Black Eyed Peas","The Black Keys","The Box Tops","The Chainsmokers","The Chiffons","The Chordettes","The Clash","The Coasters","The Commodores","The Cowsills","The Cranberries","The Crew-Cuts","The Cure","The Detroit Spinners","The Diamonds","The Doobie Brothers","The Doors","The Drifters","The Emotions","The Eurythmics","The Fireballs","The Flamingos","The Foundations","The Four Seasons","The Fray","The Game","The Go Gos","The Goo Goo Dolls","The Head And The Heart","The Hollies","The Ink Spots","The Isley Brothers","The Jackson 5","The Kid LAROI","The Killers","The Kingston Trio","The Kooks","The Lemon Pipers","The Living Tombstone","The Lumineers","The Mamas & The Papas","The Marvelettes","The McCoys","The Mills Brothers","The Miracles","The Monkees","The Moody Blues","The National","The Neighbourhood","The Notorious B.I.G.","The O'Jays","The Offspring","The Osmonds","The Partridge Family","The Penguins","The Pet Shop Boys","The Platters","The Righteous Brothers","The Rolling Stones","The Ronettes","The Score","The Script","The Seekers","The Shangri-Las","The Smashing Pumpkins","The Staple Singers","The Strokes","The Supremes","The Temptations","The Turtles","The Vamps","The Verve","The Village People","The Weavers","The White Stripes","The Young Rascals","The Zombies","Thelma Houston","Thomas R
4366hett","Three Days Grace","Three Dog Night","Three Man Down","Timbaland","Timmy Trumpet","Toby Keith","Tom Jones","Tom Petty and the Heartbreakers","Tommy Dorsey","Tommy Edwards","Tommy James & the Shondells","Tone Loc","Toni Braxton","Topic","Tory Lanez","Tove Lo","Trevor Daniel","Trey Songz","Trippie Redd","Trueno","Tulsi Kumar","Tulus","Twenty One Pilots","Two Feet","Ty Dolla $ign","Tyga","Tyler Hubbard","U2","UB40","UZI","Ufo361","Upchurch","V","Vampire Weekend","Van McCoy","Van Morrison","Vance Joy","Vanessa Carlton","Vanessa Williams","Vera Lynn","Vernon Dalhart","Vicente Fernandez","Vishal-Shekhar","Volbeat","WILLOW","Wale","Wallows","Weezer","Wham!","Whitney Houston","Why Don't We","Wilbert Harrison","Wilson Phillips","Wiz Khalifa","Woody Guthrie","Wyclef Jean","XXXTENTACION","Xavi","YG","YNW Melly","YOASOBI","Yandel","Years & Years","Yeat","Yo Gotti","Young Dolph","Young Miko","Young Thug","YoungBoy Never Broke Again","Yung Gravy","Yuuri","Yuvan Shankar Raja","ZAYN","ZZ Top","Zac Brown Band","Zach Bryan","Zara Larsson","aespa","benny blanco","blink-182","d4vd","deadmau5","girl in red","gnash","iann dior","will.i.am"],EZ=["Acid House","Acid Jazz","Acid Rock","Acoustic","Acoustic Blues","Afro-Pop","Afrobeat","Alt-Rock","Alternative","Ambient","American Trad Rock","Americana","Anime","Arena Rock","Art-Rock","Avant-Garde","Avant-Punk","Baladas y Boleros","Barbershop","Baroque","Bebop","Big Band","Black Metal","Blue Note","Bluegrass","Blues","Boogaloo","Bop","Bossa Nova","Bounce","Brazilian Funk","Breakbeat","Britpop","CCM","Cajun","Cantopop","Celtic","Celtic Folk","Chamber Music","Chant","Chanukah","Chicago Blues","Chicago House","Chicano","Children’s Music","Chill","Choral","Christian","Christmas","Classical","Club","College Rock","Conjunto","Cool Jazz","Country","Crunk","Dance","Dancehall","Death Metal","Deep House","Delta Blues","Detroit Techno","Dirty South","Disco","Disney","Dixieland","Doo-wop","Downtempo","Dream Pop","Drill","Drinking Songs","Drone","Drum'n'bass","Dub","Dubstep","EDM","Early Music","East Coast Rap","Easter","Easy Listening","Eclectic","Electric Blues","Electro","Electronic","Electronica","Emo","Enka","Environmental","Ethio-jazz","Experimental","Experimental Rock","Flamenco","Folk","Folk-Rock","Forro","French Pop","Funk","Fusion","Gangsta Rap","Garage","German Folk","German Pop","Glam Rock","Gospel","Goth","Grime","Grindcore","Groove","Grunge","Hair Metal","Halloween","Happy","Hard Bop","Hard Dance","Hard Rock","Hardcore","Hardcore Punk","Hardcore Rap","Hardstyle","Healing","Heavy Metal","High Classical","Hip Hop","Holiday","Honky Tonk","House","IDM","Impressionist","Indie","Industrial","Instrumental","J-Dance","J-Idol","J-Pop","J-Punk","J-Rock","J-Ska","J-Synth","Jackin House","Jam Bands","Japanese Pop","Jazz","Jungle","K-Pop","Karaoke","Kayokyoku","Kids","Kitsch","Klezmer","Krautrock","Latin","Latin Jazz","Latin Rap","Local","Lounge","Lullabies","MPB","Mainstream Jazz","Malay","Mandopop","March","Mariachi","Mawwal","Medieval","Meditation","Metal","Metalcore","Minimal Techno","Minimalism","Modern","Motown","Mugham","Musicals","Musique Concrète","Nature","Neo-Soul","Nerdcore","New Acoustic","New Age","New Mex","New Wave","No Wave","Noise","Nordic","Novelty","OPM","Oi!","Old School Rap","Opera","Orchestral","Original Score","Outlaw Country","Pagode","Party","Piano","Polka","Pop","Pop Film","Pop Latino","Post Dubstep","Power Pop","Praise & Worship","Progressive House","Progressive Rock","Proto-punk","Psych Rock","Psychedelic","Punk","Punk Rock","Qawwali","Quiet Storm","R&B","Ragtime","Rainy Day","Rap","Reggae","Reggaeton","Regional Mexicano","Relaxation","Renaissance","Retro","Rock","Rockabilly","Rocksteady","Romance","Romantic","Roots Reggae","Roots Rock","SKA","Sad","Salsa","S
4366amba","Second Line","Sertanejo","Shaabi","Shoegaze","Sleep","Smooth Jazz","Soft Rock","Soul","Soundtrack","Southern Gospel","Southern Rock","Space Rock","Stage And Screen","Steampunk","Summer","Surf","Swamp Pop","Swing","Synth Pop","Tango","Techno","Teen Pop","Tejano","Tex-Mex","Thanksgiving","Traditional","Trance","Trip Hop","Tropical","Underground Rap","Urban","Urban Cowboy","West Coast Rap","Western Swing","World","Worldbeat","Zydeco"],kZ=["(Everything I Do) I Do it For You","(Ghost) Riders in the Sky","(I Can't Get No) Satisfaction","(I've Got a Gal In) Kalamazoo","(I've Had) the Time of My Life","(It's No) Sin","(Just Like) Starting Over","(Let Me Be Your) Teddy Bear","(Put Another Nickel In) Music! Music! Music!","(Sexual) Healing","(Sittin' On) the Dock of the Bay","(They Long to Be) Close to You","(You Keep Me) Hangin' On","(You're My) Soul & Inspiration","(Your Love Keeps Lifting Me) Higher & Higher","12th Street Rag","1999","19th Nervous Breakdown","50 Ways to Leave Your Lover","9 to 5","96 Tears","A Boy Named Sue","A Hard Day's Night","A String of Pearls","A Thousand Miles","A Tree in the Meadow","A Whiter Shade of Pale","A Whole New World (Aladdin's Theme)","A Woman in Love","A-Tisket A-Tasket","ABC","Abracadabra","Ac-cent-tchu-ate the Positive","Addicted to Love","After You've Gone","Afternoon Delight","Again","Against All Odds (Take a Look At Me Now)","Ain't Misbehavin'","Ain't No Mountain High Enough","Ain't No Sunshine","Ain't That a Shame","Airplanes","All Along the Watchtower","All I Have to Do is Dream","All I Wanna Do","All My Lovin' (You're Never Gonna Get It)","All Night Long (All Night)","All Out of Love","All Shook Up","All You Need is Love","Alone","Alone Again (Naturally)","Always On My Mind","American Pie","American Woman","Angie","Another Brick in the Wall (part 2)","Another Day in Paradise","Another Night","Another One Bites the Dust","Apologize","April Showers","Aquarius/Let The Sunshine In","Are You Lonesome Tonight?","Arthur's Theme (Best That You Can Do)","As Time Goes By","At Last","At the Hop","Auf Wiederseh'n Sweetheart","Baby Baby","Baby Come Back","Baby Got Back","Baby Love","Baby One More Time","Bad Day","Bad Girls","Bad Moon Rising","Bad Romance","Bad, Bad Leroy Brown","Baker Street","Ball of Confusion (That's What the World is Today)","Ballad of the Green Berets","Ballerina","Band On the Run","Band of Gold","Battle of New Orleans","Be Bop a Lula","Be My Baby","Be My Love","Beat It","Beautiful Day","Beauty & the Beast","Because I Love You (The Postman Song)","Because You Loved Me","Because of You","Before The Next Teardrop Falls","Begin the Beguine","Behind Closed Doors","Being With You","Believe","Ben","Bennie & the Jets","Besame Mucho","Best of My Love","Bette Davis Eyes","Big Bad John","Big Girls Don't Cry","Billie Jean","Bitter Sweet Symphony","Black Or White","Black Velvet","Blaze of Glory","Bleeding Love","Blue Suede Shoes","Blue Tango","Blueberry Hill","Blurred Lines","Body & Soul","Bohemian Rhapsody","Boogie Oogie Oogie","Boogie Woogie Bugle Boy","Boom Boom Pow","Born in the USA","Born to Be Wild","Born to Run","Boulevard of Broken Dreams","Brand New Key","Brandy (You're A Fine Girl)","Breaking Up is Hard to Do","Breathe","Bridge Over Troubled Water","Brother Louie","Brother, Can You Spare a Dime?","Brown Eyed Girl","Brown Sugar","Build Me Up Buttercup","Burn","Buttons & Bows","Bye Bye Love","Bye Bye, Blackbird","Bye, Bye, Bye","Caldonia Boogie (What Makes Your Big Head So Hard)","California Dreamin'","California Girls","Call Me","Call Me Maybe","Can You Feel the Love Tonight","Can't Buy Me Love","Can't Get Enough of Your Love, Babe","Can't Help Falling in Love","Candle in the Wind '97","Candy Man","Car Wash","Careless Whisper","Cars","Cat's in the Cradle","Cathy's Clown","Celebration","Centerfold","Chain of Fools","Chances Are","Change the World","Chapel of Love","Chattanooga Choo Choo","Chattanoogie Shoe-Shine Boy","Check On It","Cheek to Cheek","Cherish","Cherry Pink & Apple Blossom White","Cold, Cold Heart","Colors of the Wind","Come On Eileen","Come On-a My House","Come Together","Coming Up","Cracklin' Rosie","Crazy","Crazy For You","Crazy Little Thing Called Love","Crazy in Love","Creep","Crimson & 
4366Clover","Crocodile Rock","Cry","Cry Like a Baby","Crying","Da Doo Ron Ron (When He Walked Me Home)","Dance to the Music","Dancing Queen","Dancing in the Dark","Dancing in the Street","Dardanella","Daydream Believer","December 1963 (Oh What a Night)","Delicado","Dilemma","Disco Duck","Disco Lady","Disturbia","Dizzy","Do That to Me One More Time","Do Wah Diddy Diddy","Do Ya Think I'm Sexy?","Do You Love Me?","Don't Be Cruel","Don't Fence Me In","Don't Go Breaking My Heart","Don't Leave Me This Way","Don't Let the Stars Get in Your Eyes","Don't Let the Sun Go Down On Me","Don't Speak","Don't Stop 'Til You Get Enough","Don't Worry Be Happy","Don't You (Forget About Me)","Don't You Want Me","Doo Wop (That Thing)","Down","Down Hearted Blues","Down Under","Downtown","Dreamlover","Dreams","Drop it Like It's Hot","Drops of Jupiter (Tell Me)","Duke of Earl","E.T.","Earth Angel","Ebony & Ivory","Eight Days a Week","Empire State Of Mind","End of the Road","Endless Love","Escape (The Pina Colada Song)","Eve of Destruction","Every Breath You Take","Every Little Thing She Does is Magic","Everybody Loves Somebody","Everybody Wants to Rule the World","Everyday People","Eye of the Tiger","Faith","Fallin'","Fame","Family Affair","Fantasy","Fast Car","Feel Good Inc","Feel Like Making Love","Fire & Rain","Firework","Flashdance. What a Feeling","Fly Robin Fly","Foolish Games","Footloose","For What It's Worth (Stop, Hey What's That Sound)","Fortunate Son","Frankenstein","Freak Me","Freebird","Frenesi","Funkytown","Gangsta's Paradise","Georgia On My Mind","Georgy Girl","Get Back","Get Down Tonight","Get Off of My Cloud","Ghostbusters","Gimme Some Lovin'","Girls Just Wanna Have Fun","Give Me Everything","Gives You Hell","Glamorous","Glory of Love","Go Your Own Way","God Bless America","God Bless the Child","Gold Digger","Gonna Make You Sweat (Everybody Dance Now)","Good Lovin'","Good Times","Good Vibrations","Goodbye Yellow Brick Road","Goodnight, Irene","Got to Give it Up","Grease","Great Balls of Fire","Greatest Love of All","Green Onions","Green River","Green Tambourine","Grenade","Groove is in the Heart","Groovin'","Gypsies, Tramps & Thieves","Hair","Hang On Sloopy","Hanging by a Moment","Hanky Panky","Happy Days Are Here Again","Happy Together","Harbour Lights","Hard to Say I'm Sorry","Harper Valley PTA","Have You Ever Really Loved a Woman?","He'll Have to Go","He's So Fine","He's a Rebel","Heart of Glass","Heart of Gold","Heartbreak Hotel","Hello Dolly","Hello, I Love You, Won't You Tell Me Your Name?","Help Me, Rhonda","Help!","Here Without You","Here in My Heart","Hero","Hey Baby","Hey Jude","Hey Paula","Hey There","Hey There Delilah","Hey Ya!","Higher Love","Hips don't lie","Hit the Road, Jack","Hold On","Hollaback Girl","Honey","Honky Tonk","Honky Tonk Woman","Horse With No Name","Hot Child In The City","Hot Stuff","Hotel California","Hound Dog","House of the Rising Sun","How Deep is Your Love?","How Do I Live?","How Do You Mend a Broken Heart","How High the Moon","How Much is That Doggy in the Window?","How Will I Know","How You Remind Me","How to Save a Life","Hungry Heart","Hurt So Good","I Believe I Can Fly","I Can Dream, Can't I?","I Can Help","I Can See Clearly Now","I Can't Get Next to You","I Can't Get Started","I Can't Go For That (No Can Do)","I Can't Help Myself (Sugar Pie, Honey Bunch)","I Can't Stop Loving You","I Don't Want to Miss a Thing","I Fall to Pieces","I Feel Fine","I Feel For You","I Feel Love","I Get Around","I Got You (I Feel Good)","I Got You Babe","I Gotta Feeling","I Heard it Through the Grapevine","I Honestly Love You","I Just Called to Say I Love You","I Just Wanna Be Your Everything","I Kissed A Girl","I Love Rock 'n' Roll","I Need You Now","I Only Have Eyes For You","I Shot the Sheriff","I Still Haven't Found What I'm Looking For","I Swear","I Think I Love You","I Walk the Line","I Wanna Dance With Somebody (Who Loves Me)","I Wanna Love You","I Want You Back","I Want to Hold Your Hand","I Want to Know What Love Is","I Went to Your Wedding","I Will Always Love You","I Will Follow Him","I Will Survive","I Write the Songs","I'll Be Missing You","I'll Be There","I'll Make Love to You","I'll Never Smile Again","I'll Take You There","I'll Walk Alone","I'll be seeing you","I'm Looking Over a Four Leaf Clover","I'm So Lonesome I Could Cry","I'm Sorry","I'm Walking Behind You","I'm Your Boogie Man","I'm Yours","I'm a Believer","I've Heard That Song Before","If (They Made Me a King)","If I Didn't Care","If You Don't Know Me By Now","If You Leave Me Now","Imagine","In Da Club","In the End","In the Ghetto","In the Mood","In the Summertime","In the Year 2525 (Exordium & Terminus)","Incense & Peppermints","Indian Reservation (The Lament Of The Cherokee Reservation Indian)","Instant Karma","Iris","Ironic","Irreplaceable","It Had to Be You","It's All in the Game","It's My Party","It's Now Or Never","It's Still Rock 'n' Roll to Me","It's Too Late","Jack & Diane","Jailhouse Rock","Jessie's Girl","Jive Talkin'","Johnny B Goode","Joy to the World","Judy in Disguise (With Glasses)","Jump","Jumpin' Jack Flash","Just Dance","Just My Imagination (Running Away With Me)","Just the Way You Are","Kansas City","Karma Chameleon","Keep On Loving You","Killing Me Softly With His Song","King of the Road","Kiss","Kiss & Say Goodbye","Kiss From a Rose","Kiss Me","Kiss On My List","Kiss You All Over","Knock On Wood","Knock Three Times","K
4366okomo","Kryptonite","Kung Fu Fighting","La Bamba","Lady","Lady Marmalade (Voulez-Vous Coucher Aver Moi Ce Soir?)","Last Train to Clarksville","Layla","Le Freak","Leader of the Pack","Lean On Me","Leaving, on a Jet Plane","Let Me Call You Sweetheart","Let Me Love You","Let it Be","Let it Snow! Let it Snow! Let it Snow!","Let's Dance","Let's Get it On","Let's Groove","Let's Hear it For the Boy","Let's Stay Together","Light My Fire","Lights","Like a Prayer","Like a Rolling Stone","Like a Virgin","Little Darlin'","Little Things Mean a Lot","Live & Let Die","Livin' La Vida Loca","Livin' On a Prayer","Living For the City","Locked Out Of Heaven","Lola","Lonely Boy","Long Cool Woman in a Black Dress","Long Tall Sally","Look Away","Lookin' Out My Back Door","Lose Yourself","Losing My Religion","Louie Louie","Love Child","Love Hangover","Love In This Club","Love Is Blue (L'Amour Est Bleu)","Love Letters in the Sand","Love Me Do","Love Me Tender","Love Shack","Love Theme From 'A Star is Born' (Evergreen)","Love Train","Love Will Keep Us Together","Love is a Many Splendoured Thing","Love to Love You Baby","Love's Theme","Loving You","Low","Macarena","Mack the Knife","Maggie May","Magic","Magic Carpet Ride","Make Love to Me","Make it With You","Makin' Whoopee","Mama Told Me Not to Come","Man in the Mirror","Manana (Is Soon Enough For Me)","Maneater","Maniac","Maybellene","Me & Bobby McGee","Me & Mrs Jones","Memories Are Made of This","Mercy Mercy Me (The Ecology)","Mickey","Midnight Train to Georgia","Minnie the Moocher","Miss You","Miss You Much","Mister Sandman","Mmmbop","Mona Lisa","Monday Monday","Money For Nothing","Mony Mony","Mood Indigo","Moonlight Cocktail","Moonlight Serenade","More Than Words","More Than a Feeling","Morning Train (Nine to Five)","Mr Big Stuff","Mr Brightside","Mr Tambourine Man","Mrs Brown You've Got a Lovely Daughter","Mrs Robinson","Mule Train","Music","My Blue Heaven","My Boyfriend's Back","My Eyes Adored You","My Girl","My Guy","My Heart Will Go On","My Life","My Love","My Man","My Prayer","My Sharona","My Sweet Lord","Na Na Hey Hey (Kiss Him Goodbye)","Nature Boy","Near You","Need You Now","Need You Tonight","Never Gonna Give You Up","Night & Day","Night Fever","Nights in White Satin","No One","No Scrubs","Nobody Does it Better","Nothin' on You","Nothing Compares 2 U","Nothing's Gonna Stop Us Now","Ode To Billie Joe","Oh Happy Day","Oh My Papa (O Mein Papa)","Oh, Pretty Woman","Ol' Man River","Ole Buttermilk Sky","On Bended Knee","On My Own","On the Atchison, Topeka & the Santa Fe","One","One Bad Apple","One More Try","One O'Clock Jump","One Sweet Day","One of These Nights","One of Us","Only The Lonely (Know The Way I Feel)","Only You (And You Alone)","Open Arms","Over There","Over the Rainbow","Paint it Black","Papa Don't Preach","Papa Was a Rolling Stone","Papa's Got a Brand New Bag","Paper Doll","Paper Planes","Paperback Writer","Party Rock Anthem","Peg o' My Heart","Peggy Sue","Pennies From Heaven","Penny Lane","People","People Got to Be Free","Personality","Philadelphia Freedom","Physical","Piano Man","Pick Up the Pieces","Pistol Packin' Mama","Play That Funky Music","Please Mr Postman","Poker Face","Pon De Replay","Pony Time","Pop Muzik","Prisoner of Love","Private Eyes","Promiscuous","Proud Mary","Purple Haze","Purple Rain","Puttin' on the Ritz","Que sera sera (Whatever will be will be)","Queen of Hearts","Rag Doll","Rag Mop","Rags to Riches","Raindrops Keep Falling On My Head","Rapture","Ray of Light","Reach Out (I'll Be There)","Red Red Wine","Rehab","Respect","Return to Sender","Reunited","Revolution","Rhapsody in Blue","Rhinestone Cowboy","Rich Girl","Riders On the Storm","Right Back Where We Started From","Ring My Bell","Ring of Fire","Rock Around the Clock","Rock With You","Rock Your Baby","Rock the Boat","Rock the Casbah","Roll Over Beethoven","Roll With It","Rolling In The Deep","Rosanna","Roses Are Red","Royals","Ruby Tuesday","Rudolph, the Red-Nosed Reindeer","Rum & Coca-Cola","Runaround Sue","Runaway","Running Scared","Rush Rush","Sailing","Save the Best For Last","Save the Last Dance For Me","Say It Right","Say My Name","Say Say Say","Say You, Say Me","School's Out","Seasons in the Sun","Secret Love","Sentimental Journey","Sexyback","Sh-Boom (Life Could Be a Dream)","Shadow Dancing","Shake Down","Shake You Down","She Drives Me Crazy","She Loves You","She's a Lady","Shining Star","Shop Around","Shout","Silly Love Songs","Since U Been Gone","Sing, Sing, Sing (With A Swing)","Singing The Blues","Single Ladies (Put A Ring On It)","Sir Duke","Sixteen Tons","Sledgehammer","Sleep Walk","Sleepy Lagoon","Slow Poke","Smells Like Teen Spirit","Smoke Gets in Your Eyes","Smoke On the Water","Smoke! Smoke! Smoke! (That Cigarette)","Smooth","So Much in Love","Soldier Boy","Some Enchanted Evening","Some of These Days","Somebody That I Used to Know","Somebody to Love","Someday","Somethin' Stupid","Something","Soul Man","Spanish Harlem","Spill the Wine","Spinning Wheel","Spirit in the Sky","St George & the Dragonette","St Louis Blues","Stagger Lee","Stairway to Heaven","Stand By Me","Stardust","Stars & Stripes Forever","Stay (I Missed You)","Stayin' Alive","Stop! in the Name of Love","Stormy Weather (Keeps Rainin' All the Time)","Straight Up","Strange Fruit","Stranger On the Shore","Strangers in the Night","Strawberry Fields Forever","Streets of Philadelphia","Stronger","Stuck On You","Sugar Shack","Sugar Sugar","Summer in the City","Summertime Blues","Sunday, Monday or Always","Sunshine Superman","Sunshine of Your Love","Superstar","Superstition","Surfin' USA","Suspicious Minds","Swanee","Sweet Caroline (Good Times Never Seemed So Good)","Sweet Child O' Mine","Sweet Dreams (Are Made of This)","Sweet Georgia Brown","Sweet Home Alabama","Sweet Soul Music","Swinging O
4366n a Star","T For Texas (Blue Yodel No 1)","TSOP (The Sound of Philadelphia)","Take Me Home, Country Roads","Take My Breath Away","Take On Me","Take The 'A' Train","Take a Bow","Tammy","Tangerine","Tears in Heaven","Tears of a Clown","Temperature","Tennessee Waltz","Tequila","Tha Crossroads","Thank You (Falettinme be Mice Elf Again)","That Lucky Old Sun (Just Rolls Around Heaven All Day)","That Old Black Magic","That'll Be the Day","That's Amore","That's What Friends Are For","That's the Way (I Like It)","That's the Way Love Goes","The Boy is Mine","The Boys of Summer","The Christmas Song (Chestnuts Roasting On An Open Fire)","The End of the World","The First Time Ever I Saw Your Face","The Girl From Ipanema","The Glow-Worm","The Great Pretender","The Gypsy","The Hustle","The Joker","The Last Dance","The Letter","The Loco-Motion","The Long & Winding Road","The Love You Save","The Morning After","The Power of Love","The Prisoner's Song","The Reason","The Rose","The Sign","The Song From Moulin Rouge (Where Is Your Heart)","The Sounds of Silence","The Streak","The Sweet Escape","The Thing","The Tide is High","The Tracks of My Tears","The Twist","The Wanderer","The Way We Were","The Way You Look Tonight","The Way You Move","Theme From 'A Summer Place'","Theme From 'Greatest American Hero' (Believe It Or Not)","Theme From 'Shaft'","There goes my baby","These Boots Are Made For Walking","Third Man Theme","This Diamond Ring","This Guy's in Love With You","This Land is Your Land","This Love","This Ole House","This Used to Be My Playground","Three Coins in the Fountain","Three Times a Lady","Thrift Shop","Thriller","Ticket to Ride","Tie a Yellow Ribbon 'round the Old Oak Tree","Tiger Rag","Tighten Up","Tik-Toc","Till I Waltz Again With You","Till The End of Time","Time After Time","Time of the Season","To Sir, with Love","Tom Dooley","Tonight's the Night (Gonna Be Alright)","Too Close","Too Young","Tossing & Turning","Total Eclipse of the Heart","Touch Me","Toxic","Travellin' Band","Travellin' Man","Truly Madly Deeply","Turn! Turn! Turn! (To Everything There is a Season)","Tutti Frutti","Twist & Shout","Two Hearts","U Can't Touch This","U Got it Bad","Umbrella","Un-Break My Heart","Unbelievable","Unchained Melody","Uncle Albert (Admiral Halsey)","Under the Boardwalk","Under the Bridge","Unforgettable","Up Around the Bend","Up Up & Away","Up Where We Belong","Upside Down","Use Somebody","Vaya Con Dios (may God Be With You)","Venus","Vision of Love","Viva La Vida","Vogue","Volare","Wabash Cannonball","Waiting For a Girl Like You","Wake Me Up Before You Go Go","Wake Up Little Susie","Walk Don't Run","Walk Like a Man","Walk Like an Egyptian","Walk On By","Walk On the Wild Side","Walk This Way","Wannabe","Want Ads","Wanted","War","Waterfalls","Wayward Wind","We Are Family","We Are Young","We Are the Champions","We Are the World","We Belong Together","We Built This City","We Can Work it Out","We Didn't Start the Fire","We Found Love","We Got The Beat","We Will Rock You","We've Only Just Begun","Weak","Wedding Bell Blues","West End Blues","West End Girls","What Goes Around Comes Around","What a Fool Believes","What'd I Say","What's Going On?","What's Love Got to Do With It?","Whatcha Say","Wheel of Fortune","When Doves Cry","When You Wish Upon a Star","When a Man Loves a Woman","Where Did Our Love Go","Where is the Love?","Whip It","Whispering","White Christmas","White Rabbit","Whole Lotta Love","Whole Lotta Shakin' Goin' On","Whoomp! (There it Is)","Why Do Fools Fall in Love?","Why Don't You Believe Me?","Wichita Lineman","Wicked Game","Wild Thing","Wild Wild West","Will It Go Round In Circles","Will You Love Me Tomorrow","Winchester Cathedral","Wind Beneath My Wings","Wipe Out","Wishing Well","With Or Without You","Without Me","Without You","Woman","Won't Get Fooled Again","Wooly Bully","Working My Way Back to You","YMCA","Yakety Yak","Yeah!","Yellow Rose of Texas","Yesterday","You Ain't Seen Nothin' Yet","You Always Hurt the One You Love","You Are the Sunshine of My Life","You Belong With Me","You Belong to Me","You Can't Hurry Love","You Don't Bring Me Flowers","You Don't Have to Be a Star (To Be in My Show)","You Light Up My Life","You Make Me Feel Brand New","You Make Me Feel Like Dancing","You Really Got Me","You Send Me","You Sexy Thing","You Were Meant for Me","You make Me Wanna","You'll Never Know","You're Beautiful","You're So Vain","You're Still the One","You're the One That I Want","You've Got a Friend","You've Lost That Lovin' Feelin'","Your Cheatin' Heart","Your Song"],AZ={album:CZ,artist:_Z,genre:EZ,song_name:kZ},NZ=AZ,TZ=["activist","artist","author","blogger","business owner","coach","creator","designer","developer","dreamer","educator","engineer","entrepreneur","environmentalist","film lover","filmmaker","foodie","founder","friend","gamer","geek","grad","inventor","leader","model","musician","nerd","parent","patriot","person","philosopher","photographer","public speaker","scientist","singer","streamer","student","teacher","traveler","veteran","writer"],MZ=["{{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}, {{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}, {{person.bio_part}} {{internet.emoji}}","{{word.noun}} {{person.bio_supporter}}","{{word.noun}} {{person.bio_supporter}}  {{internet.emoji}}","{{word.noun}} {{person.bio_supporter}}, {{person.bio_part}}","{{word.noun}} {{person.bio_supporter}}, {{person.bio_part}} {{internet.emoji}}"],RZ=["advocate","devotee","enthusiast","fan","junkie","lover","supporter"],DZ={generic:["Aaliyah","Aaron","Abagail","Abbey","Abbie","Abbigail","Abby","Abdiel","Abdul","Abdullah","Abe","Abel","Abelardo","Abigail","Abigale","Abigayle","Abner","Abraham","Ada","Adah","Adalberto","Adaline","Adam","Adan","Addie","Addison","Adela","Adelbert","Adele","Adelia","Adeline","Adell","Adella","Adelle","Aditya","Adolf","Adolfo","Adolph","Adolphus","Adonis","Adrain","Adrian","Adriana","Adrianna","Adriel","Adrien","Adrienne","Afton","Aglae","Agnes","Agustin","Agustina","Ahmad","Ahmed","Aid
4366a","Aidan","Aiden","Aileen","Aimee","Aisha","Aiyana","Akeem","Al","Alaina","Alan","Alana","Alanis","Alanna","Alayna","Alba","Albert","Alberta","Albertha","Alberto","Albin","Albina","Alda","Alden","Alec","Aleen","Alejandra","Alejandrin","Alek","Alena","Alene","Alessandra","Alessandro","Alessia","Aletha","Alex","Alexa","Alexander","Alexandra","Alexandre","Alexandrea","Alexandria","Alexandrine","Alexandro","Alexane","Alexanne","Alexie","Alexis","Alexys","Alexzander","Alf","Alfonso","Alfonzo","Alford","Alfred","Alfreda","Alfredo","Ali","Alia","Alice","Alicia","Alisa","Alisha","Alison","Alivia","Aliya","Aliyah","Aliza","Alize","Allan","Allen","Allene","Allie","Allison","Ally","Alphonso","Alta","Althea","Alva","Alvah","Alvena","Alvera","Alverta","Alvina","Alvis","Alyce","Alycia","Alysa","Alysha","Alyson","Alysson","Amalia","Amanda","Amani","Amara","Amari","Amaya","Amber","Ambrose","Amelia","Amelie","Amely","America","Americo","Amie","Amina","Amir","Amira","Amiya","Amos","Amparo","Amy","Amya","Ana","Anabel","Anabelle","Anahi","Anais","Anastacio","Anastasia","Anderson","Andre","Andreane","Andreanne","Andres","Andrew","Andy","Angel","Angela","Angelica","Angelina","Angeline","Angelita","Angelo","Angie","Angus","Anibal","Anika","Anissa","Anita","Aniya","Aniyah","Anjali","Anna","Annabel","Annabell","Annabelle","Annalise","Annamae","Annamarie","Anne","Annetta","Annette","Annie","Ansel","Ansley","Anthony","Antoinette","Antone","Antonetta","Antonette","Antonia","Antonietta","Antonina","Antonio","Antwan","Antwon","Anya","April","Ara","Araceli","Aracely","Arch","Archibald","Ardella","Arden","Ardith","Arely","Ari","Ariane","Arianna","Aric","Ariel","Arielle","Arjun","Arlene","Arlie","Arlo","Armand","Armando","Armani","Arnaldo","Arne","Arno","Arnold","Arnoldo","Arnulfo","Aron","Art","Arthur","Arturo","Arvel","Arvid","Arvilla","Aryanna","Asa","Asha","Ashlee","Ashleigh","Ashley","Ashly","Ashlynn","Ashton","Ashtyn","Asia","Assunta","Astrid","Athena","Aubree","Aubrey","Audie","Audra","Audreanne","Audrey","August","Augusta","Augustine","Augustus","Aurelia","Aurelie","Aurelio","Aurore","Austen","Austin","Austyn","Autumn","Ava","Avery","Avis","Axel","Ayana","Ayden","Ayla","Aylin","Baby","Bailee","Bailey","Barbara","Barney","Baron","Barrett","Barry","Bart","Bartholome","Barton","Baylee","Beatrice","Beau","Beaulah","Bell","Bella","Belle","Ben","Benedict","Benjamin","Bennett","Bennie","Benny","Benton","Berenice","Bernadette","Bernadine","Bernard","Bernardo","Berneice","Bernhard","Bernice","Bernie","Berniece","Bernita","Berry","Bert","Berta","Bertha","Bertram","Bertrand","Beryl","Bessie","Beth","Bethany","Bethel","Betsy","Bette","Bettie","Betty","Bettye","Beulah","Beverly","Bianka","Bill","Billie","Billy","Birdie","Blair","Blaise","Blake","Blanca","Blanche","Blaze","Bo","Bobbie","Bobby","Bonita","Bonnie","Boris","Boyd","Brad","Braden","Bradford","Bradley","Bradly","Brady","Braeden","Brain","Brandi","Brando","Brandon","Brandt","Brandy","Brandyn","Brannon","Branson","Brant","Braulio","Braxton","Brayan","Breana","Breanna","Breanne","Brenda","Brendan","Brenden","Brendon","Brenna","Brennan","Brennon","Brent","Bret","Brett","Bria","Brian","Briana","Brianne","Brice","Bridget","Bridgette","Bridie","Brielle","Brigitte","Brionna","Brisa","Britney","Brittany","Brock","Broderick","Brody","Brook","Brooke","Brooklyn","Brooks","Brown","Bruce","Bryana","Bryce","Brycen","Bryon","Buck","Bud","Buddy","Buford","Bulah","Burdette","Burley","Burnice","Buster","Cade","Caden","Caesar","Caitlyn","Cale","Caleb","Caleigh","Cali","Calista","Callie","Camden","Cameron","Camila","Camilla","Camille","Camren","Camron","Camryn","Camylle","Candace","Candelario","Candice","Candida","Candido","Cara","Carey","Carissa","Carlee","Carleton","Carley","Carli","Carlie","Carlo","Carlos","Carlotta","Carmel","Carmela","Carmella","Carmelo","Carmen","Carmine","Carol","Carolanne","Carole","Carolina","Caroline","Carolyn","Carolyne","Carrie","Carroll","Carson","Carter","Cary","Casandra","Casey","Casimer","Casimir","Casper","Cassandra","Cassandre","Cassidy","Cassie","Catalina","Caterina","Catharine","Catherine","Cathrine","Cathryn","Cathy","Cayla","Ceasar","Cecelia","Cecil","Cecile","Cecilia","Cedrick","Celestine","Celestino","Celia","Celine","Cesar","Chad","Chadd","Chadrick","Chaim","Chance","Chandler","Chanel","Chanelle","Charity","Charlene","Charles","Charley","Charlie","Charlotte","Chase","Chasity","Chauncey","Chaya","Chaz","Chelsea","Chelsey","Chelsie","Chesley","Chester","Chet","Cheyanne","Cheyenne","Chloe","Chris","Christ","Christa","Christelle","Christian","Christiana","Christina","Christine","Christop","Christophe","Christopher","Christy","Chyna","Ciara","Cicero","Cielo","Cierra","Cindy","Citlalli","Clair","Claire","Clara","Clarabelle","Clare","Clarissa","Clark","Claud","Claude","Claudia","Claudie","Claudine","Clay","Clemens","Clement","Clementina","Clementine","Clemmie","Cleo","Cleora","Cleta","Cletus","Cleve","Cleveland","Clifford","Clifton","Clint","Clinton","Clotilde","Clovis","Cloyd","Clyde","Coby","Cody","Colby","Cole","Coleman","Colin","Colleen","Collin","Colt","Colten","Colton","Columbus","Concepcion","Conner","Connie","Connor","Conor","Conrad","Constance","Constantin","Consuelo","Cooper","Cora","Coralie","Corbin","Cordelia","Cordell","Cordia","Cordie","Corene","Corine","Cornelius","Cornell","Corrine","Cortez","Cortney","Cory","Coty","Courtney","Coy","Craig","Crawford","Creola","Cristal","Cristian","Cristina","Cristobal","Cristopher","Cruz","Crystal","Crystel","Cullen","Curt","Curtis","Cydney","Cynthia","Cyril","Cyrus","D'angelo","Dagmar","Dahlia","Daija","Daisha","Daisy","Dakota","Dale","Dallas","Dallin","Dalton","Damaris","Dameon","Damian","Damien","Damion","Damon","Dan","Dana","Dandre","Dane
vendor: 20,735 bytes, line 4366
4366","Dangelo","Danial","Daniela","Daniella","Danielle","Danika","Dannie","Danny","Dante","Danyka","Daphne","Daphnee","Daphney","Darby","Daren","Darian","Dariana","Darien","Dario","Darion","Darius","Darlene","Daron","Darrel","Darrell","Darren","Darrick","Darrin","Darrion","Darron","Darryl","Darwin","Daryl","Dashawn","Dasia","Dave","David","Davin","Davion","Davon","Davonte","Dawn","Dawson","Dax","Dayana","Dayna","Dayne","Dayton","Dean","Deangelo","Deanna","Deborah","Declan","Dedric","Dedrick","Dee","Deion","Deja","Dejah","Dejon","Dejuan","Delaney","Delbert","Delfina","Delia","Delilah","Dell","Della","Delmer","Delores","Delpha","Delphia","Delphine","Delta","Demarco","Demarcus","Demario","Demetris","Demetrius","Demond","Dena","Denis","Dennis","Deon","Deondre","Deontae","Deonte","Dereck","Derek","Derick","Deron","Derrick","Deshaun","Deshawn","Desiree","Desmond","Dessie","Destany","Destin","Destinee","Destiney","Destini","Destiny","Devan","Devante","Deven","Devin","Devon","Devonte","Devyn","Dewayne","Dewitt","Dexter","Diamond","Diana","Dianna","Diego","Dillan","Dillon","Dimitri","Dina","Dino","Dion","Dixie","Dock","Dolly","Dolores","Domenic","Domenica","Domenick","Domenico","Domingo","Dominic","Dominique","Don","Donald","Donato","Donavon","Donna","Donnell","Donnie","Donny","Dora","Dorcas","Dorian","Doris","Dorothea","Dorothy","Dorris","Dortha","Dorthy","Doug","Douglas","Dovie","Doyle","Drake","Drew","Duane","Dudley","Dulce","Duncan","Durward","Dustin","Dusty","Dwight","Dylan","Earl","Earlene","Earline","Earnest","Earnestine","Easter","Easton","Ebba","Ebony","Ed","Eda","Edd","Eddie","Eden","Edgar","Edgardo","Edison","Edmond","Edmund","Edna","Eduardo","Edward","Edwardo","Edwin","Edwina","Edyth","Edythe","Effie","Efrain","Efren","Eileen","Einar","Eino","Eladio","Elaina","Elbert","Elda","Eldon","Eldora","Eldred","Eldridge","Eleanora","Eleanore","Eleazar","Electa","Elena","Elenor","Elenora","Eleonore","Elfrieda","Eli","Elian","Eliane","Elias","Eliezer","Elijah","Elinor","Elinore","Elisa","Elisabeth","Elise","Eliseo","Elisha","Elissa","Eliza","Elizabeth","Ella","Ellen","Ellie","Elliot","Elliott","Ellis","Ellsworth","Elmer","Elmira","Elmo","Elmore","Elna","Elnora","Elody","Eloisa","Eloise","Elouise","Eloy","Elroy","Elsa","Else","Elsie","Elta","Elton","Elva","Elvera","Elvie","Elvis","Elwin","Elwyn","Elyse","Elyssa","Elza","Emanuel","Emelia","Emelie","Emely","Emerald","Emerson","Emery","Emie","Emil","Emile","Emilia","Emiliano","Emilie","Emilio","Emily","Emma","Emmalee","Emmanuel","Emmanuelle","Emmet","Emmett","Emmie","Emmitt","Emmy","Emory","Ena","Enid","Enoch","Enola","Enos","Enrico","Enrique","Ephraim","Era","Eriberto","Eric","Erica","Erich","Erick","Ericka","Erik","Erika","Erin","Erling","Erna","Ernest","Ernestina","Ernestine","Ernesto","Ernie","Ervin","Erwin","Eryn","Esmeralda","Esperanza","Esta","Esteban","Estefania","Estel","Estell","Estella","Estelle","Estevan","Esther","Estrella","Etha","Ethan","Ethel","Ethelyn","Ethyl","Ettie","Eudora","Eugene","Eugenia","Eula","Eulah","Eulalia","Euna","Eunice","Eusebio","Eva","Evalyn","Evan","Evangeline","Evans","Eve","Eveline","Evelyn","Everardo","Everett","Everette","Evert","Evie","Ewald","Ewell","Ezekiel","Ezequiel","Ezra","Fabian","Fabiola","Fae","Fannie","Fanny","Fatima","Faustino","Fausto","Favian","Fay","Faye","Federico","Felicia","Felicita","Felicity","Felipa","Felipe","Felix","Felton","Fermin","Fern","Fernando","Ferne","Fidel","Filiberto","Filomena","Finn","Fiona","Flavie","Flavio","Fleta","Fletcher","Flo","Florence","Florencio","Florian","Florida","Florine","Flossie","Floy","Floyd","Ford","Forest","Forrest","Foster","Frances","Francesca","Francesco","Francis","Francisca","Francisco","Franco","Frank","Frankie","Franz","Fred","Freda","Freddie","Freddy","Frederic","Frederick","Frederik","Frederique","Fredrick","Fredy","Freeda","Freeman","Freida","Frida","Frieda","Friedrich","Fritz","Furman","Gabe","Gabriel","Gabriella","Gabrielle","Gaetano","Gage","Gail","Gardner","Garett","Garfield","Garland","Garnet","Garnett","Garret","Garrett","Garrick","Garrison","Garry","Garth","Gaston","Gavin","Gayle","Gene","General","Genesis","Genevieve","Gennaro","Genoveva","Geo","Geoffrey","George","Georgette","Georgiana","Georgianna","Geovanni","Geovanny","Geovany","Gerald","Geraldine","Gerard","Gerardo","Gerda","Gerhard","Germaine","German","Gerry","Gerson","Gertrude","Gia","Gianni","Gideon","Gilbert","Gilberto","Gilda","Giles","Gillian","Gina","Gino","Giovani","Giovanna","Giovanni","Giovanny","Gisselle","Giuseppe","Gladyce","Gladys","Glen","Glenda","Glenna","Glennie","Gloria","Godfrey","Golda","Golden","Gonzalo","Gordon","Grace","Gracie","Graciela","Grady","Graham","Grant","Granville","Grayce","Grayson","Green","Greg","Gregg","Gregoria","Gregorio","Gregory","Greta","Gretchen","Greyson","Griffin","Grover","Guadalupe","Gudrun","Guido","Guillermo","Guiseppe","Gunnar","Gunner","Gus","Gussie","Gust","Gustave","Guy","Gwen","Gwendolyn","Hadley","Hailee","Hailey","Hailie","Hal","Haleigh","Haley","Halie","Halle","Hallie","Hank","Hanna","Hannah","Hans","Hardy","Harley","Harmon","Harmony","Harold","Harrison","Harry","Harvey","Haskell","Hassan","Hassie","Hattie","Haven","Hayden","Haylee","Hayley","Haylie","Hazel","Hazle","Heath","Heather","Heaven","Heber","Hector","Heidi","Helen","Helena","Helene","Helga","Hellen","Helmer","Heloise","Henderson","Henri","Henriette","Henry","Herbert","Herman","Hermann","Hermina","Herminia","Herminio","Hershel","Herta","Hertha","Hester","Hettie","Hilario","Hilbert","Hilda","Hildegard","Hillard","Hillary","Hilma","Hilton","Hipolito","Hiram","Hobart","Holden","Hollie","Hollis","Holly","Hope","Horace","Horacio","Hortense","Hosea","Houston","Howard","Howell","Hoyt","Hubert","Hudson","Hugh","Hulda","Humberto","Hunter","Hyman","Ian","Ibrahim","Icie","Ida","Idell","Idella","Ignacio","Ignatius","Ike","Ila","Ilene","Iliana","Ima","Imani","Imelda","Immanuel","Imogene","Ines","Irma","Irving","Irwin","Isaac","Isabel","Isabell","Isabella","Isabelle","Isac","Isadore","Isai","Isaiah","Isaias","Isidro","Ismael","Isobel","Isom","Israel","Issac","Itzel","Iva","Ivah","Ivory","Ivy","Izabella","Izaiah","Jabari","Jace","Jacey","Jacinthe","Jacinto","Jack","Jackeline","Jackie","Jacklyn","Jackson","Jacky","Jaclyn","Jacquelyn","Jacques","Jacynthe","Jada","Jade","Jaden","Jadon","Jadyn","Jaeden","Jaida","Jaiden","Jailyn","Jaime","Jairo","Jakayla","Jake","Jakob","Jaleel","Jalen","Jalon","Jalyn","Jamaal","Jamal","Jamar","Jamarcus","Jamel","Jameson","Jamey","Jamie","Jamil","Jamir","Jamison","Jammie","Jan","Jana","Janae","Jane","Janelle","Janessa","Janet","Janice","Janick","Janie","Janis","Janiya","Jannie","Jany","Jaquan","Jaquelin","Jaqueline","Jared","Jaren","Jarod","Jaron","Jarred","Jarrell","Jarret","Jarrett","Jarrod","Jarvis","Jasen","Jasmin","Jason","Jasper","Jaunita","Javier","Javon","Javonte","Jay","Jayce","Jaycee","Jayda","Jayde","Jayden","Jaydon","Jaylan","Jaylen","Jaylin","Jaylon","Jayme","Jayne","Jayson","Jazlyn","Jazmin","Jazmyn","Jazmyne","Jean","Jeanette","Jeanie","Jeanne","Jed","Jedediah","Jedidiah","Jeff","Jefferey","Jeffery","Jeffrey","Jeffry","Jena","Jenifer","Jennie","Jennifer","Jennings","Jennyfer","Jensen","Jerad","Jerald","Jeramie","Jeramy","Jerel","Jeremie","Jeremy","Jermain","Jermaine","Jermey","Jerod","Jerome","Jeromy","Jerrell","Jerrod","Jerrold","Jerry","Jess","Jesse","Jessica","Jessie","Jessika","Jessy","Jessyca","Jesus","Jett","Jettie","Jevon","Jewel","Jewell","Jillian","Jimmie","Jimmy","Jo","Joan","Joana","Joanie","Joanne","Joannie","Joanny","Joany","Joaquin","Jocelyn","Jodie","Jody","Joe","Joel","Joelle","Joesph","Joey","Johan","Johann","Johanna","Johathan","John","Johnathan","Johnathon","Johnnie","Johnny","Johnpaul","Johnson","Jolie","Jon","Jonas","Jonatan","Jonathan","Jonathon","Jordan","Jordane","Jordi","Jordon","Jordy","Jordyn","Jorge","Jose","Josefa","Josefina","Joseph","Josephine","Josh","Joshua","Joshuah","Josiah","Josiane","Josianne","Josie","Josue","Jovan","Jovani","Jovanny","Jovany","Joy","Joyce","Juana","Juanita","Judah","Judd","Jude","Judge","Judson","Judy","Jules","Julia","Julian","Juliana","Julianne","Julie","Julien","Juliet","Julio","Julius","June","Junior","Junius","Justen","Justice","Justina","Justine","Juston","Justus","Justyn","Juvenal","Juwan","Kacey","Kaci","Kacie","Kade","Kaden","Kadin","Kaela","Kaelyn","Kaia","Kailee","Kailey","Kailyn","Kaitlin","Kaitlyn","Kale","Kaleb","Kaleigh","Kaley","Kali","Kallie","Kameron","Kamille","Kamren","Kamron","Kamryn","Kane","Kara","Kareem","Karelle","Karen","Kari","Kariane","Karianne","Karina","Karine","Karl","Karlee","Karley","Karli","Karlie","Karolann","Karson","Kasandra","Kasey","Kassandra","Katarina","Katelin","Katelyn","Katelynn","Katharina","Katherine","Katheryn","Kathleen","Kathlyn","Kathryn","Kathryne","Katlyn","Katlynn","Katrina","Katrine","Kattie","Kavon","Kay","Kaya","Kaycee","Kayden","Kayla","Kaylah","Kaylee","Kayleigh","Kayley","Kayli","Kaylie","Kaylin","Keagan","Keanu","Keara","Keaton","Keegan","Keeley","Keely","Keenan","Keira","Keith","Kellen","Kelley","Kelli","Kellie","Kelly","Kelsi","Kelsie","Kelton","Kelvin","Ken","Kendall","Kendra","Kendrick","Kenna","Kennedi","Kennedy","Kenneth","Kennith","Kenny","Kenton","Kenya","Kenyatta","Kenyon","Keon","Keshaun","Keshawn","Keven","Kevin","Kevon","Keyon","Keyshawn","Khalid","Khalil","Kian","Kiana","Kianna","Kiara","Kiarra","Kiel","Kiera","Kieran","Kiley","Kim","Kimberly","King","Kip","Kira","Kirk","Kirsten","Kirstin","Kitty","Kobe","Koby","Kody","Kolby","Kole","Korbin","Korey","Kory","Kraig","Kris","Krista","Kristian","Kristin","Kristina","Kristofer","Kristoffer","Kristopher","Kristy","Krystal","Krystel","Krystina","Kurt","Kurtis","Kyla","Kyle","Kylee","Kyleigh","Kyler","Kylie","Kyra","Lacey","Lacy","Ladarius","Lafayette","Laila","Laisha","Lamar","Lambert","Lamont","Lance","Landen","Lane","Laney","Larissa","Laron","Larry","Larue","Laura","Laurel","Lauren","Laurence","Lauretta","Lauriane","Laurianne","Laurie","Laurine","Laury","Lauryn","Lavada","Lavern","Laverna","Laverne","Lavina","Lavinia","Lavon","Lavonne","Lawrence","Lawson","Layla","Layne","Lazaro","Lea","Leann","Leanna","Leanne","Leatha","Leda","Lee","Leif","Leila","Leilani","Lela","Lelah","Leland","Lelia","Lempi","Lemuel","Lenna","Lennie","Lenny","Lenora","Lenore","Leo","Leola","Leon","Leonard","Leonardo","Leone","Leonel","Leonie","Leonor","Leonora","Leopold","Leopoldo","Leora","Lera","Lesley","Leslie","Lesly","Lessie","Lester","Leta","Letha","Letitia","Levi","Lew","Lewis","Lexi","Lexie","Lexus","Lia","Liam","Liana","Libbie","Libby","Lila","Lilian","Liliana","Liliane","Lilla","Lillian","Lilliana","Lillie","Lilly","Lily","Lilyan","Lina","Lincoln","Linda","Lindsay","Lindsey","Linnea","Linnie","Linwood","Lionel","Lisa","Lisandro","Lisette","Litzy","Liza","Lizeth","Lizzie","Llewellyn","Lloyd","Logan","Lois","Lola","Lolita","Loma","Lon","London","Lonie","Lonnie","Lonny","Lonzo","Lora","Loraine","Loren","Lorena","Lorenz","Lorenza","Lorenzo","Lori","Lorine","Lorna","Lottie","Lou","Louie","Louisa","Lourdes","Louvenia","Lowell","Loy","Loyal","Loyce","Lucas","Luciano","Lucie","Lucienne","Lucile","Lucinda","Lucio","Lucious","Lucius","Lucy","Ludie","Ludwig","Lue","Luella","Luigi","Luis","Luisa","Lukas","Lula","Lulu","Luna","Lupe","Lura","Lurline","Luther","Luz","Lyda","Lydia","Lyla","Lynn","Lyric","Lysanne","Mabel","Mabelle","Mable","Mac","Macey","Maci","Macie","Mack","Mackenzie","Macy","Madaline","Madalyn","Maddison","Madeline","Madelyn","Madelynn","Madge","Madie","Madilyn","Madisen","Madison","Madisyn","Madonna","Madyson","Mae","Maegan","Maeve","Mafalda","Magali","Magdalen","Magdalena","Maggie","Magnolia","Magnus","Maia","Maida","Maiya","Major","Makayla","Makenna","Makenzie","Malachi","Malcolm","Malika","Malinda","Mallie","Mallory","Malvina","Mandy","Manley","Manuel","Manuela","Mara","Marc","Marcel","Marcelina","Marcelino","Marcella","Marcelle","Marcellus","Marcelo","Marcia","Marco","Marcos","Marcus","Margaret","Margarete","Margarett","Margaretta","Margarette","Margarita","Marge","Margie","Margot","Margret","Marguerite","Maria","Mariah","Mariam","Marian","Mariana","Mariane","Marianna","Marianne","Mariano","Maribel","Marie","Mariela","Marielle","Marietta","Marilie","Marilou","Marilyne","Marina","Mario","Marion","Marisa","Marisol","Maritza","Marjolaine","Marjorie","Marjory","Mark","Markus","Marlee","Marlen","Marlene","Marley","Marlin","Marlon","Marques","Marquis","Marquise","Marshall","Marta","Martin","Martina","Martine","Marty","Marvin","Mary","Maryam","Maryjane","Maryse","Mason","Mateo","Mathew","Mathias","Mathilde","Matilda","Matilde","Matt","Matteo","Mattie","Maud","Maude","Maudie","Maureen","Maurice","Mauricio","Maurine","Maverick","Mavis","Max","Maxie","Maxime","Maximilian","Maximillia","Maximillian","Maximo","Maximus","Maxine","Maxwell","May","Maya","Maybell","Maybelle","Maye","Maymie","Maynard","Mayra","Mazie","Mckayla","Mckenna","Mckenzie","Meagan","Meaghan","Meda","Megane","Meggie","Meghan","Mekhi","Melany","Melba","Melisa","Melissa","Mellie","Melody","Melvin","Melvina","Melyna","Melyssa","Mercedes","Meredith","Merl","Merle","Merlin","Merritt","Mertie","Mervin","Meta","Mia","Micaela","Micah","Michael","Michaela","Michale","Micheal","Michel","Michele","Michelle","Miguel","Mikayla","Mike","Mikel","Milan","Miles","Milford","Miller","Millie","Milo","Milton","Mina","Minerva","Minnie","Miracle","Mireille","Mireya","Misael","Missouri","Misty","Mitchel","Mitchell","Mittie","Modesta","Modesto","Mohamed","Mohammad","Mohammed","Moises","Mollie","Molly","Mona","Monica","Monique","Monroe","Monserrat","Monserrate","Montana","Monte","Monty","Morgan","Moriah","Morris","Mortimer","Morton","Mose","Moses","Moshe","Mossie","Mozell","Mozelle","Muhammad","Muriel","Murl","Murphy","Murray","Mustafa","Mya","Myah","Mylene","Myles","Myra","Myriam","Myrl","Myrna","Myron","Myrtice","Myrtie","Myrtis","Myrtle","Nadia","Nakia","Name","Nannie","Naomi","Naomie","Napoleon","Narciso","Nash","Nasir","Nat","Natalia","Natalie","Natasha","Nathan","Nathanael","Nathanial","Nathaniel","Nathen","Nayeli","Neal","Ned","Nedra","Neha","Neil","Nelda","Nella","Nelle","Nellie","Nels","Nelson","Neoma","Nestor","Nettie","Neva","Newell","Newton","Nia","Nicholas","Nicholaus","Nichole","Nick","Nicklaus","Nickolas","Nico","Nicola","Nicolas","Nicole","Nicolette","Nigel","Nikita","Nikki","Nikko","Niko","Nikolas","Nils","Nina","Noah","Noble","Noe","Noel","Noelia","Noemi","Noemie","Noemy","Nola","Nolan","Nona","Nora","Norbert","Norberto","Norene","Norma","Norris","Norval","Norwood","Nova","Novella","Nya","Nyah","Nyasia","Obie","Oceane","Ocie","Octavia","Oda","Odell","Odessa","Odie","Ofelia","Okey","Ola","Olaf","Ole","Olen","Oleta","Olga","Olin","Oliver","Ollie","Oma","Omari","Omer","Ona","Onie","Opal","Ophelia","Ora","Oral","Oran","Oren","Orie","Orin","Orion","Orland","Orlando","Orlo","Orpha","Orrin","Orval","Orville","Osbaldo","Osborne","Oscar","Osvaldo","Oswald","Oswaldo","Otha","Otho","Otilia","Otis","Ottilie","Ottis","Otto","Ova","Owen","Ozella","Pablo","Paige","Palma","Pamela","Pansy","Paolo","Paris","Parker","Pascale","Pasquale","Pat","Patience","Patricia","Patrick","Patsy","Pattie","Paul","Paula","Pauline","Paxton","Payton","Pearl","Pearlie","Pearline","Pedro","Peggie","Penelope","Percival","Percy","Perry","Pete","Peter","Petra","Peyton","Philip","Phoebe","Phyllis","Pierce","Pierre","Pietro","Pink","Pinkie","Piper","Polly","Porter","Precious","Presley","Preston","Price","Prince","Princess","Priscilla","Providenci","Prudence","Queen","Queenie","Quentin","Quincy","Quinn","Quinten","Quinton","Rachael","Rachel","Rachelle","Rae","Raegan","Rafael","Rafaela","Raheem","Rahsaan","Rahul","Raina","Raleigh","Ralph","Ramiro","Ramon","Ramona","Randal","Randall","Randi","Randy","Ransom","Raoul","Raphael","Raphaelle","Raquel","Rashad","Rashawn","Rasheed","Raul","Raven","Ray","Raymond","Raymundo","Reagan","Reanna","Reba","Rebeca","Rebecca","Rebeka","Rebekah","Reece","Reed","Reese","Regan","Reggie","Reginald","Reid","Reilly","Reina","Reinhold","Remington","Rene","Renee","Ressie","Reta","Retha","Retta","Reuben","Reva","Rex","Rey","Reyes","Reymundo","Reyna","Reynold","Rhea","Rhett","Rhianna","Rhiannon","Rhoda","Ricardo","Richard","Richie","Richmond","Rick","Rickey","Rickie","Ricky","Rico","Rigoberto","Riley","Rita","River","Robb","Robbie","Robert","Roberta","Roberto","Robin","Robyn","Rocio","Rocky","Rod","Roderick","Rodger","Rodolfo","Rodrick","Rodrigo","Roel","Rogelio","Roger","Rogers","Rolando","Rollin","Roma","Romaine","Roman","Ron","Ronaldo","Ronny","Roosevelt","Rory","Rosa","Rosalee","Rosalia","Rosalind","Rosalinda","Rosalyn","Rosamond","Rosanna","Rosario","Roscoe","Rose","Rosella","Roselyn","Rosemarie","Rosemary","Rosendo","Rosetta","Rosie","Rosina","Roslyn","Ross","Rossie","Rowan","Rowena","Rowland","Roxane","Roxanne","Roy","Royal","Royce","Rozella","Ruben","Rubie","Ruby","Rubye","Rudolph","Rudy","Rupert","Russ","Russel","Russell","Rusty","Ruth","Ruthe","Ruthie","Ryan","Ryann","Ryder","Rylan","Rylee","Ryleigh","Ryley","Sabina","Sabrina","Sabryna","Sadie","Sadye","Sage","Saige","Sallie","Sally","Salma","Salvador","Salvatore","Sam","Samanta","Samantha","Samara","Samir","Sammie","Sammy","Samson","Sandra","Sandrine","Sandy","Sanford","Santa","Santiago","Santina","Santino","Santos","Sarah","Sarai","Sarina","Sasha","Saul","Savanah","Savanna","Savannah","Savion","Scarlett","Schuyler","Scot","Scottie","Scotty","Seamus","Sean","Sebastian","Sedrick","Selena","Selina","Selmer","Serena","Serenity","Seth","Shad","Shaina","Shakira","Shana","Shane","Shanel","Shanelle","Shania","Shanie","Shaniya","Shanna","Shannon","Shanny","Shanon","Shany","Sharon","Shaun","Shawn","Shawna","Shaylee","Shayna","Shayne","Shea","Sheila","Sheldon","Shemar","Sheridan","Sherman","Sherwood","Shirley","Shyann","Shyanne","Sibyl","Sid","Sidney","Sienna","Sierra","Sigmund","Sigrid","Sigurd","Silas","Sim","Simeon","Simone","Sincere","Sister","Skye","Skyla","Skylar","Sofia","Soledad","Solon","Sonia","Sonny","Sonya","Sophia","Sophie","Spencer","Stacey","Stacy","Stan","Stanford","Stanley","Stanton","Stefan","Stefanie","Stella","Stephan","Stephania","Stephanie","Stephany","Stephen","Stephon","Sterling","Steve","Stevie","Stewart","Stone","Stuart","Summer","Sunny","Susan","Susana","Susanna","Susie","Suzanne","Sven","Syble","Sydnee","Sydney","Sydni","Sydnie","Sylvan","Sylvester","Sylvia","Tabitha","Tad","Talia","Talon","Tamara","Tamia","Tania","Tanner","Tanya","Tara","Taryn","Tate","Tatum","Tatyana","Taurean","Tavares","Taya","Taylor","Teagan","Ted","Telly","Terence","Teresa","Terrance","Terrell","Terrence","Terrill","Terry","Tess","Tessie","Tevin","Thad","Thaddeus","Thalia","Thea","Thelma","Theo","Theodora","Theodore","Theresa","Therese","Theresia","Theron","Thomas","Thora","Thurman","Tia","Tiana","Tianna","Tiara","Tierra","Tiffany","Tillman","Timmothy","Timmy","Timothy","Tina","Tito","Titus","Tobin","Toby","Tod","Tom","Tomas","Tomasa","Tommie","Toney","Toni","Tony","Torey","Torrance","Torrey","Toy","Trace","Tracey","Tracy","Travis","Travon","Tre","Tremaine","Tremayne","Trent","Trenton","Tressa","Tressie","Treva","Trever","Trevion","Trevor","Trey","Trinity","Trisha","Tristian","Tristin","Triston","Troy","Trudie","Trycia","Trystan","Turner","Twila","Tyler","Tyra","Tyree","Tyreek","Tyrel","Tyrell","Tyrese","Tyrique","Tyshawn","Tyson","Ubaldo","Ulices","Ulises","Una","Unique","Urban","Uriah","Uriel","Ursula","Vada","Valentin","Valentina","Valentine","Valerie","Vallie","Van","Vance","Vanessa","Vaughn","Veda","Velda","Vella","Velma","Velva","Vena","Verda","Verdie","Vergie","Verla","Verlie","Vern","Verna","Verner","Vernice","Vernie","Vernon","Verona","Veronica","Vesta","Vicenta","Vicente","Vickie","Vicky","Victor","Victoria","Vida","Vidal","Vilma","Vince","Vincent","Vincenza","Vincenzo","Vinnie","Viola","Violet","Violette","Virgie","Virgil","Virginia","Virginie","Vita","Vito","Viva","Vivian","Viviane","Vivianne","Vivien","Vivienne","Vladimir","Wade","Waino","Waldo","Walker","Wallace","Walter","Walton","Wanda","Ward","Warren","Watson","Wava","Waylon","Wayne","Webster","Weldon","Wellington","Wendell","Wendy","Werner","Westley","Weston","Whitney","Wilber","Wilbert","Wilburn","Wiley","Wilford","Wilfred","Wilfredo","Wilfrid","Wilhelm","Wilhelmine","Will","Willa","Willard","William","Willie","Willis","Willow","Willy","Wilma","Wilmer","Wilson","Wilton","Winfield","Winifred","Winnifred","Winona","Winston","Woodrow","Wyatt","Wyman","Xander","Xavier","Xzavier","Yadira","Yasmeen","Yasmin","Yasmine","Yazmin","Yesenia","Yessenia","Yolanda","Yoshiko","Yvette","Yvonne","Zachariah","Zachary","Zachery","Zack","Zackary","Zackery","Zakary","Zander","Zane","Zaria","Zechariah","Zelda","Zella","Zelma","Zena","Zetta","Zion","Zita","Zoe","Zoey","Zoie","Zoila","Zola","Zora","Zula"],
4366female:["Ada","Adrienne","Agnes","Alberta","Alexandra","Alexis","Alice","Alicia","Alison","Allison","Alma","Alyssa","Amanda","Amber","Amelia","Amy","Ana","Andrea","Angel","Angela","Angelica","Angelina","Angie","Anita","Ann","Anna","Anne","Annette","Annie","Antoinette","Antonia","April","Arlene","Ashley","Audrey","Barbara","Beatrice","Becky","Belinda","Bernadette","Bernice","Bertha","Bessie","Beth","Bethany","Betsy","Betty","Beulah","Beverly","Billie","Blanca","Blanche","Bobbie","Bonnie","Brandi","Brandy","Brenda","Bridget","Brittany","Brooke","Camille","Candace","Candice","Carla","Carmen","Carol","Carole","Caroline","Carolyn","Carrie","Casey","Cassandra","Catherine","Cathy","Cecelia","Cecilia","Celia","Charlene","Charlotte","Chelsea","Cheryl","Christie","Christina","Christine","Christy","Cindy","Claire","Clara","Claudia","Colleen","Connie","Constance","Cora","Courtney","Cristina","Crystal","Cynthia","Daisy","Dana","Danielle","Darla","Darlene","Dawn","Deanna","Debbie","Deborah","Debra","Delia","Della","Delores","Denise","Desiree","Diana","Diane","Dianna","Dianne","Dixie","Dolores","Donna","Dora","Doreen","Doris","Dorothy","Ebony","Edith","Edna","Eileen","Elaine","Eleanor","Elena","Elisa","Elizabeth","Ella","Ellen","Eloise","Elsa","Elsie","Elvira","Emily","Emma","Erica","Erika","Erin","Erma","Ernestine","Essie","Estelle","Esther","Ethel","Eula","Eunice","Eva","Evelyn","Faith","Fannie","Faye","Felicia","Flora","Florence","Frances","Francis","Freda","Gail","Gayle","Geneva","Genevieve","Georgia","Geraldine","Gertrude","Gina","Ginger","Gladys","Glenda","Gloria","Grace","Gretchen","Guadalupe","Gwen","Gwendolyn","Hannah","Harriet","Hattie","Hazel","Heather","Heidi","Helen","Henrietta","Hilda","Holly","Hope","Ida","Inez","Irene","Iris","Irma","Isabel","Jackie","Jacqueline","Jacquelyn","Jaime","Jamie","Jan","Jana","Jane","Janet","Janice","Janie","Janis","Jasmine","Jean","Jeanette","Jeanne","Jeannette","Jeannie","Jenna","Jennie","Jennifer","Jenny","Jessica","Jessie","Jill","Jo","Joan","Joann","Joanna","Joanne","Jodi","Jody","Johanna","Johnnie","Josefina","Josephine","Joy","Joyce","Juana","Juanita","Judith","Judy","Julia","Julie","June","Kara","Karen","Kari","Karla","Kate","Katherine","Kathleen","Kathryn","Kathy","Katie","Katrina","Kay","Kayla","Kelley","Kelli","Kellie","Kelly","Kendra","Kerry","Kim","Kimberly","Krista","Kristen","Kristi","Kristie","Kristin","Kristina","Kristine","Kristy","Krystal","Lana","Latoya","Laura","Lauren","Laurie","Laverne","Leah","Lee","Leigh","Lela","Lena","Leona","Leslie","Leticia","Lila","Lillian","Lillie","Linda","Lindsay","Lindsey","Lisa","Lois","Lola","Lora","Lorena","Lorene","Loretta","Lori","Lorraine","Louise","Lucia","Lucille","Lucy","Lula","Luz","Lydia","Lynda","Lynette","Lynn","Lynne","Mabel","Mable","Madeline","Mae","Maggie","Mamie","Mandy","Marcella","Marcia","Margaret","Margarita","Margie","Marguerite","Maria","Marian","Marianne","Marie","Marilyn","Marion","Marjorie","Marlene","Marsha","Marta","Martha","Mary","Maryann","Mattie","Maureen","Maxine","May","Megan","Meghan","Melanie","Melba","Melinda","Melissa","Melody","Mercedes","Meredith","Michele","Michelle","Mildred","Mindy","Minnie","Miranda","Miriam","Misty","Molly","Mona","Monica","Monique","Muriel","Myra","Myrtle","Nadine","Nancy","Naomi","Natalie","Natasha","Nellie","Nettie","Nichole","Nicole","Nina","Nora","Norma","Olga","Olive","Olivia","Ollie","Opal","Ora","Pam","Pamela","Pat","Patricia","Patsy","Patti","Patty","Paula","Paulette","Pauline","Pearl","Peggy","Penny","Phyllis","Priscilla","Rachael","Rachel","Ramona","Raquel","Rebecca","Regina","Renee","Rhonda","Rita","Roberta","Robin","Robyn","Rochelle","Rosa","Rosalie","Rose","Rosemarie","Rosemary","Rosie","Roxanne","Ruby","Ruth","Sabrina","Sadie","Sally","Samantha","Sandra","Sandy","Sara","Sarah","Shannon","Shari","Sharon","Shawna","Sheila","Shelia","Shelley","Shelly","Sheri","Sherri","Sherry","Sheryl","Shirley","Silvia","Sonia","Sonja","Sonya","Sophia","Sophie","Stacey","Stacy","Stella","Stephanie","Sue","Susan","Susie","Suzanne","Sylvia","Tabitha","Tamara","Tami","Tammy","Tanya","Tara","Tasha","Teresa","Teri","Terri","Terry","Thelma","Theresa","Tiffany","Tina","Toni","Tonya","Tracey","Traci","Tracy","Tricia","Valerie","Vanessa","Velma","Vera","Verna","Veronica","Vicki","Vickie","Vicky","Victoria","Viola","Violet","Virginia","Vivian","Wanda","Wendy","Whitney","Willie","Wilma","Winifred","Yolanda","Yvette","Yvonne"],male:["Aaron","Abel","Abraham","Adam","Adrian","Al","Alan","Albert","Alberto","Alejandro","Alex","Alexander","Alfonso","Alfred","Alfredo","Allan","Allen","Alonzo","Alton","Alvin","Amos","Andre","Andres","Andrew","Andy","Angel","Angelo","Anthony","Antonio","Archie","Armando","Arnold","Arthur","Arturo","Aubrey","Austin","Barry","Ben","Benjamin","Bennie","Benny","Bernard","Bert","Bill","Billy","Blake","Bob","Bobby","Boyd","Brad","Bradford","Bradley","Brandon","Brendan","Brent","Brett","Brian","Bruce","Bryan","Bryant","Byron","Caleb","Calvin","Cameron","Carl","Carlos","Carlton","Carroll","Cary","Casey","Cecil","Cedric","Cesar","Chad","Charles","Charlie","Chester","Chris","Christian","Christopher","Clarence","Clark","Claude","Clay","Clayton","Clifford","Clifton","Clint","Clinton","Clyde","Cody","Colin","Conrad","Corey","Cornelius","Cory","Courtney","Craig","Curtis","Dale","Dallas","Damon","Dan","Dana","Daniel","Danny","Darin","Darnell","Darrel","Darrell","Darren","Darrin","Darryl","Daryl","Dave","David","Dean","Delbert","Dennis","Derek","Derrick","Devin","Dewey","Dexter","Domingo","Dominic","Dominick","Don","Donald","Donnie","Doug","Douglas","Doyle","Drew","Duane","Dustin","Dwayne","Dwight","Earl","Earnest","Ed","Eddie","Edgar","Edmond","Edmund","Eduardo","Edward","Edwin","Elbert","Elias","Elijah","Ellis","Elmer","Emanuel","Emilio","Emmett","Enrique","Eric","Erick","Erik","Ernest","Ernesto","Ervin","Eugene","Evan","Everett","Felipe","Felix","Fernando","Floyd","Forrest","Francis","Francisco","Frank","Frankie","Franklin","Fred","Freddie","Frederick","Fredrick","Gabriel","Garrett","Garry","Gary","Gene","Geoffrey","George","Gerald","Gerard","Gerardo","Gilbert","Gilberto","Glen","Glenn","Gordon","Grady","Grant","Greg","Gregg","Gregory","Guadalupe","Guillermo","Gustavo","Guy","Harold","Harry","Harvey","Hector","Henry","Herbert","Herman","Homer","Horace","Howard","Hubert","Hugh","Hugo","Ian","Ignacio","Ira","Irvin","Irving","Isaac","Ismael","Israel","Ivan","Jack","Jackie","Jacob","Jaime","Jake","James","Jamie","Jan","Jared","Jason","Javier","Jay","Jean","Jeff","Jeffery","Jeffrey","Jerald","Jeremiah","Jeremy","Jermaine","Jerome","Jerry","Jesse","Jessie","Jesus","Jim","Jimmie","Jimmy","Jody","Joe","Joel","Joey","John","Johnathan","Johnnie","Johnny","Jon","Jonathan","Jonathon","Jordan","Jorge","Jose","Joseph","Josh","Joshua","Juan","Julian","Julio","Julius","Justin","Karl","Keith","Kelly","Kelvin","Ken","Kenneth","Kenny","Kent","Kerry","Kevin","Kim","Kirk","Kristopher","Kurt","Kyle","Lamar","Lance","Larry","Laurence","Lawrence","Lee","Leland","Leo","Leon","Leonard","Leroy","Leslie","Lester","Levi","Lewis","Lionel","Lloyd","Lonnie","Loren","Lorenzo","Louis","Lowell","Lucas","
4366Luis","Luke","Luther","Lyle","Lynn","Mack","Malcolm","Manuel","Marc","Marco","Marcos","Marcus","Mario","Marion","Mark","Marlon","Marshall","Martin","Marty","Marvin","Mathew","Matt","Matthew","Maurice","Max","Melvin","Merle","Michael","Micheal","Miguel","Mike","Milton","Mitchell","Morris","Moses","Myron","Nathan","Nathaniel","Neal","Neil","Nelson","Nicholas","Nick","Nicolas","Noah","Noel","Norman","Oliver","Omar","Orlando","Orville","Oscar","Otis","Owen","Pablo","Pat","Patrick","Paul","Pedro","Percy","Perry","Pete","Peter","Phil","Philip","Phillip","Preston","Rafael","Ralph","Ramiro","Ramon","Randal","Randall","Randolph","Randy","Raul","Ray","Raymond","Reginald","Rene","Rex","Ricardo","Richard","Rick","Rickey","Ricky","Robert","Roberto","Robin","Roderick","Rodney","Rodolfo","Rogelio","Roger","Roland","Rolando","Roman","Ron","Ronald","Ronnie","Roosevelt","Ross","Roy","Ruben","Rudolph","Rudy","Rufus","Russell","Ryan","Salvador","Salvatore","Sam","Sammy","Samuel","Santiago","Santos","Saul","Scott","Sean","Sergio","Seth","Shane","Shannon","Shaun","Shawn","Sheldon","Sherman","Sidney","Simon","Spencer","Stanley","Stephen","Steve","Steven","Stewart","Stuart","Sylvester","Taylor","Ted","Terence","Terrance","Terrell","Terrence","Terry","Theodore","Thomas","Tim","Timmy","Timothy","Toby","Todd","Tom","Tomas","Tommie","Tommy","Tony","Tracy","Travis","Trevor","Troy","Tyler","Tyrone","Van","Vernon","Victor","Vincent","Virgil","Wade","Wallace","Walter","Warren","Wayne","Wendell","Wesley","Wilbert","Wilbur","Wilfred","Willard","William","Willie","Willis","Wilson","Winston","Wm","Woodrow","Zachary"]},PZ=["Agender","Androgyne","Androgynous","Bigender","Cis female","Cis male","Cis man","Cis woman","Cis","Cisgender female","Cisgender male","Cisgender man","Cisgender woman","Cisgender","Demi-boy","Demi-girl","Demi-man","Demi-woman","Demiflux","Demigender","F2M","FTM","Female to male trans man","Female to male transgender man","Female to male transsexual man","Female to male","Gender fluid","Gender neutral","Gender nonconforming","Gender questioning","Gender variant","Genderflux","Genderqueer","Hermaphrodite","Intersex man","Intersex person","Intersex woman","Intersex","M2F","MTF","Male to female trans woman","Male to female transgender woman","Male to female transsexual woman","Male to female","Man","Multigender","Neither","Neutrois","Non-binary","Omnigender","Other","Pangender","Polygender","T* man","T* woman","Trans female","Trans male","Trans man","Trans person","Trans woman","Trans","Transsexual female","Transsexual male","Transsexual man","Transsexual person","Transsexual woman","Transsexual","Transgender female","Transgender person","Transmasculine","Trigender","Two* person","Two-spirit person","Two-spirit","Woman","Xenogender"],jZ=["Solutions","Program","Brand","Security","Research","Marketing","Directives","Implementation","Integration","Functionality","Response","Paradigm","Tactics","Identity","Markets","Group","Division","Applications","Optimization","Operations","Infrastructure","Intranet","Communications","Web","Branding","Quality","Assurance","Mobility","Accounts","Data","Creative","Configuration","Accountability","Interactions","Factors","Usability","Metrics"],LZ=["Lead","Senior","Direct","Corporate","Dynamic","Future","Product","National","Regional","District","Central","Global","Customer","Investor","International","Legacy","Forward","Internal","Human","Chief","Principal"],IZ=["{{person.jobDescriptor}} {{person.jobArea}} {{person.jobType}}"],BZ=["Supervisor","Associate","Executive","Liaison","Officer","Manager","Engineer","Specialist","Director","Coordinator","Administrator","Architect","Analyst","Designer","Planner","Orchestrator","Technician","Developer","Producer","Consultant","Assistant","Facilitator","Agent","Representative","Strategist"],OZ={generic:["Abbott","Abernathy","Abshire","Adams","Altenwerth","Anderson","Ankunding","Armstrong","Auer","Aufderhar","Bahringer","Bailey","Balistreri","Barrows","Bartell","Bartoletti","Barton","Bashirian","Batz","Bauch","Baumbach","Bayer","Beahan","Beatty","Bechtelar","Becker","Bednar","Beer","Beier","Berge","Bergnaum","Bergstrom","Bernhard","Bernier","Bins","Blanda","Blick","Block","Bode","Boehm","Bogan","Bogisich","Borer","Bosco","Botsford","Boyer","Boyle","Bradtke","Brakus","Braun","Breitenberg","Brekke","Brown","Bruen","Buckridge","Carroll","Carter","Cartwright","Casper","Cassin","Champlin","Christiansen","Cole","Collier","Collins","Conn","Connelly","Conroy","Considine","Corkery","Cormier","Corwin","Cremin","Crist","Crona","Cronin","Crooks","Cruickshank","Cummerata","Cummings","D'Amore","Dach","Daniel","Dare","Daugherty","Davis","Deckow","Denesik","Dibbert","Dickens","Dicki","Dickinson","Dietrich","Donnelly","Dooley","Douglas","Doyle","DuBuque","Durgan","Ebert","Effertz","Emard","Emmerich","Erdman","Ernser","Fadel","Fahey","Farrell","Fay","Feeney","Feest","Feil","Ferry","Fisher","Flatley","Frami","Franecki","Franey","Friesen","Fritsch","Funk","Gerhold","Gerlach","Gibson","Gislason","Gleason","Gleichner","Glover","Goldner","Goodwin","Gorczany","Gottlieb","Goyette","Grady","Graham","Grant","Green","Greenfelder","Greenholt","Grimes","Gulgowski","Gusikowski","Gutkowski","Gutmann","Haag","Hackett","Hagenes","Hahn","Haley","Halvorson","Hamill","Hammes","Hand","Hane","Hansen","Harber","Harris","Hartmann","Harvey","Hauck","Hayes","Heaney","Heathcote","Hegmann","Heidenreich","Heller","Herman","Hermann","Hermiston","Herzog","Hessel","Hettinger","Hickle","Hilll","Hills","Hilpert","Hintz","Hirthe","Hodkiewicz","Hoeger","Homenick","Hoppe","Howe","Howell","Hudson","Huel","Huels","Hyatt","Jacobi","Jacobs","Jacobson","Jakubowski","Jaskolski","Jast","Jenkins","Jerde","Johns","Johnson","Johnston","Jones","Kassulke","Kautzer","Keebler","Keeling","Kemmer","Kerluke","Kertzmann","Kessler","Kiehn","Kihn","Kilback","King","Kirlin","Klein","Kling","Klocko","Koch","Koelpin","Koepp","Kohler","Konopelski","Koss","Kovacek","K
4366ozey","Krajcik","Kreiger","Kris","Kshlerin","Kub","Kuhic","Kuhlman","Kuhn","Kulas","Kunde","Kunze","Kuphal","Kutch","Kuvalis","Labadie","Lakin","Lang","Langosh","Langworth","Larkin","Larson","Leannon","Lebsack","Ledner","Leffler","Legros","Lehner","Lemke","Lesch","Leuschke","Lind","Lindgren","Littel","Little","Lockman","Lowe","Lubowitz","Lueilwitz","Luettgen","Lynch","MacGyver","Macejkovic","Maggio","Mann","Mante","Marks","Marquardt","Marvin","Mayer","Mayert","McClure","McCullough","McDermott","McGlynn","McKenzie","McLaughlin","Medhurst","Mertz","Metz","Miller","Mills","Mitchell","Moen","Mohr","Monahan","Moore","Morar","Morissette","Mosciski","Mraz","Mueller","Muller","Murazik","Murphy","Murray","Nader","Nicolas","Nienow","Nikolaus","Nitzsche","Nolan","O'Connell","O'Conner","O'Hara","O'Keefe","O'Kon","O'Reilly","Oberbrunner","Okuneva","Olson","Ondricka","Orn","Ortiz","Osinski","Pacocha","Padberg","Pagac","Parisian","Parker","Paucek","Pfannerstill","Pfeffer","Pollich","Pouros","Powlowski","Predovic","Price","Prohaska","Prosacco","Purdy","Quigley","Quitzon","Rath","Ratke","Rau","Raynor","Reichel","Reichert","Reilly","Reinger","Rempel","Renner","Reynolds","Rice","Rippin","Ritchie","Robel","Roberts","Rodriguez","Rogahn","Rohan","Rolfson","Romaguera","Roob","Rosenbaum","Rowe","Ruecker","Runolfsdottir","Runolfsson","Runte","Russel","Rutherford","Ryan","Sanford","Satterfield","Sauer","Sawayn","Schaden","Schaefer","Schamberger","Schiller","Schimmel","Schinner","Schmeler","Schmidt","Schmitt","Schneider","Schoen","Schowalter","Sc
4366hroeder","Schulist","Schultz","Schumm","Schuppe","Schuster","Senger","Shanahan","Shields","Simonis","Sipes","Skiles","Smith","Smitham","Spencer","Spinka","Sporer","Stamm","Stanton","Stark","Stehr","Steuber","Stiedemann","Stokes","Stoltenberg","Stracke","Streich","Stroman","Strosin","Swaniawski","Swift","Terry","Thiel","Thompson","Tillman","Torp","Torphy","Towne","Toy","Trantow","Tremblay","Treutel","Tromp","Turcotte","Turner","Ullrich","Upton","Vandervort","Veum","Volkman","Von","VonRueden","Waelchi","Walker","Walsh","Walter","Ward","Waters","Watsica","Weber","Wehner","Weimann","Weissnat","Welch","West","White","Wiegand","Wilderman","Wilkinson","Will","Williamson","Willms","Windler","Wintheiser","Wisoky","Wisozk","Witting","Wiza","Wolf","Wolff","Wuckert","Wunsch","Wyman","Yost","Yundt","Zboncak","Zemlak","Ziemann","Zieme","Zulauf"]},UZ={generic:[{value:"{{person.last_name.generic}}",weight:95},{value:"{{person.last_name.generic}}-{{person.last_name.generic}}",weight:5}]},zZ={generic:["Addison","Alex","Anderson","Angel","Arden","August","Austin","Avery","Bailey","Billie","Blake","Bowie","Brooklyn","Cameron","Charlie","Corey","Dakota","Drew","Elliott","Ellis","Emerson","Finley","Gray","Greer","Harper","Hayden","Jaden","James","Jamie","Jordan","Jules","Kai","Kendall","Kennedy","Kyle","Leslie","Logan","London","Marlowe","Micah","Nico","Noah","North","Parker","Phoenix","Quinn","Reagan","Reese","Reign","Riley","River","Robin","Rory","Rowan","Ryan","Sage","Sasha","Sawyer","Shawn","Shiloh","Skyler","Taylor"],female:["Abigail","Adele","Alex","Alice","Alisha","Amber","Amelia","Amora","Anaïs","Angelou","Anika","Anise","Annabel","Anne","Aphrodite","Aretha","Arya","Ashton","Aster","Audrey","Avery","Bailee","Bay","Belle","Beth","Billie","Blair","Blaise","Blake","Blanche","Blue","Bree","Brielle","Brienne","Brooke","Caleen","Candice","Caprice","Carelyn","Caylen","Celine","Cerise","Cia","Claire","Claudia","Clementine","Coral","Coraline","Dahlia","Dakota","Dawn","Della","Demi","Denise","Denver","Devine","Devon","Diana","Dylan","Ebony","Eden","Eleanor","Elein","Elizabeth","Ellen","Elodie","Eloise","Ember","Emma","Erin","Eyre","Faith","Farrah","Fawn","Fayre","Fern","France","Francis","Frida","Genisis","Georgia","Grace","Gwen","Harley","Harper","Hazel","Helen","Hippolyta","Holly","Hope","Imani","Iowa","Ireland","Irene","Iris","Isa","Isla","Ivy","Jade","Jane","Jazz","Jean","Jess","Jett","Jo","Joan","Jolie","Jordan","Josie","Journey","Joy","Jules","Julien","Juliet","Juniper","Justice","Kali","Karma","Kat","Kate","Kennedy","Keva","Kylie","Lake","Lane","Lark","Layla","Lee","Leigh","Leona","Lexi","London","Lou","Louise","Love","Luna","Lux","Lynn","Lyric","Maddie","Mae","Marie","Matilda","Maude","Maybel","Meadow","Medusa","Mercy","Michelle","Mirabel","Monroe","Morgan","Nalia","Naomi","Nova","Olive","Paige","Parker","Pax","Pearl","Penelope","Phoenix","Quinn","Rae","Rain","Raven","Ray","Raye","Rebel","Reese","Reeve","Regan","Riley","River","Robin","Rory","Rose","Royal","Ruth","Rylie","Sage","Sam","Saturn","Scout","Serena","Sky","Skylar","Sofia","Sophia","Storm","Sue","Suzanne","Sydney","Taylen","Taylor","Teagan","Tempest","Tenley","Thea","Trinity","Valerie","Venus","Vera","Violet","Willow","Winter","Xena","Zaylee","Zion","Zoe"],male:["Ace","Aiden","Alexander","Ander","Anthony","Asher","August","Aziel","Bear","Beckham","Benjamin","Buddy","Calvin","Carter","Charles","Christopher","Clyde","Cooper","Daniel","David","Dior","Dylan","Elijah","Ellis","Emerson","Ethan","Ezra","Fletcher","Flynn","Gabriel","Grayson","Gus","Hank","Harrison","Hendrix","Henry","Houston","Hudson","Hugh","Isaac","Jack","Jackson","Jacob","Jakobe","James","Jaxon","Jaxtyn","Jayden","John","Joseph","Josiah","Jude","Julian","Karsyn","Kenji","Kobe","Kylo","Lennon","Leo","Levi","Liam","Lincoln","Logan","Louis","Lucas","Lucky","Luke","Mason","Mateo","Matthew","Maverick","Michael","Monroe","Nixon","Ocean","Oliver","Otis","Otto","Owen","Ozzy","Parker","Rocky","Samuel","Sebastian","Sonny","Teddy","Theo","Theodore","Thomas","Truett","Walter","Warren","Watson","William","Wison","Wyatt","Ziggy","Zyair"]},GZ=[{value:"{{person.firstName}} {{person.lastName}}",weight:49},{value:"{{person.prefix}} {{person.firstName}} {{person.lastName}}",weight:7},{value:"{{person.firstName}} {{person.lastName}} {{person.suffix}}",weight:7},{value:"{{person.prefix}} {{person.firstName}} {{person.lastName}} {{person.suffix}}",weight:1}],HZ={generic:["Dr.","Miss","Mr.","Mrs.","Ms."],female:["Dr.","Miss","Mrs.","Ms."],male:["Dr.","Mr."]},WZ=["female","male"],VZ=["Jr.","Sr.","I","II","III","IV","V","MD","DDS","PhD","DVM"],$Z=["Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn"],KZ={bio_part:TZ,bio_pattern:MZ,bio_supporter:RZ,first_name:DZ,gender:PZ,job_area:jZ,job_descriptor:LZ,job_title_pattern:IZ,job_type:BZ,last_name:OZ,last_name_pattern:UZ,middle_name:zZ,name:GZ,prefix:HZ,sex:WZ,suffix:VZ,western_zodiac_sign:$Z},YZ=KZ,qZ=["!##-!##-####","(!##) !##-####","1-!##-!##-####","!##.!##.####","!##-!##-#### x###","(!##) !##-#### x###","1-!##-!##-#### x###","!##.!##.#### x###","!##-!##-#### x####","(!##) !##-#### x####","1-!##-!##-#### x####","!##.!##.#### x####","!##-!##-#### x#####","(!##) !##-#### x#####","1-!##-!##-#### x#####","!##.!##.#### x#####"],JZ=["+1!##!######"],XZ=["(!##) !##-####"],ZZ={human:qZ,international:JZ,national:XZ},QZ=ZZ,eQ={format:QZ},tQ=eQ,nQ=
vendor: 5,404 bytes, line 4366
4366[{symbol:"H",name:"Hydrogen",atomicNumber:1},{symbol:"He",name:"Helium",atomicNumber:2},{symbol:"Li",name:"Lithium",atomicNumber:3},{symbol:"Be",name:"Beryllium",atomicNumber:4},{symbol:"B",name:"Boron",atomicNumber:5},{symbol:"C",name:"Carbon",atomicNumber:6},{symbol:"N",name:"Nitrogen",atomicNumber:7},{symbol:"O",name:"Oxygen",atomicNumber:8},{symbol:"F",name:"Fluorine",atomicNumber:9},{symbol:"Ne",name:"Neon",atomicNumber:10},{symbol:"Na",name:"Sodium",atomicNumber:11},{symbol:"Mg",name:"Magnesium",atomicNumber:12},{symbol:"Al",name:"Aluminium",atomicNumber:13},{symbol:"Si",name:"Silicon",atomicNumber:14},{symbol:"P",name:"Phosphorus",atomicNumber:15},{symbol:"S",name:"Sulfur",atomicNumber:16},{symbol:"Cl",name:"Chlorine",atomicNumber:17},{symbol:"Ar",name:"Argon",atomicNumber:18},{symbol:"K",name:"Potassium",atomicNumber:19},{symbol:"Ca",name:"Calcium",atomicNumber:20},{symbol:"Sc",name:"Scandium",atomicNumber:21},{symbol:"Ti",name:"Titanium",atomicNumber:22},{symbol:"V",name:"Vanadium",atomicNumber:23},{symbol:"Cr",name:"Chromium",atomicNumber:24},{symbol:"Mn",name:"Manganese",atomicNumber:25},{symbol:"Fe",name:"Iron",atomicNumber:26},{symbol:"Co",name:"Cobalt",atomicNumber:27},{symbol:"Ni",name:"Nickel",atomicNumber:28},{symbol:"Cu",name:"Copper",atomicNumber:29},{symbol:"Zn",name:"Zinc",atomicNumber:30},{symbol:"Ga",name:"Gallium",atomicNumber:31},{symbol:"Ge",name:"Germanium",atomicNumber:32},{symbol:"As",name:"Arsenic",atomicNumber:33},{symbol:"Se",name:"Selenium",atomicNumber:34},{symbol:"Br",name:"Bromine",atomicNumber:35},{symbol:"Kr",name:"Krypton",atomicNumber:36},{symbol:"Rb",name:"Rubidium",atomicNumber:37},{symbol:"Sr",name:"Strontium",atomicNumber:38},{symbol:"Y",name:"Yttrium",atomicNumber:39},{symbol:"Zr",name:"Zirconium",atomicNumber:40},{symbol:"Nb",name:"Niobium",atomicNumber:41},{symbol:"Mo",name:"Molybdenum",atomicNumber:42},{symbol:"Tc",name:"Technetium",atomicNumber:43},{symbol:"Ru",name:"Ruthenium",atomicNumber:44},{symbol:"Rh",name:"Rhodium",atomicNumber:45},{symbol:"Pd",name:"Palladium",atomicNumber:46},{symbol:"Ag",name:"Silver",atomicNumber:47},{symbol:"Cd",name:"Cadmium",atomicNumber:48},{symbol:"In",name:"Indium",atomicNumber:49},{symbol:"Sn",name:"Tin",atomicNumber:50},{symbol:"Sb",name:"Antimony",atomicNumber:51},{symbol:"Te",name:"Tellurium",atomicNumber:52},{symbol:"I",name:"Iodine",atomicNumber:53},{symbol:"Xe",name:"Xenon",atomicNumber:54},{symbol:"Cs",name:"Caesium",atomicNumber:55},{symbol:"Ba",name:"Barium",atomicNumber:56},{symbol:"La",name:"Lanthanum",atomicNumber:57},{symbol:"Ce",name:"Cerium",atomicNumber:58},{symbol:"Pr",name:"Praseodymium",atomicNumber:59},{symbol:"Nd",name:"Neodymium",atomicNumber:60},{symbol:"Pm",name:"Promethium",atomicNumber:61},{symbol:"Sm",name:"Samarium",atomicNumber:62},{symbol:"Eu",name:"Europium",atomicNumber:63},{symbol:"Gd",name:"Gadolinium",atomicNumber:64},{symbol:"Tb",name:"Terbium",atomicNumber:65},{symbol:"Dy",name:"Dysprosium",atomicNumber:66},{symbol:"Ho",name:"Holmium",atomicNumber:67},{symbol:"Er",name:"Erbium",atomicNumber:68},{symbol:"Tm",name:"Thulium",atomicNumber:69},{symbol:"Yb",name:"Ytterbium",atomicNumber:70},{symbol:"Lu",name:"Lutetium",atomicNumber:71},{symbol:"Hf",name:"Hafnium",atomicNumber:72},{symbol:"Ta",name:"Tantalum",atomicNumber:73},{symbol:"W",name:"Tungsten",atomicNumber:74},{symbol:"Re",name:"Rhenium",atomicNumber:75},{symbol:"Os",name:"Osmium",atomicNumber:76},{symbol:"Ir",name:"Iridium",atomicNumber:77},{symbol:"Pt",name:"Platinum",atomicNumber:78},{symbol:"Au",name:"Gold",atomicNumber:79},{symbol:"Hg",name:"Mercury",atomicNumber:80},{symbol:"Tl",name:"Thallium",atomicNumber:81},{symbol:"Pb",name:"Lead",atomicNumber:82},{symbol:"Bi",name:"Bismuth",atomicNumber:83},{symbol:"Po",name:"Polonium",atomicNumber:84},{symbol:"At",name:"Astatine",atomicNumber:85},{symbol:"Rn",name:"Radon",atomicNumber:86},{symbol:"Fr",name:"Francium",atomicNumber:87},{symbol:"Ra",name:"Radium",atomicNumber:88},{symbol:"Ac",name:"Actinium",atomicNumber:89},{symbol:"Th",name:"Thorium",atomicNumber:90},{symbol:"Pa",name:"Protactinium",atomicNumber:91},{symbol:"U",name:"Uranium",atomicNumber:92},{symbol:"Np",name:"Neptunium",atomicNumber:93},{symbol:"Pu",name:"Plutonium",atomicNumber:94},{symbol:"Am",name:"Americium",atomicNumber:95},{symbol:"Cm",name:"Curium",atomicNumber:96},{symbol:"Bk",name:"Berkelium",atomicNumber:97},{symbol:"Cf",name:"Californium",atomicNumber:98},{symbol:"Es",name:"Einsteinium",atomicNumber:99},{symbol:"Fm",name:"Fermium",atomicNumber:100},{symbol:"Md",name:"Mendelevium",atomicNumber:101},{symbol:"No",name:"Nobelium",atomicNumber:102},{symbol:"Lr",name:"Lawrencium",atomicNumber:103},{symbol:"Rf",name:"Rutherfordium",atomicNumber:104},{symbol:"Db",name:"Dubnium",atomicNumber:105},{symbol:"Sg",name:"Seaborgium",atomicNumber:106},{symbol:"Bh",name:"Bohrium",atomicNumber:107},{symbol:"Hs",name:"Hassium",atomicNumber:108},{symbol:"Mt",name:"Meitnerium",atomicNumber:109},{symbol:"Ds",name:"Darmstadtium",atomicNumber:110},{symbol:"Rg",name:"Roentgenium",atomicNumber:111},{symbol:"Cn",name:"Copernicium",atomicNumber:112},{symbol:"Nh",name:"Nihonium",atomicNumber:113},{symbol:"Fl",name:"Flerovium",atomicNumber:114},{symbol:"Mc",name:"Moscovium",atomicNumber:115},{symbol:"Lv",name:"Livermorium",atomicNumber:116},{symbol:"Ts",name:"Tennessine",atomicNumber:117},{symbol:"Og",name:"Oganesson",atomicNumber:118}]
4366,rQ=[{name:"meter",symbol:"m"},{name:"second",symbol:"s"},{name:"mole",symbol:"mol"},{name:"ampere",symbol:"A"},{name:"kelvin",symbol:"K"},{name:"candela",symbol:"cd"},{name:"kilogram",symbol:"kg"},{name:"radian",symbol:"rad"},{name:"hertz",symbol:"Hz"},{name:"newton",symbol:"N"},{name:"pascal",symbol:"Pa"},{name:"joule",symbol:"J"},{name:"watt",symbol:"W"},{name:"coulomb",symbol:"C"},{name:"volt",symbol:"V"},{name:"ohm",symbol:"Ω"},{name:"tesla",symbol:"T"},{name:"degree Celsius",symbol:"°C"},{name:"lumen",symbol:"lm"},{name:"becquerel",symbol:"Bq"},{name:"gray",symbol:"Gy"},{name:"sievert",symbol:"Sv"},{name:"steradian",symbol:"sr"},{name:"farad",symbol:"F"},{name:"siemens",symbol:"S"},{name:"weber",symbol:"Wb"},{name:"henry",symbol:"H"},{name:"lux",symbol:"lx"},{name:"katal",symbol:"kat"}],aQ={chemical_element:nQ,unit:rQ},iQ=aQ,sQ=["ants","bats","bears","bees","birds","buffalo","cats","chickens","cattle","dogs","dolphins","ducks","elephants","fishes","foxes","frogs","geese","goats","horses","kangaroos","lions","monkeys","owls","oxen","penguins","people","pigs","rabbits","sheep","tigers","whales","wolves","zebras","banshees","crows","black cats","chimeras","ghosts","conspirators","dragons","dwarves","elves","enchanters","exorcists","sons","foes","giants","gnomes","goblins","gooses","griffins","lycanthropes","nemesis","ogres","oracles","prophets","sorcerors","spiders","spirits","vampires","warlocks","vixens","werewolves","witches","worshipers","zombies","druids"],oQ=["{{location.state}} {{team.creature}}"],lQ={creature:sQ,name:oQ},cQ=lQ,uQ=["Adventure Road Bicycle","BMX Bicycle","City Bicycle","Cruiser Bicycle","Cyclocross Bicycle","Dual-Sport Bicycle","Fitness Bicycle","Flat-Foot Comfort Bicycle","Folding Bicycle","Hybrid Bicycle","Mountain Bicycle","Recumbent Bicycle","Road Bicycle","Tandem Bicycle","Touring Bicycle","Track/Fixed-Gear Bicycle","Triathlon/Time Trial Bicycle","Tricycle"],dQ=["Diesel","Electric","Gasoline","Hybrid"],hQ=["Aston Martin","Audi","BMW","BYD","Bentley","Bugatti","Cadillac","Chevrolet","Chrysler","Citroën","Dodge","Ferrari","Fiat","Ford","Honda","Hyundai","Jaguar","Jeep","Kia","Lamborghini","Land Rover","MG","Mahindra & Mahindra","Maruti","Maserati","Mazda","Mercedes Benz","Mini","Mitsubishi","NIO","Nissan","Peugeot","Polestar","Porsche","Renault","Rivian","Rolls Royce","Skoda","Smart","Subaru","Suzuki","Tata","Tesla","Toyota","Vauxhall","Volkswagen","Volvo"],mQ=["1","2","911","A4","A8","ATS","Accord","Alpine","Altima","Aventador","Beetle","CTS","CX-9","Camaro","Camry","Challenger","Charger","Civic","Colorado","Corvette","Countach","Cruze","Durango","El Camino","Element","Escalade","Expedition","Explorer","F-150","Fiesta","Focus","Fortwo","Golf","Grand Caravan","Grand Cherokee","Impala","Jetta","Land Cruiser","LeBaron","Malibu","Mercielago","Model 3","Model S","Model T","Model X","Model Y","Mustang","PT Cruiser","Prius","Ranchero","Roadster","Sentra","Silverado","Spyder","Taurus","V90","Volt","Wrangler","XC90","XTS"],fQ=["Cargo Van","Convertible","Coupe","Crew Cab Pickup","Extended Cab Pickup","Hatchback","Minivan","Passenger Van","SUV","Sedan","Wagon"],pQ={bicycle_type:uQ,fuel:dQ,manufacturer:hQ,model:mQ,type:fQ},gQ=pQ,xQ=["abandoned","able","acceptable","acclaimed","accomplished","accurate","aching","acidic","actual","admired","adolescent","advanced","affectionate","afraid","aged","aggravating","aggressive","agile","agitated","agreeable","ajar","alarmed","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","angelic","anguished","animated","annual","another","antique","any","apprehensive","appropriate","apt","arid","artistic","ashamed","assured","astonishing","athletic","austere","authentic","authorized","avaricious","average","aware","awesome","awful","babyish","back","bad","baggy","bare","basic","beloved","beneficial","best","better","big","biodegradable","bitter","black","black-and-white","blank","blaring","bleak","blind","blond","blue","blushing","bogus","boiling","bony","boring","bossy","both","bouncy","bowed","brave","breakable","bright","brilliant","brisk","broken","brown","bruised","bulky","burde
4366nsome","burly","bustling","busy","buttery","buzzing","calculating","candid","carefree","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","chilly","chubby","circular","classic","clean","clear","clear-cut","close","closed","cloudy","clueless","clumsy","cluttered","coarse","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complicated","concerned","concrete","confused","considerate","content","cool","cooperative","coordinated","corny","corrupt","courageous","courteous","crafty","crazy","creamy","creative","criminal","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cumbersome","curly","cute","damaged","damp","dapper","dark","darling","dazzling","dead","deadly","deafening","dearest","decent","decisive","deep","defenseless","defensive","deficient","definite","definitive","delectable","delicious","delirious","dense","dental","dependable","dependent","descriptive","deserted","determined","devoted","different","difficult","digital","diligent","dim","direct","dirty","discrete","disloyal","dismal","distant","distinct","distorted","doting","downright","drab","dramatic","dreary","dual","dull","dutiful","each","early","earnest","easy","ecstatic","edible","educated","elastic","elderly","electric","elegant","elementary","elliptical","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enraged","entire","equatorial","essential","esteemed","ethical","everlasting","every","evil","exalted","excellent","excitable","excited","exhausted","exotic","expensive","experienced","expert","extra-large","extroverted","failing","faint","fair","fake","familiar","fantastic","far","far-flung","far-off","faraway","fat","fatal","fatherly","favorable","favorite","fearless","feline","filthy","fine","finished","firm","first","firsthand","fixed","flashy","flawed","flawless","flickering","flimsy","flowery","fluffy","flustered","focused","fond","foolhardy","foolish","forceful","formal","forsaken","fortunate","fragrant","frail","frank","free","french","frequent","friendly","frightened","frilly","frivolous","frizzy","front","frozen","frugal","fruitful","functional","funny","fussy","fuzzy","gaseous","general","gentle","genuine","gifted","gigantic","giving","glaring","glass","gleaming","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grandiose","granular","grave","gray","great","greedy","grim","grimy","gripping","grizzled","grouchy","grounded","growing","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","handsome","handy","happy","happy-go-lucky","hard-to-find","harmful","hasty","hateful","haunting","heartfelt","heavenly","heavy","hefty","helpful","helpless","hidden","hoarse","hollow","homely","honorable","honored","hopeful","hospitable","hot","huge","humble","humiliating","hungry","hurtful","husky","icy","ideal","idealistic","idolized","ignorant","ill","ill-fated","illiterate","illustrious","imaginary","imaginative","immaculate","immediate","immense","impartial","impassioned","impeccable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incomplete","inconsequential","indelible","indolent","inexperienced","infamous","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","intelligent","intent","interesting","internal","international","intrepid","ironclad","irresponsible","jagged","jam-packed","jaunty","jealous","jittery","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","juvenile","kaleidoscopic","key","knotty","knowledgeable","known","kooky","kosher","lanky","last","lasting","late","lavish","lawful","lazy","leading","lean","left","legal","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","lone","lonely","long","long-term","lost","lovable","lovely","low","lucky","lumbering","lumpy","lustrous","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","massive","mature","meager","mealy","mean","measly","meaty","mediocre","medium","memorable","menacing","merry","messy","metallic","mild","milky","mindless","minor","minty","miserable","miserly","misguided","mixed","moist","monstrous","monthly","monumental","moral","motionless","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","narrow","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","normal","noted","noteworthy","noxious","numb","nutritious","obedient","oblong","obvious","odd","oddball","official","oily","old","old-fashioned","only","optimal","optimistic","orange","orderly","ordinary","ornate","ornery","other","our","outgoing","outlandish","outlying","outrageous","outstanding","oval","overcooked","overdue","palatable","pale","paltry","parallel","parched","partial","passionate","pastel","peaceful","peppery","perfumed","perky","personal","pertinent","pessimistic","petty","phony","physical","pink","pitiful","plain","pleasant","pleased","pleasing","plump","pointed","pointless","polished","polite","political","poor","portly","posh","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","pricey","prickly","primary","prime","private","probable","productive","profitable","profuse","proper","proud","prudent","punctual","puny","pure","purple","pushy","putrid","puzzled","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quixotic","radiant","ragged","rapid","rare","raw","realistic","reasonable","recent","reckless","rectangular","red","reflecting","regal","regular","remarkable","remorseful","repentant","respectful","responsible","rewarding","rich","right","rigid","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","ruddy","rundown","runny","rural","rusty","sad","salty","same","sandy","sarcastic","sardonic","scaly","scared","scary","scented","scientific","scornful","scratchy","second","second-hand","secondary","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serpentine","severe","shabby","shadowy","shady","shallow","shameful","shameless","shimmering","shiny","shocked","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silver","similar","simple","simplistic","sinful","sizzling","skeletal","sleepy","slight","slimy","slow","slushy","
4366small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","somber","some","sophisticated","sore","sorrowful","soulful","soupy","sour","spanish","sparkling","sparse","specific","speedy","spherical","spiffy","spirited","spiteful","splendid","spotless","square","squeaky","squiggly","stable","staid","stained","stale","standard","stark","steel","steep","sticky","stiff","stingy","stormy","straight","strange","strict","strident","striking","strong","stunning","stupendous","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","svelte","sweet","swift","talkative","tall","tame","tangible","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","that","these","thick","thin","thorny","thorough","those","thrifty","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","tragic","trained","triangular","tricky","trim","trivial","troubled","true","trusting","trustworthy","trusty","turbulent","twin","ugly","ultimate","unaware","uncomfortable","uncommon","unconscious","understated","uneven","unfinished","unfit","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","unkempt","unknown","unlawful","unlined","unlucky","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwritten","upbeat","upright","upset","urban","usable","useless","utilized","utter","vague","vain","valuable","variable","vast","velvety","vengeful","vibrant","victorious","violent","vivacious","vivid","voluminous","warlike","warm","warmhearted","warped","wasteful","waterlogged","watery","wavy","wealthy","weary","webbed","wee","weekly","weighty","weird","well-documented","well-groomed","well-lit","well-made","well-off","well-to-do","well-worn","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","willing","wilted","winding","windy","winged","wise","witty","wobbly","woeful","wonderful","wordy","worldly","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty"],vQ=["abnormally","absentmindedly","accidentally","acidly","actually","adventurously","afterwards","almost","always","angrily","annually","anxiously","arrogantly","awkwardly","badly","bashfully","beautifully","bitterly","bleakly","blindly","blissfully","boastfully","boldly","bravely","briefly","brightly","briskly","broadly","busily","calmly","carefully","carelessly","cautiously","certainly","cheerfully","clearly","cleverly","closely","co
4366axingly","colorfully","commonly","continually","coolly","correctly","courageously","crossly","cruelly","curiously","daily","daintily","dearly","deceivingly","deeply","defiantly","deliberately","delightfully","diligently","dimly","doubtfully","dreamily","easily","elegantly","energetically","enormously","enthusiastically","equally","especially","even","evenly","eventually","exactly","excitedly","extremely","fairly","faithfully","famously","far","fast","fatally","ferociously","fervently","fiercely","fondly","foolishly","fortunately","frankly","frantically","freely","frenetically","frightfully","fully","furiously","generally","generously","gently","gladly","gleefully","gracefully","gratefully","greatly","greedily","happily","hastily","healthily","heavily","helpfully","helplessly","highly","honestly","hopelessly","hourly","hungrily","immediately","innocently","inquisitively","instantly","intensely","intently","interestingly","inwardly","irritably","jaggedly","jealously","joshingly","jovially","joyfully","joyously","jubilantly","judgementally","justly","keenly","kiddingly","kindheartedly","kindly","kissingly","knavishly","knottily","knowingly","knowledgeably","kookily","lazily","less","lightly","likely","limply","lively","loftily","longingly","loosely","loudly","lovingly","loyally","madly","majestically","meaningfully","mechanically","merrily","miserably","mockingly","monthly","more","mortally","mostly","mysteriously","naturally","nearly","neatly","needily","nervously","never","nicely","noisily","not","obediently","obnoxiously","oddly","offensively","officially","often","only","openly","optimistically","overconfidently","owlishly","painfully","partially","patiently","perfectly","physically","playfully","politely","poorly","positively","potentially","powerfully","promptly","properly","punctually","quaintly","quarrelsomely","queasily","questionably","questioningly","quicker","quickly","quietly","quirkily","quizzically","rapidly","rarely","readily","really","reassuringly","recklessly","regularly","reluctantly","repeatedly","reproachfully","restfully","righteously","rightfully","rigidly","roughly","rudely","sadly","safely","scarcely","scarily","searchingly","sedately","seemingly","seldom","selfishly","separately","seriously","shakily","sharply","sheepishly","shrilly","shyly","silently","sleepily","slowly","smoothly","softly","solemnly","solidly","sometimes","soon","speedily","stealthily","sternly","strictly","successfully","suddenly","surprisingly","suspiciously","sweetly","swiftly","sympathetically","tenderly","tensely","terribly","thankfully","thoroughly","thoughtfully","tightly","tomorrow","too","tremendously","triumphantly","truly","truthfully","ultimately","unabashedly","unaccountably","unbearably","unethically","unexpectedly","unfortunately","unimpressively","unnaturally","unnecessarily","upbeat","upliftingly","upright","upside-down","upward","upwardly","urgently","usefully","uselessly","usually","utterly","vacantly","vaguely","vainly","valiantly","vastly","verbally","very","viciously","victoriously","violently","vivaciously","voluntarily","warmly","weakly","wearily","well","wetly","wholly","wildly","willfully","wisely","woefully","wonderfully","worriedly","wrongly","yawningly","yearly","yearningly","yesterday","yieldingly","youthfully"],yQ=["after","although","and","as","because","before","but","consequently","even","finally","for","furthermore","hence","how","however","if","inasmuch","incidentally","indeed","instead","lest","likewise","meanwhile","nor","now","once","or","provided","since","so","supposing","than","that","though","till","unless","until","what","when","whenever","where","whereas","wherever","whether","which","while","who","whoever","whose","why","yet"],bQ=["yuck","oh","phooey","blah","boo","whoa","yowza","huzzah","boohoo","fooey","geez","pfft","ew","ah","yum","brr","hm","yahoo","aha","woot","drat","gah","meh","psst","aw","ugh","yippee","eek","gee","bah","gadzooks","duh","ha","mmm","ouch","phew","ack","uh-huh","gosh","hmph","pish","zowie","er","ick","oof","um"],wQ=["CD","SUV","abacus","academics","accelerator","accompanist","account","accountability","acquaintance","ad","adaptation","address","adrenalin","adult","advancement","advertisement","adviser","affect","affiliate","aftermath","agreement","airbus","aircraft","airline","airmail","airman","airport","alb","alert","allegation","alliance","alligator","allocation","almighty","amendment","amnesty","analogy","angle","annual","antelope","anticodon","apparatus","appliance","approach","apricot","arca
4366de","archaeology","armchair","armoire","asset","assist","atrium","attraction","availability","avalanche","awareness","babushka","backbone","backburn","bakeware","bandwidth","bar","barge","baritone","barracks","baseboard","basket","bathhouse","bathrobe","battle","begonia","behest","bell","bench","bend","beret","best-seller","bid","bidet","bin","birdbath","birdcage","birth","blight","blossom","blowgun","bob","bog","bonfire","bonnet","bookcase","bookend","boulevard","bourgeoisie","bowler","bowling","boyfriend","brace","bracelet","bran","breastplate","brief","brochure","brook","brush","bug","bump","bungalow","cafe","cake","calculus","cannon","cantaloupe","cap","cappelletti","captain","caption","carboxyl","cardboard","carnival","case","casement","cash","casket","cassava","castanet","catalyst","cauliflower","cellar","celsius","cemetery","ceramic","ceramics","certification","chainstay","chairperson","challenge","championship","chap","chapel","character","characterization","charlatan","charm","chasuble","cheese","cheetah","chiffonier","chops","chow","cinder","cinema","circumference","citizen","clamp","clavicle","cleaner","climb","co-producer","coal","coast","cod","coil","coin","coliseum","collaboration","collectivization","colon","colonialism","comestible","commercial","commodity","community","comparison","completion","complication","compromise","concentration","configuration","confusion","conservation","conservative","consistency","contractor","contrail","convection","conversation","cook","coordination","cop-out","cope","cork","cornet","corporation","corral","cosset","costume","couch","council","councilman","countess","courtroom","cow","creator","creature","crest","cricket","crocodile","cross-contamination","cruelty","cuckoo","curl","custody","custom","cutlet","cutover","cycle","daddy","dandelion","dash","daughter","dead","decision","deck","declaration","decongestant","decryption","deduction","deed","deer","defendant","density","department","dependency","deployment","depot","derby","descendant","descent","design","designation","desk","detective","devastation","developing","developmental","devil","diagram","digestive","digit","dime","director","disadvantage","disappointment","disclosure","disconnection","discourse","dish","disk","disposer","distinction","diver","diversity","dividend","divine","doing","doorpost","doubter","draft","draw","dream","dredger","dress","drive","drug","duffel","dulcimer","dusk","duster","dwell","e-mail","earth","ecliptic","ectoderm","edge","editor","effector","eggplant","electronics","elevation","elevator","elver","embarrassment","embossing","emergent","encouragement","entry","epic","equal","essence","eternity","ethyl","euphonium","event","exasperation","excess","executor","exhaust","expansion","expense","experience","exploration","extension","extent","exterior","eyebrow","eyeliner","farm","farmer","fat","fax","feather","fedora","fellow","fen","fencing","ferret","festival","fibre","filter","final","finding","finer","finger","fireplace","fisherman","fishery","fit","flame","flat","fledgling","flight","flint","flood","flu","fog","fold","folklore","follower","following","foodstuffs","footrest","forage","forager","forgery","fork","formamide","formation","formula","fort","fowl","fraudster","freckle","freezing","freight","fuel","fun","fund","fundraising","futon","gallery","galoshes","gastropod","gazebo","gerbil","ghost","giant","gift","giggle","glider","gloom","goat","godfather","godparent","going","goodwill","governance","government","gown","gradient","graffiti","grandpa","grandson","granny","grass","gray","gripper","grouper","guacamole","guard","guidance","guide","gym","gymnast","habit","haircut","halt","hamburger","hammock","handful","handle","handover","harp","haversack","hawk","heartache","heartbeat","heating","hello","help","hepatitis","heroine","hexagon","hierarchy","hippodrome","honesty","hoof","hope","horde","hornet","horst","hose","hospitalization","hovel","hovercraft","hubris","humidity","humor","hundred","hunger","hunt","husband","hutch","hydrant","hydrocarbon","hydrolyse","hydrolyze","hyena","hygienic","hyphenation","ice-cream","icebreaker","igloo","ignorance","illusion","impact","import","importance","impostor","in-joke","incandescence","independence","individual","information","injunction","innovation","insolence","inspection","instance","institute","instruction","instructor","integer","intellect","
4366intent","interchange","interior","intervention","interviewer","invite","iridescence","issue","jacket","jazz","jellyfish","jet","jogging","joy","juggernaut","jump","jungle","junior","jury","kettledrum","kick","kielbasa","kinase","king","kiss","kit","knickers","knight","knitting","knuckle","label","labourer","lace","lady","lamp","language","larva","lashes","laughter","lava","lawmaker","lay","leading","league","legend","legging","legislature","lender","license","lid","lieu","lifestyle","lift","linseed","litter","loaf","lobster","longboat","lotion","lounge","louse","lox","loyalty","luck","lyre","maestro","mainstream","maintainer","majority","makeover","making","mallard","management","manner","mantua","marathon","march","marimba","marketplace","marksman","markup","marten","massage","masterpiece","mathematics","meadow","meal","meander","meatloaf","mechanic","median","membership","mentor","merit","metabolite","metal","middle","midwife","milestone","millet","minion","minister","minor","minority","mixture","mobility","molasses","mom","moment","monasticism","monocle","monster","morbidity","morning","mortise","mountain","mouser","mousse","mozzarella","muscat","mythology","napkin","necklace","nectarine","negotiation","nephew","nerve","netsuke","newsletter","newsprint","newsstand","nightlife","noon","nougat","nucleotidase","nudge","numeracy","numeric","nun","obedience","obesity","object","obligation","ocelot","octave","offset","oil","omelet","onset","opera","operating","optimal","orchid","order","ostrich","other","outlaw","outrun","outset","overcoat","overheard","overload","ownership","pacemaker","packaging","paintwork","palate","pants","pantyhose","papa","parade","parsnip","partridge","passport","pasta","patroller","pear","pearl","pecan","pendant","peninsula","pension","peony","pepper","perfection","permafrost","perp","petal","petticoat","pharmacopoeia","phrase","pick","piglet","pigpen","pigsty","pile","pillbox","pillow","pilot","pine","pinstripe","place","plain","planula","plastic","platter","platypus","pleasure","pliers","plugin","plumber","pneumonia","pocket-watch","poetry","polarisation","polyester","pomelo","pop","poppy","popularity","populist","porter","possession","postbox","precedent","premeditation","premier","premise","premium","pressure","presume","priesthood","printer","privilege","procurement","produce","programme","prohibition","promise","pronoun","providence","provider","provision","publication","publicity","pulse","punctuation","pupil","puppet","puritan","quart","quinoa","quit","railway","range","rationale","ravioli","rawhide","reach","reasoning","reboot","receptor","recommendation","reconsideration","recovery","redesign","relative","release","remark","reorganisation","repeat","replacement","reporter","representation","republican","request","requirement","reservation","resolve","resource","responsibility","restaurant","retention","retrospectivity","reward","ribbon","rim","riser","roadway","role","rosemary","roundabout","rubric","ruin","rule","runway","rust","safe","sailor","saloon","sand","sandbar","sanity","sarong","sauerkraut","saw","scaffold","scale","scarification","scenario","schedule","schnitzel","scholarship","scorn","scorpion","scout","scrap","scratch","seafood","seagull","seal","season","secrecy","secret","section","sediment","self-confidence","sermon","sesame","settler","shadowbox","shark","shipper","shore","shoulder","sideboard","siege","sightseeing","signature","silk","simple","singing","skean","skeleton","skyline","skyscraper","slide","slime","slipper","smog","smoke","sock","soliloquy","solution","solvency","someplace","sonar","sonata","sonnet","soup","soybean","space","spear","spirit","spork","sport","spring","sprinkles","squid","stall","starboard","statue","status","stay","steak","steeple","step","step-mother","sticker","stir-fry","stitcher","stock","stool","story","strait","stranger","strategy","straw","stump","subexpression","submitter","subsidy","substitution","suitcase","summary","summer","sunbeam","sundae","supplier","surface","sushi","suspension","sustenance","swanling","swath","sweatshop","swim","swine","swing","switch","switchboard","swordfish","synergy","t-shirt","tabletop","tackle","tail","tapioca","taro","tarragon","taxicab","teammate","technician","technologist","tectonics","tenant","tenement","tennis","tentacle","teriyaki","term","testimonial","testing","thigh","thongs","thorn","thread","thunderbolt","thyme","tinderbox","toaster","tomatillo","tomb","tomography","tool","tooth","toothbrush","toothpick","topsail","traditionalism","traffic","translation","transom","transparency","trash","travel","tray","trench","tribe","tributary","trick","trolley","tuba","tuber","tune-up","turret","tusk","tuxedo","typeface","typewriter","unblinking","underneath","underpants","understanding","unibody","unique","unit","utilization","valentine","validity","valley","valuable","vanadyl","vein","velocity","venom","version","verve","vestment","veto","viability","vibraphone","vibration","vicinity","video","violin","vision","vista","vol","volleyball","wafer","waist","wallaby","warming","wasabi","waterspout","wear","wedding","whack","whale","wheel","widow","wilderness","willow","window","wombat","word","worth","wriggler","yak","yarmulke","yeast","yin","yogurt","zebra","zen"],SQ=["a","abaft","aboard","about","above","absent","across","afore","after","against","along","alongside","amid","am
4366idst","among","amongst","an","anenst","anti","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","concerning","considering","despite","down","during","except","excepting","excluding","failing","following","for","forenenst","from","given","in","including","inside","into","lest","like","mid","midst","minus","modulo","near","next","notwithstanding","of","off","on","onto","opposite","out","outside","over","pace","past","per","plus","pro","qua","regarding","round","sans","save","since","than","the","through","throughout","till","times","to","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","via","vice","with","within","without","worth"],FQ=["abnegate","abscond","abseil","absolve","accentuate","accept","access","accessorise","accompany","account","accredit","achieve","acknowledge","acquire","adjourn","adjudge","admonish","adumbrate","advocate","afford","airbrush","ameliorate","amend","amount","anaesthetise","analyse","anesthetize","anneal","annex","antagonize","ape","apologise","apostrophize","appertain","appreciate","appropriate","approximate","arbitrate","archive","arraign","arrange","ascertain","ascribe","assail","atomize","attend","attest","attribute","augment","avow","axe","baa","banish","bank","baptise","battle","beard","beep","behold","belabor","bemuse","besmirch","bestride","better","bewail","bicycle","bide","bind","biodegrade","blacken","blaspheme","bleach","blend","blink","bliss","bloom","bludgeon","bobble","boggle","bolster","book","boom","bootleg","border","bore","boss","braid","brand","brandish","break","breed","broadcast","broadside","brood","browse","buck","burgeon","bus","butter","buzzing","camouflage","cannibalise","canter","cap","capitalise","capitalize","capsize","card","carouse","carp","carpool","catalog","catalyze","catch","categorise","cease","celebrate","censor","certify","char","charter","chase","chatter","chime","chip","christen","chromakey","chunder","chunter","cinch","circle","circulate","circumnavigate","clamor","clamour","claw","cleave","clinch","clinking","clone","clonk","coagulate","coexist","coincide","collaborate","colligate","colorize","colour","comb","come","commandeer","commemorate","communicate","compete","conceal","conceptualize","conclude","concrete","condense","cone","confide","confirm","confiscate","confound","confute","congregate","conjecture","connect","consign","construe","contradict","contrast","contravene","controvert","convalesce","converse","convince","convoke","coop","cop","corner","covenant","cow","crackle","cram","crank","creak","creaking","cripple","croon","cross","crumble","crystallize","culminate","culture","curry","curse","customise","cycle","dally","dampen","darn","debit","debut","decide","decode","decouple","decriminalize","deduce","deduct","deflate","deflect","deform","defrag","degenerate","degrease","delete","delight","deliquesce","demob","demobilise","democratize","demonstrate","denitrify","deny","depart","depend","deplore","deploy","deprave","depute","dereference","describe","desecrate","deselect","destock","detain","develop","devise","dial","dicker","digitize","dilate","disapprove","disarm","disbar","discontinue","disgorge","dishearten","dishonor","disinherit","dislocate","dispense","display","dispose","disrespect","dissemble","ditch","divert","dock","doodle","downchange","downshift","dowse","draft","drag","drain","dramatize","drowse","drum","dwell","economise","edge","efface","egg","eke","electrify","embalm","embed","embody","emboss","emerge","emphasise","emphasize","emulsify","encode","endow","enfold","engage","engender","enhance","enlist","enrage","enrich","enroll","entice","entomb","entrench","entwine","equate","essay","etch","eulogise","even","evince","exacerbate","exaggerate","exalt","exempt","exonerate","expatiate","explode","expostulate","extract","extricate","eyeglasses","fabricate","facilitate","factorise","factorize","fail","fall","familiarize","fashion","father","fathom","fax","federate","feminize","fence","fess","fictionalize","fiddle","fidget","fill","flash","fleck","flight","floodlight","floss","fluctuate","fluff","fly","focalise","foot","forearm","forecast","foretell","forgather","forgo","fork","form","forswear","founder","fraternise","fray","frizz","fumigate","function","furlough","fuss","gad","gallivant","galvanize","gape","garage","garrote","gasp","gestate","give","glimmer","glisten","gloat","gloss","glow","gnash","gnaw","goose","govern","grade","graduate","graft","grok","guest","guilt","gulp","gum","gurn","gust","gut","guzzle","ham","harangue","harvest","hassle","haul","haze","headline","hearten","heighten","highlight","hoick","hold","hole","hollow","holster","home","homeschool","hoot","horn","horse","hotfoot","house","hover","howl","huddle","huff","hunger","hunt","husk","hype","hypothesise","hypothesize","idle","ignite","imagineer","impact","impanel","implode","incinerate","incline","inculcate","industrialize","ingratiate","inhibit","inject","innovate","inscribe","insert","insist","inspect","institute","institutionalize","intend","intermarry","intermesh","intermix","internalise","internalize","internationalize","intrigue","inure","inveigle","inventory","investigate","irk","iterate","jaywalk","jell","jeopardise","jiggle","jive","joint","jot","jut","keel","knife","knit","know","kowtow","lack","lampoon","large","leap","lecture","legitimize","lend","libel","liberalize","license","ligate","list","lobotomise","lock","log","loose","low","lowball","machine","magnetize","major","make","malfunction","manage","manipulate","maroon","masculinize","mash","mask","masquerade","massage","masticate","materialise","matter","maul","memorise","merge","mesh","metabolise","microblog","microchip","micromanage","militate","mill","minister","minor","misappropriate","miscalculate","misfire","misjudge","miskey","mismatch","mispronounce","misread","misreport","misspend","mob","mobilise","mobilize","moisten","mooch","moor","moralise","mortar","mosh","mothball","motivate","motor","mould","mount","muddy","mummify","mutate","mystify","nab","narrate","narrowcast","nasalise","nauseate","navigate","neaten","neck","neglect","norm","notarize","object","obscure","observe","obsess","obstruct","obtrude","offend","offset","option","orchestrate","orient","orientate","outbid","outdo","outfit","outflank","outfox","outnumber","outrank","outrun","outsource","overburden","overcharge","overcook","overdub","overfeed","overload","overplay","overproduce","overreact","override","overspend","overstay","overtrain","overvalue","overwork","own","oxidise","oxidize","oxygenate","pace","pack","pale","pant","paralyse","parody","part","pause","pave","penalise","persecute","personalise","perspire","pertain","peter","pike","pillory","pinion","pip","pity","pivot","pixellate","plagiarise","plait","plan","please","pluck","ponder","popularize","portray","prance","preclude","preheat","prejudge","preregister","presell","preside","pretend","print","prioritize","probate","probe","proceed","procrastinate","profane","progress","proliferate","proofread","propound","proselytise","provision","pry","publicize","puff","pull","pulp","pulverize","purse","put","putrefy","quadruple","quaff","quantify","quarrel","quash","quaver","question","quiet","quintuple","quip","quit","rag","rally","ramp","randomize","rationalise","rationalize","ravage","ravel","react","readies","readjust","readmit","ready","reapply","rear","reassemble","rebel","reboot","reborn","rebound","rebuff","rebuild","rebuke","recede","reckon","reclassify","recompense","reconstitute","record","recount","redact","redevelop","redound","redraw","redress","reel","refer","reference","refine","reflate","refute","regulate","reiterate","rejigger","rejoin","rekindle","relaunch","relieve","remand","remark","reopen","reorient","replicate","repossess","represent","reprimand","reproach","reprove","repurpose","requite","reschedule","resort","respray","restructure","retool","retract","revere","revitalise","revoke","reword","rewrite","ride","ridge","rim","ring","rise","rival","roger","rosin","rot","rout","row","rue","rule","safeguard","sashay","sate","satirise","satirize","satisfy","saturate","savour","scale","scamper","scar","scare","scarper","scent","schematise","scheme","schlep","scoff","scoop","scope","scotch","scowl","scrabble","scram","scramble","scrape","screw","scruple","scrutinise","scuffle","scuttle","search","secularize","see","segregate","sell","sense","sensitize","sequester","serenade","serialize","serve","service","settle","sew","shaft","sham","shampoo","shanghai","shear","sheathe","shell","shinny","shirk","shoot","shoulder","shout","shovel","showboat","shred","shrill","shudder","shush","sidetrack","sign","silt","sin","singe","sit","sizzle","skateboard","ski","slake","slap","slather","sleet","slink","slip","slope","slump","smarten","smuggle","snack","sneak","
4366sniff","snoop","snow","snowplow","snuggle","soap","solace","solder","solicit","source","spark","spattering","spectacles","spectate","spellcheck","spew","spice","spirit","splash","splay","split","splosh","splurge","spook","square","squirm","stabilise","stable","stack","stage","stake","starch","state","statement","stiffen","stigmatize","sting","stint","stoop","store","storyboard","stratify","structure","stuff","stunt","substantiate","subtract","suckle","suffice","suffocate","summarise","sun","sunbathe","sunder","sup","surge","surprise","swat","swathe","sway","swear","swelter","swerve","swill","swing","symbolise","synthesise","syringe","table","tabulate","tag","tame","tank","tankful","tarry","task","taxicab","team","telescope","tenant","terraform","terrorise","testify","think","throbbing","thump","tighten","toady","toe","tough","tousle","traduce","train","transcend","transplant","trash","treasure","treble","trek","trial","tromp","trouser","trust","tune","tut","twine","twist","typify","unbalance","uncork","uncover","underachieve","undergo","underplay","unearth","unfreeze","unfurl","unlearn","unscramble","unzip","uproot","upsell","usher","vacation","vamoose","vanish","vary","veg","venture","verify","vet","veto","volunteer","vulgarise","waft","wallop","waltz","warp","wash","waver","weary","weatherize","wedge","weep","weight","welcome","westernise","westernize","while","whine","whisper","whistle","whitewash","whup","wilt","wing","wire","wisecrack","wolf","wound","wring","writ","yak","yawn","yearn","yuppify"],CQ={adjective:xQ,adverb:vQ,conjunction:yQ,interjection:bQ,noun:wQ,preposition:SQ,verb:FQ},_Q=CQ,EQ={airline:cJ,animal:kJ,app:RJ,book:UJ,cell_phone:HJ,color:$J,commerce:XJ,company:oX,database:uX,date:fX,finance:AX,food:UX,hacker:KX,internet:ZX,location:vZ,lorem:wZ,metadata:FZ,music:NZ,person:YZ,phone_number:tQ,science:iQ,team:cQ,vehicle:gQ,word:_Q},kQ=EQ,Un=class extends Error{};function AQ(t){let e=Object.getPrototypeOf(t);do{for(let n of Object.getOwnPropertyNames(e))typeof t[n]=="function"&&n!=="constructor"&&(t[n]=t[n].bind(t));e=Object.getPrototypeOf(e)}while(e!==Object.prototype)}var Au=class{constructor(e){this.faker=e,AQ(this)}},Yr=class extends Au{constructor(t){super(t),this.faker=t}},p4=(t=>(t.Narrowbody="narrowbody",t.Regional="regional",t.Widebody="widebody",t))(p4||{}),NQ=["0","1","2","3","4","5","6","7","8","9"],TQ=["0","O","1","I","L"],MQ={regional:20,narrowbody:35,widebody:60},RQ={regional:["A","B","C","D"],narrowbody:["A","B","C","D","E","F"],widebody:["A","B","C","D","E","F","G","H","J","K"]},DQ=class extends Yr{airport(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airport)}airline(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airline)}airplane(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airplane)}recordLocator(e={}){let{allowNumerics:n=!1,allowVisuallySimilarCharacters:a=!1}=e,i=[];return n||i.push(...NQ),a||i.push(...TQ),this.faker.string.alphanumeric({length:6,casing:"upper",exclude:i})}seat(e={}){let{aircraftType:n="narrowbody"}=e,a=MQ[n],i=RQ[n],s=this.faker.number.int({min:1,max:a}),o=this.faker.helpers.arrayElement(i);return`${s}${o}`}aircraftType(){return this.faker.helpers.enumValue(p4)}flightNumber(e={}){let{length:n={min:1,max:4},addLeadingZeros:a=!1}=e,i=this.faker.string.numeric({length:n,allowLeadingZeros:!1});return a?i.padStart(4,"0"):i}},g4=(t=>(t.SRGB="sRGB",t.DisplayP3="display-p3",t.REC2020="rec2020",t.A98RGB="a98-rgb",t.ProphotoRGB="prophoto-rgb",t))(g4||{}),x4=(t=>(t.RGB="rgb",t.RGBA="rgba",t.HSL="hsl",t.HSLA="hsla",t.HWB="hwb",t.CMYK="cmyk",t.LAB="lab",t.LCH="lch",t.COLOR="color",t))(x4||{});function PQ(t,e){let{prefix:n,casing:a}=e;switch(a){case"upper":{t=t.toUpperCase();break}case"lower":{t=t.toLowerCase();break}}return n&&(t=n+t),t}function v4(t){return t.map(e=>{if(e%1!==0){let n=new ArrayBuffer(4);new DataView(n).setFloat32(0,e);let a=new Uint8Array(n);return v4([...a]).replaceAll(" ","")}return(e>>>0).toString(2).padStart(8,"0")}).join(" ")}function Bi(t){return Math.round(t*100)}function jQ(t,e="rgb",n="sRGB"){switch(e){case"rgba":return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]})`;case"color":return`color(${n} ${t[0]} ${t[1]} ${t[2]})`;case"cmyk":return`cmyk(${Bi(t[0])}%, ${Bi(t[1])}%, ${Bi(t[2])}%, ${Bi(t[3])}%)`;case"hsl":return`hsl(${t[0]}deg ${Bi(t[1])}% ${Bi(t[2])}%)`;case"hsla":return`hsl(${t[0]}deg ${Bi(t[1])}% ${Bi(t[2])}% / ${Bi(t[3])})`;case"hwb":return`hwb(${t[0]} ${Bi(t[1])}% ${Bi(t[2])}%)`;case"lab":return`lab(${Bi(t[0])}% ${t[1]} ${t[2]})`;case"lch":return`lch(${Bi(t[0])}% ${t[1]} ${t[2]})`;case"rgb":return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}}function iu(t,e,n="rgb",a="sRGB"){switch(e){case"css":return jQ(t,
4366n,a);case"binary":return v4(t);case"decimal":return t}}var LQ=class extends Yr{human(){return this.faker.helpers.arrayElement(this.faker.definitions.color.human)}space(){return this.faker.helpers.arrayElement(this.faker.definitions.color.space)}cssSupportedFunction(){return this.faker.helpers.enumValue(x4)}cssSupportedSpace(){return this.faker.helpers.enumValue(g4)}rgb(e={}){let{format:n="hex",includeAlpha:a=!1,prefix:i="#",casing:s="lower"}=e,o,c="rgb";return n==="hex"?(o=this.faker.string.hexadecimal({length:a?8:6,prefix:""}),o=PQ(o,{prefix:i,casing:s}),o):(o=Array.from({length:3},()=>this.faker.number.int(255)),a&&(o.push(this.faker.number.float({multipleOf:.01})),c="rgba"),iu(o,n,c))}cmyk(e={}){let{format:n="decimal"}=e,a=Array.from({length:4},()=>this.faker.number.float({multipleOf:.01}));return iu(a,n,"cmyk")}hsl(e={}){let{format:n="decimal",includeAlpha:a=!1}=e,i=[this.faker.number.int(360)];for(let s=0;s<(e?.includeAlpha?3:2);s++)i.push(this.faker.number.float({multipleOf:.01}));return iu(i,n,a?"hsla":"hsl")}hwb(e={}){let{format:n="decimal"}=e,a=[this.faker.number.int(360)];for(let i=0;i<2;i++)a.push(this.faker.number.float({multipleOf:.01}));return iu(a,n,"hwb")}lab(e={}){let{format:n="decimal"}=e,a=[this.faker.number.float({multipleOf:1e-6})];for(let i=0;i<2;i++)a.push(this.faker.number.float({min:-100,max:100,multipleOf:1e-4}));return iu(a,n,"lab")}lch(e={}){let{format:n="decimal"}=e,a=[this.faker.number.float({multipleOf:1e-6})];for(let i=0;i<2;i++)a.push(this.faker.number.float({max:230,multipleOf:.1}));return iu(a,n,"lch")}colorByCSSColorSpace(e={}){let{format:n="decimal",space:a="sRGB"}=e,i=Array.from({length:3},()=>this.faker.number.float({multipleOf:1e-4}));return iu(i,n,"color",a)}},y4=(t=>(t.Legacy="legacy",t.Segwit="segwit",t.Bech32="bech32",t.Taproot="taproot",t))(y4||{}),IQ=(t=>(t.Mainnet="mainnet",t.Testnet="testnet",t))(IQ||{}),BQ={legacy:{prefix:{mainnet:"1",testnet:"m"},length:{min:26,max:34},casing:"mixed",exclude:"0OIl"},segwit:{prefix:{mainnet:"3",testnet:"2"},length:{min:26,max:34},casing:"mixed",exclude:"0OIl"},bech32:{prefix:{mainnet:"bc1",testnet:"tb1"},length:{min:42,max:42},casing:"lower",exclude:"1bBiIoO"},taproot:{prefix:{mainnet:"bc1p",testnet:"tb1p"},length:{min:62,max:62},casing:"lower",exclude:"1bBiIoO"}},b4=typeof Buffer>"u"||!w4("base64")?t=>{let e=new TextEncoder().encode(t),n=Array.from(e,a=>String.fromCodePoint(a)).join("");return btoa(n)}:t=>Buffer.from(t).toString("base64"),$_=typeof Buffer>"u"||!w4("base64url")?t=>b4(t).replaceAll("+","-").replaceAll("/","_").replaceAll(/=+$/g,""):t=>Buffer.from(t).toString("base64url");function w4(t){try{return typeof Buffer.from("test").toString(t)=="string"}catch{return!1}}var OQ=Object.fromEntries([["А","A"],["а","a"],["Б","B"],["б","b"],["В","V"],["в","v"],["Г","G"],["г","g"],["Д","D"],["д","d"],["ъе","ye"],["Ъе","Ye"],["ъЕ","yE"],["ЪЕ","YE"],["Е","E"],["е","e"],["Ё","Yo"],["ё","yo"],["Ж","Zh"],["ж","zh"],["З","Z"],["з","z"],["И","I"],["и","i"],["ый","iy"],["Ый","Iy"],["ЫЙ","IY"],["ыЙ","iY"],["Й","Y"],["й","y"],["К","K"],["к","k"],["Л","L"],["л","l"],["М","M"],["м","m"],["Н","N"],["н","n"],["О","O"],["о","o"],["П","P"],["п","p"],["Р","R"],["р","r"],["С","S"],["с","s"],["Т","T"],["т","t"],["У","U"],["у","u"],["Ф","F"],["ф","f"],["Х","Kh"],["х","kh"],["Ц","Ts"],["ц","ts"],["Ч","Ch"],["ч","ch"],["Ш","Sh"],["ш","sh"],["Щ","Sch"],["щ","sch"],["Ъ",""],["ъ",""],["Ы","Y"],["ы","y"],["Ь",""],["ь",""],["Э","E"],["э","e"],["Ю","Yu"],["ю","yu"],["Я","Ya"],["я","ya"]]),UQ=Object.fromEntries([["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["π","p"],["ρ","r"],["σ","s"],["τ","t"],["υ","y"],["φ","f"],["χ","x"],["ψ","ps"],["ω","o"],["ά","a"],["έ","e"],["ί","
4366i"],["ό","o"],["ύ","y"],["ή","i"],["ώ","o"],["ς","s"],["ϊ","i"],["ΰ","y"],["ϋ","y"],["ΐ","i"],["Α","A"],["Β","B"],["Γ","G"],["Δ","D"],["Ε","E"],["Ζ","Z"],["Η","I"],["Θ","TH"],["Ι","I"],["Κ","K"],["Λ","L"],["Μ","M"],["Ν","N"],["Ξ","KS"],["Ο","O"],["Π","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Υ","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Ά","A"],["Έ","E"],["Ί","I"],["Ό","O"],["Ύ","Y"],["Ή","I"],["Ώ","O"],["Ϊ","I"],["Ϋ","Y"]]),zQ=Object.fromEntries([["ء","e"],["آ","a"],["أ","a"],["ؤ","w"],["إ","i"],["ئ","y"],["ا","a"],["ب","b"],["ة","t"],["ت","t"],["ث","th"],["ج","j"],["ح","h"],["خ","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["ش","sh"],["ص","s"],["ض","d"],["ط","t"],["ظ","z"],["ع","e"],["غ","gh"],["ـ","_"],["ف","f"],["ق","q"],["ك","k"],["ل","l"],["م","m"],["ن","n"],["ه","h"],["و","w"],["ى","a"],["ي","y"],["َ‎","a"],["ُ","u"],["ِ‎","i"]]),GQ=Object.fromEntries([["ա","a"],["Ա","A"],["բ","b"],["Բ","B"],["գ","g"],["Գ","G"],["դ","d"],["Դ","D"],["ե","ye"],["Ե","Ye"],["զ","z"],["Զ","Z"],["է","e"],["Է","E"],["ը","y"],["Ը","Y"],["թ","t"],["Թ","T"],["ժ","zh"],["Ժ","Zh"],["ի","i"],["Ի","I"],["լ","l"],["Լ","L"],["խ","kh"],["Խ","Kh"],["ծ","ts"],["Ծ","Ts"],["կ","k"],["Կ","K"],["հ","h"],["Հ","H"],["ձ","dz"],["Ձ","Dz"],["ղ","gh"],["Ղ","Gh"],["ճ","tch"],["Ճ","Tch"],["մ","m"],["Մ","M"],["յ","y"],["Յ","Y"],["ն","n"],["Ն","N"],["շ","sh"],["Շ","Sh"],["ո","vo"],["Ո","Vo"],["չ","ch"],["Չ","Ch"],["պ","p"],["Պ","P"],["ջ","j"],["Ջ","J"],["ռ","r"],["Ռ","R"],["ս","s"],["Ս","S"],["վ","v"],["Վ","V"],["տ","t"],["Տ","T"],["ր","r"],["Ր","R"],["ց","c"],["Ց","C"],["ու","u"],["ՈՒ","U"],["Ու","U"],["փ","p"],["Փ","P"],["ք","q"],["Ք","Q"],["օ","o"],["Օ","O"],["ֆ","f"],["Ֆ","F"],["և","yev"]]),HQ=Object.fromEntries([["چ","ch"],["ک","k"],["گ","g"],["پ","p"],["ژ","zh"],["ی","y"]]),WQ=Object.fromEntries([["א","a"],["ב","b"],["ג","g"],["ד","d"],["ה","h"],["ו","v"],["ז","z"],["ח","ch"],["ט","t"],["י","y"],["כ","k"],["ך","kh"],["ל","l"],["ם","m"],["מ","m"],["ן","n"],["נ","n"],["ס","s"],["ע","a"],["פ","f"],["ף","ph"],["צ","ts"],["ץ","ts"],["ק","k"],["ר","r"],["ש","sh"],["ת","t"],["ו","v"]]),K_={...OQ,...UQ,...zQ,...HQ,...GQ,...WQ},VQ=(t=>(t.Any="any",t.Loopback="loopback",t.PrivateA="private-a",t.PrivateB="private-b",t.PrivateC="private-c",t.TestNet1="test-net-1",t.TestNet2="test-net-2",t.TestNet3="test-net-3",t.LinkLocal="link-local",t.Multicast="multicast",t))(VQ||{}),$Q={any:"0.0.0.0/0",loopback:"127.0.0.0/8","private-a":"10.0.0.0/8","private-b":"172.16.0.0/12","private-c":"192.168.0.0/16","test-net-1":"192.0.2.0/24","test-net-2":"198.51.100.0/24","test-net-3":"203.0.113.0/24","link-local":"169.254.0.0/16",multicast:"224.0.0.0/4"};function Y_(t){return/^[a-z][a-z-]*[a-z]$/i.exec(t)!==null}function q_(t,e){let n=t.helpers.slugify(e);if(Y_(n))return n;let a=t.helpers.slugify(t.lorem.word());return Y_(a)?a:t.string.alpha({casing:"lower",length:t.number.int({min:4,max:8})})}var KQ=class extends Yr{email(t={}){let{firstName:e,lastName:n,provider:a=this.faker.helpers.arrayElement(this.faker.definitions.internet.free_email),allowSpecialCharacters:i=!1}=t,s=this.username({firstName:e,lastName:n});if(s=s.replaceAll(/[^A-Za-z0-9._+-]+/g,""),s=s.substring(0,50),i){let o=[..."._-"],c=[...".!#$%&'*+-/=?^_`{|}~"];s=s.replace(this.faker.helpers.arrayElement(o),this.faker.helpers.arrayElement(c))}return s=s.replaceAll(/\.{2,}/g,"."),s=s.replace(/^\./,""),s=s.replace(/\.$/,""),`${s}@${a}`}exampleEmail(t={}){let{firstName:e,lastName:n,allowSpecialCharacters:a=!1}=t,i=this.faker.helpers.arrayElement(this.faker.definitions.internet.example_email);return this.email({firstName:e,lastName:n,provider:i,allowSpecialCharacters:a})}username(t={}){let{firstName:e=this.faker.person.firstName(),lastName:n=this.faker.person.lastName(),lastName:a}=t,i=this.faker.helpers.arrayElement([".","_"]),s=this.faker.number.int(99),o=[()=>`${e}${i}${n}${s}`,()=>`${e}${i}${n}`];a||o.push(()=>`${e}${s}`);let c=this.faker.helpers.arrayElement(o)();return c=c.normalize("NFKD").replaceAll(/[\u0300-\u036F]/g,""),c=[...c].map(d=>{if(K_[d])return K_[d];let m=d.codePointAt(0)??Number.NaN;return m<128?d:m.toString(36)}).join(""),c=c.replaceAll("'",""),c=c.replaceAll(" ",""),c}displayName(t={}){let{firstName:e=this.faker.person.firstName(),lastName:n=this.faker.person.lastName()}=t,a=this.faker.helpers.arrayElement([".","_"]),i=this.faker.number.int(99),s=[()=>`${e}${i}`,()=>`${e}${a}${n}`,()=>`${e}${a}${n}${i}`],o=this.faker.helpers.arrayElement(s)();return o=o.replaceAll("'",""),o=o.replaceAll(" ",""),o}protocol(){let t=["http","https"];return this.faker.helpers.arrayElement(t)}httpMethod(){let t=["GET","POST","PUT","DELETE","PATCH"];return this.faker.helpers.arrayElement(t)}httpStatusCode(t={}){let{types:e=Object.keys(this.faker.definitions.internet.http_status_code)}=t,n=this.faker.helpers.arrayElement(e);return this.faker.helpers.arrayElement(this.faker.definitions.internet.http_status_code[n])}url(t={}){let{appendSlash:e=this.faker.datatype.boolean(),protocol:n="https"}=t;return`${n}://${this.domainName()}${e?"/":""}`}domainName(){return`${this.domainWord()}.${this.domainSuffix()}`}domainSuffix(){return this.faker.helpers.arrayElement(this.faker.definitions.internet.domain_suffix)}domainWord(){let t=q_(this.faker,this.faker.word.adjective()),e=q_(this.faker,this.faker.word.noun());return`${t}-${e}`.toLowerCase()}ip(){return this.faker.datatype.boolean()?this.ipv4():this.ipv6()}ipv4(t={}){let{network:e="any",cidrBlock:n=$Q[e]}=t;if(!/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/.test(n))throw new Un(`Invalid CIDR block provided: ${n}. Must be in the format x.x.x.x/y.`);let[a,i]=n.split("/"),s=4294967295>>>Number.parseInt(i),[o,c,d,m]=a.split(".").map(Number),f=(o<<24|c<<16|d<<8|m)&~s,p=this.faker.number.int(s),b=f|p;return[b>>>24&255,b>>>16&255,b>>>8&255,b&255].join(".")}ipv6(){return Array.from({length:8},()=>this.faker.string.hexadecimal({length:4,casing:"lower",prefix:""})).join(":")}port(){return this.faker.number.int(65535)}userAgent(){return this.faker.helpers.fake(this.faker.definitions.internet.user_agent_pattern)}mac(t={}){typeof t=="string"&&(t={separator:t});let{separator:e=":"}=t,n,a="";for([":","-",""].includes(e)||(e=":"),n=0;n<12;n++)a+=this.faker.number.hex(15),n%2===1&&n!==11&&(a+=e);return a}password(t={}){let e=/[aeiouAEIOU]$/,n=/[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/,a=(d,m,f,p)=>
4366{if(p.length>=d)return p;m&&(f=n.test(p)?e:n);let b=this.faker.number.int(94)+33,v=String.fromCodePoint(b);return m&&(v=v.toLowerCase()),f.test(v)?a(d,m,f,p+v):a(d,m,f,p)},{length:i=15,memorable:s=!1,pattern:o=/\w/,prefix:c=""}=t;return a(i,s,o,c)}emoji(t={}){let{types:e=Object.keys(this.faker.definitions.internet.emoji)}=t,n=this.faker.helpers.arrayElement(e);return this.faker.helpers.arrayElement(this.faker.definitions.internet.emoji[n])}jwtAlgorithm(){return this.faker.helpers.arrayElement(this.faker.definitions.internet.jwt_algorithm)}jwt(t={}){let{refDate:e=this.faker.defaultRefDate()}=t,n=this.faker.date.recent({refDate:e}),{header:a={alg:this.jwtAlgorithm(),typ:"JWT"},payload:i={iat:Math.round(n.valueOf()/1e3),exp:Math.round(this.faker.date.soon({refDate:n}).valueOf()/1e3),nbf:Math.round(this.faker.date.anytime({refDate:e}).valueOf()/1e3),iss:this.faker.company.name(),sub:this.faker.string.uuid(),aud:this.faker.string.uuid(),jti:this.faker.string.uuid()}}=t,s=$_(JSON.stringify(a)),o=$_(JSON.stringify(i)),c=this.faker.string.alphanumeric(64);return`${s}.${o}.${c}`}},S4=(t=>(t.Female="female",t.Male="male",t))(S4||{});function lm(t,e,n){let{generic:a,female:i,male:s}=n;switch(e){case"female":return i??a;case"male":return s??a;default:return a??t.helpers.arrayElement([i,s])??[]}}var YQ=class extends Yr{firstName(e){return this.faker.helpers.arrayElement(lm(this.faker,e,this.faker.definitions.person.first_name))}lastName(e){if(this.faker.rawDefinitions.person?.last_name_pattern!=null){let n=this.faker.helpers.weightedArrayElement(lm(this.faker,e,this.faker.rawDefinitions.person.last_name_pattern));return this.faker.helpers.fake(n)}return this.faker.helpers.arrayElement(lm(this.faker,e,this.faker.definitions.person.last_name))}middleName(e){return this.faker.helpers.arrayElement(lm(this.faker,e,this.faker.definitions.person.middle_name))}fullName(e={}){let{sex:n=this.faker.helpers.arrayElement(["female","male"]),firstName:a=this.firstName(n),lastName:i=this.lastName(n)}=e,s=this.faker.helpers.weightedArrayElement(this.faker.definitions.person.name);return this.faker.helpers.mustache(s,{"person.prefix":()=>this.prefix(n),"person.firstName":()=>a,"person.middleName":()=>this.middleName(n),"person.lastName":()=>i,"person.suffix":()=>this.suffix()})}gender(){return this.faker.helpers.arrayElement(this.faker.definitions.person.gender)}sex(){return this.faker.helpers.arrayElement(this.faker.definitions.person.sex)}sexType(){return this.faker.helpers.enumValue(S4)}bio(){let{bio_pattern:e}=this.faker.definitions.person;return this.faker.helpers.fake(e)}prefix(e){return this.faker.helpers.arrayElement(lm(this.faker,e,this.faker.definitions.person.prefix))}suffix(){return this.faker.helpers.arrayElement(this.faker.definitions.person.suffix)}jobTitle(){return this.faker.helpers.fake(this.faker.definitions.person.job_title_pattern)}jobDescriptor(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_descriptor)}jobArea(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_area)}jobType(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_type)}zodiacSign(){return this.faker.helpers.arrayElement(this.faker.definitions.person.western_zodiac_sign)}},qQ=23283064365386963e-26,JQ=1/9007199254740992,{imul:o1,trunc:l1}=Math;function J_(t){return typeof t=="number"?F4(t):XQ(t)}function F4(t){let e=Array.from({length:624});e[0]=t;for(let n=1;n!==624;++n){let a=e[n-1]^e[n-1]>>>30;e[n]=l1(o1(1812433253,a)+n)}return e}function XQ(t){let e=F4(19650218),n=1,a=0;for(let i=Math.max(624,t.length);i!==0;--i){let s=e[n-1]^e[n-1]>>>30;e[n]=l1((e[n]^o1(s,1664525))+t[a]+a),n++,a++,n>=624&&(e[0]=e[623],n=1),a>=t.length&&(a=0)}for(let i=623;i!==0;i--)e[n]=l1((e[n]^o1(e[n-1]^e[n-1]>>>30,1566083941))-n),n++,n>=624&&(e[0]=e[623],n=1);return e[0]=2147483648,e}function yy(t){for(let n=0;n!==227;++n){let a=(t[n]&2147483648)+(t[n+1]&2147483647);t[n]=t[n+397]^a>>>1^-(a&1)&2567483615}for(let n=227;n!==623;++n){let a=(t[n]&2147483648)+(t[n+1]&2147483647);t[n]=t[n+397-624]^a>>>1^-(a&1)&2567483615}let e=(t[623]&2147483648)+(t[0]&2147483647);return t[623]=t[396]^e>>>1^-(e&1)&2567483615,t}var ZQ=class{constructor(t=Math.random()*Number.MAX_SAFE_INTEGER,e=yy(J_(t)),n=0){this.states=e,this.index=n}nextU32(){let t=this.states[this.index];return t^=this.states[this.index]>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,++this.index>=624&&(this.states=yy(this.states),this.index=0),t>>>0}nextF32(){return this.nextU32()*qQ}nextU53(){let t=this.nextU32()>>>5,e=this.nextU32()>>>6;return t*67108864+e}nextF53(){return this.nextU53()*JQ}seed(t){this.states=yy(J_(t)),this.index=0}};function C4(){return Math.ceil(Math.random()*Number.MAX_SAFE_INTEGER)}function QQ(t=C4()){let e=new ZQ(t);return{next(){return e.nextF53()}
4366,seed(n){e.seed(n)}}}var eee=class extends Au{boolean(e={}){typeof e=="number"&&(e={probability:e});let{probability:n=.5}=e;return n<=0?!1:n>=1?!0:this.faker.number.float()<n}};function dl(t,e="refDate"){let n=new Date(t);if(Number.isNaN(n.valueOf()))throw new Un(`Invalid ${e} date: ${t.toString()}`);return n}var Gg=()=>{throw new Un("You cannot edit the locale data on the faker instance")};function tee(t){let e={};return new Proxy(t,{has(){return!0},get(n,a){return typeof a=="symbol"||a==="nodeType"?n[a]:a in e?e[a]:e[a]=nee(a,n[a])},set:Gg,deleteProperty:Gg})}function c1(t,...e){if(t===null)throw new Un(`The locale data for '${e.join(".")}' aren't applicable to this locale.
4367  If you think this is a bug, please report it at: https://github.com/faker-js/faker`);if(t===void 0)throw new Un(`The locale data for '${e.join(".")}' are missing in this locale.
4368  If this is a custom Faker instance, please make sure all required locales are used e.g. '[de_AT, de, en, base]'.
4369  Please contribute the missing data to the project or use a locale/Faker instance that has these data.
4370  For more information see https://fakerjs.dev/guide/localization.html`)}function nee(t,e={}){return new Proxy(e,{has(n,a){return n[a]!=null},get(n,a){let i=n[a];return typeof a=="symbol"||a==="nodeType"||c1(i,t,a.toString()),i},set:Gg,deleteProperty:Gg})}var _4=class extends Au{anytime(e={}){let{refDate:n=this.faker.defaultRefDate()}=e,a=dl(n).getTime();return this.between({from:a-1e3*60*60*24*365,to:a+1e3*60*60*24*365})}past(e={}){let{years:n=1,refDate:a=this.faker.defaultRefDate()}=e;if(n<=0)throw new Un("Years must be greater than 0.");let i=dl(a).getTime();return this.between({from:i-n*365*24*3600*1e3,to:i-1e3})}future(e={}){let{years:n=1,refDate:a=this.faker.defaultRefDate()}=e;if(n<=0)throw new Un("Years must be greater than 0.");let i=dl(a).getTime();return this.between({from:i+1e3,to:i+n*365*24*3600*1e3})}between(e){let{from:n,to:a}=e,i=dl(n,"from").getTime(),s=dl(a,"to").getTime();if(i>s)throw new Un("`from` date must be before `to` date.");return new Date(this.faker.number.int({min:i,max:s}))}betweens(e){let{from:n,to:a,count:i=3}=e;return this.faker.helpers.multiple(()=>this.between({from:n,to:a}),{count:i}).sort((s,o)=>s.getTime()-o.getTime())}recent(e={}){let{days:n=1,refDate:a=this.faker.defaultRefDate()}=e;if(n<=0)throw new Un("Days must be greater than 0.");let i=dl(a).getTime();return this.between({from:i-n*24*3600*1e3,to:i-1e3})}soon(e={}){let{days:n=1,refDate:a=this.faker.defaultRefDate()}=e;if(n<=0)throw new Un("Days must be greater than 0.");let i=dl(a).getTime();return this.between({from:i+1e3,to:i+n*24*3600*1e3})}birthdate(e={}){let{mode:n="age",min:a=18,max:i=80,refDate:s=this.faker.defaultRefDate()}=e,o=dl(s),c=o.getUTCFullYear();switch(n){case"age":{let d=new Date(o).setUTCFullYear(c-i-1)+864e5,m=new Date(o).setUTCFullYear(c-a);if(d>m)throw new Un(`Max age ${i} should be greater than or equal to min age ${a}.`);return this.between({from:d,to:m})}case"year":{let d=new Date(Date.UTC(0,0,2)).setUTCFullYear(a),m=new Date(Date.UTC(0,11,30)).setUTCFullYear(i);if(d>m)throw new Un(`Max year ${i} should be greater than or equal to min year ${a}.`);return this.between({from:d,to:m})}}}},ree=class extends _4{constructor(t){super(t),this.faker=t}month(t={}){let{abbreviated:e=!1,context:n=!1}=t,a=this.faker.definitions.date.month,i;e?i=n&&a.abbr_context!=null?"abbr_context":"abbr":i=n&&a.wide_context!=null?"wide_context":"wide";let s=a[i];return c1(s,"date.month",i),this.faker.helpers.arrayElement(s)}weekday(t={}){let{abbreviated:e=!1,context:n=!1}=t,a=this.faker.definitions.date.weekday,i;e?i=n&&a.abbr_context!=null?"abbr_context":"abbr":i=n&&a.wide_context!=null?"wide_context":"wide";let s=a[i];return c1(s,"date.weekday",i),this.faker.helpers.arrayElement(s)}timeZone(){return this.faker.helpers.arrayElement(this.faker.definitions.date.time_zone)}},aee=/\.|\(/;function iee(t,e,n=[e,e.rawDefinitions]){if(t.length===0)throw new Un("Eval expression cannot be empty.");if(n.length===0)throw new Un("Eval entrypoints cannot be empty.");let a=n,i=t;do{let o;i.startsWith("(")?[o,a]=see(i,a):[o,a]=lee(i,a),i=i.substring(o),a=a.filter(c=>c!=null).map(c=>Array.isArray(c)?e.helpers.arrayElement(c):c)}while(i.length>0&&a.length>0);if(a.length===0)throw new Un(`Cannot resolve expression '${t}'`);let s=a[0];return typeof s=="function"?s():s}function see(t,e){let[n,a]=oee(t),i=t[n+1];switch(i){case".":case"(":case void 0:break;default:throw new Un(`Expected dot ('.'), open parenthesis ('('), or nothing after function call but got '${i}'`)}return[n+(i==="."?2:1),e.map(s=>typeof s=="function"?s(...a):void 0)]}function oee(t){let e=t.indexOf(")",1);if(e===-1)throw new Un(`Missing closing parenthesis in '${t}'`);for(;e!==-1;){let a=t.substring(1,e);try{return[e,JSON.parse(`[${a}]`)]}catch{if(!a.includes("'")&&!a.includes('"'))try{return[e,JSON.parse(`["${a}"]`)]}catch{}}e=t.indexOf(")",e+1)}e=t.lastIndexOf(")");let n=t.substring(1,e);return[e,[n]]}function lee(t,e){let n=aee.exec(t),a=(n?.[0]??"")===".",i=n?.index??t.length,s=t.substring(0,i);if(s.length===0)throw new Un(`Expression parts cannot be empty in '${t}'`);let o=t[i+1];if(a&&(o==null||o==="."||o==="("))throw new Un(`Found dot without property name in '${t}'`);return[i+(a?1:0),e.map(c=>cee(c,s))]}function cee(t,e){switch(typeof t){case"function":{try{t=t()}catch{return}return t?.[e]}case"object":return t?.[e];default:return}}function uee(t){let e=dee(t.replace(/L?$/,"0"));return e===0?0:10-e}function dee(t){t=t.replaceAll(/[\s-]/g,"");let e=0,n=!1;for(let a=t.length-1;a>=0;a--){let i=Number.parseInt(t[a]);n&&(i*=2,i>9&&(i=i%10+1)),e+=i,n=!n}return e%10}function X_(t,e,n,a){let i=1;if(e)switch(e){case"?":{i=t.datatype.boolean()?0:1;break}case"*":{let s=1;for(;t.datatype.boolean();)s*=2;i=t.number.int({min:0,max:s});break}case"+":{let s=1;for(;t.datatype.boolean();)s*=2;i=t.number.int({min:1,max:s});break}default:throw new Un("Unknown quantifier symbol provided.")}else n!=null&&a!=null?i=t.number.int({min:Number.parseInt(n),max:Number.parseInt(a)}):n!=null&&a==null&&(i=Number.parseInt(n));return i}function hee(t,e=""){let n=/(.)\{(\d+),(\d+)\}/,a=/(.)\{(\d+)\}/,i=/\[(\d+)-(\d+)\]/,s,o,c,d,m=n.exec(e);for(;m!=null;)s=Number.parseInt(m[2]),o=Number.parseInt(m[3]),s>o&&(c=o,o=s,s=c),d=t.number.int({min:s,max:o}),e=e.slice(0,m.index)+m[1].repeat(d)+e.slice(m.index+m[0].length),m=n.exec(e);for(m=a.exec(e);m!=null;)d=Number.parseInt(m[2]),e=e.slice(0,m.index)+m[1].repeat(d)+e.slice(m.index+m[0].length),m=a.exec(e);for(m=i.exec(e);m!=null;)s=Number.parseInt(m[1]),o=Number.parseInt(m[2]),s>o&&(c=o,o=s,s=c),e=e.slice(0,m.index)+t.number.int({min:s,max:o}).toString()+e.slice(m.index+m[0].length),m=i.exec(e);return e}function E4(t,e="",n="#"){let a="";for(let i=0;i<e.length;i++)e.charAt(i)===n?a+=t.number.int(9):e.charAt(i)==="!"?a+=t.number.int({min:2,max:9}):a+=e.charAt(i);return a}var k4=class extends Au{slugify(e=""){return e.normalize("NFKD").replaceAll(/[\u0300-\u036F]/g,"").replaceAll(" ","-").replaceAll(/[^\
4370w.-]+/g,"")}replaceSymbols(e=""){let n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],a="";for(let i=0;i<e.length;i++)e.charAt(i)==="#"?a+=this.faker.number.int(9):e.charAt(i)==="?"?a+=this.arrayElement(n):e.charAt(i)==="*"?a+=this.faker.datatype.boolean()?this.arrayElement(n):this.faker.number.int(9):a+=e.charAt(i);return a}replaceCreditCardSymbols(e="6453-####-####-####-###L",n="#"){e=hee(this.faker,e),e=E4(this.faker,e,n);let a=uee(e);return e.replace("L",String(a))}fromRegExp(e){let n=!1;e instanceof RegExp&&(n=e.flags.includes("i"),e=e.toString(),e=/\/(.+?)\//.exec(e)?.[1]??"");let a,i,s,o=/([.A-Za-z0-9])(?:\{(\d+)(?:,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,c=o.exec(e);for(;c!=null;){let b=c[2],v=c[3],C=c[4];s=X_(this.faker,C,b,v);let S;c[1]==="."?S=this.faker.string.alphanumeric(s):n?S=this.faker.string.fromCharacters([c[1].toLowerCase(),c[1].toUpperCase()],s):S=c[1].repeat(s),e=e.slice(0,c.index)+S+e.slice(c.index+c[0].length),c=o.exec(e)}let d=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,m=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:,(\d+)|)\}|(\?|\*|\+)|)/;for(c=m.exec(e);c!=null;){let b=c[1]==="^",v=c[2]==="-",C=c[4],S=c[5],F=c[6],w=[],A=c[3],N=d.exec(A);for(v&&w.push(45);N!=null;){if(N[0].includes("-")){let z=N[0].split("-").map(D=>D.codePointAt(0)??Number.NaN);if(a=z[0],i=z[1],a>i)throw new Un("Character range provided is out of order.");for(let D=a;D<=i;D++)if(n&&Number.isNaN(Number(String.fromCodePoint(D)))){let T=String.fromCodePoint(D);w.push(T.toUpperCase().codePointAt(0)??Number.NaN,T.toLowerCase().codePointAt(0)??Number.NaN)}else w.push(D)}else n&&Number.isNaN(Number(N[0]))?w.push(N[0].toUpperCase().codePointAt(0)??Number.NaN,N[0].toLowerCase().codePointAt(0)??Number.NaN):w.push(N[0].codePointAt(0)??Number.NaN);A=A.substring(N[0].length),N=d.exec(A)}if(s=X_(this.faker,F,C,S),b){let z=-1;for(let D=48;D<=57;D++){if(z=w.indexOf(D),z>-1){w.splice(z,1);continue}w.push(D)}for(let D=65;D<=90;D++){if(z=w.indexOf(D),z>-1){w.splice(z,1);continue}w.push(D)}for(let D=97;D<=122;D++){if(z=w.indexOf(D),z>-1){w.splice(z,1);continue}w.push(D)}}let P=this.multiple(()=>String.fromCodePoint(this.arrayElement(w)),{count:s}).join("");e=e.slice(0,c.index)+P+e.slice(c.index+c[0].length),c=m.exec(e)}let f=/(.)\{(\d+),(\d+)\}/;for(c=f.exec(e);c!=null;){if(a=Number.parseInt(c[2]),i=Number.parseInt(c[3]),a>i)throw new Un("Numbers out of order in {} quantifier.");s=this.faker.number.int({min:a,max:i}),e=e.slice(0,c.index)+c[1].repeat(s)+e.slice(c.index+c[0].length),c=f.exec(e)}let p=/(.)\{(\d+)\}/;for(c=p.exec(e);c!=null;)s=Number.parseInt(c[2]),e=e.slice(0,c.index)+c[1].repeat(s)+e.slice(c.index+c[0].length),c=p.exec(e);return e}shuffle(e,n={}){let{inplace:a=!1}=n;a||(e=[...e]);for(let i=e.length-1;i>0;--i){let s=this.faker.number.int(i);[e[i],e[s]]=[e[s],e[i]]}return e}uniqueArray(e,n){if(Array.isArray(e)){let i=[...new Set(e)];return this.shuffle(i).splice(0,n)}let a=new Set;try{if(typeof e=="function"){let i=1e3*n,s=0;for(;a.size<n&&s<i;)a.add(e()),s++}}catch{}return[...a]}mustache(e,n){if(e==null)return"";for(let a in n){let i=new RegExp(`{{${a}}}`,"g"),s=n[a];typeof s=="string"&&(s=s.replaceAll("$","$$$$")),e=e.replace(i,s)}return e}maybe(e,n={}){if(this.faker.datatype.boolean(n))return e()}objectKey(e){let n=Object.keys(e);return this.arrayElement(n)}objectValue(e){let n=this.faker.helpers.objectKey(e);return e[n]}objectEntry(e){let n=this.faker.helpers.objectKey(e);return[n,e[n]]}arrayElement(e){if(e.length===0)throw new Un("Cannot get value from empty dataset.");let n=e.length>1?this.faker.number.int({max:e.length-1}):0;return e[n]}weightedArrayElement(e){if(e.length===0)throw new Un("weightedArrayElement expects an array with at least one element");if(!e.every(s=>s.weight>0))throw new Un("weightedArrayElement expects an array of { weight, value } objects where weight is a positive number");let n=e.reduce((s,{weight:o})=>s+o,0),a=this.faker.number.float({min:0,max:n}),i=0;for(let{weight:s,value:o}of e)if(i+=s,a<i)return o;return e.at(-1).value}arrayElements(e,n){if(e.length===0)return[];let a=this.rangeToNumber(n??{min:1,max:e.length});if(a>=e.length)return this.shuffle(e);if(a<=0)return[];let i=[...e],s=e.length,o=s-a,c,d;for(;s-- >o;)d=this.faker.number.int(s),c=i[d],i[d]=i[s],i[s]=c;return i.slice(o)}enumValue(e){let n=Object.keys(e).filter(i=>Number.isNaN(Number(i))),a=this.arrayElement(n);return e[a]}rangeToNumber(e){return typeof e=="number"?e:this.faker.number.int(e)}multiple(e,n={}){let a=this.rangeToNumber(n.count??3);return a<=0?[]:Array.from({length:a},e)}},mee=class extends k4{constructor(e){super(e),this.faker=e}fake(e){e=typeof e=="string"?e:this.arrayElement(e);let n=e.search(/{{[a-z]/),a=e.indexOf("}}",n);if(n===-1||a===-1)return e;let i=e.substring(n+2,a+2).replace("}}","").replace("{{",""),s=iee(i,this.faker),o=String(s),c=e.substring(0,n)+o+e.substring(a+2);return this.fake(c)}},A4=class extends Au{latitude(e={}){let{max:n=90,min:a=-90,precision:i=4}=e;return this.faker.number.float({min:a,max:n,fractionDigits:i})}longitude(e={}){let{max:n=180,min:a=-180,precision:i=4}=e;return this.faker.number.float({max:n,min:a,fractionDigits:i})}nearbyGPSCoordinate(e={}){let{origin:n,radius:a=10,isMetric:i=!1}=e;if(n==null)return[this.latitude(),this.longitude()];let s=this.faker.number.float({max:2*Math.PI,fractionDigits:5}),o=i?a:a*1.60934,c=this.faker.number.float({max:o,fractionDigits:3})*.995,d=4e4/360,m=c/d,f=[n[0]+Math.sin(s)*m,n[1]+Math.cos(s)*m];return f[0]=f[0]%180,(f[0]<-90||f[0]>90)&&(f[0]=Math.sign(f[0])*180-f[0],f[1]+=180),f[1]=(f[1]%360+540)%360-180,[f[0],f[1]]}},fee=class extends A4{constructor(t){super(t),this.faker=t}zipCode(t={}){typeof t=="string"&&(t={format:t});let{state:e}=t;if(e!=null){let a=this.faker.definitions.location.postcode_by_state[e];if(a==null)throw new Un(`No zip code definition found for state "${e}"`);return this.faker.helpers.fake(a)}let{format:n=this.faker.definitions.location.postcode}=t;return typeof n=="string"&&(n=[n]),n=this.faker.helpers.arrayElement(n),this.faker.helpers.replaceSymbols(n)}city(){return this.faker.helpers.fake(this.faker.definitions.location.city_pattern)}buildingNumber(){return this.faker.helpers.arrayElement(this.faker.definitions.location.building_number).replaceAll(/#+/g,t=>this.faker.string.numeric({length:t.length,allowLeadingZeros:!1}))}street(){return this.faker.helpers.fake(this.faker.definitions.location.street_pattern)}streetAddress(t={}){typeof t=="boolean"&&(t={useFullAddress:t});let{useFullAddress:e}=t,n=this.faker.definitions.location.street_address[e?"full":"normal"];return this.faker.helpers.fake(n)}secondaryAddress(){return this.faker.helpers.fake(this.faker.definitions.location.secondary_address).replaceAll(/#+/g,t=>this.faker.string.numeric({length:t.length,allowLeadingZeros:!1}))}county(){return this.faker.helpers.arrayElement(this.faker.definitions.location.county)}country(){return this.faker.helpers.arrayElement(this.faker.definitions.location.country)}continent(){return this.faker.helpers.arrayElement(this.faker.definitions.location.continent)}countryCode(t={}){typeof t=="string"&&(t={variant:t});let{variant:e="alpha-2"}=t,n=(()=>{switch(e){case"numeric":return"numeric";case"alpha-3":return"alpha3";case"alpha-2":return"alpha2"}})();return this.faker.helpers.arrayElement(this.faker.definitions.location.country_code)[n]}state(t={}){let{abbreviated:e=!1}=t,n=e?this.faker.definitions.location.state_abbr:this.faker.definitions.location.state;return this.faker.helpers.arrayElement(n)}direction(t={}){let{abbreviated:e=!1}=t;return e?this.faker.helpers.arrayElement([...this.faker.definitions.location.direction.cardinal_abbr,...this.faker.definitions.location.direction.ordinal_abbr]):this.faker.helpers.arrayElement([...this.faker.definitions.location.direction.cardinal,...this.faker.definitions.location.direction.ordinal])}cardinalDirection(t={}){let{abbreviated:e=!1}=t;return e?this.faker.helpers.arrayElement(this.faker.definitions.location.direction.cardinal_abbr):this.faker.helpers.arrayElement(this.faker.definitions.location.direction.cardinal)}ordinalDirection(t={}){let{abbreviated:e=!1}=t;return e?this.faker.helpers.arrayElement(this.faker.definitions.location.direction.ordinal_abbr):this.faker.helpers.arrayElement(this.faker.definitions.location.direction.ordinal)}timeZone(){return this.faker.helpers.arrayElement(this.faker.definitions.location.time_zone)}language(){return this.faker.helpers.arrayElement(this.faker.definitions.location.language)}},pee=class extends Au{int(e={}){typeof e=="number"&&(e={max:e});let{min:n=0,max:a=Number.MAX_SAFE_INTEGER,multipleOf:i=1}=e;if(!Number.isInteger(i))throw new Un("multipleOf should be an integer.");if(i<=0)throw new Un("multipleOf should be greater than 0.");let s=Math.ceil(n/i),o=Math.floor(a/i);if(s===o)return s*i;if(o<s)throw a>=n?new Un(`No suitable integer value between ${n} and ${a} found.`):new Un(`Max ${a} should be greater than min ${n}.`);let c=this.faker._randomizer.next(),d=o-s+1;return Math.floor(c*d+s)*i}float(e={}){typeof e=="number"&&(e={max:e});let{min:n=0,max:a=1,fractionDigits:i,multipleOf:s,multipleOf:o=i==null?void 0:10**-i}=e;if(a<n)throw new Un(`Max ${a} should be greater than min ${n}.`);if(i!=null){if(s!=null)throw new Un("multipleOf and fractionDigits cannot be set at the same time.");if(!Number.isInteger(i))throw new Un("fractionDigits should be an integer.");if(i<0)throw new Un("fractionDigits should be greater than or equal to 0.")}if(o!=null){if(o<=0)throw new Un("multipleOf should be greater than 0.");let c=Math.log10(o),d=o<1&&Number.isInteger(c)?10**-c:1/o;return this.int({min:n*d,max:a*d}
4370)/d}return this.faker._randomizer.next()*(a-n)+n}binary(e={}){typeof e=="number"&&(e={max:e});let{min:n=0,max:a=1}=e;return this.int({max:a,min:n}).toString(2)}octal(e={}){typeof e=="number"&&(e={max:e});let{min:n=0,max:a=7}=e;return this.int({max:a,min:n}).toString(8)}hex(e={}){typeof e=="number"&&(e={max:e});let{min:n=0,max:a=15}=e;return this.int({max:a,min:n}).toString(16)}bigInt(e={}){(typeof e=="bigint"||typeof e=="number"||typeof e=="string"||typeof e=="boolean")&&(e={max:e});let n=BigInt(e.min??0),a=BigInt(e.max??n+BigInt(999999999999999)),i=BigInt(e.multipleOf??1);if(a<n)throw new Un(`Max ${a} should be larger than min ${n}.`);if(i<=BigInt(0))throw new Un("multipleOf should be greater than 0.");let s=n/i+(n%i>0n?1n:0n),o=a/i-(a%i<0n?1n:0n);if(s===o)return s*i;if(o<s)throw new Un(`No suitable bigint value between ${n} and ${a} found.`);let c=o-s+1n,d=BigInt(this.faker.string.numeric({length:c.toString(10).length,allowLeadingZeros:!0}))%c;return(s+d)*i}romanNumeral(e={}){typeof e=="number"&&(e={max:e});let{min:n=1,max:a=3999}=e;if(n<1)throw new Un(`Min value ${n} should be 1 or greater.`);if(a>3999)throw new Un(`Max value ${a} should be 3999 or less.`);let i=this.int({min:n,max:a}),s=[["M",1e3],["CM",900],["D",500],["CD",400],["C",100],["XC",90],["L",50],["XL",40],["X",10],["IX",9],["V",5],["IV",4],["I",1]],o="";for(let[c,d]of s)o+=c.repeat(Math.floor(i/d)),i%=d;return o}},N4="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function gee(t){let e=t.valueOf(),n="";for(let a=10;a>0;a--){let i=e%32;n=N4[i]+n,e=(e-i)/32}return n}var Zp=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"],Qp=[..."abcdefghijklmnopqrstuvwxyz"],Z_=[..."0123456789"],xee=class extends Au{fromCharacters(e,n=1){if(n=this.faker.helpers.rangeToNumber(n),n<=0)return"";if(typeof e=="string"&&(e=[...e]),e.length===0)throw new Un("Unable to generate string: No characters to select from.");return this.faker.helpers.multiple(()=>this.faker.helpers.arrayElement(e),{count:n}).join("")}alpha(e={}){typeof e=="number"&&(e={length:e});let n=this.faker.helpers.rangeToNumber(e.length??1);if(n<=0)return"";let{casing:a="mixed"}=e,{exclude:i=[]}=e;typeof i=="string"&&(i=[...i]);let s;switch(a){case"upper":{s=[...Zp];break}case"lower":{s=[...Qp];break}case"mixed":{s=[...Qp,...Zp];break}}return s=s.filter(o=>!i.includes(o)),this.fromCharacters(s,n)}alphanumeric(e={}){typeof e=="number"&&(e={length:e});let n=this.faker.helpers.rangeToNumber(e.length??1);if(n<=0)return"";let{casing:a="mixed"}=e,{exclude:i=[]}=e;typeof i=="string"&&(i=[...i]);let s=[...Z_];switch(a){case"upper":{s.push(...Zp);break}case"lower":{s.push(...Qp);break}case"mixed":{s.push(...Qp,...Zp);break}}return s=s.filter(o=>!i.includes(o)),this.fromCharacters(s,n)}binary(e={}){let{prefix:n="0b"}=e,a=n;return a+=this.fromCharacters(["0","1"],e.length??1),a}octal(e={}){let{prefix:n="0o"}=e,a=n;return a+=this.fromCharacters(["0","1","2","3","4","5","6","7"],e.length??1),a}hexadecimal(e={}){let{casing:n="mixed",prefix:a="0x"}=e,i=this.faker.helpers.rangeToNumber(e.length??1);if(i<=0)return a;let s=this.fromCharacters(["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],i);return n==="upper"?s=s.toUpperCase():n==="lower"&&(s=s.toLowerCase()),`${a}${s}`}numeric(e={}){typeof e=="number"&&(e={length:e});let n=this.faker.helpers.rangeToNumber(e.length??1);if(n<=0)return"";let{allowLeadingZeros:a=!0}=e,{exclude:i=[]}=e;typeof i=="string"&&(i=[...i]);let s=Z_.filter(c=>!i.includes(c));if(s.length===0||s.length===1&&!a&&s[0]==="0")throw new Un("Unable to generate numeric string, because all possible digits are excluded.");let o="";return!a&&!i.includes("0")&&(o+=this.faker.helpers.arrayElement(s.filter(c=>c!=="0"))),o+=this.fromCharacters(s,n-o.length),o}sample(e=10){e=this.faker.helpers.rangeToNumber(e);let n={min:33,max:125},a="";for(;a.length<e;)a+=String.fromCodePoint(this.faker.number.int(n));return a}uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll("x",()=>this.faker.number.hex({min:0,max:15})).replaceAll("y",()=>this.faker.number.hex({min:8,max:11}))}ulid(e={}){let{refDate:n=this.faker.defaultRefDate()}=e,a=dl(n);return gee(a)+this.fromCharacters(N4,16)}nanoid(e=21){if(e=this.faker.helpers.rangeToNumber(e),e<=0)return"";let n=[{value:()=>this.alphanumeric(1),weight:62},{value:()=>this.faker.helpers.arrayElement(["_","-"]),weight:2}],a="";for(;a.length<e;){let i=this.faker.helpers.weightedArrayElement(n);a+=i()}return a}symbol(e=1){return this.fromCharacters(["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_","`","{","|","}","~"],e)}},T4=class{_defaultRefDate=()=>new Date;get defaultRefDate(){return this._defaultRefDate}setDefaultRefDate(e=()=>new Date){typeof e=="function"?this._defaultRefDate=e:this._defaultRefDate=()=>new Date(e)}_randomizer;datatype=new eee(this);date=new _4(this);helpers=new k4(this);location=new A4(this);number=new pee(this);
4370string=new xee(this);constructor(e={}){let{randomizer:n,seed:a}=e;n!=null&&a!=null&&n.seed(a),this._randomizer=n??QQ(a)}seed(e=C4()){return this._randomizer.seed(e),e}};new T4;function vee(t){let e={};for(let n of t)for(let a in n){let i=n[a];e[a]===void 0?e[a]={...i}:e[a]={...i,...e[a]}}return e}var yee=class extends Yr{dog(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.dog)}cat(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cat)}snake(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.snake)}bear(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.bear)}lion(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.lion)}cetacean(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cetacean)}horse(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.horse)}bird(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.bird)}cow(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cow)}fish(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.fish)}crocodilia(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.crocodilia)}insect(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.insect)}rabbit(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.rabbit)}rodent(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.rodent)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.type)}petName(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.pet_name)}},bee=class extends Yr{author(){return this.faker.helpers.arrayElement(this.faker.definitions.book.author)}format(){return this.faker.helpers.arrayElement(this.faker.definitions.book.format)}genre(){return this.faker.helpers.arrayElement(this.faker.definitions.book.genre)}publisher(){return this.faker.helpers.arrayElement(this.faker.definitions.book.publisher)}series(){return this.faker.helpers.arrayElement(this.faker.definitions.book.series)}title(){return this.faker.helpers.arrayElement(this.faker.definitions.book.title)}},wee={0:[[1999999,2],[2279999,3],[2289999,4],[3689999,3],[3699999,4],[6389999,3],[6397999,4],[6399999,7],[6449999,3],[6459999,7],[6479999,3],[6489999,7],[6549999,3],[6559999,4],[6999999,3],[8499999,4],[8999999,5],[9499999,6],[9999999,7]],1:[[99999,3],[299999,2],[349999,3],[399999,4],[499999,3],[699999,2],[999999,4],[3979999,3],[5499999,4],[6499999,5],[6799999,4],[6859999,5],[7139999,4],[7169999,3],[7319999,4],[7399999,7],[7749999,5],[7753999,7],[7763999,5],[7764999,7],[7769999,5],[7782999,7],[7899999,5],[7999999,4],[8004999,5],[8049999,5],[8379999,5],[8384999,7],[8671999,5],[8675999,4],[8697999,5],[9159999,6],[9165059,7],[9168699,6],[9169079,7],[9195999,6],[9196549,7],[9729999,6],[9877999,4],[9911499,6],[9911999,7],[9989899,6],[9999999,7]]},See=class extends Yr{department(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.department)}productName(){return`${this.productAdjective()} ${this.productMaterial()} ${this.product()}`}price(t={}){let{dec:e=2,max:n=1e3,min:a=1,symbol:i=""}=t;if(a<0||n<0)return`${i}0`;if(a===n)return`${i}${a.toFixed(e)}`;let s=this.faker.number.float({min:a,max:n,fractionDigits:e});if(e===0)return`${i}${s.toFixed(e)}`;let o=s*10**e%10,c=this.faker.helpers.weightedArrayElement([{weight:5,value:9},{weight:3,value:5},{weight:1,value:0},{weight:1,value:this.faker.number.int({min:0,max:9})}]),d=(1/10)**e,m=o*d,f=c*d,p=s-m+f;return a<=p&&p<=n?`${i}${p.toFixed(e)}`:`${i}${s.toFixed(e)}`}productAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.adjective)}productMaterial(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.material)}product(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.product)}productDescription(){return this.faker.helpers.fake(this.faker.definitions.commerce.product_description)}isbn(t={}){typeof t=="number"&&(t={variant:t});let{variant:e=13,separator:n="-"}=t,a="978",[i,s]=this.faker.helpers.objectEntry(wee),o=this.faker.string.numeric(8),c=Number.parseInt(o.slice(0,-1)),d=s.find(([C])=>c<=C)?.[1];if(!d)throw new Un(`Unable to find a registrant length for the group ${i}`);
4370let m=o.slice(0,d),f=o.slice(d),p=[a,i,m,f];e===10&&p.shift();let b=p.join(""),v=0;for(let C=0;C<e-1;C++){let S=e===10?C+1:C%2?3:1;v+=S*Number.parseInt(b[C])}return v=e===10?v%11:(10-v%10)%10,p.push(v===10?"X":v.toString()),p.join(n)}},Fee=class extends Yr{name(){return this.faker.helpers.fake(this.faker.definitions.company.name_pattern)}catchPhrase(){return[this.catchPhraseAdjective(),this.catchPhraseDescriptor(),this.catchPhraseNoun()].join(" ")}buzzPhrase(){return[this.buzzVerb(),this.buzzAdjective(),this.buzzNoun()].join(" ")}catchPhraseAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.company.adjective)}catchPhraseDescriptor(){return this.faker.helpers.arrayElement(this.faker.definitions.company.descriptor)}catchPhraseNoun(){return this.faker.helpers.arrayElement(this.faker.definitions.company.noun)}buzzAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_adjective)}buzzVerb(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_verb)}buzzNoun(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_noun)}},Cee=class extends Yr{column(){return this.faker.helpers.arrayElement(this.faker.definitions.database.column)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.database.type)}collation(){return this.faker.helpers.arrayElement(this.faker.definitions.database.collation)}engine(){return this.faker.helpers.arrayElement(this.faker.definitions.database.engine)}mongodbObjectId(){return this.faker.string.hexadecimal({length:24,casing:"lower",prefix:""})}},_ee={alpha:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],formats:[{country:"AL",total:28,bban:[{type:"n",count:8},{type:"c",count:16}],format:"ALkk bbbs sssx cccc cccc cccc cccc"},{country:"AD",total:24,bban:[{type:"n",count:8},{type:"c",count:12}],format:"ADkk bbbb ssss cccc cccc cccc"},{country:"AT",total:20,bban:[{type:"n",count:5},{type:"n",count:11}],format:"ATkk bbbb bccc cccc cccc"},{country:"AZ",total:28,bban:[{type:"a",count:4},{type:"n",count:20}],format:"AZkk bbbb cccc cccc cccc cccc cccc"},{country:"BH",total:22,bban:[{type:"a",count:4},{type:"c",count:14}],format:"BHkk bbbb cccc cccc cccc cc"},{country:"BE",total:16,bban:[{type:"n",count:3},{type:"n",count:9}],format:"BEkk bbbc cccc ccxx"},{country:"BA",total:20,bban:[{type:"n",count:6},{type:"n",count:10}],format:"BAkk bbbs sscc cccc ccxx"},{country:"BR",total:29,bban:[{type:"n",count:13},{type:"n",count:10},{type:"a",count:1},{type:"c",count:1}],format:"BRkk bbbb bbbb ssss sccc cccc ccct n"},{country:"BG",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"c",count:8}],format:"BGkk bbbb ssss ddcc cccc cc"},{country:"CR",total:22,bban:[{type:"n",count:1},{type:"n",count:3},{type:"n",count:14}],format:"CRkk xbbb cccc cccc cccc cc"},{country:"HR",total:21,bban:[{type:"n",count:7},{type:"n",count:10}],format:"HRkk bbbb bbbc cccc cccc c"},{country:"CY",total:28,bban:[{type:"n",count:8},{type:"c",count:16}],format:"CYkk bbbs ssss cccc cccc cccc cccc"},{country:"CZ",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"CZkk bbbb ssss sscc cccc cccc"},{country:"DK",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"DKkk bbbb cccc cccc cc"},{country:"DO",total:28,bban:[{type:"a",count:4},{type:"n",count:20}],format:"DOkk bbbb cccc cccc cccc cccc cccc"},{country:"TL",total:23,bban:[{type:"n",count:3},{type:"n",count:16}],format:"TLkk bbbc cccc cccc cccc cxx"},{country:"EE",total:20,bban:[{type:"n",count:4},{type:"n",count:12}],format:"EEkk bbss cccc cccc cccx"},{country:"FO",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"FOkk bbbb cccc cccc cx"},{country:"FI",total:18,bban:[{type:"n",count:6},{type:"n",count:8}],format:"FIkk bbbb bbcc cccc cx"},{country:"FR",total:27,bban:[{type:"n",count:10},{type:"c",count:11},{type:"n",count:2}],format:"FRkk bbbb bggg ggcc cccc cccc cxx"},{country:"GE",total:22,bban:[{type:"a",count:2},{type:"n",count:16}],format:"GEkk bbcc cccc cccc cccc cc"},{country:"DE",total:22,bban:[{type:"n",count:8},{type:"n",count:10}],format:"DEkk bbbb bbbb cccc cccc cc"},{country:"GI",total:23,bban:[{type:"a",count:4},{type:"c",count:15}],format:"GIkk bbbb cccc cccc cccc ccc"},{country:"GR",total:27,bban:[{type:"n",count:7}
4370,{type:"c",count:16}],format:"GRkk bbbs sssc cccc cccc cccc ccc"},{country:"GL",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"GLkk bbbb cccc cccc cc"},{country:"GT",total:28,bban:[{type:"c",count:4},{type:"c",count:4},{type:"c",count:16}],format:"GTkk bbbb mmtt cccc cccc cccc cccc"},{country:"HU",total:28,bban:[{type:"n",count:8},{type:"n",count:16}],format:"HUkk bbbs sssk cccc cccc cccc cccx"},{country:"IS",total:26,bban:[{type:"n",count:6},{type:"n",count:16}],format:"ISkk bbbb sscc cccc iiii iiii ii"},{country:"IE",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"n",count:8}],format:"IEkk aaaa bbbb bbcc cccc cc"},{country:"IL",total:23,bban:[{type:"n",count:6},{type:"n",count:13}],format:"ILkk bbbn nncc cccc cccc ccc"},{country:"IT",total:27,bban:[{type:"a",count:1},{type:"n",count:10},{type:"c",count:12}],format:"ITkk xaaa aabb bbbc cccc cccc ccc"},{country:"JO",total:30,bban:[{type:"a",count:4},{type:"n",count:4},{type:"n",count:18}],format:"JOkk bbbb nnnn cccc cccc cccc cccc cc"},{country:"KZ",total:20,bban:[{type:"n",count:3},{type:"c",count:13}],format:"KZkk bbbc cccc cccc cccc"},{country:"XK",total:20,bban:[{type:"n",count:4},{type:"n",count:12}],format:"XKkk bbbb cccc cccc cccc"},{country:"KW",total:30,bban:[{type:"a",count:4},{type:"c",count:22}],format:"KWkk bbbb cccc cccc cccc cccc cccc cc"},{country:"LV",total:21,bban:[{type:"a",count:4},{type:"c",count:13}],format:"LVkk bbbb cccc cccc cccc c"},{country:"LB",total:28,bban:[{type:"n",count:4},{type:"c",count:20}],format:"LBkk bbbb cccc cccc cccc cccc cccc"},{country:"LI",total:21,bban:[{type:"n",count:5},{type:"c",count:12}],format:"LIkk bbbb bccc cccc cccc c"},{country:"LT",total:20,bban:[{type:"n",count:5},{type:"n",count:11}],format:"LTkk bbbb bccc cccc cccc"},{country:"LU",total:20,bban:[{type:"n",count:3},{type:"c",count:13}],format:"LUkk bbbc cccc cccc cccc"},{country:"MK",total:19,bban:[{type:"n",count:3},{type:"c",count:10},{type:"n",count:2}],format:"MKkk bbbc cccc cccc cxx"},{country:"MT",total:31,bban:[{type:"a",count:4},{type:"n",count:5},{type:"c",count:18}],format:"MTkk bbbb ssss sccc cccc cccc cccc ccc"},{country:"MR",total:27,bban:[{type:"n",count:10},{type:"n",count:13}],format:"MRkk bbbb bsss sscc cccc cccc cxx"},{country:"MU",total:30,bban:[{type:"a",count:4},{type:"n",count:4},{type:"n",count:15},{type:"a",count:3}],format:"MUkk bbbb bbss cccc cccc cccc 000d dd"},{country:"MC",total:27,bban:[{type:"n",count:10},{type:"c",count:11},{type:"n",count:2}],format:"MCkk bbbb bsss sscc cccc cccc cxx"},{country:"MD",total:24,bban:[{type:"c",count:2},{type:"c",count:18}],format:"MDkk bbcc cccc cccc cccc cccc"},{country:"ME",total:22,bban:[{type:"n",count:3},{type:"n",count:15}],format:"MEkk bbbc cccc cccc cccc xx"},{country:"NL",total:18,bban:[{type:"a",count:4},{type:"n",count:10}],format:"NLkk bbbb cccc cccc cc"},{country:"NO",total:15,bban:[{type:"n",count:4},{type:"n",count:7}],format:"NOkk bbbb cccc ccx"},{country:"PK",total:24,bban:[{type:"a",count:4},{type:"n",count:16}],format:"PKkk bbbb cccc cccc cccc cccc"},{country:"PS",total:29,bban:[{type:"a",count:4},{type:"n",count:9},{type:"n",count:12}],format:"PSkk bbbb xxxx xxxx xccc cccc cccc c"},{country:"PL",total:28,bban:[{type:"n",count:8},{type:"n",count:16}],format:"PLkk bbbs sssx cccc cccc cccc cccc"},{country:"PT",total:25,bban:[{type:"n",count:8},{type:"n",count:13}],format:"PTkk bbbb ssss cccc cccc cccx x"},{country:"QA",total:29,bban:[{type:"a",count:4},{type:"c",count:21}],format:"QAkk bbbb cccc cccc cccc cccc cccc c"},{country:"RO",total:24,bban:[{type:"a",count:4},{type:"c",count:16}],format:"ROkk bbbb cccc cccc cccc cccc"},{country:"SM",total:27,bban:[{type:"a",count:1},{type:"n",count:10},{type:"c",count:12}],format:"SMkk xaaa aabb bbbc cccc cccc ccc"},{country:"SA",total:24,bban:[{type:"n",count:2},{type:"c",count:18}],format:"SAkk bbcc cccc cccc cccc cccc"},{country:"RS",total:22,bban:[{type:"n",count:3},{type:"n",count:15}],format:"RSkk bbbc cccc cccc cccc xx"},{country:"SK",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"SKkk bbbb ssss sscc cccc cccc"},{country:"SI",total:19,bban:[{type:"n",count:5},{type:"n",count:10}
vendor: 5,830 bytes, line 4370
4370],format:"SIkk bbss sccc cccc cxx"},{country:"ES",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"ESkk bbbb gggg xxcc cccc cccc"},{country:"SE",total:24,bban:[{type:"n",count:3},{type:"n",count:17}],format:"SEkk bbbc cccc cccc cccc cccc"},{country:"CH",total:21,bban:[{type:"n",count:5},{type:"c",count:12}],format:"CHkk bbbb bccc cccc cccc c"},{country:"TN",total:24,bban:[{type:"n",count:5},{type:"n",count:15}],format:"TNkk bbss sccc cccc cccc cccc"},{country:"TR",total:26,bban:[{type:"n",count:5},{type:"n",count:1},{type:"n",count:16}],format:"TRkk bbbb bxcc cccc cccc cccc cc"},{country:"AE",total:23,bban:[{type:"n",count:3},{type:"n",count:16}],format:"AEkk bbbc cccc cccc cccc ccc"},{country:"GB",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"n",count:8}],format:"GBkk bbbb ssss sscc cccc cc"},{country:"VG",total:24,bban:[{type:"a",count:4},{type:"n",count:16}],format:"VGkk bbbb cccc cccc cccc cccc"}],iso3166:["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],mod97:t=>{let e=0;for(let n of t)e=(e*10+ +n)%97;return e},pattern10:["01","02","03","04","05","06","07","08","09"],pattern100:["001","002","003","004","005","006","007","008","009"],toDigitString:t=>t.replaceAll(/[A-Z]/gi,e=>String((e.toUpperCase().codePointAt(0)??Number.NaN)-55))},cl=_ee;function Eee(t){let e="";for(let n=0;n<t.length;n+=4)e+=`${t.substring(n,n+4)} `;return e.trimEnd()}var kee=class extends Yr{accountNumber(e={}){typeof e=="number"&&(e={length:e});let{length:n=8}=e;return this.faker.string.numeric({length:n,allowLeadingZeros:!0})}accountName(){return[this.faker.helpers.arrayElement(this.faker.definitions.finance.account_type),"Account"].join(" ")}routingNumber(){let e=this.faker.string.numeric({length:8,allowLeadingZeros:!0}),n=0;for(let a=0;a<e.length;a+=3)n+=Number(e[a])*3,n+=Number(e[a+1])*7,n+=Number(e[a+2])||0;return`${e}${Math.ceil(n/10)*10-n}`}amount(e={}){let{autoFormat:n=!1,dec:a=2,max:i=1e3,min:s=0,symbol:o=""}=e,c=this.faker.number.float({max:i,min:s,fractionDigits:a}),d=n?c.toLocaleString(void 0,{minimumFractionDigits:a}):c.toFixed(a);return o+d}transactionType(){return this.faker.helpers.arrayElement(this.faker.definitions.finance.transaction_type)}currency(){return this.faker.helpers.arrayElement(this.faker.definitions.finance.currency)}currencyCode(){return this.currency().code}currencyName(){return this.currency().name}currencySymbol(){let e;do e=this.currency().symbol;while(e.length===0);return e}currencyNumericCode(){return this.currency().numericCode}bitcoinAddress(e={}){let{type:n=this.faker.helpers.enumValue(y4),network:a="mainnet"}=e,i=BQ[n],s=i.prefix[a],o=this.faker.number.int(i.length),c=this.faker.string.alphanumeric({length:o-s.length,casing:i.casing,exclude:i.exclude});return s+c}litecoinAddress(){let e=this.faker.number.int({min:26,max:33});return this.faker.string.fromCharacters("LM3")+this.faker.string.fromCharacters("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",e-1)}creditCardNumber(e={}){typeof e=="string"&&(e={issuer:e});let{issuer:n=""}=e,a,i=this.faker.definitions.finance.credit_card,s=n.toLowerCase();if(s in i)a=this.faker.helpers.arrayElement(i[s]);else if(n.includes("#"))a=n;else{let o=this.faker.helpers.objectValue(i);a=this.faker.helpers.arrayElement(o)}return a=a.replaceAll("/",""),this.faker.helpers.replaceCreditCardSymbols(a)}creditCardCVV(){return this.faker.string.numeric({length:3,allowLeadingZeros:!0})}creditCardIssuer(){return this.faker.helpers.objectKey(this.faker.definitions.finance.credit_card)}pin(e={}){typeof e=="number"&&(e={length:e});let{length:n=4}=e;if(n<1)throw new Un("minimum length is 1");return this.faker.string.numeric({length:n,allowLeadingZeros:!0})}ethereumAddress(){return this.faker.string.hexadecimal({length:40,casing:"lower"})}iban(e={}){let{countryCode:n,formatted:a=!1}=e,i=n?cl.formats.find(m=>m.country===n):this.faker.helpers.arrayElement(cl.formats);if(!i)throw new Un(`Country code ${n} not supported.`);let s="",o=0;for(let m of i.bban){let f=m.count;for(o+=m.count;f>0;)m.type==="a"?s+=this.faker.helpers.arrayElement(cl.alpha):m.type==="c"?this.faker.datatype.boolean(.8)?s+=this.faker.number.int(9):s+=this.faker.helpers.arrayElement(cl.alpha):f>=3&&this.faker.datatype.boolean(.3)?this.faker.datatype.boolean()?(s+=this.faker.helpers.arrayElement(cl.pattern100),f-=2):(s+=this.faker.helpers.arrayElement(cl.pattern10),f--):s+=this.faker.number.int(9),f--;s=s.substring(0,o)}let c=98-cl.mod97(cl.toDigitString(`${s}${i.country}00`));c<10&&(c=`0${c}`);let d=`${i.country}${c}${s}`;return a?Eee(d):d}bic(e={}){let{includeBranchCode:n=this.faker.datatype.boolean()}
4370=e,a=this.faker.string.alpha({length:4,casing:"upper"}),i=this.faker.helpers.arrayElement(cl.iso3166),s=this.faker.string.alphanumeric({length:2,casing:"upper"}),o=n?this.faker.datatype.boolean()?this.faker.string.alphanumeric({length:3,casing:"upper"}):"XXX":"";return`${a}${i}${s}${o}`}transactionDescription(){return this.faker.helpers.fake(this.faker.definitions.finance.transaction_description_pattern)}};function Q_(t){return t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var Aee=class extends Yr{adjective(){return this.faker.helpers.arrayElement(this.faker.definitions.food.adjective)}description(){return this.faker.helpers.fake(this.faker.definitions.food.description_pattern)}dish(){return this.faker.datatype.boolean()?Q_(this.faker.helpers.fake(this.faker.definitions.food.dish_pattern)):Q_(this.faker.helpers.arrayElement(this.faker.definitions.food.dish))}ethnicCategory(){return this.faker.helpers.arrayElement(this.faker.definitions.food.ethnic_category)}fruit(){return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit)}ingredient(){return this.faker.helpers.arrayElement(this.faker.definitions.food.ingredient)}meat(){return this.faker.helpers.arrayElement(this.faker.definitions.food.meat)}spice(){return this.faker.helpers.arrayElement(this.faker.definitions.food.spice)}vegetable(){return this.faker.helpers.arrayElement(this.faker.definitions.food.vegetable)}},Nee=" ",Tee=class extends Yr{branch(){let e=this.faker.hacker.noun().replace(" ","-"),n=this.faker.hacker.verb().replace(" ","-");return`${e}-${n}`}commitEntry(e={}){let{merge:n=this.faker.datatype.boolean({probability:.2}),eol:a="CRLF",refDate:i}=e,s=[`commit ${this.faker.git.commitSha()}`];n&&s.push(`Merge: ${this.commitSha({length:7})} ${this.commitSha({length:7})}`);let o=this.faker.person.firstName(),c=this.faker.person.lastName(),d=this.faker.person.fullName({firstName:o,lastName:c}),m=this.faker.internet.username({firstName:o,lastName:c}),f=this.faker.helpers.arrayElement([d,m]),p=this.faker.internet.email({firstName:o,lastName:c});f=f.replaceAll(/^[.,:;"\\']|[<>\n]|[.,:;"\\']$/g,""),s.push(`Author: ${f} <${p}>`,`Date: ${this.commitDate({refDate:i})}`,"",`${Nee.repeat(4)}${this.commitMessage()}`,"");let b=a==="CRLF"?`\r
4371`:`
4372`;return s.join(b)}commitMessage(){return`${this.faker.hacker.verb()} ${this.faker.hacker.adjective()} ${this.faker.hacker.noun()}`}commitDate(e={}){let{refDate:n=this.faker.defaultRefDate()}=e,a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=this.faker.date.recent({days:1,refDate:n}),o=a[s.getUTCDay()],c=i[s.getUTCMonth()],d=s.getUTCDate(),m=s.getUTCHours().toString().padStart(2,"0"),f=s.getUTCMinutes().toString().padStart(2,"0"),p=s.getUTCSeconds().toString().padStart(2,"0"),b=s.getUTCFullYear(),v=this.faker.number.int({min:-11,max:12}),C=Math.abs(v).toString().padStart(2,"0"),S="00",F=v>=0?"+":"-";return`${o} ${c} ${d} ${m}:${f}:${p} ${b} ${F}${C}${S}`}commitSha(e={}){let{length:n=40}=e;return this.faker.string.hexadecimal({length:n,casing:"lower",prefix:""})}},Mee=class extends Yr{abbreviation(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.abbreviation)}adjective(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.adjective)}noun(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.noun)}verb(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.verb)}ingverb(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.ingverb)}phrase(){let e={abbreviation:this.abbreviation,adjective:this.adjective,ingverb:this.ingverb,noun:this.noun,verb:this.verb},n=this.faker.helpers.arrayElement(this.faker.definitions.hacker.phrase);return this.faker.helpers.mustache(n,e)}};function Ree(t){let{deprecated:e,since:n,until:a,proposed:i}=t,s=`[@faker-js/faker]: ${e} is deprecated`;n&&(s+=` since v${n}`),a&&(s+=` and will be removed in v${a}`),i&&(s+=`. Please use ${i} instead`),console.warn(`${s}.`)}var Dee=class extends Yr{avatar(){return this.faker.helpers.arrayElement([this.personPortrait,this.avatarGitHub])()}avatarGitHub(){return`https://avatars.githubusercontent.com/u/${this.faker.number.int(1e8)}`}personPortrait(e={}){let{sex:n=this.faker.person.sexType(),size:a=512}=e;
vendor: 1,062 bytes, line 4372
4372return`https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait/${n}/${a}/${this.faker.number.int({min:0,max:99})}.jpg`}url(e={}){let{width:n=this.faker.number.int({min:1,max:3999}),height:a=this.faker.number.int({min:1,max:3999})}=e;return this.faker.helpers.arrayElement([({width:i,height:s})=>this.urlPicsumPhotos({width:i,height:s,grayscale:!1,blur:0})])({width:n,height:a})}urlLoremFlickr(e={}){Ree({deprecated:"faker.image.urlLoremFlickr()",proposed:"faker.image.url()",since:"10.1.0",until:"11.0.0"});let{width:n=this.faker.number.int({min:1,max:3999}),height:a=this.faker.number.int({min:1,max:3999}),category:i}=e;return`https://loremflickr.com/${n}/${a}${i==null?"":`/${i}`}?lock=${this.faker.number.int()}`}urlPicsumPhotos(e={}){let{width:n=this.faker.number.int({min:1,max:3999}),height:a=this.faker.number.int({min:1,max:3999}),grayscale:i=this.faker.datatype.boolean(),blur:s=this.faker.number.int({max:10})}=e,o=`https://picsum.photos/seed/${this.faker.string.alphanumeric({length:{min:5,max:10}})}/${n}/${a}`,c=typeof s=="number"&&s>=1&&s<=10;
4372return(i||c)&&(o+="?",i&&(o+="grayscale"),i&&c&&(o+="&"),c&&(o+=`blur=${s}`)),o}dataUri(e={}){let{width:n=this.faker.number.int({min:1,max:3999}),height:a=this.faker.number.int({min:1,max:3999}),color:i=this.faker.color.rgb(),type:s=this.faker.helpers.arrayElement(["svg-uri","svg-base64"])}=e,o=`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full" width="${n}" height="${a}"><rect width="100%" height="100%" fill="${i}"/><text x="${n/2}" y="${a/2}" font-size="20" alignment-baseline="middle" text-anchor="middle" fill="white">${n}x${a}</text></svg>`;return s==="svg-uri"?`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(o)}`:`data:image/svg+xml;base64,${b4(o)}`}};function Pee(t,e,n=a=>a){let a={};for(let i of t){let s=e(i);a[s]===void 0&&(a[s]=[]),a[s].push(n(i))}return a}var by={fail:()=>{throw new Un("No words found that match the given length.")},closest:(t,e)=>{let n=Pee(t,c=>c.length),a=Object.keys(n).map(Number),i=Math.min(...a),s=Math.max(...a),o=Math.min(e.min-i,s-e.max);return t.filter(c=>c.length===e.min-o||c.length===e.max+o)},shortest:t=>{let e=Math.min(...t.map(n=>n.length));return t.filter(n=>n.length===e)},longest:t=>{let e=Math.max(...t.map(n=>n.length));return t.filter(n=>n.length===e)},"any-length":t=>[...t]};function mc(t){let{wordList:e,length:n,strategy:a="fail"}=t;if(n!=null){let i=typeof n=="number"?o=>o.length===n:o=>o.length>=n.min&&o.length<=n.max,s=e.filter(i);return s.length>0?s:typeof n=="number"?by[a](e,{min:n,max:n}):by[a](e,n)}else if(a==="shortest"||a==="longest")return by[a](e);return[...e]}var jee=class extends Yr{word(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(mc({...e,wordList:this.faker.definitions.lorem.word}))}words(e=3){return this.faker.helpers.multiple(()=>this.word(),{count:e}).join(" ")}sentence(e={min:3,max:10}){let n=this.words(e);return`${n.charAt(0).toUpperCase()+n.substring(1)}.`}slug(e=3){let n=this.words(e);return this.faker.helpers.slugify(n)}sentences(e={min:2,max:6},n=" "){return this.faker.helpers.multiple(()=>this.sentence(),{count:e}).join(n)}paragraph(e=3){return this.sentences(e)}paragraphs(e=3,n=`
4373`){return this.faker.helpers.multiple(()=>this.paragraph(),{count:e}).join(n)}text(){let e=["sentence","sentences","paragraph","paragraphs","lines"],n=this.faker.helpers.arrayElement(e);return this[n]()}lines(e={min:1,max:5}){return this.sentences(e,`
4374`)}},Lee=class extends Yr{album(){return this.faker.helpers.arrayElement(this.faker.definitions.music.album)}artist(){return this.faker.helpers.arrayElement(this.faker.definitions.music.artist)}genre(){return this.faker.helpers.arrayElement(this.faker.definitions.music.genre)}songName(){return this.faker.helpers.arrayElement(this.faker.definitions.music.song_name)}},Iee=class extends Yr{number(e={}){let{style:n="human"}=e,a=this.faker.definitions.phone_number.format[n];if(!a)throw new Error(`No definitions for ${n} in this locale`);let i=this.faker.helpers.arrayElement(a);return E4(this.faker,i)}imei(){return this.faker.helpers.replaceCreditCardSymbols("##-######-######-L","#")}},Bee=class extends Yr{chemicalElement(){return this.faker.helpers.arrayElement(this.faker.definitions.science.chemical_element)}unit(){return this.faker.helpers.arrayElement(this.faker.definitions.science.unit)}},Oee=["video","audio","image","text","application"],Uee=["application/pdf","audio/mpeg","audio/wav","image/png","image/jpeg","image/gif","video/mp4","video/mpeg","text/html"],zee=["en","wl","ww"],eE={index:"o",slot:"s",mac:"x",pci:"p"},Gee=["SUN","MON","TUE","WED","THU","FRI","SAT"],Hee=class extends Yr{fileName(e={}){let{extensionCount:n=1}=e,a=this.faker.word.words().toLowerCase().replaceAll(/\W/g,"_"),i=this.faker.helpers.multiple(()=>this.fileExt(),{count:n}).join(".");return i.length===0?a:`${a}.${i}`}commonFileName(e){return`${this.fileName({extensionCount:0})}.${e||this.commonFileExt()}`}mimeType(){let e=Object.keys(this.faker.definitions.system.mime_type);return this.faker.helpers.arrayElement(e)}commonFileType(){return this.faker.helpers.arrayElement(Oee)}commonFileExt(){return this.fileExt(this.faker.helpers.arrayElement(Uee))}fileType(){let e=this.faker.definitions.system.mime_type,n=new Set(Object.keys(e).map(a=>a.split("/")[0]));return this.faker.helpers.arrayElement([...n])}fileExt(e){let n=this.faker.definitions.system.mime_type;if(typeof e=="string")return this.faker.helpers.arrayElement(n[e].extensions);let a=new Set(Object.values(n).flatMap(({extensions:i})=>i));return this.faker.helpers.arrayElement([...a])}directoryPath(){let e=this.faker.definitions.system.directory_path;return this.faker.helpers.arrayElement(e)}filePath(){return`${this.directoryPath()}/${this.fileName()}`}semver(){return[this.faker.number.int(9),this.faker.number.int(20),this.faker.number.int(20)].join(".")}networkInterface(e={}){let{interfaceType:n=this.faker.helpers.arrayElement(zee),interfaceSchema:a=this.faker.helpers.objectKey(eE)}=e,i,s="";switch(a){case"index":{i=this.faker.string.numeric();break}case"slot":{i=`${this.faker.string.numeric()}${this.faker.helpers.maybe(()=>`f${this.faker.string.numeric()}`)??""}${this.faker.helpers.maybe(()=>`d${this.faker.string.numeric()}`)??""}`;break}case"mac":{i=this.faker.internet.mac("");break}case"pci":{s=this.faker.helpers.maybe(()=>`P${this.faker.string.numeric()}`)??"",i=`${this.faker.string.numeric()}s${this.faker.string.numeric()}${this.faker.helpers.maybe(()=>`f${this.faker.string.numeric()}`)??""}${this.faker.helpers.maybe(()=>`d${this.faker.string.numeric()}`)??""}`;break}}return`${s}${n}${eE[a]}${i}`}cron(e={}){let{includeYear:n=!1,includeNonStandard:a=!1}=e,i=[this.faker.number.int(59),"*"],s=[this.faker.number.int(23),"*"],o=[this.faker.number.int({min:1,max:31}
4374),"*","?"],c=[this.faker.number.int({min:1,max:12}),"*"],d=[this.faker.number.int(6),this.faker.helpers.arrayElement(Gee),"*","?"],m=[this.faker.number.int({min:1970,max:2099}),"*"],f=this.faker.helpers.arrayElement(i),p=this.faker.helpers.arrayElement(s),b=this.faker.helpers.arrayElement(o),v=this.faker.helpers.arrayElement(c),C=this.faker.helpers.arrayElement(d),S=this.faker.helpers.arrayElement(m),F=`${f} ${p} ${b} ${v} ${C}`;n&&(F+=` ${S}`);let w=["@annually","@daily","@hourly","@monthly","@reboot","@weekly","@yearly"];return!a||this.faker.datatype.boolean()?F:this.faker.helpers.arrayElement(w)}},Wee=class extends Yr{vehicle(){return`${this.manufacturer()} ${this.model()}`}manufacturer(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.manufacturer)}model(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.model)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.type)}fuel(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.fuel)}vin(){let e=["o","i","q","O","I","Q"];return`${this.faker.string.alphanumeric({length:10,casing:"upper",exclude:e})}${this.faker.string.alpha({length:1,casing:"upper",exclude:e})}${this.faker.string.alphanumeric({length:1,casing:"upper",exclude:e})}${this.faker.string.numeric({length:5,allowLeadingZeros:!0})}`}color(){return this.faker.color.human()}vrm(){return`${this.faker.string.alpha({length:2,casing:"upper"})}${this.faker.string.numeric({length:2,allowLeadingZeros:!0})}${this.faker.string.alpha({length:3,casing:"upper"})}`}bicycle(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.bicycle_type)}},Vee=class extends Yr{adjective(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.adjective}))}adverb(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.adverb}))}conjunction(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.conjunction}))}interjection(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.interjection}))}noun(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.noun}))}preposition(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.preposition}))}verb(t={}){return typeof t=="number"&&(t={length:t}),this.faker.helpers.arrayElement(mc({...t,wordList:this.faker.definitions.word.verb}))}sample(t={}){let e=this.faker.helpers.shuffle([this.adjective,this.adverb,this.conjunction,this.interjection,this.noun,this.preposition,this.verb]);for(let n of e)try{return n(t)}catch{continue}throw new Un("No matching word data available for the current locale")}words(t={}){typeof t=="number"&&(t={count:t});let{count:e={min:1,max:3}}=t;return this.faker.helpers.multiple(()=>this.sample(),{count:e}).join(" ")}},$ee=class extends T4{rawDefinitions;definitions;airline=new DQ(this);animal=new yee(this);book=new bee(this);color=new LQ(this);commerce=new See(this);company=new Fee(this);database=new Cee(this);date=new ree(this);finance=new kee(this);food=new Aee(this);git=new Tee(this);hacker=new Mee(this);helpers=new mee(this);image=new Dee(this);internet=new KQ(this);location=new fee(this);lorem=new jee(this);music=new Lee(this);person=new YQ(this);phone=new Iee(this);science=new Bee(this);system=new Hee(this);
4374vehicle=new Wee(this);word=new Vee(this);constructor(e){super({randomizer:e.randomizer,seed:e.seed});let{locale:n}=e;if(Array.isArray(n)){if(n.length===0)throw new Un("The locale option must contain at least one locale definition.");n=vee(n)}this.rawDefinitions=n,this.definitions=tee(this.rawDefinitions)}getMetadata(){return this.rawDefinitions.metadata??{}}},Kee=["Academy Color Encoding System (ACES)","Adobe RGB","Adobe Wide Gamut RGB","British Standard Colour (BS)","CIE 1931 XYZ","CIELAB","CIELUV","CIEUVW","CMY","CMYK","DCI-P3","Display-P3","Federal Standard 595C","HKS","HSL","HSLA","HSLuv","HSV","HWB","LCh","LMS","Munsell Color System","Natural Color System (NSC)","Pantone Matching System (PMS)","ProPhoto RGB Color Space","RAL","RG","RGBA","RGK","Rec. 2020","Rec. 2100","Rec. 601","Rec. 709","Uniform Color Spaces (UCSs)","YDbDr","YIQ","YPbPr","sRGB","sYCC","scRGB","xvYCC"],Yee={space:Kee},qee=Yee,Jee=["ascii_bin","ascii_general_ci","cp1250_bin","cp1250_general_ci","utf8_bin","utf8_general_ci","utf8_unicode_ci"],Xee=["ARCHIVE","BLACKHOLE","CSV","InnoDB","MEMORY","MyISAM"],Zee=["bigint","binary","bit","blob","boolean","date","datetime","decimal","double","enum","float","geometry","int","mediumint","point","real","serial","set","smallint","text","time","timestamp","tinyint","varchar"],Qee={collation:Jee,engine:Xee,type:Zee},ete=Qee,M4=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/Ne
4374w_York","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kirov","Europe/Kyiv","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kanton","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],tte={time_zone:M4},nte=tte,rte=["ADP","AGP","AI","API","ASCII","CLI","COM","CSS","DNS","DRAM","EXE","FTP","GB","HDD","HEX","HTTP","IB","IP","JBOD","JSON","OCR","PCI","PNG","RAM","RSS","SAS","SCSI","SDD","SMS","SMTP","SQL","SSD","SSL","TCP","THX","TLS","UDP","USB","UTF8","VGA","XML","XSS"],ate={abbreviation:rte},ite=ate,ste={smiley:["☠️","☹️","☺️","❣️","❤️","❤️‍🔥","❤️‍🩹","👁️‍🗨️","👹","👺","👻","👽","👾","👿","💀","💋","💌","💓","💔","💕","💖","💗","💘","💙","💚","💛","💜","💝","💞","💟","💢","💣","💤","💥","💦","💨","💩","💫","💬","💭","💯","🕳️","🖤","🗨️","🗯️","😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😮‍💨","😯","😰","😱","😲","😳","😴","😵","😵‍💫","😶","😶‍🌫️","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄","🙈","🙉","🙊","🤍","🤎","🤐","🤑","🤒","🤓","🤔","🤕","🤖","🤗","🤠","🤡","🤢","🤣","🤤","🤥","🤧","🤨","🤩","🤪","🤫","🤬","🤭","🤮","🤯","🥰","🥱","🥲","🥳","🥴","🥵","🥶","🥸","🥺","🧐","🧡"],body:["☝🏻","☝🏼","☝🏽","☝🏾","☝🏿","☝️","✊","✊ðŸ
4374»","✊🏼","✊🏽","✊🏾","✊🏿","✋","✋🏻","✋🏼","✋🏽","✋🏾","✋🏿","✌🏻","✌🏼","✌🏽","✌🏾","✌🏿","✌️","✍🏻","✍🏼","✍🏽","✍🏾","✍🏿","✍️","👀","👁️","👂","👂🏻","👂🏼","👂🏽","👂🏾","👂🏿","👃","👃🏻","👃🏼","👃🏽","👃🏾","👃🏿","👄","👅","👆","👆🏻","👆🏼","👆🏽","👆🏾","👆🏿","👇","👇🏻","👇🏼","👇🏽","👇🏾","👇🏿","👈","👈🏻","👈🏼","👈🏽","👈🏾","👈🏿","👉","👉🏻","👉🏼","👉🏽","👉🏾","👉🏿","👊","👊🏻","👊🏼","👊🏽","👊🏾","👊🏿","👋","👋🏻","👋🏼","👋🏽","👋🏾","👋🏿","👌","👌🏻","👌🏼","👌🏽","👌🏾","👌🏿","👍","👍🏻","👍🏼","👍🏽","👍🏾","👍🏿","👎","👎🏻","👎🏼","👎🏽","👎🏾","👎🏿","👏","👏🏻","👏🏼","👏🏽","👏🏾","👏🏿","👐","👐🏻","👐🏼","👐🏽","👐🏾","👐🏿","💅","💅🏻","💅🏼","💅🏽","💅🏾","💅🏿","💪","💪🏻","💪🏼","💪🏽","💪🏾","💪🏿","🖐🏻","🖐🏼","🖐🏽","🖐🏾","🖐🏿","🖐️","🖕","🖕🏻","🖕🏼","🖕🏽","🖕🏾","🖕🏿","🖖","🖖🏻","🖖🏼","🖖🏽","🖖🏾","🖖🏿","🙌","🙌🏻","🙌🏼","🙌🏽","🙌🏾","🙌🏿","🙏","🙏🏻","🙏🏼","🙏🏽","🙏🏾","🙏🏿","🤌","🤌🏻","🤌🏼","🤌🏽","🤌🏾","🤌🏿","🤏","🤏🏻","🤏🏼","🤏🏽","🤏🏾","🤏🏿","🤘","🤘🏻","🤘🏼","🤘🏽","🤘🏾","🤘🏿","🤙","🤙🏻","🤙🏼","🤙🏽","🤙🏾","🤙🏿","🤚","🤚🏻","🤚🏼","🤚🏽","🤚🏾","🤚🏿","🤛","🤛🏻","🤛🏼","🤛🏽","🤛🏾","🤛🏿","🤜","🤜🏻","🤜🏼","🤜🏽","🤜🏾","🤜🏿","🤝","🤞","🤞🏻","🤞🏼","🤞🏽","🤞🏾","🤞🏿","🤟","🤟🏻","🤟🏼","🤟🏽","🤟🏾","🤟🏿","🤲","🤲🏻","🤲🏼","🤲🏽","🤲🏾","🤲🏿","🤳","🤳🏻","🤳🏼","🤳🏽","🤳🏾","🤳🏿","🦴","🦵","🦵🏻","🦵🏼","🦵🏽","🦵🏾","🦵🏿","🦶","🦶🏻","🦶🏼","🦶🏽","🦶🏾","🦶🏿","🦷","🦻","🦻🏻","🦻🏼","🦻🏽","🦻🏾","🦻🏿","🦾","🦿","🧠","🫀","🫁"],person:["🎅","🎅🏻","🎅🏼","🎅🏽","🎅🏾","🎅🏿","👦","👦🏻","👦🏼","👦🏽","👦🏾","👦🏿","👧","👧🏻","👧🏼","👧🏽","👧🏾","👧🏿","👨","👨‍⚕️","👨‍⚖️","👨‍✈️","👨‍🌾","👨‍🍳","👨‍🍼","👨‍🎓","👨‍🎤","👨‍🎨","👨‍🏫","👨‍🏭","👨‍💻","👨‍💼","👨‍🔧","👨‍🔬","👨‍🚀","👨‍🚒","👨‍🦰","👨‍🦱","👨‍🦲","👨‍🦳","👨🏻","👨🏻‍⚕️","👨🏻‍⚖️","👨🏻‍✈️","👨🏻‍🌾","👨🏻‍🍳","👨🏻‍🍼","👨🏻‍🎓","👨🏻‍🎤","👨🏻‍🎨","👨🏻‍🏫","👨🏻‍🏭","👨🏻‍💻","👨🏻‍💼","👨🏻‍🔧","👨🏻‍🔬","👨🏻‍🚀","👨🏻‍🚒","👨🏻‍🦰","👨🏻‍🦱","👨🏻‍🦲","👨🏻‍🦳","👨🏼","👨🏼‍⚕️","👨🏼‍⚖️","👨🏼‍✈️","👨🏼‍🌾","👨🏼‍🍳","👨🏼‍🍼","👨🏼‍🎓","👨🏼‍🎤","👨🏼‍🎨","👨🏼‍🏫","👨🏼‍🏭","👨🏼‍💻","👨🏼‍💼","👨🏼‍🔧","👨🏼‍🔬","👨🏼‍🚀","👨🏼‍🚒","👨🏼‍🦰","👨🏼‍🦱","👨🏼‍🦲","👨🏼‍🦳","👨🏽","👨🏽‍⚕️","👨🏽‍⚖️","👨🏽‍✈️","👨🏽‍🌾","👨🏽‍🍳","👨🏽‍🍼","👨🏽‍🎓","👨🏽‍🎤","👨🏽‍🎨","👨🏽‍🏫","👨🏽‍🏭","👨🏽‍💻","👨🏽‍💼","👨🏽‍🔧","👨🏽‍🔬","👨🏽‍🚀","👨🏽‍🚒","👨🏽‍🦰","👨🏽‍🦱","👨🏽‍🦲","👨🏽‍🦳","👨🏾","👨🏾‍⚕️","👨🏾‍⚖️","👨🏾‍✈️","👨🏾‍🌾","👨🏾‍🍳","👨🏾‍🍼","👨🏾‍🎓","👨🏾‍🎤","👨🏾‍🎨","👨🏾‍🏫","👨🏾‍🏭","👨🏾‍💻","👨🏾‍💼","👨🏾‍🔧","👨🏾‍🔬","👨🏾‍🚀","👨🏾‍🚒","👨🏾‍🦰","👨🏾‍🦱","👨🏾‍🦲","👨🏾‍🦳","👨🏿","👨🏿‍⚕️","👨🏿‍⚖️","👨🏿‍✈️","👨🏿‍🌾","👨🏿‍🍳","👨🏿‍🍼","👨🏿‍🎓","👨🏿‍🎤","👨🏿‍🎨","👨🏿‍🏫","👨🏿‍🏭","👨🏿‍💻","👨🏿‍💼","👨🏿‍🔧","👨🏿‍🔬","👨🏿‍🚀","👨🏿‍🚒","👨🏿‍🦰","👨🏿‍🦱","👨🏿‍🦲","👨🏿‍🦳","👩","👩‍⚕️","👩‍⚖️","👩‍✈️","👩‍🌾","👩‍🍳","👩‍🍼","👩‍🎓","👩‍🎤","👩‍🎨","👩‍🏫","👩‍🏭","👩‍💻","👩‍💼","👩‍🔧","👩‍🔬","👩‍🚀","👩‍🚒","👩‍🦰","👩‍🦱","👩‍🦲","👩‍🦳","👩🏻","👩🏻‍⚕️","👩🏻‍⚖️","👩🏻‍✈️","👩🏻‍🌾","👩🏻‍🍳","👩🏻‍🍼","👩🏻‍🎓","👩🏻‍🎤","👩🏻‍🎨","👩🏻‍🏫","👩🏻‍🏭","👩🏻‍💻","👩🏻‍💼","👩🏻‍🔧","👩🏻‍🔬","👩🏻‍🚀","👩🏻‍🚒","👩🏻‍🦰","👩🏻‍🦱","👩🏻‍🦲","👩🏻‍🦳","👩🏼","👩🏼‍⚕️","👩🏼‍⚖️","👩🏼‍✈️","👩🏼‍🌾","👩🏼‍🍳","👩🏼‍🍼","👩🏼‍🎓","👩🏼‍🎤","👩🏼‍🎨","👩🏼‍🏫","👩🏼‍🏭","👩🏼‍💻","👩🏼‍💼","👩🏼‍🔧","👩🏼‍🔬","👩🏼‍🚀","👩🏼‍🚒","👩🏼‍🦰","👩🏼‍🦱","👩🏼‍🦲","👩🏼‍🦳","👩🏽","👩🏽‍⚕️","👩🏽‍⚖️","👩🏽‍✈️","👩🏽‍🌾","👩🏽‍🍳","👩🏽‍🍼","👩🏽‍🎓","👩🏽‍🎤","👩🏽‍🎨","👩🏽‍🏫","👩🏽‍🏭","👩🏽‍💻","👩🏽‍💼","👩🏽‍🔧","👩🏽‍🔬","👩🏽‍🚀","👩🏽‍🚒","👩🏽‍🦰","👩🏽‍🦱","👩🏽‍🦲","👩🏽‍🦳","👩🏾","👩🏾‍⚕️","👩🏾‍⚖️","👩🏾‍✈️","👩🏾‍🌾","👩🏾‍🍳","👩🏾‍🍼","👩🏾‍🎓","👩🏾‍🎤","👩🏾‍🎨","👩🏾‍🏫","👩🏾‍🏭","👩🏾‍💻","👩🏾‍💼","👩🏾‍🔧","👩🏾‍🔬","👩🏾‍🚀","👩🏾‍🚒","👩🏾‍🦰","👩🏾‍🦱","👩🏾‍🦲","👩🏾‍🦳","👩🏿","👩🏿‍⚕️","👩🏿‍⚖️","👩🏿‍✈️","👩🏿‍🌾","👩🏿‍🍳","👩🏿‍🍼","👩🏿‍🎓","👩🏿‍🎤","👩🏿‍🎨","👩🏿‍🏫","👩🏿‍🏭","👩🏿‍💻","👩🏿‍💼","👩🏿‍🔧","👩🏿‍🔬","👩🏿‍🚀","👩🏿‍🚒","👩🏿‍🦰","👩🏿‍🦱","👩🏿‍🦲","👩🏿‍🦳","👮","👮‍♀️","👮‍♂️","👮🏻","👮🏻‍♀️","👮🏻‍♂️","👮🏼","👮🏼‍♀️","👮🏼‍♂️","👮🏽","👮🏽‍♀️","👮🏽‍♂️","👮🏾","👮🏾‍♀️","👮🏾‍♂️","👮🏿","👮🏿‍♀️","👮🏿‍♂️","👰","👰‍♀️","👰‍♂️","👰🏻","👰🏻‍♀️","👰🏻‍♂️","👰🏼","👰🏼‍♀️","👰🏼‍♂️","👰🏽","👰🏽‍♀️","👰🏽‍♂️","👰🏾","👰🏾‍♀️","👰🏾‍♂️","👰🏿","👰🏿‍♀️","👰🏿‍♂️","👱","👱‍♀️","👱‍♂️","👱🏻","👱🏻‍♀️","👱🏻‍♂️","👱🏼","👱🏼‍♀️","👱🏼‍♂️","👱🏽","👱🏽‍♀️","👱🏽‍♂️","👱🏾","👱🏾‍♀️","👱🏾‍♂️","👱🏿","👱🏿‍♀️","👱🏿‍♂️","👲","👲🏻","👲🏼","👲🏽","👲🏾","👲🏿","👳","👳‍♀️","👳‍♂️","👳🏻","👳🏻‍♀️","👳🏻‍♂️","👳🏼","👳🏼‍♀️","👳🏼‍♂️","👳🏽","👳🏽‍♀️","👳🏽‍♂️","👳🏾","👳🏾‍♀️","👳🏾‍♂️","👳🏿","👳🏿‍♀️","👳🏿‍♂️","👴","👴🏻","👴🏼","👴🏽","👴🏾","👴🏿","👵","👵🏻","👵🏼","👵🏽","👵🏾","👵🏿","👶","👶🏻","👶🏼","👶🏽","👶🏾","👶🏿","👷","👷‍♀️","👷‍♂️","👷🏻","👷🏻‍♀️","👷🏻‍♂️","👷🏼","👷🏼‍♀️","👷🏼‍♂️","👷🏽","👷🏽‍♀️","👷🏽‍♂️","👷🏾","👷🏾‍♀️","👷🏾‍♂️","👷🏿","👷🏿‍♀️","👷🏿‍♂️","👸","👸🏻","👸🏼","👸🏽","👸🏾","👸🏿","👼","👼🏻","👼🏼","👼🏽","👼🏾","👼🏿","💁","💁‍♀️","💁‍♂️","💁🏻","💁🏻‍♀️","💁🏻‍♂️","💁🏼","💁🏼‍♀️","💁🏼‍♂️","💁🏽","💁🏽‍♀️","💁🏽‍♂️","💁🏾","💁🏾‍♀️","💁🏾‍♂️","💁🏿","💁🏿‍♀️","💁🏿‍♂️","💂","💂‍♀️","💂‍♂️","💂🏻","💂🏻‍♀️","💂🏻‍♂️","💂🏼","💂🏼‍♀️","💂🏼‍♂️","💂🏽","💂🏽‍♀️","💂🏽‍♂️","💂🏾","💂🏾‍♀️","💂🏾‍♂️","💂🏿","💂🏿‍♀️","💂🏿‍♂️","💆","💆‍♀️","💆‍♂️","💆🏻","💆🏻‍♀️","💆🏻‍♂️","💆🏼","💆🏼‍♀️","💆🏼‍♂️","💆🏽","💆🏽‍♀️","💆🏽‍♂️","💆🏾","💆🏾‍♀️","💆🏾‍♂️","💆🏿","💆🏿‍♀️","💆🏿‍♂️","💇","💇🏻","💇🏼","💇🏽","🕵🏻","🕵🏻‍♀️","🕵🏻‍♂️","🕵🏼","🕵🏼‍♀️","🕵🏼‍♂️","🕵🏽","🕵🏽‍♀️","🕵🏽‍♂️","🕵🏾","🕵🏾‍♀️","🕵🏾‍♂️","🕵🏿","🕵🏿‍♀️","🕵🏿‍♂️","🕵️","🕵️‍♀️","🕵️‍♂️","🙅","🙅‍♀️","🙅‍♂️","🙅🏻","🙅🏻‍♀️","🙅🏻‍♂️","🙅🏼","🙅🏼‍♀️","🙅🏼‍♂️","🙅🏽","🙅🏽‍♀️","🙅🏽‍♂️","🙅🏾","🙅🏾‍♀️","🙅🏾‍♂️","🙅🏿","🙅🏿‍♀️","🙅🏿‍♂️","🙆","🙆‍♀️","🙆‍♂️","🙆🏻","🙆🏻‍♀️","🙆🏻‍♂️","🙆🏼","🙆🏼‍♀️","🙆🏼‍♂️","🙆🏽","🙆🏽‍♀️","🙆🏽‍♂️","🙆🏾","🙆🏾‍♀️","🙆🏾‍♂️","🙆🏿","🙆🏿‍♀️","🙆🏿‍♂️","🙇","🙇‍♀️","🙇‍♂️","🙇🏻","🙇🏻‍♀️","🙇🏻‍♂️","🙇🏼","🙇🏼‍♀️","🙇🏼‍♂️","🙇🏽","🙇🏽‍♀️","🙇🏽‍♂️","🙇🏾","🙇🏾‍♀️","🙇🏾‍♂️","🙇🏿","🙇🏿‍♀️","🙇🏿‍♂️","🙋","🙋‍♀️","🙋‍♂️","🙋🏻","🙋🏻‍♀️","🙋🏻‍♂️","🙋🏼","🙋🏼‍♀️","🙋🏼‍♂️","🙋🏽","🙋🏽‍♀️","🙋🏽‍♂️","🙋🏾","🙋🏾‍♀️","🙋🏾‍♂️","🙋🏿","🙋🏿‍♀️","🙋🏿‍♂️","🙍","🙍‍♀️","🙍‍♂️","🙍🏻","🙍🏻‍♀️","🙍🏻‍♂️","🙍🏼","🙍🏼‍♀️","🙍🏼‍♂️","🙍🏽","🙍🏽‍♀️","🙍🏽‍♂️","🙍🏾","🙍🏾‍♀️","🙍🏾‍♂️","🙍🏿","🙍🏿‍♀️","🙍🏿‍♂️","🙎","🙎‍♀️","🙎‍♂️","🙎🏻","🙎🏻‍♀️","🙎🏻‍♂️","🙎🏼","🙎🏼‍♀️","🙎🏼‍♂️","🙎🏽","🙎🏽‍♀️","🙎🏽‍♂️","🙎🏾","🙎🏾‍♀️","🙎🏾‍♂️","🙎🏿","🙎🏿‍♀️","🙎🏿‍♂️","🤦","🤦‍♀️","🤦‍♂️","🤦🏻","🤦🏻‍♀️","🤦🏻‍♂️","🤦🏼","🤦🏼‍♀️","🤦🏼‍♂️","🤦🏽","🤦🏽‍♀️","🤦🏽‍♂️","🤦🏾","🤦🏾‍♀️","🤦🏾‍♂️","🤦🏿","🤦🏿‍♀️","🤦🏿‍♂️","🤰","🤰🏻","🤰🏼","🤰🏽","🤰🏾","🤰🏿","🤱","🤱🏻","🤱🏼","🤱🏽","🤱🏾","🤱🏿","🤴","🤴🏻","🤴🏼","🤴🏽","🤴🏾","🤴🏿","🤵","🤵‍♀️","🤵‍♂️","🤵🏻","🤵🏻‍♀️","🤵🏻‍♂️","🤵🏼","🤵🏼‍♀️","🤵🏼‍♂️","🤵🏽","🤵🏽‍♀️","🤵🏽‍♂️","🤵🏾","🤵🏾‍♀️","🤵🏾‍♂️","🤵🏿","🤵🏿‍♀️","🤵🏿‍♂️","🤶","🤶🏻","🤶🏼","🤶🏽","🤶🏾","🤶🏿","🤷","🤷‍♀️","🤷‍♂️","🤷🏻","🤷🏻‍♀️","🤷🏻‍♂️","🤷🏼","🤷🏼‍♀️","🤷🏼‍♂️","🤷🏽","🤷🏽‍♀️","🤷🏽‍♂️","🤷🏾","🤷🏾‍♀️","🤷🏾‍♂️","🤷🏿","🤷🏿‍♀️","🤷🏿‍♂️","🥷","🥷🏻","🥷🏼","🥷🏽","🥷🏾","🥷🏿","🦸","🦸‍♀️","🦸‍♂️","🦸🏻","🦸🏻‍♀️","🦸🏻‍♂️","🦸🏼","🦸🏼‍♀️","🦸🏼‍♂️","🦸🏽","🦸🏽‍♀️","🦸🏽‍♂️","🦸🏾","🦸🏾‍♀️","🦸🏾‍♂️","🦸🏿","🦸🏿‍♀️","🦸🏿‍♂️","🦹","🦹‍♀️","🦹‍♂️","🦹🏻","🦹🏻‍♀️","🦹🏻‍♂️","🦹🏼","🦹🏼‍♀️","🦹🏼‍♂️","🦹🏽","🦹🏽‍♀️","🦹🏽‍♂️","🦹🏾","🦹🏾‍♀️","🦹🏾‍♂️","🦹🏿","🦹🏿‍♀️","🦹🏿‍♂️","🧏","🧏‍♀️","🧏‍♂️","🧏🏻","🧏🏻‍♀️","🧏🏻‍♂️","🧏🏼","🧏🏼‍♀️","🧏🏼‍♂️","🧏🏽","🧏🏽‍♀️","🧏🏽‍♂️","🧏🏾","🧏🏾‍♀️","🧏🏾‍♂️","🧏🏿","🧏🏿‍♀️","🧏🏿‍♂️","🧑","🧑‍⚕️","🧑‍⚖️","🧑‍✈️","🧑‍🌾","🧑‍🍳","🧑‍🍼","🧑‍🎄","🧑‍🎓","🧑‍🎤","🧑‍🎨","🧑‍🏫","🧑‍🏭","🧑‍💻","🧑‍💼","🧑‍🔧","🧑‍🔬","🧑‍🚀","🧑‍🚒","🧑‍🦰","🧑‍🦱","🧑‍🦲","🧑‍🦳","🧑🏻","🧑🏻‍⚕️","🧑🏻‍⚖️","🧑🏻‍✈️","🧑🏻‍🌾","🧑🏻‍🍳","🧑🏻‍🍼","🧑🏻‍🎄","🧑🏻‍🎓","🧑🏻‍🎤","🧑🏻‍🎨","🧑🏻‍🏫","🧑🏻‍🏭","🧑🏻‍💻","🧑🏻‍💼","🧑🏻‍🔧","🧑🏻‍🔬","🧑🏻‍🚀","🧑🏻‍🚒","🧑🏻‍🦰","🧑🏻‍🦱","🧑🏻‍🦲","🧑🏻‍🦳","🧑🏼","🧑🏼‍⚕️","🧑🏼‍⚖️","🧑🏼‍✈️","🧑🏼‍🌾","🧑🏼‍🍳","🧑🏼‍🍼","🧑🏼‍🎄","🧑🏼‍🎓","🧑🏼‍🎤","🧑🏼‍🎨","🧑🏼‍🏫","🧑🏼‍🏭","🧑🏼‍💻","🧑🏼‍💼","🧑🏼‍🔧","🧑🏼‍🔬","🧑🏼‍🚀","🧑🏼‍🚒","🧑🏼‍🦰","🧑🏼‍🦱","🧑🏼‍🦲","🧑🏼‍🦳","🧑🏽","🧑🏽‍⚕️","🧑🏽‍⚖️","🧑🏽‍✈️","🧑🏽‍🌾","🧑🏽‍🍳","🧑🏽‍🍼","🧑🏽‍🎄","🧑🏽‍🎓","🧑🏽‍🎤","🧑🏽‍🎨","🧑🏽‍🏫","🧑🏽‍🏭","🧑🏽‍💻","🧑🏽‍💼","🧑🏽‍🔧","🧑🏽‍🔬","🧑🏽‍🚀","🧑🏽‍🚒","🧑🏽‍🦰","🧑🏽‍🦱","🧑🏽‍🦲","🧑🏽‍🦳","🧑🏾","🧑🏾‍⚕️","🧑🏾‍⚖️","🧑🏾‍✈️","🧑🏾‍🌾","🧑🏾‍🍳","🧑🏾‍🍼","🧑🏾‍🎄","🧑🏾‍🎓","🧑🏾‍🎤","🧑🏾‍🎨","🧑🏾‍🏫","🧑🏾‍🏭","🧑🏾‍💻","🧑🏾‍💼","🧑🏾‍🔧","🧑🏾‍🔬","🧑🏾‍🚀","🧑🏾‍🚒","🧑🏾‍🦰","🧑🏾‍🦱","🧑🏾‍🦲","🧑🏾‍🦳","🧑🏿","🧑🏿‍⚕️","🧑🏿‍⚖️","🧑🏿‍✈️","🧑🏿‍🌾","🧑🏿‍🍳","🧑🏿‍🍼","🧑🏿‍🎄","🧑🏿‍🎓","🧑🏿‍🎤","🧑🏿‍🎨","🧑🏿‍🏫","🧑🏿‍🏭","🧑🏿‍💻","🧑🏿‍💼","🧑🏿‍🔧","🧑🏿‍🔬","🧑🏿‍🚀","🧑ðŸ
4374¿â€ðŸš’","🧑🏿‍🦰","🧑🏿‍🦱","🧑🏿‍🦲","🧑🏿‍🦳","🧒","🧒🏻","🧒🏼","🧒🏽","🧒🏾","🧒🏿","🧓","🧓🏻","🧓🏼","🧓🏽","🧓🏾","🧓🏿","🧔","🧔‍♀️","🧔‍♂️","🧔🏻","🧔🏻‍♀️","🧔🏻‍♂️","🧔🏼","🧔🏼‍♀️","🧔🏼‍♂️","🧔🏽","🧔🏽‍♀️","🧔🏽‍♂️","🧔🏾","🧔🏾‍♀️","🧔🏾‍♂️","🧔🏿","🧔🏿‍♀️","🧔🏿‍♂️","🧕","🧕🏻","🧕🏼","🧕🏽","🧕🏾","🧕🏿","🧙","🧙‍♀️","🧙‍♂️","🧙🏻","🧙🏻‍♀️","🧙🏻‍♂️","🧙🏼","🧙🏼‍♀️","🧙🏼‍♂️","🧙🏽","🧙🏽‍♀️","🧙🏽‍♂️","🧙🏾","🧙🏾‍♀️","🧙🏾‍♂️","🧙🏿","🧙🏿‍♀️","🧙🏿‍♂️","🧚","🧚‍♀️","🧚‍♂️","🧚🏻","🧚🏻‍♀️","🧚🏻‍♂️","🧚🏼","🧚🏼‍♀️","🧚🏼‍♂️","🧚🏽","🧚🏽‍♀️","🧚🏽‍♂️","🧚🏾","🧚🏾‍♀️","🧚🏾‍♂️","🧚🏿","🧚🏿‍♀️","🧚🏿‍♂️","🧛","🧛‍♀️","🧛‍♂️","🧛🏻","🧛🏻‍♀️","🧛🏻‍♂️","🧛🏼","🧛🏼‍♀️","🧛🏼‍♂️","🧛🏽","🧛🏽‍♀️","🧛🏽‍♂️","🧛🏾","🧛🏾‍♀️","🧛🏾‍♂️","🧛🏿","🧛🏿‍♀️","🧛🏿‍♂️","🧜","🧜‍♀️","🧜‍♂️","🧜🏻","🧜🏻‍♀️","🧜🏻‍♂️","🧜🏼","🧜🏼‍♀️","🧜🏼‍♂️","🧜🏽","🧜🏽‍♀️","🧜🏽‍♂️","🧜🏾","🧜🏾‍♀️","🧜🏾‍♂️","🧜🏿","🧜🏿‍♀️","🧜🏿‍♂️","🧝","🧝‍♀️","🧝‍♂️","🧝🏻","🧝🏻‍♀️","🧝🏻‍♂️","🧝🏼","🧝🏼‍♀️","🧝🏼‍♂️","🧝🏽","🧝🏽‍♀️","🧝🏽‍♂️","🧝🏾","🧝🏾‍♀️","🧝🏾‍♂️","🧝🏿","🧝🏿‍♀️","🧝🏿‍♂️","🧞","🧞‍♀️","🧞‍♂️","🧟","🧟‍♀️","🧟‍♂️"],nature:["☘️","🌱","🌲","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻","🌼","🌾","🌿","🍀","🍁","🍂","🍃","🏵️","🐀","🐁","🐂","🐃","🐄","🐅","🐆","🐇","🐈","🐈‍⬛","🐉","🐊","🐋","🐌","🐍","🐎","🐏","🐐","🐑","🐒","🐓","🐔","🐕","🐕‍🦺","🐖","🐗","🐘","🐙","🐚","🐛","🐜","🐝","🐞","🐟","🐠","🐡","🐢","🐣","🐤","🐥","🐦","🐧","🐨","🐩","🐪","🐫","🐬","🐭","🐮","🐯","🐰","🐱","🐲","🐳","🐴","🐵","🐶","🐷","🐸","🐹","🐺","🐻","🐻‍❄️","🐼","🐽","🐾","🐿️","💐","💮","🕊️","🕷️","🕸️","🥀","🦁","🦂","🦃","🦄","🦅","🦆","🦇","🦈","🦉","🦊","🦋","🦌","🦍","🦎","🦏","🦒","🦓","🦔","🦕","🦖","🦗","🦘","🦙","🦚","🦛","🦜","🦝","🦟","🦠","🦡","🦢","🦣","🦤","🦥","🦦","🦧","🦨","🦩","🦫","🦬","🦭","🦮","🪰","🪱","🪲","🪳","🪴","🪶"],food:["☕","🌭","🌮","🌯","🌰","🌶️","🌽","🍄","🍅","🍆","🍇","🍈","🍉","🍊","🍋","🍌","🍍","🍎","🍏","🍐","🍑","🍒","🍓","🍔","🍕","🍖","🍗","🍘","🍙","🍚","🍛","🍜","🍝","🍞","🍟","🍠","🍡","🍢","🍣","🍤","🍥","🍦","🍧","🍨","🍩","🍪","🍫","🍬","🍭","🍮","🍯","🍰","🍱","🍲","🍳","🍴","🍵","🍶","🍷","🍸","🍹","🍺","🍻","🍼","🍽️","🍾","🍿","🎂","🏺","🔪","🥂","🥃","🥄","🥐","🥑","🥒","🥓","🥔","🥕","🥖","🥗","🥘","🥙","🥚","🥛","🥜","🥝","🥞","🥟","🥠","🥡","🥢","🥣","🥤","🥥","🥦","🥧","🥨","🥩","🥪","🥫","🥬","🥭","🥮","🥯","🦀","🦐","🦑","🦞","🦪","🧀","🧁","🧂","🧃","🧄","🧅","🧆","🧇","🧈","🧉","🧊","🧋","🫐","🫑","🫒","🫓","🫔","🫕","🫖"],travel:["⌚","⌛","⏰","⏱️","⏲️","⏳","☀️","☁️","☂️","☃️","☄️","☔","♨️","⚓","⚡","⛄","⛅","⛈️","⛩️","⛪","⛰️","⛱️","⛲","⛴️","⛵","⛺","⛽","✈️","❄️","⭐","🌀","🌁","🌂","🌃","🌄","🌅","🌆","🌇","🌈","🌉","🌊","🌋","🌌","🌍","🌎","🌏","🌐","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","🌝","🌞","🌟","🌠","🌡️","🌤️","🌥️","🌦️","🌧️","🌨️","🌩️","🌪️","🌫️","🌬️","🎠","🎡","🎢","🎪","🏍️","🏎️","🏔️","🏕️","🏖️","🏗️","🏘️","🏙️","🏚️","🏛️","🏜️","🏝️","🏞️","🏟️","🏠","🏡","🏢","🏣","🏤","🏥","🏦","🏨","🏩","🏪","🏫","🏬","🏭","🏯","🏰","💈","💒","💧","💺","🔥","🕋","🕌","🕍","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧","🕰️","🗺️","🗻","🗼","🗽","🗾","🚀","🚁","🚂","🚃","🚄","🚅","🚆","🚇","🚈","🚉","🚊","🚋","🚌","🚍","🚎","🚏","🚐","🚑","🚒","🚓","🚔","🚕","🚖","🚗","🚘","🚙","🚚","🚛","🚜","🚝","🚞","🚟","🚠","🚡","🚢","🚤","🚥","🚦","🚧","🚨","🚲","🛎️","🛑","🛕","🛖","🛢️","🛣️","🛤️","🛥️","🛩️","🛫","🛬","🛰️","🛳️","🛴","🛵","🛶","🛸","🛹","🛺","🛻","🛼","🦼","🦽","🧭","🧱","🧳","🪂","🪐","🪨","🪵"],activity:["♟️","♠️","♣️","♥️","♦️","⚽","⚾","⛳","⛸️","✨","🀄","🃏","🎀","🎁","🎃","🎄","🎆","🎇","🎈","🎉","🎊","🎋","🎍","🎎","🎏","🎐","🎑","🎖️","🎗️","🎟️","🎣","🎨","🎫","🎭","🎮","🎯","🎰","🎱","🎲","🎳","🎴","🎽","🎾","🎿","🏀","🏅","🏆","🏈","🏉","🏏","🏐","🏑","🏒","🏓","🏸","🔮","🕹️","🖼️","🛷","🤿","🥅","🥇","🥈","🥉","🥊","🥋","🥌","🥍","🥎","🥏","🧧","🧨","🧩","🧵","🧶","🧸","🧿","🪀","🪁","🪄","🪅","🪆","🪡","🪢"],object:["⌨️","☎️","⚒️","⚔️","⚖️","⚗️","⚙️","⚰️","⚱️","⛏️","⛑️","⛓️","✂️","✉️","✏️","✒️","🎒","🎓","🎙️","🎚️","🎛️","🎞️","🎤","🎥","🎧","🎩","🎬","🎵","🎶","🎷","🎸","🎹","🎺","🎻","🎼","🏮","🏷️","🏹","👑","👒","👓","👔","👕","👖","👗","👘","👙","👚","👛","👜","👝","👞","👟","👠","👡","👢","💄","💉","💊","💍","💎","💡","💰","💳","💴","💵","💶","💷","💸","💹","💻","💼","💽","💾","💿","📀","📁","📂","📃","📄","📅","📆","📇","📈","📉","📊","📋","📌","📍","📎","📏","📐","📑","📒","📓","📔","📕","📖","📗","📘","📙","📚","📜","📝","📞","📟","📠","📡","📢","📣","📤","📥","📦","📧","📨","📩","📪","📫","📬","📭","📮","📯","📰","📱","📲","📷","📸","📹","📺","📻","📼","📽️","📿","🔇","🔈","🔉","🔊","🔋","🔌","🔍","🔎","🔏","🔐","🔑","🔒","🔓","🔔","🔕","🔖","🔗","🔦","🔧","🔨","🔩","🔫","🔬","🔭","🕯️","🕶️","🖇️","🖊️","🖋️","🖌️","🖍️","🖥️","🖨️","🖱️","🖲️","🗂️","🗃️","🗄️","🗑️","🗒️","🗓️","🗜️","🗝️","🗞️","🗡️","🗳️","🗿","🚪","🚬","🚽","🚿","🛁","🛋️","🛍️","🛏️","🛒","🛗","🛠️","🛡️","🥁","🥻","🥼","🥽","🥾","🥿","🦯","🦺","🧢","🧣","🧤","🧥","🧦","🧪","🧫","🧬","🧮","🧯","🧰","🧲","🧴","🧷","🧹","🧺","🧻","🧼","🧽","🧾","🩰","🩱","🩲","🩳","🩴","🩸","🩹","🩺","🪃","🪑","🪒","🪓","🪔","🪕","🪖","🪗","🪘","🪙","🪚","🪛","🪜","🪝","🪞","🪟","🪠","🪣","🪤","🪥","🪦","🪧"],symbol:["#️⃣","*️⃣","0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","©️","®️","‼️","⁉️","™️","ℹ️","↔️","↕️","↖️","↗️","↘️","↙️","↩️","↪️","⏏️","⏩","⏪","⏫","⏬","⏭️","⏮️","⏯️","⏸️","⏹️","⏺️","Ⓜ️","▪️","▫️","▶️","◀️","◻️","◼️","◽","◾","☑️","☢️","☣️","☦️","☪️","☮️","☯️","☸️","♀️","♂️","♈","♉","♊","♋","♌","♍","♎","♏","♐","♑","♒","♓","♻️","♾️","♿","⚕️","⚛️","⚜️","⚠️","⚧️","⚪","⚫","⛎","⛔","✅","✔️","✖️","✝️","âœ
4374¡ï¸","✳️","✴️","❇️","❌","❎","❓","❔","❕","❗","➕","➖","➗","➡️","➰","➿","⤴️","⤵️","⬅️","⬆️","⬇️","⬛","⬜","⭕","〰️","〽️","㊗️","㊙️","🅰️","🅱️","🅾️","🅿️","🆎","🆑","🆒","🆓","🆔","🆕","🆖","🆗","🆘","🆙","🆚","🈁","🈂️","🈚","🈯","🈲","🈳","🈴","🈵","🈶","🈷️","🈸","🈹","🈺","🉐","🉑","🎦","🏧","💠","💱","💲","📛","📳","📴","📵","📶","🔀","🔁","🔂","🔃","🔄","🔅","🔆","🔘","🔙","🔚","🔛","🔜","🔝","🔞","🔟","🔠","🔡","🔢","🔣","🔤","🔯","🔰","🔱","🔲","🔳","🔴","🔵","🔶","🔷","🔸","🔹","🔺","🔻","🔼","🔽","🕉️","🕎","🚫","🚭","🚮","🚯","🚰","🚱","🚳","🚷","🚸","🚹","🚺","🚻","🚼","🚾","🛂","🛃","🛄","🛅","🛐","🟠","🟡","🟢","🟣","🟤","🟥","🟦","🟧","🟨","🟩","🟪","🟫"],flag:["🇦🇨","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇳","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼","🎌","🏁","🏳️","🏳️‍⚧️","🏳️‍🌈","🏴","🏴‍☠️","🚩"]},ote={informational:[100,101,102,103],success:[200,201,202,203,204,205,206,207,208,226],redirection:[300,301,302,303,304,305,306,307,308],clientError:[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451],serverError:[500,501,502,503,504,505,506,507,508,510,511]},lte=["ES256","ES384","ES512","HS256","HS384","HS512","PS256","PS384","PS512","RS256","RS384","RS512","none"],cte=["FakerBot/{{system.semver}}","Googlebot/2.1 (+http://www.google.com/bot.html)",'Mozilla/5.0 (Linux; Android {{number.int({"min":5,"max":13})}}; {{helpers.arrayElement(["SM-G998U","SM-G998B","SM-G998N","SM-G998P","SM-T800"])}}) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Mobile Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:{{number.int({"min":75, "max":133})}}.0) Gecko/20100101 Firefox/{{number.int({"min":75, "max":133})}}.0','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Version/16.1 Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_15_7) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Windows NT {{helpers.arrayElement(["5.1","5.2","6.0","6.1","6.2","6.3","10.0"])}}; Win64; x64) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} Edg/{{number.int({"min":110,"max":131})}}.{{system.semver}}','Mozilla/5.0 (X11; Linux x86_64; rv:{{number.int({"min":75,"max":133})}}.0) Gecko/20100101 Firefox/{{number.int({"min":75,"max":133})}}.0','Mozilla/5.0 (compatible; MSIE {{number.int({"min":6,"max":10})}}.0; Windows NT {{helpers.arrayElement(["5.1","5.2","6.0","6.1","6.2","6.3","10.0"])}}; Trident/{{number.int({"min":4,"max":7})}}.0)','Mozilla/5.0 (iPhone; CPU iPhone OS {{number.int({"min":10,"max":18})}}_{{number.int({"min":0,"max":4})}} like Mac OS X) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Version/{{number.int({"min":10,"max":18})}}_{{number.int({"min":0,"max":4})}} Mobile/15E148 Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}'],ute={emoji:ste,http_status_code:ote,jwt_algorithm:lte,user_agent_pattern:cte},dte=ute,hte=[{alpha2:"AD",alpha3:"AND",numeric:"020"},{alpha2:"AE",alpha3:"ARE",numeric:"784"},{alpha2:"AF",alpha3:"AFG",numeric:"004"},{alpha2:"AG",alpha3:"ATG",numeric:"028"},{alpha2:"AI",alpha3:"AIA",numeric:"660"},{alpha2:"AL",alpha3:"ALB",numeric:"008"},{alpha2:"AM",alpha3:"ARM",numeric:"051"},{alpha2:"AO",alpha3:"AGO",numeric:"024"},{alpha2:"AQ",alpha3:"ATA",numeric:"010"},{alpha2:"AR",alpha3:"ARG",numeric:"032"},{alpha2:"AS",alpha3:"ASM",numeric:"016"},{alpha2:"AT",alpha3:"AUT",numeric:"040"},{alpha2:"AU",alpha3:"AUS",numeric:"036"},{alpha2:"AW",alpha3:"ABW",numeric:"533"},{alpha2:"AX",alpha3:"ALA",numeric:"248"},{alpha2:"AZ",alpha3:"AZE",numeric:"031"},{alpha2:"BA",alpha3:"BIH",numeric:"070"},{alpha2:"BB",alpha3:"BRB",numeric:"052"},{alpha2:"BD",alpha3:"BGD",numeric:"050"},{alpha2:"BE",alpha3:"BEL",numeric:"056"},{alpha2:"BF",alpha3:"BFA",numeric:"854"},{alpha2:"BG",alpha3:"BGR",numeric:"100"},{alpha2:"BH",alpha3:"BHR",numeric:"048"}
4374,{alpha2:"BI",alpha3:"BDI",numeric:"108"},{alpha2:"BJ",alpha3:"BEN",numeric:"204"},{alpha2:"BL",alpha3:"BLM",numeric:"652"},{alpha2:"BM",alpha3:"BMU",numeric:"060"},{alpha2:"BN",alpha3:"BRN",numeric:"096"},{alpha2:"BO",alpha3:"BOL",numeric:"068"},{alpha2:"BQ",alpha3:"BES",numeric:"535"},{alpha2:"BR",alpha3:"BRA",numeric:"076"},{alpha2:"BS",alpha3:"BHS",numeric:"044"},{alpha2:"BT",alpha3:"BTN",numeric:"064"},{alpha2:"BV",alpha3:"BVT",numeric:"074"},{alpha2:"BW",alpha3:"BWA",numeric:"072"},{alpha2:"BY",alpha3:"BLR",numeric:"112"},{alpha2:"BZ",alpha3:"BLZ",numeric:"084"},{alpha2:"CA",alpha3:"CAN",numeric:"124"},{alpha2:"CC",alpha3:"CCK",numeric:"166"},{alpha2:"CD",alpha3:"COD",numeric:"180"},{alpha2:"CF",alpha3:"CAF",numeric:"140"},{alpha2:"CG",alpha3:"COG",numeric:"178"},{alpha2:"CH",alpha3:"CHE",numeric:"756"},{alpha2:"CI",alpha3:"CIV",numeric:"384"},{alpha2:"CK",alpha3:"COK",numeric:"184"},{alpha2:"CL",alpha3:"CHL",numeric:"152"},{alpha2:"CM",alpha3:"CMR",numeric:"120"},{alpha2:"CN",alpha3:"CHN",numeric:"156"},{alpha2:"CO",alpha3:"COL",numeric:"170"},{alpha2:"CR",alpha3:"CRI",numeric:"188"},{alpha2:"CU",alpha3:"CUB",numeric:"192"},{alpha2:"CV",alpha3:"CPV",numeric:"132"},{alpha2:"CW",alpha3:"CUW",numeric:"531"},{alpha2:"CX",alpha3:"CXR",numeric:"162"},{alpha2:"CY",alpha3:"CYP",numeric:"196"},{alpha2:"CZ",alpha3:"CZE",numeric:"203"},{alpha2:"DE",alpha3:"DEU",numeric:"276"},{alpha2:"DJ",alpha3:"DJI",numeric:"262"},{alpha2:"DK",alpha3:"DNK",numeric:"208"},{alpha2:"DM",alpha3:"DMA",numeric:"212"},{alpha2:"DO",alpha3:"DOM",numeric:"214"},{alpha2:"DZ",alpha3:"DZA",numeric:"012"},{alpha2:"EC",alpha3:"ECU",numeric:"218"},{alpha2:"EE",alpha3:"EST",numeric:"233"},{alpha2:"EG",alpha3:"EGY",numeric:"818"},{alpha2:"EH",alpha3:"ESH",numeric:"732"},{alpha2:"ER",alpha3:"ERI",numeric:"232"},{alpha2:"ES",alpha3:"ESP",numeric:"724"},{alpha2:"ET",alpha3:"ETH",numeric:"231"},{alpha2:"FI",alpha3:"FIN",numeric:"246"},{alpha2:"FJ",alpha3:"FJI",numeric:"242"},{alpha2:"FK",alpha3:"FLK",numeric:"238"},{alpha2:"FM",alpha3:"FSM",numeric:"583"},{alpha2:"FO",alpha3:"FRO",numeric:"234"},{alpha2:"FR",alpha3:"FRA",numeric:"250"},{alpha2:"GA",alpha3:"GAB",numeric:"266"},{alpha2:"GB",alpha3:"GBR",numeric:"826"},{alpha2:"GD",alpha3:"GRD",numeric:"308"},{alpha2:"GE",alpha3:"GEO",numeric:"268"},{alpha2:"GF",alpha3:"GUF",numeric:"254"},{alpha2:"GG",alpha3:"GGY",numeric:"831"},{alpha2:"GH",alpha3:"GHA",numeric:"288"},{alpha2:"GI",alpha3:"GIB",numeric:"292"},{alpha2:"GL",alpha3:"GRL",numeric:"304"},{alpha2:"GM",alpha3:"GMB",numeric:"270"},{alpha2:"GN",alpha3:"GIN",numeric:"324"},{alpha2:"GP",alpha3:"GLP",numeric:"312"},{alpha2:"GQ",alpha3:"GNQ",numeric:"226"},{alpha2:"GR",alpha3:"GRC",numeric:"300"},{alpha2:"GS",alpha3:"SGS",numeric:"239"},{alpha2:"GT",alpha3:"GTM",numeric:"320"},{alpha2:"GU",alpha3:"GUM",numeric:"316"},{alpha2:"GW",alpha3:"GNB",numeric:"624"},{alpha2:"GY",alpha3:"GUY",numeric:"328"},{alpha2:"HK",alpha3:"HKG",numeric:"344"},{alpha2:"HM",alpha3:"HMD",numeric:"334"},{alpha2:"HN",alpha3:"HND",numeric:"340"},{alpha2:"HR",alpha3:"HRV",numeric:"191"},{alpha2:"HT",alpha3:"HTI",numeric:"332"},{alpha2:"HU",alpha3:"HUN",numeric:"348"},{alpha2:"ID",alpha3:"IDN",numeric:"360"},{alpha2:"IE",alpha3:"IRL",numeric:"372"},{alpha2:"IL",alpha3:"ISR",numeric:"376"},{alpha2:"IM",alpha3:"IMN",numeric:"833"},{alpha2:"IN",alpha3:"IND",numeric:"356"},{alpha2:"IO",alpha3:"IOT",numeric:"086"},{alpha2:"IQ",alpha3:"IRQ",numeric:"368"},{alpha2:"IR",alpha3:"IRN",numeric:"364"},{alpha2:"IS",alpha3:"ISL",numeric:"352"},{alpha2:"IT",alpha3:"ITA",numeric:"380"},{alpha2:"JE",alpha3:"JEY",numeric:"832"},{alpha2:"JM",alpha3:"JAM",numeric:"388"},{alpha2:"JO",alpha3:"JOR",numeric:"400"},{alpha2:"JP",alpha3:"JPN",numeric:"392"},{alpha2:"KE",alpha3:"KEN",numeric:"404"},{alpha2:"KG",alpha3:"KGZ",numeric:"417"},{alpha2:"KH",alpha3:"KHM",numeric:"116"},{alpha2:"KI",alpha3:"KIR",numeric:"296"},{alpha2:"KM",alpha3:"COM",numeric:"174"},{alpha2:"KN",alpha3:"KNA",numeric:"659"},{alpha2:"KP",alpha3:"PRK",numeric:"408"},{alpha2:"KR",alpha3:"KOR",numeric:"410"},{alpha2:"KW",alpha3:"KWT",numeric:"414"},{alpha2:"KY",alpha3:"CYM",numeric:"136"},{alpha2:"KZ",alpha3:"KAZ",numeric:"398"},{alpha2:"LA",alpha3:"LAO",numeric:"418"},{alpha2:"LB",alpha3:"LBN",numeric:"422"},{alpha2:"LC",alpha3:"LCA",numeric:"662"},{alpha2:"LI",alpha3:"LIE",numeric:"438"},{alpha2:"LK",alpha3:"LKA",numeric:"144"},{alpha2:"LR",alpha3:"LBR",numeric:"430"},{alpha2:"LS",alpha3:"LSO",numeric:"426"},{alpha2:"LT",alpha3:"LTU",numeric:"440"},{alpha2:"LU",alpha3:"LUX",numeric:"442"},{alpha2:"LV",alpha3:"LVA",numeric:"428"},{alpha2:"LY",alpha3:"LBY",numeric:"434"},{alpha2:"MA",alpha3:"MAR",numeric:"504"},{alpha2:"MC",alpha3:"MCO",numeric:"492"},{alpha2:"MD",alpha3:"MDA",numeric:"498"},{alpha2:"ME",alpha3:"MNE",numeric:"499"},{alpha2:"MF",alpha3:"MAF",numeric:"663"},{alpha2:"MG",alpha3:"MDG",numeric:"450"},{alpha2:"MH",alpha3:"MHL",numeric:"584"},{alpha2:"MK",alpha3:"MKD",numeric:"807"},{alpha2:"ML",alpha3:"MLI",numeric:"466"},{alpha2:"MM",alpha3:"MMR",numeric:"104"},{alpha2:"MN",alpha3:"MNG",numeric:"496"},{alpha2:"MO",alpha3:"MAC",numeric:"446"},{alpha2:"MP",alpha3:"MNP",numeric:"580"}
4374,{alpha2:"MQ",alpha3:"MTQ",numeric:"474"},{alpha2:"MR",alpha3:"MRT",numeric:"478"},{alpha2:"MS",alpha3:"MSR",numeric:"500"},{alpha2:"MT",alpha3:"MLT",numeric:"470"},{alpha2:"MU",alpha3:"MUS",numeric:"480"},{alpha2:"MV",alpha3:"MDV",numeric:"462"},{alpha2:"MW",alpha3:"MWI",numeric:"454"},{alpha2:"MX",alpha3:"MEX",numeric:"484"},{alpha2:"MY",alpha3:"MYS",numeric:"458"},{alpha2:"MZ",alpha3:"MOZ",numeric:"508"},{alpha2:"NA",alpha3:"NAM",numeric:"516"},{alpha2:"NC",alpha3:"NCL",numeric:"540"},{alpha2:"NE",alpha3:"NER",numeric:"562"},{alpha2:"NF",alpha3:"NFK",numeric:"574"},{alpha2:"NG",alpha3:"NGA",numeric:"566"},{alpha2:"NI",alpha3:"NIC",numeric:"558"},{alpha2:"NL",alpha3:"NLD",numeric:"528"},{alpha2:"NO",alpha3:"NOR",numeric:"578"},{alpha2:"NP",alpha3:"NPL",numeric:"524"},{alpha2:"NR",alpha3:"NRU",numeric:"520"},{alpha2:"NU",alpha3:"NIU",numeric:"570"},{alpha2:"NZ",alpha3:"NZL",numeric:"554"},{alpha2:"OM",alpha3:"OMN",numeric:"512"},{alpha2:"PA",alpha3:"PAN",numeric:"591"},{alpha2:"PE",alpha3:"PER",numeric:"604"},{alpha2:"PF",alpha3:"PYF",numeric:"258"},{alpha2:"PG",alpha3:"PNG",numeric:"598"},{alpha2:"PH",alpha3:"PHL",numeric:"608"},{alpha2:"PK",alpha3:"PAK",numeric:"586"},{alpha2:"PL",alpha3:"POL",numeric:"616"},{alpha2:"PM",alpha3:"SPM",numeric:"666"},{alpha2:"PN",alpha3:"PCN",numeric:"612"},{alpha2:"PR",alpha3:"PRI",numeric:"630"},{alpha2:"PS",alpha3:"PSE",numeric:"275"},{alpha2:"PT",alpha3:"PRT",numeric:"620"},{alpha2:"PW",alpha3:"PLW",numeric:"585"},{alpha2:"PY",alpha3:"PRY",numeric:"600"},{alpha2:"QA",alpha3:"QAT",numeric:"634"},{alpha2:"RE",alpha3:"REU",numeric:"638"},{alpha2:"RO",alpha3:"ROU",numeric:"642"},{alpha2:"RS",alpha3:"SRB",numeric:"688"},{alpha2:"RU",alpha3:"RUS",numeric:"643"},{alpha2:"RW",alpha3:"RWA",numeric:"646"},{alpha2:"SA",alpha3:"SAU",numeric:"682"},{alpha2:"SB",alpha3:"SLB",numeric:"090"},{alpha2:"SC",alpha3:"SYC",numeric:"690"},{alpha2:"SD",alpha3:"SDN",numeric:"729"},{alpha2:"SE",alpha3:"SWE",numeric:"752"},{alpha2:"SG",alpha3:"SGP",numeric:"702"},{alpha2:"SH",alpha3:"SHN",numeric:"654"},{alpha2:"SI",alpha3:"SVN",numeric:"705"},{alpha2:"SJ",alpha3:"SJM",numeric:"744"},{alpha2:"SK",alpha3:"SVK",numeric:"703"},{alpha2:"SL",alpha3:"SLE",numeric:"694"},{alpha2:"SM",alpha3:"SMR",numeric:"674"},{alpha2:"SN",alpha3:"SEN",numeric:"686"},{alpha2:"SO",alpha3:"SOM",numeric:"706"},{alpha2:"SR",alpha3:"SUR",numeric:"740"},{alpha2:"SS",alpha3:"SSD",numeric:"728"},{alpha2:"ST",alpha3:"STP",numeric:"678"},{alpha2:"SV",alpha3:"SLV",numeric:"222"},{alpha2:"SX",alpha3:"SXM",numeric:"534"},{alpha2:"SY",alpha3:"SYR",numeric:"760"},{alpha2:"SZ",alpha3:"SWZ",numeric:"748"},{alpha2:"TC",alpha3:"TCA",numeric:"796"},{alpha2:"TD",alpha3:"TCD",numeric:"148"},{alpha2:"TF",alpha3:"ATF",numeric:"260"},{alpha2:"TG",alpha3:"TGO",numeric:"768"},{alpha2:"TH",alpha3:"THA",numeric:"764"},{alpha2:"TJ",alpha3:"TJK",numeric:"762"},{alpha2:"TK",alpha3:"TKL",numeric:"772"},{alpha2:"TL",alpha3:"TLS",numeric:"626"},{alpha2:"TM",alpha3:"TKM",numeric:"795"},{alpha2:"TN",alpha3:"TUN",numeric:"788"},{alpha2:"TO",alpha3:"TON",numeric:"776"},{alpha2:"TR",alpha3:"TUR",numeric:"792"},{alpha2:"TT",alpha3:"TTO",numeric:"780"},{alpha2:"TV",alpha3:"TUV",numeric:"798"},{alpha2:"TW",alpha3:"TWN",numeric:"158"},{alpha2:"TZ",alpha3:"TZA",numeric:"834"},{alpha2:"UA",alpha3:"UKR",numeric:"804"},{alpha2:"UG",alpha3:"UGA",numeric:"800"},{alpha2:"UM",alpha3:"UMI",numeric:"581"},{alpha2:"US",alpha3:"USA",numeric:"840"},{alpha2:"UY",alpha3:"URY",numeric:"858"},{alpha2:"UZ",alpha3:"UZB",numeric:"860"},{alpha2:"VA",alpha3:"VAT",numeric:"336"},{alpha2:"VC",alpha3:"VCT",numeric:"670"},{alpha2:"VE",alpha3:"VEN",numeric:"862"},{alpha2:"VG",alpha3:"VGB",numeric:"092"},{alpha2:"VI",alpha3:"VIR",numeric:"850"},{alpha2:"VN",alpha3:"VNM",numeric:"704"},{alpha2:"VU",alpha3:"VUT",numeric:"548"},{alpha2:"WF",alpha3:"WLF",numeric:"876"},{alpha2:"WS",alpha3:"WSM",numeric:"882"},{alpha2:"YE",alpha3:"YEM",numeric:"887"},{alpha2:"YT",alpha3:"MYT",numeric:"175"},{alpha2:"ZA",alpha3:"ZAF",numeric:"710"},{alpha2:"ZM",alpha3:"ZMB",numeric:"894"},{alpha2:"ZW",alpha3:"ZWE",numeric:"716"}],mte={country_code:hte,time_zone:M4}
4374,fte=mte,pte={title:"Base",code:"base"},gte=pte,xte=["/Applications","/bin","/boot","/boot/defaults","/dev","/etc","/etc/defaults","/etc/mail","/etc/namedb","/etc/periodic","/etc/ppp","/home","/home/user","/home/user/dir","/lib","/Library","/lost+found","/media","/mnt","/net","/Network","/opt","/opt/bin","/opt/include","/opt/lib","/opt/sbin","/opt/share","/private","/private/tmp","/private/var","/proc","/rescue","/root","/sbin","/selinux","/srv","/sys","/System","/tmp","/Users","/usr","/usr/X11R6","/usr/bin","/usr/include","/usr/lib","/usr/libdata","/usr/libexec","/usr/local/bin","/usr/local/src","/usr/obj","/usr/ports","/usr/sbin","/usr/share","/usr/src","/var","/var/log","/var/mail","/var/spool","/var/tmp","/var/yp"],vte={"application/epub+zip":{extensions:["epub"]},"application/gzip":{extensions:["gz"]},"application/java-archive":{extensions:["jar","war","ear"]},"application/json":{extensions:["json","map"]},"application/ld+json":{extensions:["jsonld"]},"application/msword":{extensions:["doc","dot"]},"application/octet-stream":{extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/ogg":{extensions:["ogx"]},"application/pdf":{extensions:["pdf"]},"application/rtf":{extensions:["rtf"]},"application/vnd.amazon.ebook":{extensions:["azw"]},"application/vnd.apple.installer+xml":{extensions:["mpkg"]},"application/vnd.mozilla.xul+xml":{extensions:["xul"]},"application/vnd.ms-excel":{extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-fontobject":{extensions:["eot"]},"application/vnd.ms-powerpoint":{extensions:["ppt","pps","pot"]},"application/vnd.oasis.opendocument.presentation":{extensions:["odp"]},"application/vnd.oasis.opendocument.spreadsheet":{extensions:["ods"]},"application/vnd.oasis.opendocument.text":{extensions:["odt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{extensions:["docx"]},"application/vnd.rar":{extensions:["rar"]},"application/vnd.visio":{extensions:["vsd","vst","vss","vsw"]},"application/x-7z-compressed":{extensions:["7z"]},"application/x-abiword":{extensions:["abw"]},"application/x-bzip":{extensions:["bz"]},"application/x-bzip2":{extensions:["bz2","boz"]},"application/x-csh":{extensions:["csh"]},"application/x-freearc":{extensions:["arc"]},"application/x-httpd-php":{extensions:["php"]},"application/x-sh":{extensions:["sh"]},"application/x-tar":{extensions:["tar"]},"application/xhtml+xml":{extensions:["xhtml","xht"]},"application/xml":{extensions:["xml","xsl","xsd","rng"]},"application/zip":{extensions:["zip"]},"audio/3gpp":{extensions:["3gpp"]},"audio/3gpp2":{extensions:["3g2"]},"audio/aac":{extensions:["aac"]},"audio/midi":{extensions:["mid","midi","kar","rmi"]},"audio/mpeg":{extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/ogg":{extensions:["oga","ogg","spx","opus"]},"audio/opus":{extensions:["opus"]},"audio/wav":{extensions:["wav"]},"audio/webm":{extensions:["weba"]},"font/otf":{extensions:["otf"]},"font/ttf":{extensions:["ttf"]},"font/woff":{extensions:["woff"]},"font/woff2":{extensions:["woff2"]},"image/avif":{extensions:["avif"]},"image/bmp":{extensions:["bmp"]},"image/gif":{extensions:["gif"]},"image/jpeg":{extensions:["jpeg","jpg","jpe"]},"image/png":{extensions:["png"]},"image/svg+xml":{extensions:["svg","svgz"]},"image/tiff":{extensions:["tif","tiff"]},"image/vnd.microsoft.icon":{extensions:["ico"]},"image/webp":{extensions:["webp"]},"text/calendar":{extensions:["ics","ifb"]},"text/css":{extensions:["css"]},"text/csv":{extensions:["csv"]},"text/html":{extensions:["html","htm","shtml"]},"text/javascript":{extensions:["js","mjs"]},"text/plain":{extensions:["txt","text","conf","def","list","log","in","ini"]},"video/3gpp":{extensions:["3gp","3gpp"]},"video/3gpp2":{extensions:["3g2"]},"video/mp2t":{extensions:["ts"]},"video/mp4":{extensions:["mp4","mp4v","mpg4"]},"video/mpeg":{extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/ogg":{extensions:["ogv"]},"video/webm":{extensions:["webm"]},"video/x-msvideo":{extensions:["avi"]}},yte={directory_path:xte,mime_type:vte},bte=yte,wte={color:qee,database:ete,date:nte,hacker:ite,internet:dte,location:fte,metadata:gte,system:bte},Ste=wte,Nn=new $ee({locale:[kQ,Ste]});const Fte=["Avi","Amy","Aaron","James","John","Michael","David","Chris","Daniel","Matthew","Andrew","Ryan","Kevin","Jason","Brian","Eric","Mark","Steven","Paul","Robert","William","Richard","Thomas","Sarah","Jennifer","Jessica","Emily","Ashley","Amanda","Michelle","Nicole","Stephanie","Lisa","Elizabeth","Rachel","Megan","Laura","Rebecca","Heather","Kimberly","Christina","Angela","Alex","Jordan","Taylor","Morgan","Casey","Riley","Sam","Jamie","Drew","Pat"],Cte=["admin","support","help","info","team","staff","test","demo","security","sales","marketing","legal","billing","newsletter","ceo","cto","founder","president","board","membership","events","media","press","official","xrguild","guild"],_te=["mentoring","website","library","guild-hall","recruiting","events","content-media","social-media","fundraising","principles","metaverse-standards","leadership","nyc-area-events","la-area-events","bay-area-events"],Ete=["3D Modeling","Animation","Unity Development","Unreal Engine Development","AR Development","VR Development","MR Development","UI/UX Design","Graphic Design","Game Design","Sound Design","Hardware Prototyping","Project Management","Technical Writing","Video Production","Spatial Audio","Photogrammetry","WebXR Development","C# Programming","C++ Programming","JavaScript/TypeScript","Python Programming","Shader Programming","Machine Learning","Computer Vision","Interaction Design","Product Management","Community Management","Marketing & Communications","Legal & Policy","Business Development"],kte=["Gaming","Education & Training","Healthcare & Medical","Architecture & Real Estate","Industrial & Manufacturing","Retail & E-Commerce","Entertainment & Media","Social VR","Remote Collaboration","Fitness & Wellness","Art & Creative Expression","Tourism & Travel","Accessibility","Sustainability","Military & Defense","Therapy & Mental Health","Sports & Athletics","Museum & Cultural Heritage"];function Ate(t=[]){const e=Nn.helpers.arrayElement(Fte),n=Nn.person.lastName(),i=`${`test_${Nn.internet.username({firstName:e,lastName:n}).toLowerCase()}`}@example.com`,s=crypto.randomUUID()+crypto.randomUUID().replace(/-/g,""),o=[];if(Nn.datatype.boolean(.7)){const f=e.toLowerCase().replace(/[^a-z]/g,""),p=n.toLowerCase().replace(/[^a-z]/g,"");if(Nn.datatype.boolean(.9)?o.push(f):o.push(Nn.helpers.arrayElement(Cte)),Nn.datatype.boolean(.5)&&o.push(`${f}.${p}`),Nn.datatype.boolean(.3)){const b=[`${f}${p}`,`${e.charAt(0).toLowerCase()}.${p}`,`${p}.${f}`],v=Nn.helpers.arrayElement(b);o.includes(v)||o.push(v)}}let c=[],d=[];if(Nn.datatype.boolean(.8)){const f=Nn.helpers.arrayElements(_te,{min:1,max:3});for(const p of f)Nn.datatype.boolean(.5)?d.push(p):c.push(p)}const m=Nn.datatype.boolean(.6)?Nn.helpers.arrayElement([Nn.person.firstName(),Nn.word.adjective()+Nn.word.noun(),e.substring(0,3)+Nn.number.int({min:10,max:99}),Nn.internet.displayName(),Nn.word.noun()]):"";return{memberKey:s,email:i.toLowerCase(),firstName:e,lastName:n,preferredName:m,ph
4374one:Nn.phone.number(),secondaryEmails:Nn.datatype.boolean(.4)?Array.from({length:Nn.number.int({min:1,max:3})},()=>Nn.internet.email()):[],discordId:Nn.internet.username().toLowerCase(),requestedEmail:o.length>0?{names:o}:void 0,requestedTracks:c,tracks:d,leading:[],city:Nn.location.city(),stateProvince:Nn.location.state({abbreviated:!0}),postalCode:Nn.location.zipCode(),country:"United States",company:Nn.datatype.boolean(.7)?Nn.company.name():"",jobTitle:Nn.datatype.boolean(.8)?Nn.person.jobTitle():"",linkedIn:Nn.datatype.boolean(.6)?`https://linkedin.com/in/${Nn.internet.username()}`:"",website:Nn.datatype.boolean(.4)?Nn.internet.url():"",bio:Nn.datatype.boolean(.8)?Nn.lorem.paragraph():"",skills:Nn.datatype.boolean(.85)?Nn.helpers.arrayElements(Ete,{min:1,max:5}).join(", "):"",interests:Nn.datatype.boolean(.85)?Nn.helpers.arrayElements(kte,{min:1,max:4}).join(", "):"",profileImageUrl:t.length>0&&Nn.datatype.boolean(.9)?Nn.helpers.arrayElement(t):void 0,pronouns:Nn.helpers.arrayElement([["he","him"],["she","her"],["they","them"],["he","they"],["she","they"]]),public:(()=>{const f=Nn.datatype.boolean(.7),p=!f&&Nn.datatype.boolean(.33);return f?{name:!0,image:!0,job:!0,bio:!0,region:!0,donation:!0,tracks:!0}:p?{name:!1,image:!1,job:!1,bio:!1,region:!1,donation:!1,tracks:!1}:{name:Nn.datatype.boolean(.8),image:Nn.datatype.boolean(.7),job:Nn.datatype.boolean(.6),bio:Nn.datatype.boolean(.5),region:Nn.datatype.boolean(.5),donation:Nn.datatype.boolean(.3),tracks:Nn.datatype.boolean(.6)}})(),essentialEmailsOnly:Nn.datatype.boolean(.5),donationStatus:{isDonor:Nn.datatype.boolean(.3),frequency:Nn.helpers.arrayElement(["monthly","yearly","one-time"]),amount:Nn.number.int({min:5,max:100})},Created:Nn.date.past({years:2}).toISOString(),Modified:new Date().toISOString(),principlesAccepted:!0,principlesAcceptedAt:Nn.date.past({years:2}).toISOString()}}async function Nte(t,e=[],n){const a=[];for(let i=0;i<t;i++)a.push(Ate(e)),n&&(i%10===0||i===t-1)&&(n(i+1,t),await new Promise(s=>setTimeout(s,0)));return a}function Tte(){const t=_r(),{toast:e}=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,logout:s}=ia(),o=Po(),{isConnected:c,presenceMap:d,testRestartCountdown:m}=rf(),[f,p]=x.useState(!1),[b,v]=x.useState({phase:"",current:0,total:0}),[C,S]=x.useState(!1),[F,w]=x.useState(!1),[A,N]=x.useState("Test field 1 value"),[P,z]=x.useState("Test field 2 value"),[D,T]=x.useState(null);x.useEffect(()=>{n&&(async()=>{try{const j=await o("/api/admin/server-info");if(j.ok){const U=await j.json();T(U)}}catch(j){console.error("Error fetching server info:",j)}})()},[n,o]),x.useEffect(()=>{n?i!=="SUPER_ADMIN"&&t("/admin/dashboard"):t("/admin/login")},[n,i,t]);const K=async()=>{await s(),e({title:"Logged Out",description:"You have been successfully logged out"}),t("/admin/login")},B=async(I=500)=>{if(confirm(`⚠️ This will DELETE all existing members and generate ${I} fake members. Are you sure?`)){p(!0),v({phase:"Fetching photos...",current:0,total:I});try{v({phase:"Fetching photos...",current:0,total:I});const q=(await(await o("/api/admin/profile-photos")).json()).photos||[];v({phase:"Generating members...",current:0,total:I});const Y=await Nte(I,q,(J,ie)=>{v({phase:"Generating members...",current:J,total:ie})});v({phase:"Saving to database...",current:0,total:I});const W=await o("/api/admin/bulkInsertMembers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({members:Y,deleteExisting:!0,isTestGeneration:!0})});if(!W.ok)throw new Error("Failed to save members");const H=await W.json();v({phase:"Complete!",current:I,total:I}),e({title:"Members Regenerated",description:`Generated ${H.inserted||I} fake members (${q.length} photos available)`})}catch(j){console.error("Error regenerating members:",j),e({variant:"destructive",title:"Error",description:j.message||"Failed to regenerate members"})}finally{p(!1),v({phase:"",current:0,total:0})}}},k=async()=>{if(confirm("⚠️ This will remove ALL members from ALL test Google Groups. This may take 30+ seconds. Continue?")){S(!0);try{e({title:"Resetting Google Groups",description:"Deleting old groups and creating fresh ones... This will take 30+ seconds."});const I=await o("/api/admin/clearAllTestGroups",{method:"POST"});if(!I.ok)throw new Error("Failed to clear groups");const j=await I.json();e({title:"Groups Reset",description:`Deleted ${j.groupsDeleted||0}, created ${j.groupsCreated||0} groups (counter: ${j.counter||"?"})${j.errors?` - ${j.errors} errors`:""}`})}catch(I){console.error("Error clearing groups:",I),e({variant:"destructive",title:"Error",description:I.message||"Failed to clear groups"})}finally{S(!1)}}},O=async()=>
4374{if(confirm("⚠️ This will clear ALL email approval data for ALL members. Continue?")){w(!0);try{e({title:"Resetting Email Approvals",description:"Clearing approval data for all members..."});const I=await o("/api/admin/resetEmailApprovals",{method:"POST"});if(!I.ok)throw new Error("Failed to reset approvals");const j=await I.json();e({title:"Approvals Reset",description:`Reset approval data for ${j.stats?.modified||0} members`})}catch(I){console.error("Error resetting approvals:",I),e({variant:"destructive",title:"Error",description:I.message||"Failed to reset approvals"})}finally{w(!1)}}};return!n||i!=="SUPER_ADMIN"?null:r.jsx("div",{className:"min-h-screen bg-background p-8",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsx(Lo,{title:"⚠️ Testing Tools",subtitle:"Dangerous operations for testing only. Use with extreme caution.",adminEmail:a,adminRole:i,onLogout:K}),r.jsx(Ft,{className:"mb-6 border-red-500 bg-red-50 dark:bg-red-950/20",children:r.jsxs(bn,{children:[r.jsxs(wn,{className:"text-red-600 flex items-center gap-2",children:[r.jsx(ah,{className:"h-5 w-5"}),"⚠️ Warning: Destructive Operations"]}),r.jsx(Ln,{className:"text-red-900 dark:text-red-200",children:"These tools will DELETE or MODIFY data. Only use them in test/staging environments. All operations require confirmation."})]})}),r.jsxs(Ft,{className:"mb-6",children:[r.jsxs(bn,{children:[r.jsx(wn,{children:"Member Data Testing"}),r.jsx(Ln,{children:"Tools for generating and managing test member data"})]}),r.jsx(fn,{className:"space-y-4",children:r.jsx("div",{className:"flex flex-col gap-4",children:r.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg border border-destructive/20",children:[r.jsxs("h3",{className:"font-semibold mb-2 flex items-center gap-2",children:[r.jsx(Rr,{className:"h-4 w-4"}),"Regenerate Members"]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Deletes ALL existing members and generates fake test data. This is irreversible."}),D?.isProductionCluster&&r.jsx("div",{className:"mb-3 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded text-sm text-red-700 dark:text-red-300",children:"Disabled: Connected to production cluster (cluster 0)"}),f&&b.total>0&&r.jsxs("div",{className:"mb-4 space-y-2",children:[r.jsxs("div",{className:"flex justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:b.phase}),r.jsxs("span",{className:"font-mono",children:[b.current,"/",b.total]})]}),r.jsx(f4,{value:b.current/b.total*100,className:"h-2"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{variant:"destructive",onClick:()=>B(50),disabled:f||D?.isProductionCluster,className:"gap-2",children:[r.jsx(Rr,{className:`h-4 w-4 ${f?"animate-spin":""}`}),f?"Generating...":"Regenerate 50"]}),r.jsxs(Fe,{variant:"destructive",onClick:()=>B(500),disabled:f||D?.isProductionCluster,className:"gap-2",children:[r.jsx(Rr,{className:`h-4 w-4 ${f?"animate-spin":""}`}),f?"Generating...":"Regenerate 500"]})]})]})})})]}),r.jsxs(Ft,{className:"mb-6",children:[r.jsxs(bn,{children:[r.jsx(wn,{children:"Google Groups Testing"}),r.jsx(Ln,{children:"Tools for managing test Google Groups"})]}),r.jsx(fn,{className:"space-y-4",children:r.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg border border-destructive/20",children:[r.jsxs("h3",{className:"font-semibold mb-2 flex items-center gap-2",children:[r.jsx(gu,{className:"h-4 w-4"}),"Clear All Test Groups"]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Deletes ALL test Google Groups and creates fresh ones with a new counter. This operation takes 30+ seconds."}),D?.isProductionCluster&&r.jsx("div",{className:"mb-3 p-2 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded text-sm text-red-700 dark:text-red-300",children:"Disabled: Connected to production cluster (cluster 0)"}),r.jsxs(Fe,{variant:"destructive",onClick:k,disabled:C||D?.isProductionCluster,className:"gap-2",children:[r.jsx(gu,{className:`h-4 w-4 ${C?"animate-spin":""}`}),C?"Resetting...":"Reset All Groups"]})]})})]}),r.jsxs(Ft,{className:"mb-6",children:[r.jsxs(bn,{children:[r.jsx(wn,{children:"Email Approval Testing"}),r.jsx(Ln,{children:"Tools for testing guild email approval workflows"})]}),r.jsx(fn,{className:"space-y-4",children:r.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg border border-destructive/20",children:[r.jsxs("h3",{className:"font-semibold mb-2 flex items-center gap-2",children:[r.jsx(Rr,{className:"h-4 w-4"}),"Reset Email Approvals"]}
4374),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Clears all email approval data for ALL members (approval status, verification codes, guild emails). Useful for testing the approval workflow from scratch."}),r.jsxs(Fe,{variant:"destructive",onClick:O,disabled:F,className:"gap-2",children:[r.jsx(Rr,{className:`h-4 w-4 ${F?"animate-spin":""}`}),F?"Resetting...":"Reset All Approvals"]})]})})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(NP,{className:"h-5 w-5"}),"WebSocket Real-Time Collaboration"]}),r.jsx(Ln,{children:"Test field-level locking and presence tracking"})]}),r.jsxs(fn,{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(an,{variant:c?"default":"destructive",children:c?"Connected":"Disconnected"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:c?"WebSocket connection active":"WebSocket not connected"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Oi,{resource:"test",resourceId:"demo",fieldName:"field1",value:A,onChange:N,type:"textarea",label:"Test Field 1 (Textarea)",textareaProps:{placeholder:"Type to test field locking...",rows:4}}),r.jsx(Oi,{resource:"test",resourceId:"demo",fieldName:"field2",value:P,onChange:z,type:"textarea",label:"Test Field 2 (Textarea)",textareaProps:{placeholder:"Type to test field locking...",rows:4}})]}),r.jsxs("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg",children:[r.jsx("h4",{className:"text-sm font-semibold mb-2",children:"How to test:"}),r.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1 list-decimal list-inside",children:[r.jsx("li",{children:"Open this page in two browser windows"}),r.jsx("li",{children:"Log in as different admins in each window"}),r.jsx("li",{children:"Focus on the same field in both windows"}),r.jsx("li",{children:'You should see the "Editing: [admin email]" badge appear'}),r.jsx("li",{children:"The field should be locked in the other window"})]})]}),Object.keys(d).length>0&&r.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 rounded-lg border border-blue-200 dark:border-blue-800",children:[r.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Active Presence:"}),r.jsx("pre",{className:"text-xs overflow-auto",children:JSON.stringify(d,null,2)})]}),r.jsxs("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg",children:[r.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Restart Countdown Test:"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Trigger a fake restart countdown to test the notification banner. Choose delay:"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>m(10),children:"10 seconds"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>m(60),children:"1 minute"}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>m(900),children:"15 minutes"})]})]})]})]})]})})}function Mte(){const t=_r(),{isAuthenticated:e,adminRole:n,sessionId:a}=ia(),[i,s]=x.useState(null),[o,c]=x.useState(!0),[d,m]=x.useState(null),[f,p]=x.useState("week"),[b,v]=x.useState(48),[C,S]=x.useState(null),[F,w]=x.useState(null),[A,N]=x.useState(!1),P=async()=>{try{c(!0),m(null);const U=await fetch(`/api/admin/visitor-stats?period=${f}`,{headers:{"X-Session-ID":a||""}});if(!U.ok)throw new Error("Failed to fetch visitor stats");const q=await U.json();s(q)}catch(U){m(U instanceof Error?U.message:"Unknown error")}finally{c(!1)}},z=async U=>{S(U),N(!0),w(null);try{const q=await fetch(`/api/admin/visitor-stats/hourly?hour=${U.hour}`,{headers:{"X-Session-ID":a||""}});if(!q.ok)throw new Error("Failed to fetch hourly details");const Y=await q.json();w(Y)}catch(q){console.error("Error fetching hourly details:",q)}finally{N(!1)}},D=()=>{S(null),w(null)};if(x.useEffect(()=>{if(e&&a){P();const U=setInterval(P,3e4);return()=>clearInterval(U)}},[e,a,f]),!e)return null;if(n!=="SUPER_ADMIN"&&n!=="SUPPORT_ADMIN")return r.jsx("div",{className:"container mx-auto px-4 py-8",children:r.jsx(Ft,{children:r.jsxs(bn,{children:[r.jsx(wn,{children:"Access Denied"}),r.jsx(Ln,{children:"You don't have permission to view visitor statistics."})]})})});const T=U=>new Date(U).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),K=i?.timeline?.length||0,B=Math.min(b,K),k=i?.timeline?i.timeline.slice(-B):[],O=k.length>0?Math.max(...k.map(U=>U.views),1):1,I=(U,q,Y)=>{const W=new Date(U);return q===0||q>0&&W.getHours()===0?W.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}):Y>48?W.getHours()===0||W.getHours()===12?W.toLocaleTimeString([],{hour:"numeric"}):"":W.toLocaleTimeString([],{hour:"numeric"})},j=[0,Math.round(O/2),O];return r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20",children:[r.jsx("header",{className:"border-b bg-card/50 backdrop-blur",children:r.jsx("div",{className:"container mx-auto px-4 py-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>t("/admin"),children:r.jsx(Zg,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold",children:"Visitor Statistics"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Real-time site traffic and active sessions"})]})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(Sl,{value:f,onValueChange:U=>p(U),children:[r.jsx(To,{className:"w-32",children:r.jsx(Fl,{})}),r.jsxs(Mo,{children:[r.jsx(ta,{value:"hour",children:"Last Hour"}),r.jsx(ta,{value:"day",children:"Last 24h"}),r.jsx(ta,{value:"week",children:"Last 7 Days"})]})]}),r.jsx(Fe,{variant:"outline",size:"icon",onClick:P,disabled:o,children:r.jsx(Rr,{className:`h-4 w-4 ${o?"animate-spin":""}`})})]})]})})}),r.jsxs("main",{className:"container mx-auto px-4 py-8",children:[d&&r.jsx(Ft,{className:"mb-6 border-destructive",children:r.jsx(fn,{className:"pt-6",children:r.jsx("p",{className:"text-destructive",children:d})})}),r.jsxs("div",{className:"grid gap-4 md:grid-cols-3 mb-8",children:[r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[r.jsx(Fc,{className:"h-4 w-4"}),"Total Page Views"]})}),r.jsxs(fn,{children:[r.jsx("div",{className:"text-3xl font-bold",children:i?.totalViews??"-"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["in ",f==="hour"?"last hour":f==="day"?"last 24 hours":"last 7 days"]})]})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[r.jsx(na,{className:"h-4 w-4"}),"Unique Visitors"]})}),r.jsxs(fn,{children:[r.jsx("div",{className:"text-3xl font-bold",children:i?.totalUniqueVisitors??"-"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"anonymous hashed IPs"})]})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[r.jsx(Cr,{className:"h-4 w-4"}),"Guild Email Users"]})}),r.jsxs(fn,{children:[r.jsx("div",{className:"text-3xl font-bold",children:i?.memberActivity?.usingGuildEmail??0}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",i?.memberActivity?.withGuildEmail??0," with emails"]})]})]})]}),r.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(y3,{className:"h-5 w-5"}),"Views by Page"]}),r.jsx(Ln,{children:"Page view distribution"})]}),r.jsxs(fn,{children:[i?.viewsByPath&&Object.keys(i.viewsByPath).length>0?r.jsx("div",{className:"space-y-3",children:Object.entries(i.viewsByPath).sort(([,U],[,q])=>q-U).map(([U,q])=>r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-24 font-mono text-sm truncate",children:U}),r.jsx("div",{className:"flex-1 bg-muted rounded-full h-2 overflow-hidden",children:r.jsx("div",{className:"bg-primary h-full transition-all",style:{width:`${q/i.totalViews*100}%`}})}),r.jsx("div",{className:"w-12 text-right text-sm font-medium",children:q})]},U))}):r.jsx("p",{className:"text-muted-foreground text-sm",children:"No page views recorded yet"}),i?.notFoundByPath&&Object.keys(i.notFoundByPath).length>0&&r.jsxs(JN,{className:"mt-4",children:[r.jsxs(XN,{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground w-full py-2 border-t",children:[r.jsx(Ja,{className:"h-4 w-4 transition-transform duration-200 [&[data-state=open]>svg]:rotate-180"}),r.jsx(ah,{className:"h-4 w-4 text-orange-500"}),r.jsxs("span",{children:["404 Not Found (",Object.values(i.notFoundByPath).reduce((U,q)=>U+q,0)," requests)"]})]}),r.jsx(ZN,{className:"pt-2 space-y-2",children:Object.entries(i.notFoundByPath).sort(([,U],[,q])=>q-U).map(([U,q])=>r.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[r.jsx("div",{className:"w-24 font-mono truncate",children:U}),r.jsx("div",{className:"flex-1 bg-orange-100 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:"bg-orange-400 h-full",style:{width:`${q/Object.values(i.notFoundByPath).reduce((Y,W)=>Y+W,0)*100}%`}})}),r.jsx("div",{className:"w-10 text-right text-xs",children:q})]},U))})]})]})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(jy,{className:"h-5 w-5"}),"Member Activity"]}),r.jsxs(Ln,{children:["Engagement metrics across ",i?.memberActivity?.totalMembers||0," members"]})]}),r.jsx(fn,{children:i?.memberActivity?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(Cr,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium",children:"Guild Email"})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.pendingGuildEmailRequests}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Pending"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.withGuildEmail}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Have Email"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold text-green-600",children:i.memberActivity.usingGuildEmail}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Using It"})]})]})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(jy,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium",children:"Login Funnel"})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.loginCodesSent}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Codes Sent"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold text-green-600",children:i.memberActivity.loginCodesUsed}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Logged In"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold text-yellow-600",children:i.memberActivity.loginCodesExpired}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Expired"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.avgVerificationTimeSec!==null?`${i.memberActivity.avgVerificationTimeSec}s`:"—"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg Time"})]})]})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(FP,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium",children:"Profile Activity"})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.membersWithLastLogin}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Logged In"})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.profilesEdited}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Edited Profile"})]})]})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(xP,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-medium",children:"Track Participation"})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold",children:i.memberActivity.withPendingTracks}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["Pending (",i.memberActivity.totalPendingTrackRequests," requests)"]})]}),r.jsxs("div",{className:"p-2 bg-muted/50 rounded text-center",children:[r.jsx("div",{className:"text-lg font-bold text-green-600",children:i.memberActivity.withJoinedTracks}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["Joined (",i.memberActivity.totalJoinedTracks," memberships)"]})]})]})]})]}):r.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading member activity..."})})]})]}),r.jsxs(Ft,{className:"mt-6",children:[r.jsx(bn,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(wn,{children:"Traffic Timeline"}),r.jsxs(Ln,{className:"flex items-center gap-2",children:["Page views per hour (click bar for details)",i?.source&&r.jsxs(an,{variant:"outline",className:"text-xs gap-1",children:[r.jsx(Fm,{className:"h-3 w-3"}),i.source==="nginx"?"nginx logs":"in-memory"]}),i?.nginxLastRefresh&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(refreshed ",T(i.nginxLastRefresh),")"]})]})]}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"text-sm text-muted-foreground whitespace-nowrap",children:[B,"h / ",K,"h"]}),r.jsx(uf,{value:[b],onValueChange:([U])=>
4374v(U),min:6,max:Math.max(K,24),step:6,className:"w-40"})]})]})}),r.jsx(fn,{children:k.length>0?r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute left-0 top-0 bottom-6 w-8 flex flex-col justify-between text-xs text-muted-foreground z-10",children:j.slice().reverse().map((U,q)=>r.jsx("div",{className:"text-right pr-2",children:U},q))}),r.jsx("div",{className:"ml-10 overflow-x-scroll pb-2",style:{scrollbarWidth:"thin",scrollbarColor:"hsl(var(--muted-foreground)) transparent"},children:r.jsxs("div",{style:{minWidth:`${Math.max(k.length*12,100)}px`},children:[r.jsx("div",{className:"h-40 flex items-end gap-px",children:k.map((U,q)=>r.jsx("div",{className:"flex-1 bg-primary/20 hover:bg-primary/40 transition-colors rounded-t relative group min-w-[10px] cursor-pointer",style:{height:`${Math.max(U.views/O*100,2)}%`},onClick:()=>z(U),children:r.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1 opacity-0 group-hover:opacity-100 transition-opacity bg-popover text-popover-foreground text-xs px-2 py-1 rounded shadow-lg whitespace-nowrap z-10 pointer-events-none",children:[r.jsxs("div",{className:"font-semibold",children:[U.views," views"]}),r.jsxs("div",{className:"text-muted-foreground",children:[U.uniqueVisitors," unique"]}),r.jsxs("div",{className:"text-muted-foreground border-t pt-1 mt-1",children:[new Date(U.hour).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}),r.jsx("br",{}),new Date(U.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]}),r.jsx("div",{className:"text-primary text-[10px] mt-1",children:"Click for details"})]})},q))}),r.jsx("div",{className:"h-6 flex items-start pt-1",children:k.map((U,q)=>{const Y=I(U.hour,q,k.length);return Y?r.jsx("div",{className:"flex-1 min-w-[10px] text-xs text-muted-foreground truncate text-center",children:Y},q):r.jsx("div",{className:"flex-1 min-w-[10px]"},q)})})]})})]}):r.jsx("div",{className:"h-40 flex items-center justify-center text-muted-foreground",children:"No timeline data yet"})})]})]}),r.jsx("div",{className:`fixed inset-y-0 right-0 w-full max-w-md bg-background border-l shadow-xl transform transition-transform duration-300 ease-in-out z-50 ${C?"translate-x-0":"translate-x-full"}`,children:C&&r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"border-b p-4 flex items-center justify-between bg-card",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold",children:"Traffic Details"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(C.hour).toLocaleDateString([],{weekday:"long",month:"short",day:"numeric"})," ","at ",new Date(C.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),r.jsx(Fe,{variant:"ghost",size:"icon",onClick:D,children:r.jsx(gr,{className:"h-5 w-5"})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:A?r.jsx("div",{className:"flex items-center justify-center h-40",children:r.jsx(Rr,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):F?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg text-center",children:[r.jsx("div",{className:"text-2xl font-bold",children:F.totalRequests}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Requests"})]}),r.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg text-center",children:[r.jsx("div",{className:"text-2xl font-bold",children:F.uniqueIPs}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"Unique IPs"})]})]}),(F.suspiciousIndicators.highVolumeIPs>0||F.suspiciousIndicators.botUserAgents>0||F.suspiciousIndicators.failedRequests>10)&&r.jsxs(Ft,{className:"border-orange-200 bg-orange-50 dark:border-orange-900 dark:bg-orange-950/30",children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm flex items-center gap-2 text-orange-700 dark:text-orange-400",children:[r.jsx(Ra,{className:"h-4 w-4"}),"Suspicious Activity Detected"]})}),r.jsxs(fn,{className:"text-sm space-y-1",children:[F.suspiciousIndicators.highVolumeIPs>0&&r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{children:"High-volume IPs (100+ reqs):"}),r.jsx("span",{className:"font-medium",children:F.suspiciousIndicators.highVolumeIPs})]}),F.suspiciousIndicators.botUserAgents>0&&r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{children:"Bot user agents:"}),r.jsx("span",{className:"font-medium",children:F.suspiciousIndicators.botUserAgents})]}),F.suspiciousIndicators.emptyReferers>0&&r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{children:"Empty referers:"}),r.jsx("span",{className:"font-medium",children:F.suspiciousIndicators.emptyReferers})]}),F.suspiciousIndicators.failedRequests>0&&r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{children:"Failed requests (4xx/5xx):"}),r.jsx("span",{className:"font-medium",children:F.suspiciousIndicators.failedRequests})]})]})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm flex items-center gap-2",children:[r.jsx(m3,{className:"h-4 w-4"}),"Top IP Addresses"]})}),r.jsx(fn,{children:r.jsx("div",{className:"space-y-2",children:F.topIPs.slice(0,10).map((U,q)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsxs("div",{className:"w-6 text-muted-foreground",children:[q+1,"."]}),r.jsx("div",{className:"flex-1 font-mono text-xs truncate",title:U.ip,children:U.ip}),r.jsx(an,{variant:U.count>
4374100?"destructive":U.count>50?"secondary":"outline",children:U.count})]},q))})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm flex items-center gap-2",children:[r.jsx(sP,{className:"h-4 w-4"}),"Top User Agents"]})}),r.jsx(fn,{children:r.jsx("div",{className:"space-y-2",children:F.topUserAgents.slice(0,8).map((U,q)=>r.jsx("div",{className:"text-sm",children:r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("div",{className:"flex-1 text-xs truncate text-muted-foreground",title:U.userAgent,children:U.userAgent.length>60?U.userAgent.substring(0,60)+"...":U.userAgent}),r.jsx(an,{variant:"outline",children:U.count})]})},q))})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm flex items-center gap-2",children:[r.jsx(fP,{className:"h-4 w-4"}),"Top Paths"]})}),r.jsx(fn,{children:r.jsx("div",{className:"space-y-2",children:F.topPaths.slice(0,10).map((U,q)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("div",{className:"flex-1 font-mono text-xs truncate",children:U.path}),r.jsx(an,{variant:"outline",children:U.count})]},q))})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsxs(wn,{className:"text-sm flex items-center gap-2",children:[r.jsx(g3,{className:"h-4 w-4"}),"Top Referers"]})}),r.jsx(fn,{children:r.jsx("div",{className:"space-y-2",children:F.topReferers.length>0?F.topReferers.slice(0,8).map((U,q)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("div",{className:"flex-1 text-xs truncate text-muted-foreground",title:U.referer,children:U.referer||"(direct/none)"}),r.jsx(an,{variant:"outline",children:U.count})]},q)):r.jsx("p",{className:"text-sm text-muted-foreground",children:"No referer data"})})})]}),r.jsxs(Ft,{children:[r.jsx(bn,{className:"pb-2",children:r.jsx(wn,{className:"text-sm",children:"HTTP Status Codes"})}),r.jsx(fn,{children:r.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(F.statusCodes).sort(([U],[q])=>parseInt(U)-parseInt(q)).map(([U,q])=>r.jsxs(an,{variant:U.startsWith("2")?"default":U.startsWith("3")?"secondary":"destructive",children:[U,": ",q]},U))})})]})]}):r.jsx("div",{className:"text-center text-muted-foreground py-8",children:"Failed to load details"})})]})}),C&&r.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:D})]})}function Rte(){const t=_r(),{toast:e}=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,sessionId:s,logout:o}=ia(),c=Po(),[d,m]=x.useState([]),[f,p]=x.useState(!0),[b,v]=x.useState(!1),C=jx({onReload:async()=>{v(!0);try{const T=await c("/api/admin/refreshCache",{method:"POST"});if(!T.ok)throw new Error("Failed to refresh cache");const K=await T.json();m(K.members||[]),e({title:"Cache Refreshed",description:`Loaded ${K.members?.length||0} members from database`})}finally{v(!1)}}}),S=async()=>{try{const T=await c("/api/admin/members");if(!T.ok)throw new Error("Failed to fetch members");const K=await T.json();m(K.members||[])}catch(T){console.error("Error fetching members:",T)}finally{p(!1),v(!1)}};x.useEffect(()=>{n&&s&&S()},[n,s]);const F=()=>{o(),t("/admin/login")};if(!n)return null;const w=d.filter(T=>T.feedback&&T.feedback.trim()).sort((T,K)=>{const B=T.LastChanged?new Date(T.LastChanged).getTime():0;return(K.LastChanged?new Date(K.LastChanged).getTime():0)-B}),A=d.filter(T=>T.aspirations&&T.aspirations.trim()).sort((T,K)=>{const B=T.LastChanged?new Date(T.LastChanged).getTime():0;return(K.LastChanged?new Date(K.LastChanged).getTime():0)-B}),N=T=>T.preferredName?T.preferredName:T.firstName&&T.lastName?`${T.firstName} ${T.lastName}`:T.firstName?T.firstName:T.email,P=T=>T.guildEmail?T.guildEmail.includes("@")?T.guildEmail:`${T.guildEmail}@xrguild.org`:T.email,z=T=>T?new Date(T).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Unknown",D=({member:T,content:K,type:B})=>r.jsxs(Ft,{className:"mb-4",children:[r.jsx(bn,{className:"pb-3",children:r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:`p-2 rounded-full ${B==="feedback"?"bg-blue-100 dar
4374k:bg-blue-900/50":"bg-amber-100 dark:bg-amber-900/50"}`,children:B==="feedback"?r.jsx(Dy,{className:`h-4 w-4 ${B==="feedback"?"text-blue-600 dark:text-blue-400":""}`}):r.jsx(My,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"})}),r.jsxs("div",{children:[r.jsx(wn,{className:"text-base",children:N(T)}),r.jsxs(Ln,{className:"text-xs",children:["Last updated: ",z(T.LastChanged)]})]})]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>window.location.href=`mailto:${P(T)}`,className:"gap-1",children:[r.jsx(Cr,{className:"h-3 w-3"}),"Email"]})]})}),r.jsx(fn,{children:r.jsx("p",{className:"text-sm whitespace-pre-wrap",children:K})})]});return r.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-6xl",children:[r.jsx(Lo,{title:"Member Feedback",subtitle:"Review feedback and aspirations from members",adminEmail:a,adminRole:i,onLogout:F,pendingChangesCount:C.pendingCount,isWatching:C.isWatching,isReloading:C.isReloading,onReload:C.triggerReload,onWatchChange:T=>C.toggleWatch(T)}),f?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Dy,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"}),r.jsx("h2",{className:"text-xl font-semibold",children:"Feedback"}),r.jsx(an,{variant:"secondary",children:w.length})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Suggestions and comments from members"}),w.length===0?r.jsx(Ft,{children:r.jsx(fn,{className:"py-8 text-center text-muted-foreground",children:"No feedback submitted yet"})}):w.map(T=>r.jsx(D,{member:T,content:T.feedback,type:"feedback"},`feedback-${T.memberKey}`))]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(My,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"}),r.jsx("h2",{className:"text-xl font-semibold",children:"Aspirations"}),r.jsx(an,{variant:"secondary",children:A.length})]}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"What members want to see the XR Guild accomplish"}),A.length===0?r.jsx(Ft,{children:r.jsx(fn,{className:"py-8 text-center text-muted-foreground",children:"No aspirations submitted yet"})}):A.map(T=>r.jsx(D,{member:T,content:T.aspirations,type:"aspirations"},`aspirations-${T.memberKey}`))]})]})]})}function Dte(){const t=_r(),{isAuthenticated:e,adminRole:n,sessionId:a}=ia(),[i,s]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState([]),[f,p]=x.useState(!0),[b,v]=x.useState(null),[C,S]=x.useState(""),[F,w]=x.useState(null);x.useEffect(()=>{e?n!=="SUPER_ADMIN"&&t("/admin/dashboard"):t("/admin/login")},[e,n,t]);const A=x.useCallback(async()=>{p(!0),v(null);try{const[D,T,K]=await Promise.all([fetch("/api/admin/security/bans",{headers:{"X-Session-ID":a||""}}),fetch("/api/admin/security/stats",{headers:{"X-Session-ID":a||""}}),fetch("/api/admin/security/whitelist",{headers:{"X-Session-ID":a||""}})]);if(!D.ok||!T.ok||!K.ok)throw new Error("Failed to fetch security data");const B=await D.json(),k=await T.json(),O=await K.json();s(B.bans||[]),c(k.jails||[]),m(O.whitelist||[])}catch(D){v(D instanceof Error?D.message:"Failed to fetch data")}finally{p(!1)}},[a]);x.useEffect(()=>{e&&n==="SUPER_ADMIN"&&A()},[e,n,A]);const N=async(D,T)=>{w(D);try{if(!(await fetch("/api/admin/security/unban",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":a||""},body:JSON.stringify({ip:D,jail:T})})).ok)throw new Error("Failed to unban IP");await A()}catch(K){v(K instanceof Error?K.message:"Failed to unban IP")}finally{w(null)}},P=async()=>{if(C.trim()){w("whitelist-add");try{const D=await fetch("/api/admin/security/whitelist",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":a||""},body:JSON.stringify({ip:C.trim()})});if(!D.ok){const T=await D.json();throw new Error(T.message||"Failed to add to whitelist")}S(""),await A()}catch(D){v(D instanceof Error?D.message:"Failed to add to whitelist")}finally{w(null)}}},z=async D=>{w(`whitelist-${D}`);try{if(!(await fetch("/api/admin/security/whitelist",{method:"DELETE",headers:{"Content-Type":"application/json","X-Session-ID":a||""},body:JSON.stringify({ip:D})})).ok)throw new Error("Failed to remove from whitelist");await A()}catch(T){v(T instanceof Error?T.message:"Failed to remove from whitelist")}finally{w(null)}};return!e||n!=="SUPER_ADMIN"?null:r.jsx("div",{className:"min-h-screen bg-background p-8",children:r.jsxs("div",{className:"max-w-6xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-8",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>
4374t("/admin/dashboard"),children:r.jsx(Zg,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-2",children:[r.jsx(Ra,{className:"h-8 w-8 text-primary"}),"Security"]}),r.jsx("p",{className:"text-muted-foreground",children:"IP bans and fail2ban management"})]})]}),r.jsxs(Fe,{variant:"outline",onClick:A,disabled:f,children:[r.jsx(Rr,{className:`h-4 w-4 mr-2 ${f?"animate-spin":""}`}),"Refresh"]})]}),b&&r.jsxs("div",{className:"mb-6 p-4 bg-red-100 dark:bg-red-950/30 border border-red-300 dark:border-red-700 rounded-lg flex items-center gap-2 text-red-700 dark:text-red-400",children:[r.jsx(ah,{className:"h-5 w-5 flex-shrink-0"}),b,r.jsx(Fe,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>v(null),children:r.jsx(gr,{className:"h-4 w-4"})})]}),f?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(on,{className:"h-8 w-8 animate-spin text-primary"})}):r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Ty,{className:"h-5 w-5"}),"Fail2ban Jails"]}),r.jsx(Ln,{children:"Overview of active jails and ban statistics"})]}),r.jsx(fn,{children:o.length===0?r.jsx("p",{className:"text-muted-foreground",children:"No active jails"}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map(D=>r.jsxs("div",{className:"p-4 rounded-lg border bg-card",children:[r.jsx("div",{className:"font-semibold text-lg mb-2",children:D.jail}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Currently banned:"}),r.jsx(an,{variant:D.currentlyBanned>0?"destructive":"secondary",className:"ml-2",children:D.currentlyBanned})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Total banned:"}),r.jsx("span",{className:"ml-2 font-medium",children:D.totalBanned})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Currently failed:"}),r.jsx("span",{className:"ml-2 font-medium",children:D.currentlyFailed})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Total failed:"}),r.jsx("span",{className:"ml-2 font-medium",children:D.totalFailed})]})]})]},D.jail))})})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(Ty,{className:"h-5 w-5 text-destructive"}),"Currently Banned IPs",i.length>0&&r.jsx(an,{variant:"destructive",children:i.length})]}),r.jsx(Ln,{children:"IPs currently blocked by fail2ban. Click unban to remove."})]}),r.jsx(fn,{children:i.length===0?r.jsx("p",{className:"text-muted-foreground py-4 text-center",children:"No IPs currently banned"}):r.jsx("div",{className:"space-y-2",children:i.map(D=>r.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-900",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("code",{className:"font-mono text-sm bg-red-100 dark:bg-red-900/50 px-2 py-1 rounded",children:D.ip}),r.jsx(an,{variant:"outline",children:D.jail})]}),r.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>N(D.ip,D.jail),disabled:F===D.ip,children:F===D.ip?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(yF,{className:"h-4 w-4 mr-1"}),"Unban"]})})]},`${D.ip}-${D.jail}`))})})]}),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx(yF,{className:"h-5 w-5 text-green-600"}),"Whitelist"]}),r.jsx(Ln,{children:"IPs that will never be banned. Runtime only - add to /etc/fail2ban/jail.d/whitelist.local for persistence."})]}),r.jsx(fn,{children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx(un,{placeholder:"Enter IP address (e.g., 1.2.3.4 or 1.2.3.0/24)",value:C,onChange:D=>S(D.target.value),onKeyDown:D=>{D.key==="Enter"&&P()}}),r.jsx(Fe,{onClick:P,disabled:!C.trim()||F==="whitelist-add",children:F==="whitelist-add"?r.jsx(on,{className:"h-4 w-4 animate-spin"}):r.jsxs(r.Fragment,{children:[r.jsx(ko,{className:"h-4 w-4 mr-1"}),"Add"]})})]}),d.length===0?r.jsx("p",{className:"text-muted-foreground py-4 text-center",children:"No IPs in whitelist (except defaults like 127.0.0.1)"}):r.jsx("div",{className:"flex flex-wrap gap-2",children:d.map(D=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-900",children:[r.jsx("code",{className:"font-mono text-sm",children:D}),r.jsx(Fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>z(D),disabled:F===`whitelist-${D}`,children:F===`whitelist-${D}`?r.jsx(on,{className:"h-3 w-3 animate-spin"}):r.jsx(gr,{className:"h-3 w-3"})})]},D))})]})})]}),r.jsxs(Ft,{className:"bg-blue-50 dark:bg-blue-950/20 border-blue-200 dark:border-blue-900",children:[r.jsx(bn,{children:r.jsxs(wn,{className:"flex items-center gap-2 text-blue-700 dark:text-blue-400",children:[r.jsx(Ra,{className:"h-5 w-5"}),"How Fail2ban Works"]})}),r.jsxs(fn,{className:"text-sm text-blue-700 dark:text-blue-400 space-y-2",children:[r.jsxs("p",{children:[r.jsx("strong",{children:"nginx-badrequest jail:"})," Monitors nginx access logs for 404, 400, and 403 errors. An IP is banned for 24 hours after 50+ bad requests within 5 minutes."]}),r.jsxs("p",{children:[r.jsx("strong",{children:"Unbanning:"})," Use the unban button to immediately remove a ban. The IP can be banned again if it continues bad behavior."]}),r.jsxs("p",{children:[r.jsx("strong",{children:"Whitelisting:"})," Whitelisted IPs are never banned. Use this for known-good IPs like office connections or monitoring services. Note: Whitelist changes here are runtime-only and reset on fail2ban restart."]})]})]})]})]})})}const Pte=["profile-images","event-images"];function pu(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/1024/1024).toFixed(1)} MB`:`${(t/1024/1024/1024).toFixed(2)} GB`}function jte(){const t=_r(),{sessionId:e,isAuthenticated:n,adminRole:a}=ia(),{toast:i}=nr(),[s,o]=x.useState({}),[c,d]=x.useState({}
4374),[m,f]=x.useState({}),[p,b]=x.useState({}),[v,C]=x.useState({}),[S,F]=x.useState(null),[w,A]=x.useState(!1),[N,P]=x.useState(null);x.useEffect(()=>{n?a!=="SUPER_ADMIN"&&t("/admin/dashboard"):t("/admin/login")},[n,a,t]);const z=x.useCallback(async k=>{d(O=>({...O,[k]:!0}));try{const O=await fetch(`/api/admin/storage/summary?bucket=${encodeURIComponent(k)}`,{headers:{"X-Session-ID":e||""}}),I=await O.json();if(!O.ok||!I.success)throw new Error(I.message||`Server returned ${O.status}`);o(j=>({...j,[k]:I}))}catch(O){i({variant:"destructive",title:`Could not load ${k} summary`,description:O.message}),o(I=>({...I,[k]:null}))}finally{d(O=>({...O,[k]:!1}))}},[e,i]),D=x.useCallback(async(k,O)=>{const I=O?`${k}/${O}`:k;b(j=>({...j,[I]:!0}));try{const j=O?`/api/admin/storage/orphans?bucket=${encodeURIComponent(k)}&folder=${encodeURIComponent(O)}`:`/api/admin/storage/orphans?bucket=${encodeURIComponent(k)}`,U=await fetch(j,{headers:{"X-Session-ID":e||""}}),q=await U.json();if(!U.ok||!q.success)throw new Error(q.message||`Server returned ${U.status}`);f(Y=>({...Y,[I]:q})),C(Y=>({...Y,[I]:new Set(q.orphans.map(W=>W.key))}))}catch(j){i({variant:"destructive",title:"Orphan scan failed",description:j.message})}finally{b(j=>({...j,[I]:!1}))}},[e,i]);function T(k,O){C(I=>{const j=new Set(I[k]||[]);return j.has(O)?j.delete(O):j.add(O),{...I,[k]:j}})}function K(k,O){C(I=>{const U=(I[k]||new Set).size===O.orphans.length;return{...I,[k]:U?new Set:new Set(O.orphans.map(q=>q.key))}})}async function B(k){const O=m[k],I=v[k];if(!O||!I||I.size===0){F(null);return}const j=Array.from(I),U=O.orphans.filter(q=>I.has(q.key)).reduce((q,Y)=>q+Y.size,0);A(!0);try{const q=await fetch("/api/admin/storage/delete-orphans",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":e||""},body:JSON.stringify({bucket:O.bucket,keys:j,confirmedCount:j.length,confirmedTotalBytes:U})}),Y=await q.json();if(!q.ok||!Y.success)throw new Error(Y.message||`Server returned ${q.status}`);i({title:"Cleanup complete",description:`Deleted ${Y.deleted} of ${Y.requested} objects${Y.errors?.length?` (${Y.errors.length} errors)`:""}.`});const[W,H]=k.includes("/")?k.split("/"):[k,void 0];await z(W),await D(W,H),C(J=>({...J,[k]:new Set}))}catch(q){i({variant:"destructive",title:"Delete failed",description:q.message})}finally{A(!1),F(null)}}return r.jsx("div",{className:"min-h-screen bg-background p-6",children:r.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>t("/admin/dashboard"),"aria-label":"Back to dashboard",children:r.jsx(Zg,{className:"h-5 w-5"})}),r.jsx(p3,{className:"h-6 w-6 text-primary"}),r.jsx("h1",{className:"text-2xl font-bold",children:"Storage"})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Find and remove R2 image objects that aren't referenced by any live record. ",r.jsx("span",{className:"font-medium",children:"Member photos:"})," profile images for every member. ",r.jsx("span",{className:"font-medium",children:"Timeline:"})," ","every doc version (current + history). All deletions are audit-logged."]}),Pte.map(k=>r.jsx(Lte,{bucket:k,summary:s[k],loadingSummary:!!c[k],onLoadSummary:()=>z(k),orphans:m,loadingOrphans:p,selected:v,onFindOrphans:O=>D(k,O),onToggleOne:(O,I)=>T(O,I),onToggleAll:(O,I)=>K(O,I),onAskDelete:O=>F(O),onPreview:(O,I,j)=>P({url:O,key:I,size:j})},k)),r.jsx(Bm,{open:S!==null,onOpenChange:k=>{k||F(null)},children:r.jsxs(Gd,{children:[r.jsxs(Hd,{children:[r.jsx(Vd,{children:"Delete orphan objects?"}),r.jsx($d,{children:S&&(()=>{const k=m[S],O=v[S];if(!k||!O)return null;const I=O.size,j=k.orphans.filter(U=>O.has(U.key)).reduce((U,q)=>U+q.size,0);return r.jsxs("span",{children:["About to permanently delete ",r.jsx("strong",{children:I})," objects (",pu(j),") from ",r.jsx("code",{children:k.bucket}),". This cannot be undone. (A local backup at ",r.jsx("code",{children:"~/backups/xrguild-images/"})," ","should cover anything that turns out to have been needed.)"]})})()})]}),r.jsxs(Wd,{children:[r.jsx(Fx,{disabled:w,children:"Cancel"}),r.jsx(mu,{disabled:w,onClick:()=>S&&B(S),className:"bg-destructive hover:bg-destructive/90",children:w?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-4 h-4 mr-2 animate-spin"}),"Deleting…"]}):"Delete"})]})]})}),r.jsx(Sa,{open:N!==null,onOpenChange:k=>{k||P(null)},children:r.jsxs(da,{className:"max-w-3xl",children:[r.jsxs(ha,{children:[r.jsx(ma,{className:"font-mono text-sm break-all",children:N?.key}),r.jsxs(Fa,{children:[N&&pu(N.size),N&&r.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"ml-3 underline text-primary",children:"Open in new tab"})]})]}),N&&r.jsx("div",{className:"flex items-center justify-center bg-muted/30 rounded-md p-2 max-h-[70vh] overflow-auto",children:r.jsx("img",{src:N.url,alt:N.key,referrerPolicy:"no-referrer",className:"max-w-full max-h-[60vh] object-contain"})})]})})]})})}function Lte({bucket:t,summary:e,loadingSummary:n,onLoadSummary:a,orphans:i,loadingOrphans:s,selected:o,onFindOrphans:c,onToggleOne:d,onToggleAll:m,onAskDelete:f,onPreview:p}){return x.useEffect(()=>{e===void 0&&a()},[]),r.jsxs(Ft,{children:[r.jsxs(bn,{children:[r.jsxs(wn,{className:"flex items-center justify-between",children:[r.jsx("span",{children:r.jsx("code",{children:t})}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:a,disabled:n,"aria-label":"Refresh summary",children:r.jsx(Rr,{className:`w-4 h-4 ${n?"animate-spin":""}`})})]}
4374),r.jsx(Ln,{children:e?`${e.grandCount.toLocaleString()} objects, ${pu(e.grandBytes)}`:n?"Loading…":"Unavailable"})]}),r.jsx(fn,{children:e&&e.folders.length>0?r.jsx("div",{className:"space-y-2",children:e.folders.map(b=>{const v=`${t}/${b.folder}`,C=i[v],S=o[v]||new Set,F=!!s[v];return r.jsxs("div",{className:"border rounded-md p-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsxs("div",{children:[r.jsxs("span",{className:"font-mono text-sm",children:[b.folder,"/"]}),r.jsxs(an,{variant:"secondary",className:"ml-2",children:[b.count.toLocaleString()," obj · ",pu(b.totalBytes)]})]}),r.jsx("div",{className:"flex gap-2 items-center",children:b.excluded?r.jsx("span",{className:"text-xs text-muted-foreground italic",children:"Not auditable from this server — manual cleanup only"}):r.jsxs(r.Fragment,{children:[r.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>c(b.folder),disabled:F,children:F?r.jsxs(r.Fragment,{children:[r.jsx(on,{className:"w-3 h-3 mr-1 animate-spin"}),"Scanning…"]}):"Find orphans"}),C&&S.size>0&&r.jsxs(Fe,{size:"sm",variant:"destructive",onClick:()=>f(v),children:[r.jsx(gu,{className:"w-3 h-3 mr-1"}),"Delete ",S.size]})]})})]}),C&&!b.excluded&&r.jsx(Ite,{scanKey:v,scan:C,selected:S,onToggleOne:d,onToggleAll:m,onPreview:p})]},b.folder)})}):!n&&e===null?r.jsx("p",{className:"text-sm text-muted-foreground",children:"Bucket not configured or accessible."}):null})]})}function Ite({scanKey:t,scan:e,selected:n,onToggleOne:a,onToggleAll:i,onPreview:s}){const[o,c]=x.useState("size"),[d,m]=x.useState("desc");function f(w){w===o?m(A=>A==="asc"?"desc":"asc"):(c(w),m(w==="size"?"desc":"asc"))}const p=x.useMemo(()=>{const w=[...e.orphans];return w.sort((A,N)=>{let P=0;return o==="size"?P=A.size-N.size:o==="lastModified"?P=(A.lastModified||"").localeCompare(N.lastModified||""):P=A.key.localeCompare(N.key),d==="asc"?P:-P}),w},[e.orphans,o,d]),b=x.useMemo(()=>n.size>0&&n.size===e.orphans.length,[n.size,e.orphans.length]),v=n.size>0,C=p.slice(0,500);function S(w){const A=`${e.bucketPublicUrl}/${w.key}`;s(A,w.key,w.size)}function F(w){return o!==w?r.jsx("span",{className:"opacity-30 inline-block ml-1",children:r.jsx(hF,{className:"w-3 h-3 inline"})}):d==="asc"?r.jsx(rP,{className:"w-3 h-3 inline ml-1"}):r.jsx(hF,{className:"w-3 h-3 inline ml-1"})}return r.jsxs("div",{className:"mt-3 border-t pt-3",children:[r.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:["Scanned ",e.scannedCount.toLocaleString()," objects. Found"," ",r.jsx("strong",{children:e.orphans.length.toLocaleString()})," orphans (",pu(e.totalBytes),"). Referenced filenames: ",e.referencedCount.toLocaleString(),".",r.jsx("span",{className:"ml-2 text-[10px]",children:"Click any row to preview the image. Click column headers to sort."})]}),e.orphans.length===0?r.jsx("p",{className:"text-sm text-green-700 dark:text-green-400",children:"No orphans in this folder — nothing to clean up."}):r.jsxs("div",{className:"max-h-96 overflow-auto border rounded-md",children:[r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{className:"sticky top-0 bg-muted text-left",children:r.jsxs("tr",{children:[r.jsx("th",{className:"p-2 w-8",children:r.jsx(ar,{checked:b,onCheckedChange:()=>i(t,e),"aria-label":b?"Deselect all":"Select all"})}),r.jsxs("th",{className:"p-2 cursor-pointer hover:bg-muted-foreground/10 select-none",onClick:()=>f("key"),children:["Key",F("key")]}),r.jsxs("th",{className:"p-2 text-right cursor-pointer hover:bg-muted-foreground/10 select-none",onClick:()=>f("size"),children:["Size",F("size")]}),r.jsxs("th",{className:"p-2 cursor-pointer hover:bg-muted-foreground/10 select-none",onClick:()=>f("lastModified"),children:["Last modified",F("lastModified")]})]})}),r.jsx("tbody",{children:C.map(w=>r.jsxs("tr",{className:"border-t hover:bg-accent/30 cursor-pointer",onClick:()=>S(w),title:"Click to preview image",children:[r.jsx("td",{className:"p-2",onClick:A=>A.stopPropagation(),children:r.jsx(ar,{checked:n.has(w.key),onCheckedChange:()=>a(t,w.key)})}),r.jsx("td",{className:"p-2 font-mono truncate max-w-md",children:w.key}),r.jsx("td",{className:"p-2 text-right",children:pu(w.size)}),r.jsx("td",{className:"p-2",children:w.lastModified?new Date(w.lastModified).toISOString().slice(0,10):"?"})]},w.key))})]}),e.orphans.length>500&&r.jsxs("div",{className:"text-xs text-muted-foreground p-2 border-t bg-muted/50",children:["Showing first 500 of ",e.orphans.length.toLocaleStr
4374ing()," orphans (sorted by ",o," ",d==="asc"?"↑":"↓",'). "Delete selected" still applies to ALL checked items, including ones not shown.']}),v&&r.jsxs("div",{className:"text-xs p-2 border-t bg-muted/30",children:[r.jsx("strong",{children:n.size})," selected for deletion (",pu(e.orphans.filter(w=>n.has(w.key)).reduce((w,A)=>w+A.size,0)),")."]})]})]})}const Bte="modulepreload",Ote=function(t){return"/"+t},tE={},R4=function(e,n,a){let i=Promise.resolve();if(n&&n.length>0){let d=function(m){return Promise.all(m.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");i=d(n.map(m=>{if(m=Ote(m),m in tE)return;tE[m]=!0;const f=m.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const b=document.createElement("link");if(b.rel=f?"stylesheet":Bte,f||(b.as="script"),b.crossOrigin="",b.href=m,c&&b.setAttribute("nonce",c),document.head.appendChild(b),f)return new Promise((v,C)=>{b.addEventListener("load",v),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})},Ute=()=>"",zte=Ute();function Gte(){return typeof window>"u"?null:sessionStorage.getItem("adminSessionId")}async function wa(t,e={}){const n=Gte(),a={...e.headers,...n?{"x-session-id":n}:{}},i=await fetch(`${zte}${t}`,{...e,headers:a});if(i.status===401||i.status===403)throw new Error("Admin session expired or invalid. Please log in again.");return i}async function D4(){const t=await wa("/api/admin/migration/backup-data");if(!t.ok)throw new Error(`Failed to fetch backup data: ${t.statusText}`);return await t.json()}async function Nae(t,e){const n=await wa("/api/admin/migration/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,oldImagePath:e})});if(!n.ok){const a=await n.json();throw new Error(a.error||"Failed to upload image")}return await n.json()}async function Hte(t,e){const n=await wa("/api/admin/migration/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({members:t,stats:e})});if(!n.ok){const a=await n.json();throw new Error(a.error||"Failed to commit members")}return await n.json()}async function nE(t){const e=await wa("/api/admin/migration/save-name-patches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patches:t})});if(!e.ok){const n=await e.json();throw new Error(n.error||"Failed to save name patches")}return await e.json()}async function P4(t){const e=await wa("/api/admin/migration/save-image-patches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({patches:t})});if(!e.ok){const n=await e.json();throw new Error(n.error||"Failed to save image patches")}return await e.json()}async function Wte(){const t=await wa("/api/admin/migration/image-patches");if(!t.ok)throw new Error(`Failed to load image patches: ${t.statusText}`);return await t.json()}async function Vte(){const t=await wa("/api/admin/refreshGoogleData",{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok){const e=await t.json();throw new Error(e.error||"Failed to refresh Google data")}return await t.json()}const eg=[{old:"Email",new:"email",type:"direct",oldLevel:0,newLevel:0},{old:"First",new:"firstName",type:"direct",oldLevel:0,newLevel:0},{old:"Middle",new:"middleName",type:"direct",oldLevel:0,newLevel:0},{old:"Last",new:"lastName",type:"direct",oldLevel:0,newLevel:0},{old:"Pronouns",new:"pronouns",type:"array",oldLevel:0,newLevel:0},{old:"Phone",new:"phone",type:"direct",oldLevel:0,newLevel:0},{old:"Address",new:"streetAddress",type:"renamed",oldLevel:0,newLevel:0},{old:"City",new:"city",type:"direct",oldLevel:0,newLevel:0},{old:"State",new:"stateProvince",type:"renamed",oldLevel:0,newLevel:0},{old:"Postal",new:"postalCode",type:"renamed",oldLevel:0,newLevel:0},{old:"Country",new:"country",type:"transform",note:"US → United States",oldLevel:0,newLevel:0}
4374,{old:"Discord",new:"discordId",type:"renamed",oldLevel:0,newLevel:0},{old:"LinkedIn",new:"linkedIn",type:"direct",oldLevel:0,newLevel:0},{old:"Website",new:"website",type:"direct",oldLevel:0,newLevel:0},{old:"Gmail",new:"guildEmail",type:"conditional",note:"xrguild.org → guildEmail",oldLevel:0,newLevel:0},{old:"Google Workspace",new:"secondaryEmails",type:"transform",note:"Work/home/recovery emails from Google Workspace API (also includes emails from merged duplicates)",oldLevel:0,newLevel:0},{old:"Public",new:"public.*",type:"transform",note:"Expands to granular permissions: name, image, job, bio, donation, tracks",oldLevel:0,newLevel:0},{old:"Created",new:"Created",type:"direct",oldLevel:0,newLevel:0},{old:"Tracks",new:"tracks",type:"transform",note:'Parse "TrackName/Role" → tracks array (unique names)',oldLevel:0,newLevel:0,targetFields:["tracks","leading"]},{old:"Tracks→leading",new:"leading",type:"transform",note:'Extract tracks with "/Leader" role',oldLevel:0,newLevel:0,skipOldRender:!0},{old:"Nickname",new:"preferredName",type:"renamed",oldLevel:0,newLevel:0},{old:"TimeZone",new:"timezoneOffset",type:"transform",note:"Store GMT offset (-12 to +12). TODO: Call ipgeolocation.io API in profile editor when address changes",oldLevel:0,newLevel:0},{old:"Social",new:"???",type:"unknown",note:"Social media field not mapped yet",oldLevel:0,newLevel:0},{old:"Badges",new:"???",type:"unknown",note:"Badge system not implemented in new schema",oldLevel:0,newLevel:0},{old:"Status",new:"???",type:"unknown",note:"Member status not mapped (was Volunteer, Sponsor, etc)",oldLevel:0,newLevel:0},{old:"Profile",new:null,type:"object",oldLevel:0,newLevel:0,isGroup:!0,note:"Display/cache object (underscored fields ignored)"},{old:"Profile.Name",new:"firstName + lastName",type:"transform",oldLevel:1,newLevel:0,note:"Derived from First/Last"},{old:"Profile.Text",new:"bio",type:"direct",oldLevel:1,newLevel:0},{old:"Profile.Photo",new:"profileImageUrl",type:"transform",note:"Upload to R2",oldLevel:1,newLevel:0},{old:"Profile.Pronouns",new:"pronouns",type:"transform",note:'Parse "[he, him]" string (fallback to top-level Pronouns)',oldLevel:1,newLevel:0},{old:"Profile.LinkedIn",new:"linkedIn",type:"direct",oldLevel:1,newLevel:0,note:"Fallback to top-level LinkedIn"},{old:"Profile.Status",new:"badges",type:"array",oldLevel:1,newLevel:0,note:"Display status badges"},{old:"GiveBack",new:"donationStatus",type:"object",oldLevel:0,newLevel:0,isGroup:!0},{old:"GiveBack.Amount",new:"donationStatus.amount",type:"direct",oldLevel:1,newLevel:1},{old:"GiveBack.BoxId",new:"❌ (deprecated)",type:"unknown",note:"Old DonorBox ID - service discontinued, do not migrate",oldLevel:1,newLevel:0},{old:"GiveBack.GiveId",new:"donationStatus.giveId",type:"direct",note:"Givebutter ID - CRITICAL for API lookups. If missing, use transactionId + UI flow",oldLevel:1,newLevel:1},{old:"GiveBack.TransId",new:"donationStatus.transactionId",type:"direct",note:"Transaction ID - fallback for UI flow when giveId is missing",oldLevel:1,newLevel:1},{old:"GiveBack.Latest",new:"donationStatus.lastDonation",type:"transform",note:"Convert to ISO date",oldLevel:1,newLevel:1},{old:"GiveBack.Modified",new:"donationStatus.modified",type:"direct",oldLevel:1,newLevel:1},{old:"??? (Givebutter API)",new:"donationStatus.frequency",type:"missing-source",note:"Fetch from Givebutter API using giveId (monthly, annual, one-time)",oldLevel:0,newLevel:1},{old:"Keys",new:"oldKeys",type:"object",oldLevel:0,newLevel:0,isGroup:!0,note:"Old keys preserved for image lookup"},{old:"Keys.Membership",new:"memberKey",type:"transform",note:"New UUID generated (old key in oldKeys.membership)",oldLevel:1,newLevel:0},{old:null,new:"oldKeys.membership",type:"transform",note:"Original Keys.Membership value",oldLevel:0,newLevel:1,skipOldRender:!0},{old:null,new:"oldKeys.tracks",type:"transform",note:"Original Keys.Tracks value",oldLevel:0,newLevel:1,skipOldRender:!0},{old:null,new:"oldKeys.voting",type:"transform",note:"Original Keys.Voting value",oldLevel:0,newLevel:1,skipOldRender:!0},{old:"Profile.ProId → forms.tracks",new:"tracks",type:"array",note:"Track IDs member is assigned to (Accepted/Approved status)",oldLevel:0,newLevel:0},{old:"Profile.ProId → forms.tracks (Leader role)",new:"leading",type:"array",note:"Track IDs member leads (Leader role with Accepted/Approved status)",oldLevel:0,newLevel:0}];function $te(t,e,n,a){const i={migrationFailed:!1,missingRequired:[],missingImage:!1,inferredNames:!1,duplicateEmail:!1,duplicateName:!1,editedPostMigration:!1};if(!e)return i.migrationFailed=!0,i.missingRequired=["email","firstName","lastName"],i;["email","firstName","lastName"].forEach(c=>{(!e[c]||e[c].trim()==="")&&i.missingRequired.push(c)});const o=t.Profile?.Photo?.toLowerCase().includes("logo-3.jpeg")||t.Profile?.Photo?.toLowerCase().includes("logo3.jpeg");if(t.Profile?.Photo&&!e.profileImageUrl&&!o&&(i.missingImage=!0),e._inferredNames===!0&&(i.inferredNames=!0),n){const c=t.Email?.toLowerCase().trim(),d=(t.First||t["First Name"]||"").toLowerCase().trim(),m=(t.Last||t["Last Name"]||"").toLowerCase().trim(),f=`${d} ${m}`.trim();c&&n.emailSet.has(c)&&(i.duplicateEmail=!0),f&&f!==" "&&n.nameSet.has(f)&&(i.duplicateName=!0)}if((t._wasMerged===!0||e._wasMerged===!0)&&(i.duplicateEmail=!0),a&&e?.email){const c=a.get(e.email.toLowerCase());if(c&&c.Modified&&e.LastChanged){const d=new Date(c.Modified).getTime(),m=new Date(e.LastChanged).getTime();d>m&&(i.editedPostMigration=!0)}}return i}function rE(t){return t.migrationFailed||t.missingRequired.length>0||t.missingImage||t.inferredNames||t.duplicateEmail||t.duplicateName||t.editedPostMigration}const Kte=()=>{const t=_r(),{toast:e}
4374=nr(),{isAuthenticated:n,adminEmail:a,adminRole:i,logout:s}=ia(),[o,c]=x.useState([]),[d,m]=x.useState(null),[f,p]=x.useState(0),[b,v]=x.useState("all"),[C,S]=x.useState(new Set),[F,w]=x.useState(null),[A,N]=x.useState([]),[P,z]=x.useState(!1),[D,T]=x.useState(!1),[K,B]=x.useState(new Map),[k,O]=x.useState(null),[I,j]=x.useState(""),[U,q]=x.useState([]),[Y,W]=x.useState(new Set),[H,J]=x.useState(null),[ie,Q]=x.useState([]),[ve,pe]=x.useState(null),[Me,We]=x.useState(!1),[Ae,Ce]=x.useState(null),[He,Ct]=x.useState(!1),[bt,Rt]=x.useState(!1),[zt,Ut]=x.useState(!1),[Bt,re]=x.useState(null),[wt,Nt]=x.useState(!1),[vt,Tt]=x.useState(null),[Wt,Dt]=x.useState(!1),[jt,he]=x.useState(!1),[ee,ze]=x.useState([]),[Ve,lt]=x.useState(new Map),qe=x.useRef(null),It=x.useRef(null),gt=x.useRef(new Map),Ee=async()=>{await s(),e({title:"Logged Out",description:"You have been successfully logged out"})};x.useEffect(()=>{n?i!=="SUPER_ADMIN"&&t("/admin/dashboard"):t("/admin/login")},[n,i,t]);const Je=o.map(ue=>({...ue,issues:$te(ue.old,ue.new,H||void 0,Ve)})),$e=Je.filter((ue,rt)=>b==="all"?!0:b==="migration-failed"?ue.issues.migrationFailed:b==="missing-required"?ue.issues.missingRequired.length>0:b==="missing-image"?ue.issues.missingImage:b==="inferred-names"?ue.issues.inferredNames:b==="duplicates"?ue.issues.duplicateEmail||ue.issues.duplicateName:b==="guild-email-populated"?ue.new&&ue.new.guildEmail:b==="secondary-emails-populated"?ue.new&&ue.new.secondaryEmails&&ue.new.secondaryEmails.length>0:b==="has-image"?ue.new&&ue.new.profileImageUrl:b==="public-profile"?ue.new?.public&&Object.values(ue.new.public).some(je=>je===!0):b==="edited-post-migration"?ue.issues.editedPostMigration:b==="search-results"?U.includes(rt):!0),Xe={all:o.length,anyIssues:Je.filter(ue=>rE(ue.issues)).length,migrationFailed:Je.filter(ue=>ue.issues.migrationFailed).length,missingRequired:Je.filter(ue=>ue.issues.missingRequired.length>0).length,missingImage:Je.filter(ue=>ue.issues.missingImage).length,inferredNames:Je.filter(ue=>ue.issues.inferredNames).length,duplicates:Je.filter(ue=>ue.issues.duplicateEmail||ue.issues.duplicateName).length,guildEmailPopulated:Je.filter(ue=>ue.new&&ue.new.guildEmail).length,secondaryEmailsPopulated:Je.filter(ue=>ue.new&&ue.new.secondaryEmails&&ue.new.secondaryEmails.length>0).length,hasImage:Je.filter(ue=>ue.new&&ue.new.profileImageUrl).length,publicProfile:Je.filter(ue=>ue.new?.public&&Object.values(ue.new.public).some(rt=>rt===!0)).length,editedPostMigration:Je.filter(ue=>ue.issues.editedPostMigration).length},X=$e.length>0?$e[f]:null,ke=()=>{if(!X)return;const ue=X.old.Email,rt=new Set(C);rt.has(ue)?rt.delete(ue):rt.add(ue),S(rt)},De=async()=>{try{const ue=Array.from(C).sort(),rt=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5),je=`skipped-members-${rt}.txt`,_t=`# Skipped Members - Migration ${rt}
4375# These members had issues during migration and should be contacted
4376# to re-do their profiles once the new website is live.
4377# Total: ${ue.length} members
4378#
4379# Email addresses (one per line):
4380# --------------------------------------------------------
4381
4382${ue.join(`
4383`)}
4384`,Kt=await wa("/api/admin/migration/save-skipped-members",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:je,content:_t,count:ue.length})});if(!Kt.ok)throw new Error(`Failed to save: ${Kt.statusText}`);const gn=await Kt.json();alert(`✅ Saved ${ue.length} skipped members to:
4385${gn.filepath}`)}catch(ue){console.error("Error saving skipped list:",ue),alert(`❌ Failed to save skipped list: ${ue.message}`)}};x.useEffect(()=>{o.length>0&&!D&&!P&&(async()=>{z(!0);try{const rt=await wa("/api/admin/migration/orphaned-images");if(!rt.ok)throw new Error(`Failed to fetch: ${rt.statusText}`);const je=await rt.json();N(je.images||[]),console.log(`Loaded ${je.images?.length||0} orphaned images`)}catch(rt){console.error("Error fetching orphaned images:",rt)}finally{z(!1),T(!0)}})()},[o.length,D,P]),x.useEffect(()=>{console.log("[DUPLICATES] useEffect triggered:",{migratedMembersLength:o.length,hasDuplicateData:!!H}),o.length>0&&!H&&(console.log("[DUPLICATES] Fetching duplicates from API..."),(async()=>{try{console.log("[DUPLICATES] Calling api/admin/migration/find-duplicates");const rt=await wa("/api/admin/migration/find-duplicates");if(console.log("[DUPLICATES] Response status:",rt.status),!rt.ok)throw new Error(`Failed to fetch duplicates: ${rt.statusText}`);const je=await rt.json();console.log("[DUPLICATES] Received data:",je);const _t=new Set,Kt=new Set;je.duplicates.email.forEach(gn=>
4385{gn.members.forEach(_e=>{_t.add(_e.email.toLowerCase().trim())})}),je.duplicates.name.forEach(gn=>{Kt.add(gn.name.toLowerCase().trim())}),J({emailSet:_t,nameSet:Kt}),Q(je.duplicateGroups||[]),console.log(`✅ Loaded ${_t.size} duplicate emails, ${Kt.size} duplicate names, ${je.duplicateGroups?.length||0} duplicate groups`)}catch(rt){console.error("❌ Error loading duplicates:",rt)}})())},[o.length,H]);const oe=async()=>{try{Rt(!0),console.log("Refreshing Google data from Google Workspace API...");const ue=await Vte();console.log("Google data refreshed:",ue),alert(`✅ Google data refreshed!
4386
4387Google Users: ${ue.googleUsersCount}
4388Google Groups: ${ue.googleGroupsCount}`)}catch(ue){console.error("Failed to refresh Google data:",ue),alert(`❌ Failed to refresh Google data: ${ue.message}`)}finally{Rt(!1)}},te=async()=>{try{console.log("🚀 Starting browser-based migration with deduplication..."),console.log("⏳ This may take a few minutes. Please wait..."),Ce(null),We(!0),pe("Loading backup data from server..."),await new Promise(tt=>setTimeout(tt,100));const{doMigrationWithDeduplication:ue}=await R4(async()=>{const{doMigrationWithDeduplication:tt}=await import("./memberMigration-DKXBLv4F.js");return{doMigrationWithDeduplication:tt}},[]);console.log("📥 Fetching backup data from server...");const rt=await D4();console.log("[DEBUG] Raw backup data:",rt);const{oldMembers:je,backupDate:_t,namePatches:Kt,imagePatches:gn,availableLegacyImages:_e,grantedGuildEmails:et,memberTrackAssignments:Ge,existingMemberKeys:ht,googleUsers:ft}=rt;_t&&m(_t),console.log("[DEBUG] googleUsers from destructure:",ft),console.log(`✅ Loaded ${je.length} members from backup`),console.log(`✅ Loaded ${_e?.length||0} available legacy images in R2`),console.log(`✅ Loaded ${et?.length||0} granted @xrguild.org emails from Google Workspace`),console.log(`✅ Loaded ${Object.keys(Ge||{}).length} members with track assignments`),console.log(`✅ Loaded ${Object.keys(ht||{}).length} existing member keys from DB`),console.log(`✅ Loaded ${ft?.length||0} Google Workspace users`),ze(gn||[]);const Mt=new Map(Kt.map(tt=>[tt.email.toLowerCase(),tt])),be=new Map(gn.map(tt=>[tt.email.toLowerCase(),tt])),Z=new Set(_e||[]),it=new Set((et||[]).map(tt=>tt.toLowerCase())),we=new Map(Object.entries(ht||{}));pe("Running migration in browser..."),await new Promise(tt=>setTimeout(tt,100));const{finalMembers:st,originalOldMembers:Lt,stats:Ot}=await ue(je,Mt,be,Z,it,Ge,ft,we,!1,(tt,ge,$)=>{console.log(`[${ge}/${$}] ${tt}`),pe(tt)});console.log("✅ Browser migration complete:",Ot);const Et={success:!0,finalMembers:st,originalOldMembers:Lt,stats:Ot};if(Et.success&&Et.finalMembers){console.log(`📊 Processing ${Et.finalMembers.length} final members for display...`);const tt=Et.finalMembers.map(de=>{const Ie=de.email.toLowerCase().trim(),Ke=Et.originalOldMembers.get(Ie);return Ke?{old:Ke,new:de}:(console.warn(`⚠️  No original old member found for ${Ie}, using fallback`),{old:{Email:de.email,First:de.firstName,Last:de.lastName,_isSynthetic:!0,_wasMerged:de._wasMerged||!1,_duplicateCount:de._duplicateCount||0,_mergedMemberKeys:de._mergedMemberKeys||[]},new:de})});pe("Validating profile images...");const ge=tt.filter(de=>de.new.profileImageUrl);if(ge.length>0){console.log(`🔍 Validating ${ge.length} profile images...`);try{const Ie=await(await wa("/api/admin/migration/validate-images",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({images:ge.map(Ke=>({email:Ke.new.email,imageUrl:Ke.new.profileImageUrl}))})})).json();if(Ie.success&&Ie.badImages?.length>0){console.log(`⚠️  Found ${Ie.badImages.length} bad images, resetting...`);const Ke=new Set(Ie.badImages.map(ut=>ut.email.toLowerCase()));for(const ut of tt)Ke.has(ut.new.email.toLowerCase())&&(ut.new.profileImageUrl="",ut.new._missingImage=!0,ut.new._badImage=!0);Et.stats.badImages=Ie.badImages.length,Et.stats.missingImages=(Et.stats.missingImages||0)+Ie.badImages.length,console.log(`✅ Reset ${Ie.badImages.length} bad images to default`)}}catch(de){console.error("Failed to validate images:",de)}}console.log(`✅ Setting ${tt.length} members in UI state...`),c(tt),p(0),console.log("📥 Fetching current DB members for edit detection...");try{const Ie=await(await wa("/api/admin/members")).json(),Ke=new Map;
4388(Ie.members||[]).forEach(ae=>{ae.email&&Ke.set(ae.email.toLowerCase(),ae)}),lt(Ke),console.log(`✅ Loaded ${Ke.size} current DB members for comparison`);const ut=new Set;tt.forEach(ae=>{if(ae.new?.email&&ae.new?.LastChanged){const Te=Ke.get(ae.new.email.toLowerCase());if(Te?.Modified){const Qe=new Date(Te.Modified).getTime(),ot=new Date(ae.new.LastChanged).getTime();Qe>ot&&ut.add(ae.old.Email)}}}),ut.size>0&&(console.log(`⚠️  Auto-excluding ${ut.size} members edited post-migration`),S(ae=>{const Te=new Set(ae);return ut.forEach(Qe=>Te.add(Qe)),Te}))}catch(de){console.warn("Failed to fetch current DB members:",de)}J(null),console.log("✅ Duplicate data cleared (batch deduplication already completed)");const $=Et.stats,xe=tt.filter(de=>de.new._wasMerged).length;console.log(`
4389========================================
4390🎉 MIGRATION & DEDUPLICATION COMPLETE!
4391========================================
4392Total Processed:      ${$.total}
4393✅ Success:           ${$.success}
4394❌ Failed:            ${$.failed||0}
4395⚠️  Skipped:          ${$.skipped||0}
4396🔍 Duplicates Found:  ${$.duplicatesFound} groups
4397🔀 Duplicates Removed: ${$.duplicatesRemoved} records
4398🖼️  Had Images:       ${$.hadImageInOld||0}
4399📷 Missing Images:    ${$.missingImages||0}
4400📊 Final Count:       ${tt.length}
4401🔗 Merged Records:    ${xe} (with _wasMerged flag)
4402========================================
4403        `);const ne=$.badImages>0?` (${$.badImages} were bad/corrupt files)`:"",me=$.missingImages>0?`
4404
4405⚠️  ${$.missingImages} members are missing profile images${ne}`:"";Ce({type:"success",message:`✅ Migration & Deduplication Complete!
4406
4407Total OLD Records: ${$.total}
4408Duplicate Groups Found: ${$.duplicatesFound}
4409Duplicates Merged: ${$.duplicatesRemoved}
4410Final Migrated Count: ${tt.length}
4411Records with Merge History: ${xe}${me}
4412
4413✅ ${$.duplicatesFound} duplicate groups → ${xe} merged records
4414Use the "Duplicates" filter to review merged records.
4415
4416⚠️  Records are in MEMORY only - use "Commit to Database" button when ready.`}),pe(null),We(!1),Ct(!0)}else throw new Error("No members returned from migration")}catch(ue){console.error("❌ Migration error:",ue);const rt=ue instanceof Error?ue.message:"Unknown error";pe(null),We(!1),Ce({type:"error",message:`❌ Migration failed: ${rt}`})}},ye=async()=>{if(!He||o.length===0){Ce({type:"error",message:"No migrated records available to commit."});return}if(confirm(`⚠️  Are you sure you want to commit ${o.length} migrated members to the database?
4417
4418This will permanently write the records to MongoDB.
4419
4420This action cannot be easily undone.`))try{console.log("💾 Committing migrated records to database..."),Ce(null),We(!0),pe("Committing records to database..."),await new Promise(Kt=>setTimeout(Kt,100));const rt=o.map(Kt=>Kt.new),je={total:o.length,success:o.length,failed:0,skipped:0,duplicatesFound:o.filter(Kt=>Kt.new._wasMerged).length,duplicatesRemoved:0,missingImages:o.filter(Kt=>Kt.new._missingImage).length,hadImageInOld:o.filter(Kt=>Kt.new._hadImageInOld).length};console.log(`📤 Sending ${rt.length}
4420 members to server...`);const _t=await Hte(rt,je);if(console.log("✅ Database commit result:",_t),_t.success)Ce({type:"success",message:`✅ Successfully committed ${_t.count} members to database!
4421
4422The migration is now complete and saved to MongoDB.`}),Ct(!1),pe(null),We(!1);else throw new Error("Database commit failed")}catch(rt){console.error("❌ Database commit error:",rt);const je=rt instanceof Error?rt.message:"Unknown error";pe(null),We(!1),Ce({type:"error",message:`❌ Database commit failed: ${je}`})}},Re=async()=>{if(zt)return;const ue=o.filter(je=>je.new.profileImageUrl).map(je=>({email:je.new.email,currentUrl:je.new.profileImageUrl}));if(ue.length===0){Ce({type:"error",message:"No members with profile images to rotate."});return}if(window.confirm(`⚠️  Are you sure you want to rotate ${ue.length} profile image URLs?
4423
4424This will:
4425• Copy all images to /profiles/ folder with new UUIDs
4426• Update all member records with new URLs
4427• Delete old images if they were already in /profiles/
4428
4429This helps prevent caching and scraping of profile images.`))try{Ce(null),Ut(!0),re(null),We(!0),pe("Rotating profile images..."),console.log(`🔄 Starting bulk image rotation for ${ue.length} images...`);const _t=await(await wa("/api/admin/migration/rotate-images-bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({images:ue})})).json();if(_t.success){console.log("✅ Bulk image rotation complete:",_t),re(_t.stats);const Kt=new Map(_t.results.filter(_e=>_e.success&&_e.newUrl).map(_e=>[_e.email,_e.newUrl]));c(_e=>_e.map(et=>{const Ge=Kt.get(et.new.email);return Ge?{...et,new:{...et.new,profileImageUrl:Ge}}:et}));const gn=_t.stats.sourceFolders?Object.entries(_t.stats.sourceFolders).map(([_e,et])=>`${_e}: ${et}`).join(", "):"";Ce({type:"success",message:`✅ Image rotation complete in ${_t.elapsed}s
4430
4431• Images copied: ${_t.stats.copied}`+(gn?` (from ${gn})`:"")+`
4432• DB records updated: ${_t.stats.dbUpdated}
4433• Skipped (not R2): ${_t.stats.skipped}
4434• Errors: ${_t.stats.errors}${_t.stats.dbErrors?` (${_t.stats.dbErrors} DB errors)`:""}
4435
4436📁 Final /profiles/ count: ${_t.stats.finalProfilesCount}`+(_t.stats.orphanedInProfiles>0?`
4437⚠️ Orphaned files: ${_t.stats.orphanedInProfiles} (use Purge Orphans to clean)`:"")})}else throw new Error(_t.error||"Unknown error")}catch(je){console.error("❌ Image rotation error:",je);const _t=je instanceof Error?je.message:"Unknown error";Ce({type:"error",message:`❌ Image rotation failed: ${_t}`})}finally{Ut(!1),We(!1),pe(null)}},Le=async()=>{if(!(wt||!window.confirm(`🧹 Purge orphaned files from /profiles/?
4438
4439This will ONLY delete files NOT referenced by any member profile.
4440Referenced images will be kept safe.
4441
4442Images in other directories (members, legacy, migrated) will NOT be affected.`)))try{Ce(null),Nt(!0),Tt(null),We(!0),pe("Purging orphaned files..."),console.log("🧹 Purging orphaned files from /profiles/...");const je=await(await wa("/api/admin/migration/purge-profiles",{method:"POST",headers:{"Content-Type":"application/json"}})).json();if(je.success)console.log("✅ Purge complete:",je),Tt(je),Ce({type:"success",message:`✅ Orphan purge complete in ${je.elapsed}s
4443
4444• Total files in /profiles/: ${je.totalInProfiles}
4445• Referenced by members: ${je.referenced}
4446• Orphaned files deleted: ${je.deleted}
4447• Files kept: ${je.kept}
4448• Errors: ${je.errors}`});else throw new Error(je.error||"Unknown error")}catch(rt){console.error("❌ Purge error:",rt);const je=rt instanceof Error?rt.message:"Unknown error";Ce({type:"error",message:`❌ Purge failed: ${je}`})}finally{Nt(!1),We(!1),pe(null)}},fe=async ue=>{if(ue.preventDefault(),ue.stopPropagation(),Dt(!1),!X)return;const rt=ue.dataTransfer.files;if(rt.length===0)return;const je=rt[0];if(!je.type.startsWith("image/")){alert("Please drop an image file (PNG, JPEG, etc.)");return}const _t=X.old?.Email||X.new?.email;if(!_t){alert("Cannot determine member email");return}try{he(!0),console.log(`📤 Uploading image for ${_t}...`);const Kt=new FormData;Kt.append("image",je),Kt.append("memberKey",X.new?.memberKey||"migration-upload");const _e=await(await fetch("/api/uploadProfileImage",{method:"POST",body:Kt})).json();if(_e.success&&_e.imageUrl){console.log(`✅ Image uploaded: ${_e.imageUrl}`),c(ht=>ht.map(ft=>(ft.old?.Email||ft.new?.email)?.toLowerCase()===_t.toLowerCase()?{...ft,new:{...ft.new,profileImageUrl:_e.imageUrl}}:ft));const et={email:_t.toLowerCase(),imageFilename:_e.imageUrl,source:"manual"},Ge=[...ee.filter(ht=>ht.email.toLowerCase()!==_t.toLowerCase()),et];ze(Ge);try{await P4(Ge),console.log(`✅ Image patch saved for ${_t}`)}catch(ht){console.error("Failed to save image patch:",ht)}}else throw new Error(_e.error||"Upload failed")}catch(Kt){console.error("❌ Image upload error:",Kt);const gn=Kt instanceof Error?Kt.message:"Unknown error";alert(`❌ Image upload failed: ${gn}`)}finally{he(!1)}},Se=(ue,rt)=>{w(ue);const je=rt?It:qe,Kt=eg.find(et=>et.old===ue)?.targetFields||[ue],gn=`${rt?"new":"old"}-${Kt[0]}`,_e=gt.current.get(gn);if(je.current&&_e){const et=je.current,Ge=_e,ht=et.scrollTop,ft=ht+et.clientHeight,Mt=Ge.offsetTop,be=Mt+Ge.offsetHeight;if(Mt<ht||be>ft){const Z=Mt-et.clientHeight/2+Ge.offsetHeight/2;et.scrollTo({top:Z,behavior:"smooth"})}}},Be=(ue,rt)=>rt.split(".").reduce((je,_t)=>je?.[_t],ue),Ze=ue=>{switch(ue){case"direct":return"bg-green-500/20 text-green-700 dark:text-green-400 border-green-500/30";case"renamed":return"bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500/30";case"transform":return"bg-purple-500/20 text-purple-700 dark:text-purple-400 border-purple-500/30";case"conditional":return"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border-yellow-500/30";case"array":return"bg-cyan-500/20 text-cyan-700 dark:text-cyan-400 border-cyan-500/30";case"object":return"bg-slate-500/20 text-slate-700 dark:text-slate-400 border-slate-500/30";case"unknown":return"bg-red-500/20 text-red-700 dark:text-red-400 border-red-500/30";case"missing-source":return"bg-orange-500/20 text-orange-700 dark:text-orange-400 border-orange-500/30";default:return"bg-gray-500/20 text-gray-700 dark:text-gray-400 border-gray-500/30"}};return r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 p-8",children:[r.jsx(Lo,{title:"Member Migration",subtitle:"Visualize and test schema migration from old format (forms.membership) to new format (streamlined.members)",adminEmail
4448:a,adminRole:i,onLogout:Ee}),r.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[r.jsxs("div",{className:"flex justify-center gap-3",children:[r.jsxs(Fe,{onClick:async()=>{const ue=new Map;K.forEach((je,_t)=>{const Kt=_t.split("-"),gn=Kt[Kt.length-1],_e=Kt.slice(0,-1).join("-");ue.has(_e)||ue.set(_e,{email:_e});const et=ue.get(_e);je&&je.trim()&&(et[gn]=je.trim())});const rt=Array.from(ue.values());if(rt.length===0){alert("No name edits to save. Edit some names first.");return}try{const je=await nE(rt);alert(`Saved ${je.count} name patches to ${je.filepath}`)}catch(je){console.error("Error saving patches:",je);const _t=je instanceof Error?je.message:"Unknown error";alert(`Failed to save name patches: ${_t}`)}},variant:"outline",className:"gap-2",children:["💾 Save Name Edits as Patches (",(()=>{const ue=new Set;return K.forEach((rt,je)=>{const Kt=je.split("-").slice(0,-1).join("-");ue.add(Kt)}),ue.size})(),")"]}),r.jsx(Fe,{onClick:()=>window.location.href="/admin/image-matcher",variant:"outline",className:"gap-2",children:"🖼️ Open Image Matcher"}),r.jsx(Fe,{onClick:oe,variant:"outline",className:"gap-2",disabled:bt||Me,children:bt?r.jsxs(r.Fragment,{children:[r.jsx(Rr,{className:"w-4 h-4 animate-spin"}),"Refreshing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Rr,{className:"w-4 h-4"}),"Refresh Google Data"]})}),r.jsxs(Fe,{variant:"outline",className:"gap-2",onClick:()=>t("/admin/members"),children:[r.jsx(_i,{className:"w-4 h-4"}),"View Member Table"]})]}),r.jsxs("div",{className:"flex justify-center gap-4 flex-wrap",children:[r.jsx(Ft,{className:"border-2 border-green-500/50 bg-green-50 dark:bg-green-950/20",children:r.jsx(fn,{className:"py-4",children:r.jsxs("div",{className:"flex flex-col items-center gap-3",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-sm font-semibold text-green-700 dark:text-green-400 mb-1",children:"🚀 Step 1: Full Migration"}),r.jsx("div",{className:"text-xs text-green-600 dark:text-green-500",children:"Migrate all 709 records to memory"}),d&&r.jsxs("div",{className:"text-xs text-green-500 dark:text-green-600 mt-1",children:["Backup: ",new Date(d).toLocaleDateString()]})]}),r.jsxs(Fe,{onClick:te,size:"lg",variant:"default",className:"gap-2 bg-green-600 hover:bg-green-700",disabled:Me,children:[r.jsx("span",{className:"text-lg",children:Me?"⏳":"🚀"}),Me?"Migrating...":"Full Migration"]})]})})}),r.jsx(Ft,{className:`border-2 ${He&&o.length>0?"border-blue-500/50 bg-blue-50 dark:bg-blue-950/20":"border-gray-300/50 bg-gray-50 dark:bg-gray-950/20"}`,children:r.jsx(fn,{className:"py-4",children:r.jsxs("div",{className:"flex flex-col items-center gap-3",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:`text-sm font-semibold mb-1 ${He&&o.length>0?"text-blue-700 dark:text-blue-400":"text-gray-500 dark:text-gray-400"}`,children:"💾 Step 2: Commit to DB"}),r.jsx("div",{className:`text-xs ${He&&o.length>0?"text-blue-600 dark:text-blue-500":"text-gray-400 dark:text-gray-500"}`,children:o.length>0?`Save ${o.length} members to database`:"Run migration first"})]}),r.jsxs(Fe,{onClick:ye,size:"lg",variant:"default",className:`gap-2 ${He&&o.length>0?"bg-blue-600 hover:bg-blue-700":"bg-gray-400"}`,disabled:!He||o.length===0||Me,children:[r.jsx("span",{className:"text-lg",children:"💾"}),"Commit to Database"]})]})})}),r.jsx(Ft,{className:"border-2 border-orange-500/50 bg-orange-50 dark:bg-orange-950/20",children:r.jsx(fn,{className:"py-4",children:r.jsxs("div",{className:"flex flex-col items-center gap-3",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-sm font-semibold text-orange-700 dark:text-orange-400 mb-1",children:"🔄 Step 3: Rotate Images"}),r.jsx("div",{className:"text-xs text-orange-600 dark:text-orange-500",children:"Copy all images to /profiles/ with new UUIDs"}),Bt&&r.jsxs("div",{className:"text-xs text-orange-500 dark:text-orange-600 mt-1",children:["Last run: ",Bt.copied," copied",Bt.finalProfilesCount!==void 0&&`, ${Bt.finalProfilesCount} in /profiles/`,Bt.orphanedInProfiles>0&&r.jsxs("span",{className:"text-red-500",children:[" ⚠️ ",Bt.orphanedInProfiles," orphaned"]})]})]}),r.jsxs(Fe,{onClick:Re,size:"lg",variant:"default",className:"gap-2 bg-orange-600 hover:bg-orange-700",disabled:zt||wt||Me,children:[r.jsx("span",{className:"text-lg",children:zt?"⏳":"🔄"}),zt?"Rotating Images...":"Rotate Image URLs"]})]})})}),r.jsx(Ft,{className:"border-2 border-amber-500/50 bg-amber-50 dark:bg-amber-950/20",children:r.jsx(fn,{className:"py-4",children:r.jsxs("div",{className:"flex flex-col items-center gap-3",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-sm font-semibold text-amber-700 dark:text-amber-400 mb-1",children:"🧹 Step 4: Purge Orphans"}
4448),r.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-500",children:"Delete unreferenced files in /profiles/"}),vt&&r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-600 mt-1",children:["Last purge: ",vt.deleted," deleted, ",vt.kept," kept"]})]}),r.jsxs(Fe,{onClick:Le,size:"lg",variant:"default",className:"gap-2 bg-amber-600 hover:bg-amber-700",disabled:wt||zt||Me,children:[r.jsx("span",{className:"text-lg",children:wt?"⏳":"🧹"}),wt?"Purging...":"Purge Orphans"]})]})})})]}),(Me||Ae)&&r.jsx(Ft,{className:`border-2 ${Me?"border-blue-500/50 bg-blue-50 dark:bg-blue-950/20":Ae?.type==="success"?"border-green-500/50 bg-green-50 dark:bg-green-950/20":"border-red-500/50 bg-red-50 dark:bg-red-950/20"}`,children:r.jsx(fn,{className:"py-4",children:Me?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center justify-center gap-4",children:[r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),r.jsx("div",{className:"text-lg font-semibold text-blue-700 dark:text-blue-400",children:ve})]}),r.jsx("div",{className:"text-center text-sm text-blue-600 dark:text-blue-400 mt-3",children:"This process may take several minutes. Please don't close this page."})]}):Ae&&r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsx("div",{className:`flex-1 whitespace-pre-wrap text-sm font-mono ${Ae.type==="success"?"text-green-700 dark:text-green-400":"text-red-700 dark:text-red-400"}`,children:Ae.message}),r.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>Ce(null),className:"flex-shrink-0 h-6 w-6 p-0",children:"✕"})]})})}),o.length>0&&r.jsxs(Ft,{children:[r.jsxs(bn,{className:"pb-4",children:[r.jsxs(wn,{className:"text-base flex items-center justify-between",children:[r.jsxs("span",{children:["Migrated Members (",o.length,")"]}),Xe.anyIssues>0&&r.jsxs(an,{variant:"destructive",className:"ml-2",children:[Xe.anyIssues," with issues"]})]}),r.jsxs(Ln,{children:["Viewing member ",f+1," of ",$e.length,b!=="all"&&" (filtered)",X?.old.Email&&` - ${X.old.Email}`]})]}),r.jsxs(fn,{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-sm font-medium",children:"Search Members:"}),r.jsx(un,{placeholder:"Search by first name, last name, preferred name, or email...",value:I,onChange:ue=>{const rt=ue.target.value;if(j(rt),rt.length>=2){const je=rt.toLowerCase(),_t=[];o.forEach((Kt,gn)=>{const _e=Kt.new.firstName?.toLowerCase()||"",et=Kt.new.lastName?.toLowerCase()||"",Ge=Kt.new.preferredName?.toLowerCase()||"",ht=Kt.old.Email?.toLowerCase()||"";(`${_e} ${et} ${Ge} ${ht}`.toLowerCase().includes(je)||_e.includes(je)||et.includes(je)||Ge.includes(je)||ht.includes(je))&&_t.push(gn)}),q(_t),_t.length>0&&(v("search-results"),p(0))}else q([]),b==="search-results"&&v("all")},className:"max-w-md"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-sm font-medium",children:"Filter by Issue Type:"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsxs(Fe,{variant:b==="all"?"default":"outline",size:"sm",onClick:()=>{v("all"),p(0)},className:"gap-2",children:["All Members",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.all})]}),U.length>0&&r.jsxs(Fe,{variant:b==="search-results"?"default":"outline",size:"sm",onClick:()=>{v("search-results"),p(0)},className:"gap-2",children:["🔍 Search Results",r.jsx(an,{variant:"secondary",className:"ml-1",children:U.length})]}),r.jsxs(Fe,{variant:b==="migration-failed"?"default":"outline",size:"sm",onClick:()=>{v("migration-failed"),p(0)},className:"gap-2",disabled:Xe.migrationFailed===0,children:["❌ Migration Failed",r.jsx(an,{variant:"destructive",className:"ml-1",children:Xe.migrationFailed})]}),r.jsxs(Fe,{variant:b==="missing-required"?"default":"outline",size:"sm",onClick:()=>{v("missing-required"),p(0)},className:"gap-2",disabled:Xe.missingRequired===0,children:["Missing Required",r.jsx(an,{variant:"destructive",className:"ml-1",children:Xe.missingRequired})]}),r.jsxs(Fe,{variant:b==="missing-image"?"default":"outline",size:"sm",onClick:()=>{v("missing-image"),p(0)},className:"gap-2",disabled:Xe.missingImage===0,children:["Missing Image",r.jsx(an,{variant:"destructive",className:"ml-1",children:Xe.missingImage})]}),r.jsxs(Fe,{variant:b==="inferred-names"?"default":"outline",size:"sm",onClick:()=>{v("inferred-names"),p(0)},className:"gap-2",disabled:Xe.inferredNames===0,children:["Inferred Names",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.inferredNames})]}),r.jsxs(Fe,{variant:b==="duplicates"?"default":"outline",size:"sm",onClick:()=>{v("duplicates"),p(0)},className:"gap-2",disabled:Xe.duplicates===0,children:["Duplicates",r.jsx(an,{variant:"destructive",className:"ml-1",children:Xe.duplicates})]}),r.jsxs(Fe,{variant:b==="guild-email-populated"?"default":"outline",size:"sm",onClick:()=>{v("guild-email-populated"),p(0)}
4448,className:"gap-2",disabled:Xe.guildEmailPopulated===0,children:["✉️ Guild Email",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.guildEmailPopulated})]}),r.jsxs(Fe,{variant:b==="secondary-emails-populated"?"default":"outline",size:"sm",onClick:()=>{v("secondary-emails-populated"),p(0)},className:"gap-2",disabled:Xe.secondaryEmailsPopulated===0,children:["📧 Secondary Emails",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.secondaryEmailsPopulated})]}),r.jsxs(Fe,{variant:b==="has-image"?"default":"outline",size:"sm",onClick:()=>{v("has-image"),p(0)},className:"gap-2",disabled:Xe.hasImage===0,children:["🖼️ Has Image",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.hasImage})]}),r.jsxs(Fe,{variant:b==="public-profile"?"default":"outline",size:"sm",onClick:()=>{v("public-profile"),p(0)},className:"gap-2",disabled:Xe.publicProfile===0,children:["👁️ Public",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.publicProfile})]}),r.jsxs(Fe,{variant:b==="edited-post-migration"?"default":"outline",size:"sm",onClick:()=>{v("edited-post-migration"),p(0)},className:"gap-2",disabled:Xe.editedPostMigration===0,title:"Members edited on new site after backup was taken (auto-excluded from commit)",children:["✏️ Edited",r.jsx(an,{variant:"secondary",className:"ml-1",children:Xe.editedPostMigration})]})]})]}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Fe,{variant:"outline",size:"icon",onClick:()=>p(Math.max(0,f-1)),disabled:f===0,children:r.jsx(Qg,{className:"w-4 h-4"})}),r.jsx("div",{className:"flex-1",children:r.jsx(uf,{value:[f],onValueChange:ue=>p(ue[0]),max:Math.max(0,$e.length-1),step:1,className:"w-full"})}),r.jsx(Fe,{variant:"outline",size:"icon",onClick:()=>p(Math.min($e.length-1,f+1)),disabled:f===$e.length-1,children:r.jsx(nh,{className:"w-4 h-4"})}),r.jsxs("span",{className:"text-sm text-muted-foreground min-w-[3rem] text-center",children:[f+1," / ",$e.length]})]})]})]}),X&&rE(X.issues)&&r.jsxs(Ft,{className:"border-2 border-red-500/30 bg-red-500/5",children:[r.jsx(bn,{children:r.jsx(wn,{className:"text-base text-red-600 dark:text-red-400 flex items-center gap-2",children:"⚠️ Issues Detected"})}),r.jsxs(fn,{className:"space-y-2",children:[X.issues.missingRequired.length>0&&r.jsxs("div",{className:"text-sm",children:[r.jsx("strong",{className:"text-red-600",children:"Missing Required Fields:"})," ",X.issues.missingRequired.join(", ")]}),X.issues.missingImage&&r.jsxs("div",{className:"text-sm",children:[r.jsx("strong",{className:"text-red-600",children:"Missing Profile Image:"})," ","Old member had a photo but new member doesn't have profileImageUrl"]}),(X.issues.duplicateEmail||X.issues.duplicateName)&&(()=>{const ue=X.old._wasMerged||X.new._wasMerged,rt=X.old._duplicateCount||X.new._duplicateCount||0,je=X.old._mergedMemberKeys||X.new._mergedMemberKeys||[];return ue?r.jsx("div",{className:"space-y-2 p-3 bg-green-50 border border-green-300 rounded",children:r.jsx("div",{className:"flex items-start gap-3",children:r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"text-sm",children:[r.jsx("strong",{className:"text-green-700",children:"✅ Merged Record (Post-Deduplication):"})," ","This record was created by merging ",rt," duplicate member records."]}),je.length>0&&r.jsxs("div",{className:"text-xs text-green-700 mt-2",children:[r.jsx("strong",{children:"Merged from memberKeys:"}),r.jsx("ul",{className:"list-disc list-inside mt-1 ml-2",children:je.map((_t,Kt)=>r.jsxs("li",{className:"font-mono text-xs",children:[_t.substring(0,16),"..."]},Kt))})]}),X.new._collectedSecondaryEmails&&X.new._collectedSecondaryEmails.length>0&&r.jsxs("div",{className:"text-xs text-green-700 mt-2",children:[r.jsx("strong",{children:"Secondary emails from duplicates:"}),r.jsx("ul",{className:"list-disc list-inside mt-1 ml-2",children:X.new._collectedSecondaryEmails.map((_t,Kt)=>r.jsx("li",{children:_t},Kt))})]})]})})}):r.jsx("div",{className:"space-y-2 p-3 bg-yellow-50 border border-yellow-300 rounded",children:r.jsx("div",{className:"flex items-start gap-3",children:r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"text-sm",children:[r.jsx("strong",{className:"text-yellow-700",children:"⚠️ Potential Duplicate (Pre-Migration):"})," ","This appears to be a duplicate. Run batch migration to automatically merge duplicates."]}),r.jsx("div",{className:"text-xs text-yellow-600 mt-1",children:"The batch migration process will detect and merge all duplicates automatically."})]})})})})(),X.issues.inferredNames&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"text-sm",children:[r.jsx("strong",{className:"text-yellow-600",children:"Inferred Names from Email:"})," ","Edit the fields below to correct any inferences"]}),(X.old.LinkedIn||X.old.Profile?.LinkedIn)&&r.jsxs(Fe,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>{const ue=X.old.LinkedIn||X.old.Profile?.LinkedIn;window.open(ue,"_blank","noopener,noreferrer")},children:[r.jsx(_i,{className:"w-4 h-4"}),"Check LinkedIn"]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"First Name"}),r.jsx(un,{value:K.get(`${X.old.Email}-firstName`)??X.new.firstName??"",onChange:ue=>{const rt=new Map(K);rt.set(`${X.old.Email}-firstName`,ue.target.value),B(rt)},className:"h-8 text-sm"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Middle Name"}),r.jsx(un,{value:K.get(`${X.old.Email}-middleName`)??X.new.middleName??"",onChange:ue=>{const rt=new Map(K);rt.set(`${X.old.Email}-middleName`,ue.target.value),B(rt)},className:"h-8 text-sm",placeholder:"(optional)"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Last Name"}),r.jsx(un,{value:K.get(`${X.old.Email}-lastName`)??X.new.lastName??"",onChange:ue=>{const rt=new Map(K);rt.set(`${X.old.Email}-lastName`,ue.target.value),B(rt)},className:"h-8 text-sm"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Preferred Name"}),r.jsx(un,{value:K.get(`${X.old.Email}-preferredName`)??X.new.preferredName??"",onChange:ue=>{const rt=new Map(K);rt.set(`${X.old.Email}-preferredName`,ue.target.value),B(rt)},className:"h-8 text-sm",placeholder:"(e.g., Zen)"})]})]}),r.jsx("div",{className:"text-xs text-muted-foreground italic",children:'Hint: Extract from email if obvious (e.g., "[email protected]" → "Zen"), otherwise leave blank'}),K.size>0&&r.jsx("div",{className:"mt-3 pt-3 border-t",children:r.jsxs(Fe,{size:"sm",variant:"default",className:"w-full gap-2",onClick:async()=>{const ue=new Map;
4448K.forEach((je,_t)=>{const Kt=_t.split("-"),gn=Kt[Kt.length-1],_e=Kt.slice(0,-1).join("-");ue.has(_e)||ue.set(_e,{email:_e});const et=ue.get(_e);je&&je.trim()&&(et[gn]=je.trim())});const rt=Array.from(ue.values());if(rt.length===0){alert("No name edits to save. Edit some names first.");return}try{const je=await nE(rt);alert(`✅ Saved ${je.count} name patches to ${je.filepath}`)}catch(je){console.error("Error saving patches:",je);const _t=je instanceof Error?je.message:"Unknown error";alert(`❌ Failed to save name patches: ${_t}`)}},children:["💾 Save Name Edits (",K.size," field",K.size!==1?"s":""," edited)"]})})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsxs(Ft,{className:"border-2 border-orange-500/30",children:[r.jsx(bn,{className:"bg-orange-500/10",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:"Old Schema"}),r.jsx(an,{variant:"outline",className:"text-xs",children:"forms.membership"})]}),r.jsx(Ln,{children:"Original member data structure"})]}),X&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"include-member",checked:!C.has(X.old.Email),onCheckedChange:()=>ke()}),r.jsx("label",{htmlFor:"include-member",className:`text-sm cursor-pointer ${C.has(X.old.Email)?"text-red-600 line-through":"text-green-600"}`,children:C.has(X.old.Email)?"Excluded":"Include"}),C.size>0&&r.jsxs(Fe,{variant:"ghost",size:"sm",onClick:De,className:"ml-2 h-6 px-2 text-xs",title:`Save ${C.size} skipped members`,children:["💾 ",C.size]})]})]})}),r.jsx(fn,{ref:qe,className:"space-y-1 max-h-[600px] overflow-y-auto",children:eg.map((ue,rt)=>{if(ue.skipOldRender||ue.old&&(ue.old.split(".").pop()||"").startsWith("_"))return null;const je=X?Be(X.old,ue.old):null;if(ue.isGroup)return r.jsx("div",{className:"mt-3 first:mt-0",children:r.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-orange-500/10 border-l-4 border-orange-500 rounded",children:[r.jsx("span",{className:"font-mono font-bold text-sm text-orange-700 dark:text-orange-300",children:ue.old}),ue.note&&r.jsx("span",{className:"text-xs text-muted-foreground italic",children:ue.note})]})},rt);if(ue.isMultiTarget)return r.jsx("div",{className:"mt-3 first:mt-0",children:r.jsxs("div",{className:"flex items-start justify-between gap-2 p-2 bg-purple-500/10 border-l-4 border-purple-500 rounded",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("span",{className:"font-mono font-bold text-sm text-purple-700 dark:text-purple-300",children:ue.old}),r.jsx(an,{className:`text-xs ${Ze(ue.type)}`,children:ue.type})]}),ue.note&&r.jsx("div",{className:"text-xs text-muted-foreground italic",children:ue.note})]}),r.jsx(km,{className:"w-4 h-4 text-muted-foreground flex-shrink-0 mt-1"})]})},rt);if((je==null||je==="")&&ue.type!=="unknown")return null;const _t=ue.oldLevel===1?"ml-4":"";return r.jsxs("div",{ref:Kt=>Kt&&gt.current.set(`old-${ue.old}`,Kt),className:`p-2 rounded-lg border transition-all cursor-pointer ${_t} ${F===ue.old?"ring-2 ring-purple-500 bg-purple-500/10":"hover:bg-slate-100 dark:hover:bg-slate-800"}`,onMouseEnter:()=>Se(ue.old,!0),onMouseLeave:()=>w(null),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm font-mono font-semibold text-orange-600 dark:text-orange-400",children:ue.old?ue.oldLevel===1?ue.old.split(".")[1]:ue.old:"(no source)"}),r.jsx(an,{className:`text-xs ${Ze(ue.type)}`,children:ue.type})]}),r.jsx(km,{className:"w-4 h-4 text-muted-foreground flex-shrink-0 mt-1"})]}),r.jsx("div",{className:"text-sm text-muted-foreground break-all",children:ue.old==="Profile.Photo"&&je?r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("img",{src:`https://xrguild.org${je}`,alt:"Profile",className:"w-16 h-16 object-cover rounded border border-orange-300",onError:Kt=>{Kt.currentTarget.style.display="none"}}),r.jsx("span",{className:"text-xs",children:String(je)})]}):typeof je=="object"?JSON.stringify(je,null,2):String(je)}),ue.note&&r.jsx("div",{className:"text-xs text-muted-foreground mt-1 italic",children:ue.note})]},rt)})})]}),r.jsxs(Ft,{className:`border-2 ${X?"border-green-500/30":"border-slate-300/30"}`,children:[r.jsx(bn,{className:`py-3 ${X?"bg-green-500/10":"bg-slate-100 dar
4448k:bg-slate-800"}`,children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs(wn,{className:"flex items-center gap-2",children:[r.jsx("span",{className:X?"text-green-600 dark:text-green-400":"text-muted-foreground",children:"New Schema"}),r.jsx(an,{variant:"outline",className:"text-xs",children:"streamlined.members"})]}),r.jsx(Ln,{className:"mt-1",children:X?"Migrated member data":"Run migration to see result"})]}),X&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex flex-col items-center gap-1 cursor-pointer",title:"Toggle all public profile visibility settings",children:[r.jsx(ar,{checked:X.new.public&&Object.values(X.new.public).some(ue=>ue===!0),onCheckedChange:ue=>{c(rt=>rt.map(je=>{if(je.new.email===X.new.email){const _t=ue===!0;return{...je,new:{...je.new,public:{name:_t,image:_t,job:_t,bio:_t,region:_t,donation:_t,tracks:_t}}}}return je}))}}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Public"})]}),r.jsx("div",{onDrop:fe,onDragOver:ue=>{ue.preventDefault(),Dt(!0)},onDragLeave:()=>Dt(!1),className:`w-[70px] h-[70px] rounded-[5px] border-2 border-dashed flex items-center justify-center transition-colors ${Wt?"border-green-400 bg-green-500/20":X.new.profileImageUrl?"border-transparent":"border-green-500/30 hover:border-green-500/50"}`,title:"Drop image here to upload",children:jt?r.jsx("div",{className:"animate-spin w-6 h-6 border-2 border-green-500 border-t-transparent rounded-full"}):X.new.profileImageUrl?r.jsx(Ld,{email:X.new.email,profileImageUrl:X.new.profileImageUrl,displayName:`${X.new.firstName} ${X.new.lastName}`,size:"lg"}):r.jsx("span",{className:"text-2xl opacity-50 cursor-default",children:"📷"})})]})]})}),r.jsx(fn,{ref:It,className:"space-y-1 max-h-[600px] overflow-y-auto",children:X?eg.map((ue,rt)=>{if(ue.isGroup&&ue.new)return r.jsx("div",{className:"mt-3 first:mt-0",children:r.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-green-500/10 border-l-4 border-green-500 rounded",children:r.jsx("span",{className:"font-mono font-bold text-sm text-green-700 dark:text-green-300",children:ue.new})})},rt);if(ue.isGroup||ue.isMultiTarget||!ue.new)return null;const je=ue.new.split("/")[0],_t=X?Be(X.new,je):null,gn=X?.issues?.missingRequired.includes(je),_e=gn,et=ue.new==="profileImageUrl";if(_t===void 0&&ue.type!=="missing-source"&&!_e&&!et)return null;const Ge=ue.newLevel===1?"ml-4":"",ht=eg.find(Mt=>Mt.old===F),ft=F===ue.old||ht?.targetFields&&ht.targetFields.includes(ue.new);return r.jsxs("div",{ref:Mt=>Mt&&gt.current.set(`new-${ue.new}`,Mt),className:`p-2 rounded-lg border transition-all cursor-pointer ${Ge} ${ft?"ring-2 ring-purple-500 bg-purple-500/10":_e?"border-red-500 bg-red-500/10":"hover:bg-slate-100 dark:hover:bg-slate-800"}`,onMouseEnter:()=>Se(ue.old,!1),onMouseLeave:()=>w(null),children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("div",{className:"text-sm font-mono font-semibold text-green-600 dark:text-green-400",children:ue.newLevel===1&&ue.new.includes(".")?ue.new.split(".")[1]:ue.new}),r.jsx(an,{className:`text-xs ${Ze(ue.type)}`,children:ue.type}),gn&&r.jsx(an,{variant:"destructive",className:"text-xs",children:"Required!"})]}),r.jsx("div",{className:"text-sm text-muted-foreground break-all",children:ue.type==="missing-source"?r.jsx("span",{className:"italic opacity-50",children:"(empty - no source data)"}):_t===null?r.jsx("span",{className:`italic font-semibold ${_e?"text-red-600":"opacity-50"}`,children:_e?"⚠️ null (MISSING!)":"null"}):_t===void 0?r.jsx("span",{className:`italic font-semibold ${_e?"text-red-600":"opacity-50"}`,children:_e?"⚠️ undefined (MISSING!)":"undefined"}):_t===""?r.jsx("span",{className:`italic font-semibold ${_e?"text-red-600":"opacity-50"}`,children:_e?'⚠️ "" (EMPTY!)':"(empty string)"}):ue.new==="profileImageUrl"&&typeof _t=="string"?r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("img",{src:_t,alt:"Profile",className:"w-16 h-16 object-cover rounded border border-green-300",onError:Mt=>{Mt.currentTarget.style.display="none"}}),r.jsx("span",{className:"text-xs",children:String(_t)})]}):typeof _t=="object"?JSON.stringify(_t,null,2):String(_t)}),ue.note&&r.jsx("div",{className:"text-xs text-muted-foreground mt-1 italic",children:ue.note})]},rt)}):r.jsx("div",{className:"text-center py-16 text-muted-foreground",children:r.jsx("p",{children:'Click "Full Migration" to see the transformed data'})})})]})]}),r.jsxs(Ft,{children:[r.jsx(bn,{children:r.jsx(wn,{className:"text-lg",children:"Field Mapping Types"})}),r.jsx(fn,{children:r.jsxs("div",{className:"flex flex-wrap gap-3",children:[r.jsx(an,{className:Ze("direct"),children:"Direct 
4448Copy"}),r.jsx(an,{className:Ze("renamed"),children:"Renamed Field"}),r.jsx(an,{className:Ze("transform"),children:"Data Transform"}),r.jsx(an,{className:Ze("conditional"),children:"Conditional Logic"}),r.jsx(an,{className:Ze("array"),children:"Array Handling"}),r.jsx(an,{className:Ze("object"),children:"Object/Group"}),r.jsx(an,{className:Ze("unknown"),children:"⚠️ No Target (unmapped)"}),r.jsx(an,{className:Ze("missing-source"),children:"⚠️ No Source (new field)"})]})})]}),X&&r.jsxs(Ft,{children:[r.jsx(bn,{children:r.jsx(wn,{children:"Full JSON Comparison"})}),r.jsx(fn,{children:r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold mb-2 text-orange-600 dark:text-orange-400",children:"Old Format"}),r.jsx("pre",{className:"text-xs bg-slate-100 dark:bg-slate-900 p-4 rounded-lg overflow-auto max-h-96",children:JSON.stringify(X.old,null,2)})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold mb-2 text-green-600 dark:text-green-400",children:"New Format"}),r.jsx("pre",{className:"text-xs bg-slate-100 dark:bg-slate-900 p-4 rounded-lg overflow-auto max-h-96",children:JSON.stringify(X.new,null,2)})]})]})})]})]})]})};function Yte(){const t=_r(),{isAuthenticated:e,adminEmail:n,adminRole:a,logout:i}=ia(),{toast:s}=nr(),[o,c]=x.useState([]),[d,m]=x.useState(null),[f,p]=x.useState([]),[b,v]=x.useState([]),[C,S]=x.useState(null),[F,w]=x.useState(""),[A,N]=x.useState(""),[P,z]=x.useState(!0),[D,T]=x.useState(!1),[K,B]=x.useState([]),[k,O]=x.useState(new Set),[I,j]=x.useState(null),U=async()=>{await i(),s({title:"Logged Out",description:"You have been successfully logged out"})};x.useEffect(()=>{e?a!=="SUPER_ADMIN"&&t("/admin/dashboard"):t("/admin/login")},[e,a,t]),x.useEffect(()=>{q()},[]),x.useEffect(()=>{const re=setTimeout(()=>{w(A)},300);return()=>clearTimeout(re)},[A]);const q=async(re=!1)=>{z(!0);try{const vt=await(await wa(`/api/admin/migration/orphaned-images${re?"?refresh=true":""}`)).json(),Tt=vt.images||[];
4448c(Tt),m(vt.stats||null),console.log("[ImageMatcher] Loaded orphaned images:",vt.stats,vt.cachedAt?`(cached: ${vt.cachedAt})`:"(fresh)");const Wt=await D4(),{doMigrationWithDeduplication:Dt}=await R4(async()=>{const{doMigrationWithDeduplication:gt}=await import("./memberMigration-DKXBLv4F.js");return{doMigrationWithDeduplication:gt}},[]),jt=new Map((Wt.namePatches||[]).map(gt=>[gt.email.toLowerCase(),gt])),he=new Map((Wt.imagePatches||[]).map(gt=>[gt.email.toLowerCase(),gt])),ee=new Set(Wt.availableLegacyImages||[]);console.log("[ImageMatcher] Running migration to detect current missing images...");const ze=new Set((Wt.grantedGuildEmails||[]).map(gt=>gt.toLowerCase())),Ve=new Map(Object.entries(Wt.existingMemberKeys||{})),{finalMembers:lt}=await Dt(Wt.oldMembers,jt,he,ee,ze,Wt.memberTrackAssignments||{},Wt.googleUsers||[],Ve,!1,void 0,!1),qe=lt.filter(gt=>gt._hadImageInOld&&(gt._missingImage||!gt.profileImageUrl)).map(gt=>({email:gt.email,firstName:gt.firstName||"",lastName:gt.lastName||"",preferredName:gt.preferredName||"",profileImageUrl:gt.profileImageUrl,linkedIn:gt.linkedIn||""})).sort((gt,Ee)=>gt.firstName.localeCompare(Ee.firstName));console.log(`[ImageMatcher] ${qe.length} members still missing images after migration`),p(qe);const It=await Wte();v(It.patches||[]);try{const Ee=await(await wa("/api/admin/migration/redundant-images")).json();B(Ee.images||[]),console.log(`[ImageMatcher] Loaded ${Ee.images?.length||0} saved redundant images`)}catch{console.log("[ImageMatcher] No saved redundant images found")}}catch(wt){console.error("Failed to load data:",wt)}finally{z(!1)}},Y=async()=>{try{const re=await P4(b);s({title:"Patches saved",description:`${re.count} image patches saved`})}catch(re){console.error("Error saving patches:",re);const wt=re instanceof Error?re.message:"Unknown error";s({title:"Save failed",description:wt,variant:"destructive"})}},W=re=>{S(re)},H=re=>{re.preventDefault()},J=(re,wt)=>{if(re.preventDefault(),!C)return;const Nt=b.findIndex(Tt=>Tt.email===wt.email),vt={email:wt.email,imageFilename:C.url};if(Nt>=0){const Tt=[...b];Tt[Nt]=vt,v(Tt)}else v([...b,vt]);c(o.filter(Tt=>Tt.key!==C.key)),S(null)},ie=re=>{b.find(Nt=>Nt.email===re)&&v(b.filter(Nt=>Nt.email!==re))},Q=async re=>{re.preventDefault(),T(!1),C&&(B(wt=>[...wt,C]),c(o.filter(wt=>wt.key!==C.key)),console.log(`Marked ${C.key} as redundant`),S(null))},ve=async()=>{try{const re=await wa("/api/admin/migration/save-redundant-images",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({images:K.map(wt=>({key:wt.key,url:wt.url,folder:wt.folder,filename:wt.filename,size:wt.size}))})});if(re.ok){const wt=await re.json();console.log(`Saved ${wt.count} redundant images to file`),s({title:"Redundant images saved",description:`${K.length} images marked for deletion`})}}catch(re){console.error("Failed to save redundant images:",re),s({title:"Save failed",description:"Could not save redundant images list",variant:"destructive"})}},pe=re=>{re.preventDefault(),T(!0)},Me=()=>{T(!1)},We=async(re,wt)=>{re.preventDefault();const Nt=re.dataTransfer.getData("text/uri-list")||re.dataTransfer.getData("text/plain");if(!Nt||!Nt.startsWith("http")){console.log("No valid image URL found in drop");return}console.log(`Uploading external image for ${wt.email}:`,Nt),j(wt.email);try{const vt=await wa("/api/admin/migration/upload-external-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:wt.email,imageUrl:Nt,markPrivate:!0})});if(vt.ok){const Tt=await vt.json();console.log(`Uploaded image for ${wt.email}:`,Tt.profileImageUrl),v(Wt=>{const Dt=Wt.findIndex(he=>he.email.toLowerCase()===wt.email.toLowerCase()),jt={email:wt.email,imageFilename:Tt.profileImageUrl};if(Dt>=0){const he=[...Wt];return he[Dt]=jt,he}return[...Wt,jt]}),s({title:"Image uploaded",description:`${wt.firstName} ${wt.lastName} - profile marked private`})}else{const Tt=await vt.json();s({title:"Upload failed",description:Tt.error,variant:"destructive"})}}catch(vt){console.error("Failed to upload external image:",vt),s({title:"Upload failed",description:"Could not upload image",variant:"destructive"})}finally{j(null)}},Ae=f.filter(re=>{if(!F)return!0;const wt=F.toLowerCase();return`${re.firstName} ${re.lastName} ${re.preferredName} ${re.email}`.toLowerCase().includes(wt)}),Ce=Ae.filter(re=>b.some(wt=>wt.email===re.email)),He=Ae.filter(re=>!b.some(wt=>wt.email===re.email)),Ct=He.filter(re=>re.linkedIn),bt=Ct.filter(re=>!k.has(re.email)),Rt=()=>{const re=bt.slice(0,10);re.length!==0&&(re.forEach(wt=>
4448{wt.linkedIn&&window.open(wt.linkedIn,"_blank")}),O(wt=>{const Nt=new Set(wt);return re.forEach(vt=>Nt.add(vt.email)),Nt}))},zt=new Set(b.map(re=>re.imageFilename)),Ut=new Set(K.map(re=>re.key)),Bt=o.filter(re=>!zt.has(re.url)&&!Ut.has(re.key));return P?r.jsx("div",{className:"container mx-auto p-8",children:r.jsx("div",{className:"text-center",children:"Loading..."})}):r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 p-8",children:[r.jsx(Lo,{title:"Image Matcher",subtitle:"Drag images to member names to associate them",adminEmail:n,adminRole:a,onLogout:U,backTo:"/admin/migration"}),r.jsxs("div",{className:"container mx-auto space-y-6",children:[r.jsxs("div",{className:"flex justify-center gap-3",children:[r.jsxs(Fe,{onClick:Y,className:"bg-blue-600 hover:bg-blue-700",children:["Save Patches (",b.length,")"]}),r.jsx(Fe,{variant:"outline",onClick:()=>q(!1),children:"Reload (cached)"}),r.jsx(Fe,{variant:"outline",onClick:()=>q(!0),className:"border-orange-600 text-orange-300 hover:bg-orange-900",children:"Refresh from R2"})]}),r.jsxs("div",{className:"flex flex-wrap gap-4",children:[r.jsxs(an,{variant:"secondary",className:"bg-gray-800 text-gray-300",children:[o.length," orphaned images"]}),r.jsxs(an,{variant:"secondary",className:"bg-gray-800 text-gray-300",children:[f.length," members without images"]}),r.jsxs(an,{variant:"default",className:"bg-green-700 text-gray-100",children:[b.length," matched"]}),d&&r.jsxs(r.Fragment,{children:[r.jsxs(an,{variant:"outline",className:"border-gray-600 text-gray-400",children:["R2 Total: ",d.total]}),r.jsxs(an,{variant:"outline",className:"border-gray-600 text-gray-400",children:["In Use: ",d.inUse]}),d.duplicatesRemoved>0&&r.jsxs(an,{variant:"outline",className:"border-orange-600 text-orange-400",children:["Deduped: -",d.duplicatesRemoved]}),r.jsxs(an,{variant:"outline",className:"border-blue-600 text-blue-400",children:["legacy: ",d.byFolder?.legacy||0]}),r.jsxs(an,{variant:"outline",className:"border-purple-600 text-purple-400",children:["members: ",d.byFolder?.members||0]}),r.jsxs(an,{variant:"outline",className:"border-green-600 text-green-400",children:["migrated: ",d.byFolder?.migrated||0]})]})]}),r.jsxs(Ft,{className:"p-4 bg-gray-900 border-gray-700",children:[r.jsxs("h2",{className:"text-xl font-bold text-gray-100 mb-3",children:["Orphaned Images from R2 (Drag to Match) - ",Bt.length," shown"]}),r.jsx("div",{className:"grid gap-0.5",style:{gridTemplateColumns:"repeat(auto-fill, 60px)"},children:Bt.map(re=>{const Nt={legacy:"border-blue-500",members:"border-purple-500",migrated:"border-green-500"}[re.folder]||"border-gray-600",vt=re.dimensions?`${re.dimensions.width}×${re.dimensions.height}`:"",Tt=Math.round(re.size/1024),Wt=[`${re.folder}/${re.filename}`,re.uuid?`UUID: ${re.uuid}`:"No UUID",`Size: ${Tt}KB`,vt?`Dims: ${vt}`:"",re.duplicateCount?`+${re.duplicateCount} duplicates removed`:""].filter(Boolean).join(`
4449`);return r.jsxs("div",{draggable:!0,onDragStart:()=>W(re),className:"cursor-move hover:scale-105 transition-transform relative group",children:[r.jsx("img",{src:re.url,alt:re.filename,className:`w-[60px] h-[60px] object-cover rounded border ${Nt}`,title:Wt}),r.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-black/70 text-[10px] text-center text-white opacity-0 group-hover:opacity-100 transition-opacity rounded-b",children:[re.folder," ",vt&&`• ${vt}`]})]},re.key)})}),Bt.length===0&&r.jsx("p",{className:"text-gray-400 text-center py-8",children:"No orphaned images remaining"})]}),r.jsx(Ft,{className:`p-4 border-2 border-dashed transition-colors ${D?"border-red-500 bg-red-950":"border-gray-600 bg-gray-900"}`,onDragOver:pe,onDragLeave:Me,onDrop:Q,children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsxs("p",{className:"text-lg font-semibold text-gray-100",children:["Drop Redundant Images Here (",K.length,")"]}),r.jsx("p",{className:"text-sm text-gray-400",children:"These can be deleted from R2 later"})]}),K.length>0&&r.jsx(Fe,{onClick:ve,variant:"destructive",size:"sm",children:"Save List for Deletion"})]})}),r.jsxs(Ft,{className:"p-6 bg-gray-900 border-gray-700",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{className:"text-xl font-bold text-gray-100",children:"Members Without Images (Drop Target)"}),r.jsxs("div",{className:"flex items-center gap-2",children:[Ct.length>0&&r.jsxs(Fe,{onClick:Rt,variant:"outline",size:"sm",className:"border-blue-600 text-blue-400 hover:bg-blue-900",disabled:bt.length<=0,children:["Open LinkedIn (next 10 of ",bt.length," remaining)"]}),r.jsx(un,{placeholder:"Search members...",value:A,onChange:re=>N(re.target.value),className:"max-w-xs bg-gray-800 border-gray-600 text-gray-100 placeholder:text-gray-400"})]})]}),He.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3 text-gray-100",children:["Unmatched (",He.length,")"]}
4449),r.jsx("div",{className:"grid grid-cols-5 gap-3",children:He.map(re=>{const wt=re.profileImageUrl&&re.profileImageUrl.trim(),Nt=I===re.email;return r.jsxs("div",{onDragOver:H,onDrop:vt=>{C?J(vt,re):We(vt,re)},className:`border-2 border-dashed rounded p-3 transition-colors relative ${Nt?"border-yellow-400 bg-yellow-950 animate-pulse":C?"border-purple-400 bg-purple-950":wt?"border-red-500 bg-red-950":"border-gray-600 bg-gray-800"}`,children:[wt&&r.jsx("div",{className:"absolute top-1 right-1",children:r.jsx("img",{src:wt,alt:"Sanity check - this shouldn't be here!",className:"w-8 h-8 rounded border-2 border-red-500",title:`BUG: Has image at ${wt}`})}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs("p",{className:"font-semibold truncate text-gray-100 flex-1",children:[re.firstName," ",re.lastName]}),re.linkedIn&&r.jsx("a",{href:re.linkedIn,target:"_blank",rel:"noopener noreferrer",onClick:vt=>vt.stopPropagation(),className:"flex-shrink-0",title:"LinkedIn Profile",children:r.jsx("svg",{className:"w-[15px] h-[15px] text-blue-400 hover:text-blue-300",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})})]}),re.preferredName&&r.jsxs("p",{className:"text-sm text-gray-400 truncate italic",children:['"',re.preferredName,'"']}),r.jsx("p",{className:"text-xs text-gray-500 truncate mt-1",children:re.email})]},re.email)})})]}),Ce.length>0&&r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3 text-green-400",children:["Matched (",Ce.length,")"]}),r.jsx("div",{className:"grid grid-cols-4 gap-4",children:Ce.map(re=>{const Nt=b.find(vt=>vt.email===re.email)?.imageFilename||"";return r.jsx("div",{className:"border-2 border-green-600 rounded p-3 bg-green-950",children:r.jsxs("div",{className:"flex items-start gap-3",children:[Nt&&r.jsx("img",{src:Nt,alt:re.email,className:"w-16 h-16 object-cover rounded"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs("p",{className:"font-semibold truncate text-gray-100 flex-1",children:[re.firstName," ",re.lastName]}),re.linkedIn&&r.jsx("a",{href:re.linkedIn,target:"_blank",rel:"noopener noreferrer",onClick:vt=>vt.stopPropagation(),className:"flex-shrink-0",title:"LinkedIn Profile",children:r.jsx("svg",{className:"w-[15px] h-[15px] text-blue-400 hover:text-blue-300",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})})]}),re.preferredName&&r.jsxs("p",{className:"text-sm text-gray-400 truncate italic",children:['"',re.preferredName,'"']}),r.jsx("p",{className:"text-xs text-gray-500 truncate",children:re.email}),r.jsx(Fe,{size:"sm",variant:"ghost",onClick:()=>ie(re.email),className:"mt-1 h-6 px-2 text-xs text-red-400 hover:text-red-300",children:"Remove"})]})]})},re.email)})})]}),Ae.length===0&&r.jsx("p",{className:"text-gray-400 text-center py-8",children:"No members found"})]})]})]})}function qte(){const[t,e]=x.useState(null),[n,a]=x.useState(!1),[i,s]=x.useState(""),[o,c]=x.useState(!1);return x.useEffect(()=>{const d=async()=>{try{const f=await fetch("/api/admin-status");if(f.status>=500||f.status===404){if(sessionStorage.getItem("adminSessionId")){console.log("[AdminApp] Server unavailable but user has session, letting AdminAuthContext handle it"),e(!0);return}console.log("[AdminApp] Server unavailable (no session), showing stand-by screen"),c(!0);return}const p=await f.json();if(!p.enabled){console.log("[AdminApp] Admin API disabled"),a(!0);return}e(!0),s(p.mode||""),c(!1)}catch(f){if(sessionStorage.getItem("adminSessionId")&&t===!0){console.log("[AdminApp] Network error but user has session, letting AdminAuthContext handle it");return}console.log("[AdminApp] Network error, showing stand-by screen:",f),c(!0)}};d();let m=null;return(o||t===null)&&(m=setInterval(d,1e3)),()=>{m&&clearInterval(m)}},[o,t]),n?r.jsx(QT,{}):o?r.jsx(ku,{isConnected:!1,showImmediately:!0}):t===null?r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"Checking admin availability..."})]})}):r.jsx(fK,{children:r.jsxs(pK,{children:[r.jsx(tM,{}),r.jsx(vK,{}),r.jsxs(_k,{children:[r.jsx(tr,{path:"/setup",element:r.jsx(UK,{})}),r.jsx(tr,{path:"/login",element:r.jsx(SK,{})}),r.jsx(tr,{path:"/dashboard",element:r.jsx(OK,{})}),r.jsx(tr,{path:"/management",element:r.jsx(HK,{})}),r.jsx(tr,{path:"/members",element:r.jsx(Wq,{})}),r.jsx(tr,{path:"/tracks",element:r.jsx(Kq,{})}),r.jsx(tr,{path:"/track-lead-view",element:r.jsx(vM,{viewAllTracks:!0})}),r.jsx(tr,{path:"/track-activity",element:r.jsx(qq,{})}),r.jsx(tr,{path:"/admin-service-logs",element:r.jsx(H_,{})}),r.jsx(tr,{path:"/audit-logs",element:r.jsx(H_,{})}),r.jsx(tr,{path:"/email-templates",element:r.jsx(Xq,{})}),r.jsx(tr,{path:"/testing-tools",element:r.jsx(Tte,{})}),r.jsx(tr,{path:"/visitor-stats",element:r.jsx(Mte,{})}),r.jsx(tr,{path:"/member-feedback",element:r.jsx(Rte,{})}),r.jsx(tr,{path:"/security",element:r.jsx(Dte,{})}),r.jsx(tr,{path:"/storage",element:r.jsx(jte,{})}),r.jsx(tr,{path:"/migration",element:r.jsx(Kte,{})}),r.jsx(tr,{path:"/image-matcher",element:r.jsx(Yte,{})}),r.jsx(tr,{path:"/",element:r.jsx(uc,{to:"/admin/login",replace:!0})})]})]})})}function Jte(){return r.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",children:[r.jsx(Z1,{className:"absolute inset-0",requireFocus:!1}),r.jsxs("div",{className:"relative text-center p-8 max-w-md text-white select-none pointer-events-none",children:[r.jsx("img",{src:"/images/xrguild-white-transparent.svg",alt:"",className:"w-48 h-48 mx-auto mb-4 object-contain pointer-events-none",style:{mixBlendMode:"plus-lighter"}}),r.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-4 border-white border-t-transparent mx-auto mb-6"}),r.jsx("h2",{className:"text-3xl font-bold mb-3",children:"Please Stand By"}),r.jsx("p",{className:"text-white/80 mb-2",children:"We're experiencing a brief interruption..."}),r.jsx("p",{className:"text-sm text-white/60 mb-6",children:"This page will refresh automatically when the server is ready."}),r.jsxs(Fe,{variant:"outline",className:"border-white/30 text-white hover:bg-white/10 pointer-events-auto",onClick:()=>window.location.reload(),children:[r.jsx(Rr,{className:"w-4 h-4 mr-2"}),"Refresh Now"]})]})]})}const qa=[{id:"products",label:"Products",yOffset:-80,color:"#22c55e"},{id:"research",label:"Research",yOffset:-40,color:"#3b82f6"},{id:"concepts",label:"Concepts",yOffset:0,color:"#8b5cf6"}
vendor: 4,801 bytes, line 4449
4449,{id:"infrastructure",label:"Infrastructure",yOffset:40,color:"#f59e0b"},{id:"events",label:"Events",yOffset:60,color:"#ef4444"},{id:"fiction",label:"Fiction",yOffset:80,color:"#06b6d4"}];function sS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nu=sS();function j4(t){Nu=t}var Em={exec:()=>null};function dr(t,e=""){let n=typeof t=="string"?t:t.source,a={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(li.caret,"$1"),n=n.replace(i,o),a},getRegex:()=>new RegExp(n,e)};return a}var Xte=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),li={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Zte=/^(?:[ \t]*(?:\n|$))+/,Qte=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ene=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ff=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tne=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oS=/(?:[*+-]|\d{1,9}[.)])/,L4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,I4=dr(L4).replace(/bull/g,oS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nne=dr(L4).replace(/bull/g,oS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rne=/^[^\n]+/,cS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ane=dr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cS).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ine=dr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oS).getRegex(),Ox="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",uS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sne=dr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>
4449)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",uS).replace("tag",Ox).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B4=dr(lS).replace("hr",ff).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ox).getRegex(),one=dr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B4).getRegex(),dS={blockquote:one,code:Qte,def:ane,fences:ene,heading:tne,hr:ff,html:sne,lheading:I4,list:ine,newline:Zte,paragraph:B4,table:Em,text:rne},aE=dr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ff).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ox).getRegex(),lne={...dS,lheading:nne,table:aE,paragraph:dr(lS).replace("hr",ff).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",aE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ox).getRegex()},cne={...dS,html:dr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",uS).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Em,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dr(lS).replace("hr",ff).replace("heading",` *#{1,6} *[^
4450]`).replace("lheading",I4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},une=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dne=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,O4=/^( {2,}|\\)\n(?!\s*$)/,hne=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ux=/[\p{P}\p{S}]/u,hS=/[\s\p{P}\p{S}]/u,U4=/[^\s\p{P}\p{S}]/u,mne=dr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hS).getRegex(),z4=/(?!~)[\p{P}\p{S}]/u,fne=/(?!~)[\s\p{P}\p{S}]/u,pne=/(?:[^\s\p{P}\p{S}]|~)/u,gne=dr(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xte?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),G4=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,xne=dr(G4,"u").replace(/punct/g,Ux).getRegex(),vne=dr(G4,"u").replace(/punct/g,z4).getRegex(),H4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yne=dr(H4,"gu").replace(/notPunctSpace/g,U4).replace(/punctSpace/g,hS).replace(/punct/g,Ux).getRegex(),bne=dr(H4,"gu").replace(/notPunctSpace/g,pne).replace(/punctSpace/g,fne).replace(/punct/g,z4).getRegex(),wne=dr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,U4).replace(/punctSpace/g,hS).replace(/punct/g,Ux).getRegex(),Sne=dr(/\\(punct)/,"gu").replace(/punct/g,Ux).getRegex(),Fne=dr(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cne=dr(uS).replace("(?:-->|$)","-->").getRegex(),_ne=dr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hg=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ene=dr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hg).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),W4=dr(/^!?\[(label)\]\[(ref)\]/).replace("label",Hg).replace("ref",cS).getRegex(),V4=dr(/^!?\[(ref)\](?:\[\])?/).replace("ref",cS).getRegex(),kne=dr("reflink|nolink(?!\\()","g").replace("reflink",W4).replace("nolink",V4).getRegex(),iE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mS={_backpedal:Em,anyPunctuation:Sne,autolink:Fne,blockSkip:gne,br:O4,code:dne,del:Em,emStrongLDelim:xne,emStrongRDelimAst:yne,emStrongRDelimUnd:wne,escape:une,link:Ene,nolink:V4,punctuation:mne,reflink:W4,reflinkSearch:kne,tag:_ne,text:hne,url:Em},Ane={...mS,link:dr(/^!?\[(label)\]\((.*?)\)/).replace("label",Hg).getRegex(),reflink:dr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hg).getRegex()},u1={...mS,emStrongRDelimAst:bne,emStrongLDelim:vne,url:dr(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",iE).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:dr(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",iE).getRegex()},Nne={...u1,br:dr(O4).replace("{2,}","*").getRegex(),text:dr(u1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tg={normal:dS,gfm:lne,pedantic:cne},cm={normal:mS,gfm:u1,breaks:Nne,pedantic:Ane},Tne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sE=t=>Tne[t];function hl(t,e){if(e){if(li.escapeTest.test(t))return t.replace(li.escapeReplace,sE)}else if(li.escapeTestNoEncode.test(t))return t.replace(li.escapeReplaceNoEncode,sE);return t}function oE(t){try{t=encodeURI(t).replace(li.percentDecode,"%")}catch{return null}return t}function lE(t,e){let n=t.replace(li.findPipe,(s,o,c)=>{let d=!1,m=o;for(;--m>=0&&c[m]==="\\";)d=!d;return d?"|":" |"}),a=n.split(li.splitPipe),i=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;i<a.length;i++)a[i]=a[i].trim().replace(li.slashPipe,"|");return a}function um(t,e,n){let a=t.length;if(a===0)return"";let i=0;for(;i<a&&t.charAt(a-i-1)===e;)i++;return t.slice(0,a-i)}function Mne(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===e[0])n++;else if(t[a]===e[1]&&(n--,n<0))return a;return n>0?-2:-1}function cE(t,e,n,a,i){let s=e.href,o=e.title||null,c=t[1].replace(i.other.outputLinkReplace,"$1");a.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,d}function Rne(t,e,n){let a=t.match(n.other.indentCodeCompensation);if(a===null)return e;let i=a[1];return e.split(`
4451`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[c]=o;return c.length>=i.length?s.slice(i.length):s}
vendor: 22,743 bytes, lines 4451-4506
4451).join(`
4452`)}var Wg=class{options;rules;lexer;constructor(t){this.options=t||Nu}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:um(n,`
4453`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],a=Rne(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let a=um(n,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(n=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:um(e[0],`
4454`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=um(e[0],`
4455`).split(`
4456`),a="",i="",s=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let m=c.join(`
4457`),f=m.replace(this.rules.other.blockquoteSetextReplace,`
4458    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
4459${m}`:m,i=i?`${i}
4460${f}`:f;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,s,!0),this.lexer.state.top=p,n.length===0)break;let b=s.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let v=b,C=v.raw+`
4461`+n.join(`
4462`),S=this.blockquote(C);s[s.length-1]=S,a=a.substring(0,a.length-v.raw.length)+S.raw,i=i.substring(0,i.length-v.text.length)+S.text;break}else if(b?.type==="list"){let v=b,C=v.raw+`
4463`+n.join(`
4464`),S=this.list(C);s[s.length-1]=S,a=a.substring(0,a.length-b.raw.length)+S.raw,i=i.substring(0,i.length-v.raw.length)+S.raw,n=C.substring(s.at(-1).raw.length).split(`
4465`);continue}}return{type:"blockquote",raw:a,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),a=n.length>1,i={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let d=!1,m="",f="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;m=e[0],t=t.substring(m.length);let p=e[2].split(`
4466`,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),b=t.split(`
4467`,1)[0],v=!p.trim(),C=0;if(this.options.pedantic?(C=2,f=p.trimStart()):v?C=e[1].length+1:(C=e[2].search(this.rules.other.nonSpaceChar),C=C>4?1:C,f=p.slice(C),C+=e[1].length),v&&this.rules.other.blankLine.test(b)&&(m+=b+`
4468`,t=t.substring(b.length+1),d=!0),!d){let S=this.rules.other.nextBulletRegex(C),F=this.rules.other.hrRegex(C),w=this.rules.other.fencesBeginRegex(C),A=this.rules.other.headingBeginRegex(C),N=this.rules.other.htmlBeginRegex(C);for(;t;){let P=t.split(`
4469`,1)[0],z;if(b=P,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting,"  "),z=b):z=b.replace(this.rules.other.tabCharGlobal,"    "),w.test(b)||A.test(b)||N.test(b)||S.test(b)||F.test(b))break;if(z.search(this.rules.other.nonSpaceChar)>=C||!b.trim())f+=`
4470`+z.slice(C);else{if(v||p.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||w.test(p)||A.test(p)||F.test(p))break;f+=`
4471`+b}!v&&!b.trim()&&(v=!0),m+=P+`
4472`,t=t.substring(P.length+1),p=z.slice(C)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(o=!0)),i.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),i.raw+=m}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(d.raw);if(m){let f={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};d.checked=f.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=f.raw+d.tokens[0].raw,d.tokens[0].text=f.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(f)):d.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):d.tokens.unshift(f)}}if(!i.loose){let m=d.tokens.filter(p=>p.type==="space"),f=m.length>0&&m.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=f}}if(i.loose)for(let d of i.items){d.loose=!0;for(let m of d.tokens)m.type==="text"&&(m.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:a,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=lE(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
4473`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===a.length){for(let o of a)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of i)s.rows.push(lE(o,s.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[d]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
4474`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=um(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Mne(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let a=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?a=a.slice(1):a=a.slice(1,-1)),cE(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let a=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[a.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return cE(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...a[0]].length-1,s,o,c=i,d=0,m=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,e=e.slice(-1*t.length+i);(a=m.exec(e))!=null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(o=[...s].length,a[3]||a[4]){c+=o;continue}else if((a[5]||a[6])&&i%3&&!((i+o)%3)){d+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+d);let f=[...a[0]][0].length,p=t.slice(0,i+a.index+f+o);if(Math.min(i,o)%2){let v=p.slice(1,-1);return{type:"em",raw:p,text:v,tokens:this.lexer.inlineTokens(v)}}let b=p.slice(2,-2);return{type:"strong",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return a&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,a;return e[2]==="@"?(n=e[1],a="mailto:"+n):(n=e[1],a=n),{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,a;if(e[2]==="@")n=e[0],a="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:n,href:a,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Ls=class d1{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Nu,this.options.tokenizer=this.options.tokenizer||new Wg,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:li,block:tg.normal,inline:cm.normal};this.options.pedantic?(n.block=tg.pedantic,n.inline=cm.pedantic):this.options.gfm&&(n.block=tg.gfm,this.options.breaks?n.inline=cm.breaks:n.inline=cm.gfm),this.tokenizer.rules=n}static get rules(){return{block:tg,inline:cm}}static lex(e,n){return new d1(n).lex(e)}static lexInline(e,n){return new d1(n).inlineTokens(e)}lex(e){e=e.replace(li.carriageReturn,`
4475`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let a=this.inlineQueue[n];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],a=!1){for(this.options.pedantic&&(e=e.replace(li.tabCharGlobal,"    ").replace(li.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=n.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
4476`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
4477`)?"":`
4478`)+i.raw,o.text+=`
4479`+i.text,this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
4480`)?"":`
4481`)+i.raw,o.text+=`
4482`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,c=e.slice(1),d;this.options.extensions.startBlock.forEach(m=>{d=m.call({lexer:this},c),typeof d=="number"&&d>=0&&(o=Math.min(o,d))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let o=n.at(-1);a&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
4483`)?"":`
4484`)+i.raw,o.text+=`
4485`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i),a=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
4486`)?"":`
4487`)+i.raw,o.text+=`
4488`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let a=e,i=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)d.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)s=i[2]?i[2].length:0,a=a.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let o=!1,c="";for(;e;){o||(c=""),o=!1;let d;if(this.options.extensions?.inline?.some(f=>(d=f.call({lexer:this},e,n))?(e=e.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let f=n.at(-1);d.type==="text"&&f?.type==="text"?(f.raw+=d.raw,f.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(e,a,c)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(e)){e=e.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),n.push(d);continue}let m=e;if(this.options.extensions?.startInline){let f=1/0,p=e.slice(1),b;this.options.extensions.startInline.forEach(v=>{b=v.call({lexer:this},p),typeof b=="number"&&b>=0&&(f=Math.min(f,b))}),f<1/0&&f>=0&&(m=e.substring(0,f+1))}if(d=this.tokenizer.inlineText(m)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(c=d.raw.slice(-1)),o=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=d.raw,f.text+=d.text):n.push(d);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}},Vg=class{options;parser;constructor(t){this.options=t||Nu}space(t){return""}code({text:t,lang:e,escaped:n}){let a=(e||"").match(li.notSpaceStart)?.[0],i=t.replace(li.endingNewline,"")+`
4489`;return a?'<pre><code class="language-'+hl(a)+'">'+(n?i:hl(i,!0))+`</code></pre>
4490`:"<pre><code>"+(n?i:hl(i,!0))+`</code></pre>
4491`}blockquote({tokens:t}){return`<blockquote>
4492${this.parser.parse(t)}</blockquote>
4493`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
4494`}hr(t){return`<hr>
4495`}list(t){let e=t.ordered,n=t.start,a="";for(let o=0;o<t.items.length;o++){let c=t.items[o];a+=this.listitem(c)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
4496`+a+"</"+i+`>
4497`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
4498`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
4499`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let a="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);a+=this.tablerow({text:n})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
4500<thead>
4501`+e+`</thead>
4502`+a+`</table>
4503`}tablerow({text:t}){return`<tr>
4504${t}</tr>
4505`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
4506`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${hl(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let a=this.parser.parseInline(n),i=oE(t);if(i===null)return a;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+hl(e)+'"'),s+=">"+a+"</a>",s}image({href:t,title:e,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let i=oE(t);if(i===null)return hl(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${hl(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:hl(t.text)}},fS=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Is=class h1{options;renderer;textRenderer;constructor(e){this.options=e||Nu,this.options.renderer=this.options.renderer||new Vg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fS}static parse(e,n){return new h1(n).parse(e)}static parseInline(e,n){return new h1(n).parseInline(e)}parse(e){let n="";for(let a=0;a<e.length;a++){let i=e[a];if(this.options.extensions?.renderers?.[i.type]){let o=i,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=c||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){let a="";for(let i=0;i<e.length;i++){let s=e[i];if(this.options.extensions?.renderers?.[s.type]){let c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){a+=c||"";continue}}let o=s;switch(o.type){case"escape":{a+=n.text(o);break}case"html":{a+=n.html(o);break}case"link":{a+=n.link(o);break}case"image":{a+=n.image(o);break}case"checkbox":{a+=n.checkbox(o);break}case"strong":{a+=n.strong(o);break}case"em":{a+=n.em(o);break}case"codespan":{a+=n.codespan(o);break}case"br":{a+=n.br(o);break}case"del":{a+=n.del(o);break}case"text":{a+=n.text(o);break}default:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},bm=class{options;block;constructor(t){this.options=t||Nu}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Ls.lex:Ls.lexInline}provideParser(){return this.block?Is.parse:Is.parseInline}},Dne=class{defaults=sS();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Is;Renderer=Vg;TextRenderer=fS;Lexer=Ls;Tokenizer=Wg;Hooks=bm;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let a of t)switch(n=n.concat(e.call(this,a)),a.type){case"table":{let i=a;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of i.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=a;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=a;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let o=i[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(i=>
vendor: 6,683 bytes, lines 4506-4507
4506{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=s.apply(this,o)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),a.extensions=e),n.renderer){let i=this.defaults.renderer||new Vg(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,c=n.renderer[o],d=i[o];i[o]=(...m)=>{let f=c.apply(i,m);return f===!1&&(f=d.apply(i,m)),f||""}}a.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Wg(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,c=n.tokenizer[o],d=i[o];i[o]=(...m)=>{let f=c.apply(i,m);return f===!1&&(f=d.apply(i,m)),f}}a.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new bm;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,c=n.hooks[o],d=i[o];bm.passThroughHooks.has(s)?i[o]=m=>{if(this.defaults.async&&bm.passThroughHooksRespectAsync.has(s))return(async()=>{let p=await c.call(i,m);return d.call(i,p)})();let f=c.call(i,m);return d.call(i,f)}:i[o]=(...m)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(i,m);return p===!1&&(p=await d.apply(i,m)),p})();let f=c.apply(i,m);return f===!1&&(f=d.apply(i,m)),f}}a.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(o){let c=[];return c.push(s.call(this,o)),i&&(c=c.concat(i.call(this,o))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Ls.lex(t,e??this.defaults)}parser(t,e){return Is.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let a={...n},i={...this.defaults,...a},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,c=await(i.hooks?await i.hooks.provideLexer():t?Ls.lex:Ls.lexInline)(o,i),d=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let m=await(i.hooks?await i.hooks.provideParser():t?Is.parse:Is.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(m):m})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer():t?Ls.lex:Ls.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser():t?Is.parse:Is.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return s(o)}}}onError(t,e){return n=>{if(n.message+=`
4507Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+hl(n.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(n);throw n}}},Cu=new Dne;function pr(t,e){return Cu.parse(t,e)}pr.options=pr.setOptions=function(t){return Cu.setOptions(t),pr.defaults=Cu.defaults,j4(pr.defaults),pr};pr.getDefaults=sS;pr.defaults=Nu;pr.use=function(...t){return Cu.use(...t),pr.defaults=Cu.defaults,j4(pr.defaults),pr};pr.walkTokens=function(t,e){return Cu.walkTokens(t,e)};pr.parseInline=Cu.parseInline;pr.Parser=Is;pr.parser=Is.parse;pr.Renderer=Vg;pr.TextRenderer=fS;pr.Lexer=Ls;pr.lexer=Ls.lex;pr.Tokenizer=Wg;pr.Hooks=bm;pr.parse=pr;pr.options;pr.setOptions;pr.use;pr.walkTokens;pr.parseInline;Is.parse;Ls.lex;const{entries:$4,setPrototypeOf:uE,isFrozen:Pne,getPrototypeOf:jne,getOwnPropertyDescriptor:Lne}=Object;let{freeze:ci,seal:hs,create:_d}=Object,{apply:m1,construct:f1}=typeof Reflect<"u"&&Reflect;ci||(ci=function(e){return e});hs||(hs=function(e){return e});m1||(m1=function(e,n){for(var a=arguments.length,i=new Array(a>2?a-2:0),s=2;s<a;s++)i[s-2]=arguments[s];return e.apply(n,i)});f1||(f1=function(e){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return new e(...a)});const dm=aa(Array.prototype.forEach),Ine=aa(Array.prototype.lastIndexOf),dE=aa(Array.prototype.pop),hm=aa(Array.prototype.push),Bne=aa(Array.prototype.splice),ai=Array.isArray,wm=aa(String.prototype.toLowerCase),wy=aa(String.prototype.toString),hE=aa(String.prototype.match),Fd=aa(String.prototype.replace),mE=aa(String.prototype.indexOf),One=aa(String.prototype.trim),Une=aa(Number.prototype.toString),zne=aa(Boolean.prototype.toString),fE=typeof BigInt>"u"?null:aa(BigInt.prototype.toString),pE=typeof Symbol>"u"?null:aa(Symbol.prototype.toString),zr=aa(Object.prototype.hasOwnProperty),mm=aa(Object.prototype.toString),Ta=aa(RegExp.prototype.test),ng=Gne(TypeError);function aa(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return m1(t,e,a)}}function Gne(t){return function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return f1(t,n)}}function Xn(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wm;if(uE&&uE(t,null),!ai(e))return t;let a=e.length;for(;a--;){let i=e[a];if(typeof i=="string"){const s=n(i);s!==i&&(Pne(e)||(e[a]=s),i=s)}t[i]=!0}return t}function Hne(t){for(let e=0;e<t.length;e++)zr(t,e)||(t[e]=null);return t}function wi(t){const e=_d(null);for(const[n,a]of $4(t))zr(t,n)&&(ai(a)?e[n]=Hne(a):a&&typeof a=="object"&&a.constructor===Object?e[n]=wi(a):e[n]=a);return e}function Wne(t){switch(typeof t){case"string":return t;case"number":return Une(t);case"boolean":return zne(t);case"bigint":return fE?fE(t):"0";case"symbol":return pE?pE(t):"Symbol()";case"undefined":return mm(t);case"function":case"object":{if(t===null)return mm(t);const e=t,n=Ed(e,"toString");if(typeof n=="function"){const a=n(e);
vendor: 6,679 bytes, line 4507
4507return typeof a=="string"?a:mm(a)}return mm(t)}default:return mm(t)}}function Ed(t,e){for(;t!==null;){const a=Lne(t,e);if(a){if(a.get)return aa(a.get);if(typeof a.value=="function")return aa(a.value)}t=jne(t)}function n(){return null}return n}function Vne(t){try{return Ta(t,""),!0}catch{return!1}}const gE=ci(["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"]),Sy=ci(["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"]),Fy=ci(["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"]),$ne=ci(["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"]),Cy=ci(["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"]),Kne=ci(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xE=ci(["#text"]),vE=ci(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),_y=ci(["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"]),yE=ci(["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","
4507subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rg=ci(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yne=hs(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qne=hs(/<%[\w\W]*|[\w\W]*%>/gm),Jne=hs(/\$\{[\w\W]*/gm),Xne=hs(/^data-[\-\w.\u00B7-\uFFFF]+$/),Zne=hs(/^aria-[\-\w]+$/),K4=hs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qne=hs(/^(?:\w+script|data):/i),ere=hs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y4=hs(/^html$/i),tre=hs(/^[a-z][.\w]*(-[.\w]+)+$/i);var bE=Object.freeze({__proto__:null,ARIA_ATTR:Zne,ATTR_WHITESPACE:ere,CUSTOM_ELEMENT:tre,DATA_ATTR:Xne,DOCTYPE_NAME:Y4,ERB_EXPR:qne,IS_ALLOWED_URI:K4,IS_SCRIPT_OR_DATA:Qne,MUSTACHE_EXPR:Yne,TMPLIT_EXPR:Jne});const fm={element:1,text:3,progressingInstruction:7,comment:8,document:9},nre=function(){return typeof window>"u"?null:window},rre=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let a=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(a=n.getAttribute(i));const s="dompurify"+(a?"#"+a:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},wE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function q4(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nre();const e=tt=>q4(tt);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==fm.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const a=n,i=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:c,Element:d,NodeFilter:m,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:b,trustedTypes:v}=t,C=d.prototype,S=Ed(C,"cloneNode"),F=Ed(C,"remove"),w=Ed(C,"nextSibling"),A=Ed(C,"childNodes"),N=Ed(C,"parentNode");if(typeof o=="function"){const tt=n.createElement("template");tt.content&&tt.content.ownerDocument&&(n=tt.content.ownerDocument)}let P,z="";const{implementation:D,createNodeIterator:T,createDocumentFragment:K,getElementsByTagName:B}=n,{importNode:k}=a;let O=wE();e.isSupported=typeof $4=="function"&&typeof N=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:I,ERB_EXPR:j,TMPLIT_EXPR:U,DATA_ATTR:q,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:H,CUSTOM_ELEMENT:J}=bE;let{IS_ALLOWED_URI:ie}=bE,Q=null;const ve=Xn({},[...gE,...Sy,...Fy,...Cy,...xE]);let pe=null;const Me=Xn({},[...vE,..._y,...yE,...rg]);let We=Object.seal(_d(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}})),Ae=null,Ce=null;const He=Object.seal(_d(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ct=!0,bt=!0,Rt=!1,zt=!0,Ut=!1,Bt=!0,re=!1,wt=!1,Nt=!1,vt=!1,Tt=!1,Wt=!1,Dt=!0,jt=!1;const he="user-content-";let ee=!0,ze=!1,Ve={},lt=null;const qe=Xn({},["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 It=null;const gt=Xn({},["audio","video","img","source","image","track"]);let Ee=null;const Je=Xn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml";let ke=X,De=!1,oe=null;const te=Xn({},[$e,Xe,X],wy);let ye=Xn({},["mi","mo","mn","ms","mtext"]),Re=Xn({},["annotation-xml"]);const Le=Xn({},["title","style","font","a","script"]);let fe=null;const Se=["application/xhtml+xml","text/html"],Be="text/html";let Ze=null,ue=null;const rt=n.createElement("form"),je=function(ge){return ge instanceof RegExp||ge instanceof Function},_t=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ue&&ue===ge)return;(!ge||typeof ge!="object")&&(ge={}
vendor: 8,321 bytes, line 4507
4507),ge=wi(ge),fe=Se.indexOf(ge.PARSER_MEDIA_TYPE)===-1?Be:ge.PARSER_MEDIA_TYPE,Ze=fe==="application/xhtml+xml"?wy:wm,Q=zr(ge,"ALLOWED_TAGS")&&ai(ge.ALLOWED_TAGS)?Xn({},ge.ALLOWED_TAGS,Ze):ve,pe=zr(ge,"ALLOWED_ATTR")&&ai(ge.ALLOWED_ATTR)?Xn({},ge.ALLOWED_ATTR,Ze):Me,oe=zr(ge,"ALLOWED_NAMESPACES")&&ai(ge.ALLOWED_NAMESPACES)?Xn({},ge.ALLOWED_NAMESPACES,wy):te,Ee=zr(ge,"ADD_URI_SAFE_ATTR")&&ai(ge.ADD_URI_SAFE_ATTR)?Xn(wi(Je),ge.ADD_URI_SAFE_ATTR,Ze):Je,It=zr(ge,"ADD_DATA_URI_TAGS")&&ai(ge.ADD_DATA_URI_TAGS)?Xn(wi(gt),ge.ADD_DATA_URI_TAGS,Ze):gt,lt=zr(ge,"FORBID_CONTENTS")&&ai(ge.FORBID_CONTENTS)?Xn({},ge.FORBID_CONTENTS,Ze):qe,Ae=zr(ge,"FORBID_TAGS")&&ai(ge.FORBID_TAGS)?Xn({},ge.FORBID_TAGS,Ze):wi({}),Ce=zr(ge,"FORBID_ATTR")&&ai(ge.FORBID_ATTR)?Xn({},ge.FORBID_ATTR,Ze):wi({}),Ve=zr(ge,"USE_PROFILES")?ge.USE_PROFILES&&typeof ge.USE_PROFILES=="object"?wi(ge.USE_PROFILES):ge.USE_PROFILES:!1,Ct=ge.ALLOW_ARIA_ATTR!==!1,bt=ge.ALLOW_DATA_ATTR!==!1,Rt=ge.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=ge.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ut=ge.SAFE_FOR_TEMPLATES||!1,Bt=ge.SAFE_FOR_XML!==!1,re=ge.WHOLE_DOCUMENT||!1,vt=ge.RETURN_DOM||!1,Tt=ge.RETURN_DOM_FRAGMENT||!1,Wt=ge.RETURN_TRUSTED_TYPE||!1,Nt=ge.FORCE_BODY||!1,Dt=ge.SANITIZE_DOM!==!1,jt=ge.SANITIZE_NAMED_PROPS||!1,ee=ge.KEEP_CONTENT!==!1,ze=ge.IN_PLACE||!1,ie=Vne(ge.ALLOWED_URI_REGEXP)?ge.ALLOWED_URI_REGEXP:K4,ke=typeof ge.NAMESPACE=="string"?ge.NAMESPACE:X,ye=zr(ge,"MATHML_TEXT_INTEGRATION_POINTS")&&ge.MATHML_TEXT_INTEGRATION_POINTS&&typeof ge.MATHML_TEXT_INTEGRATION_POINTS=="object"?wi(ge.MATHML_TEXT_INTEGRATION_POINTS):Xn({},["mi","mo","mn","ms","mtext"]),Re=zr(ge,"HTML_INTEGRATION_POINTS")&&ge.HTML_INTEGRATION_POINTS&&typeof ge.HTML_INTEGRATION_POINTS=="object"?wi(ge.HTML_INTEGRATION_POINTS):Xn({},["annotation-xml"]);const $=zr(ge,"CUSTOM_ELEMENT_HANDLING")&&ge.CUSTOM_ELEMENT_HANDLING&&typeof ge.CUSTOM_ELEMENT_HANDLING=="object"?wi(ge.CUSTOM_ELEMENT_HANDLING):_d(null);if(We=_d(null),zr($,"tagNameCheck")&&je($.tagNameCheck)&&(We.tagNameCheck=$.tagNameCheck),zr($,"attributeNameCheck")&&je($.attributeNameCheck)&&(We.attributeNameCheck=$.attributeNameCheck),zr($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),Ut&&(bt=!1),Tt&&(vt=!0),Ve&&(Q=Xn({},xE),pe=_d(null),Ve.html===!0&&(Xn(Q,gE),Xn(pe,vE)),Ve.svg===!0&&(Xn(Q,Sy),Xn(pe,_y),Xn(pe,rg)),Ve.svgFilters===!0&&(Xn(Q,Fy),Xn(pe,_y),Xn(pe,rg)),Ve.mathMl===!0&&(Xn(Q,Cy),Xn(pe,yE),Xn(pe,rg))),He.tagCheck=null,He.attributeCheck=null,zr(ge,"ADD_TAGS")&&(typeof ge.ADD_TAGS=="function"?He.tagCheck=ge.ADD_TAGS:ai(ge.ADD_TAGS)&&(Q===ve&&(Q=wi(Q)),Xn(Q,ge.ADD_TAGS,Ze))),zr(ge,"ADD_ATTR")&&(typeof ge.ADD_ATTR=="function"?He.attributeCheck=ge.ADD_ATTR:ai(ge.ADD_ATTR)&&(pe===Me&&(pe=wi(pe)),Xn(pe,ge.ADD_ATTR,Ze))),zr(ge,"ADD_URI_SAFE_ATTR")&&ai(ge.ADD_URI_SAFE_ATTR)&&Xn(Ee,ge.ADD_URI_SAFE_ATTR,Ze),zr(ge,"FORBID_CONTENTS")&&ai(ge.FORBID_CONTENTS)&&(lt===qe&&(lt=wi(lt)),Xn(lt,ge.FORBID_CONTENTS,Ze)),zr(ge,"ADD_FORBID_CONTENTS")&&ai(ge.ADD_FORBID_CONTENTS)&&(lt===qe&&(lt=wi(lt)),Xn(lt,ge.ADD_FORBID_CONTENTS,Ze)),ee&&(Q["#text"]=!0),re&&Xn(Q,["html","head","body"]),Q.table&&(Xn(Q,["tbody"]),delete Ae.tbody),ge.TRUSTED_TYPES_POLICY){if(typeof ge.TRUSTED_TYPES_POLICY.createHTML!="function")throw ng('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ge.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ng('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');P=ge.TRUSTED_TYPES_POLICY,z=P.createHTML("")}else P===void 0&&(P=rre(v,i)),P!==null&&typeof z=="string"&&(z=P.createHTML(""));ci&&ci(ge),ue=ge},Kt=Xn({},[...Sy,...Fy,...$ne]),gn=Xn({},[...Cy,...Kne]),_e=function(ge){let $=N(ge);(!$||!$.tagName)&&($={namespaceURI:ke,tagName:"template"});const xe=wm(ge.tagName),ne=wm($.tagName);return oe[ge.namespaceURI]?ge.namespaceURI===Xe?$.namespaceURI===X?xe==="svg":$.namespaceURI===$e?xe==="svg"&&(ne==="annotation-xml"||ye[ne]):!!Kt[xe]:ge.namespaceURI===$e?$.namespaceURI===X?xe==="math":$.namespaceURI===Xe?xe==="math"&&Re[ne]:!!gn[xe]:ge.namespaceURI===X?$.namespaceURI===Xe&&!Re[ne]||$.namespaceURI===$e&&!ye[ne]?!1:!gn[xe]&&(Le[xe]||!Kt[xe]):!!(fe==="application/xhtml+xml"&&oe[ge.namespaceURI]):!1},et=function(ge){hm(e.removed,{element:ge});try{N(ge).removeChild(ge)}catch{F(ge)}},Ge=function(ge,$){try{hm(e.removed,{attribute:$.getAttributeNode(ge),from:$})}catch{hm(e.removed,{attribute:null,from:$})}if($.removeAttribute(ge),ge==="is")if(vt||Tt)try{et($)}catch{}else try{$.setAttribute(ge,"")}catch{}},ht=function(ge){let $=null,xe=null;if(Nt)ge="<remove></remove>"+ge;else{const de=hE(ge,/^[\r\n\t ]+/);xe=de&&de[0]}fe==="application/xhtml+xml"&&ke===X&&(ge='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ge+"</body></html>");const ne=P?P.createHTML(ge):ge;if(ke===X)try{$=new b().parseFromString(ne,fe)}catch{}if(!$||!$.documentElement){$=D.createDocument(ke,"template",null);try{$.documentElement.innerHTML=De?z:ne}catch{}}const me=$.body||$.documentElement;return ge&&xe&&me.insertBefore(n.createTextNode(xe),me.childNodes[0]||null),ke===X?B.call($,re?"html":"body")[0]:re?$.documentElement:me},ft=function(ge){return T.call(ge.ownerDocument||ge,ge,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Mt=function(ge){return ge instanceof p&&(typeof ge.nodeName!="string"||typeof ge.textContent!="string"||typeof ge.removeChild!="function"||!(ge.attributes instanceof f)||typeof ge.removeAttribute!="function"||typeof ge.setAttribute!="function"||typeof ge.namespaceURI!="string"||typeof ge.insertBefore!="function"||typeof ge.hasChildNodes!="function")},be=function(ge){return typeof c=="function"&&ge instanceof c};function Z(tt,ge,$){dm(tt,xe=>{xe.call(e,ge,$,ue)})}const it=function(ge){let $=null;if(Z(O.beforeSanitizeElements,ge,null),Mt(ge))return et(ge),!0;const xe=Ze(ge.nodeName);if(Z(O.uponSanitizeElement,ge,{tagName:xe,allowedTags:Q}),Bt&&ge.hasChildNodes()&&!be(ge.firstElementChild)&&Ta(/<[/\w!]/g,ge.innerHTML)&&Ta(/<[/\w!]/g,ge.textContent)||Bt&&ge.namespaceURI===X&&xe==="style"&&be(ge.firstElementChild)||ge.nodeType===fm.progressingInstruction||Bt&&ge.nodeType===fm.comment&&Ta(/<[/\w]/g,ge.data))return et(ge),!0;if(Ae[xe]||!(He.tagCheck instanceof Function&&He.tagCheck(xe))&&!Q[xe]){if(!Ae[xe]&&Lt(xe)&&(We.tagNameCheck instanceof RegExp&&Ta(We.tagNameCheck,xe)||We.tagNameCheck instanceof Function&&We.tagNameCheck(xe)))return!1;if(ee&&!lt[xe]){const ne=N(ge)||ge.parentNode,me=A(ge)||ge.childNodes;if(me&&ne){const de=me.length;for(let Ie=de-1;Ie>=0;--Ie){const Ke=S(me[Ie],!0);ne.insertBefore(Ke,w(ge))}}}return et(ge),!0}return ge instanceof d&&!_e(ge)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ta(/<\/no(script|embed|frames)/i,ge.innerHTML)?(et(ge),!0):(Ut&&ge.nodeType===fm.text&&($=ge.textContent,dm([I,j,U],ne=>{$=Fd($,ne," ")}),ge.textContent!==$&&(hm(e.removed,{element:ge.cloneNode()}),ge.textContent=$)),Z(O.afterSanitizeElements,ge,null),!1)},we=function(ge,$,xe){if(Ce[$]||Dt&&($==="id"||$==="name")&&(xe in n||xe in rt))return!1;const ne=pe[$]||He.attributeCheck instanceof Function&&He.attributeCheck($,ge);if(!(bt&&!Ce[$]&&Ta(q,$))){if(!(Ct&&Ta(Y,$))){if(!ne||Ce[$]){if(!(Lt(ge)&&(We.tagNameCheck instanceof RegExp&&Ta(We.tagNameCheck,ge)||We.tagNameCheck instanceof Function&&We.tagNameCheck(ge))&&(We.attributeNameCheck instanceof RegExp&&Ta(We.attributeNameCheck,$)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck($,ge))||$==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&Ta(We.tagNameCheck,xe)||We.tagNameCheck instanceof Function&&We.tagNameCheck(xe))))return!1}else if(!Ee[$]){if(!Ta(ie,Fd(xe,H,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&ge!=="script"&&mE(xe,"data:")===0&&It[ge])){if(!(Rt&&!Ta(W,Fd(xe,H,"")))){if(xe)return!1}}}}}}return!0},st=Xn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Lt=function(ge){return!st[wm(ge)]&&Ta(J,ge)},Ot=function(ge){Z(O.beforeSanitizeAttributes,ge,null);const{attributes:$}=ge;if(!$||Mt(ge))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0};let ne=$.length;for(;
4507ne--;){const me=$[ne],{name:de,namespaceURI:Ie,value:Ke}=me,ut=Ze(de),ae=Ke;let Te=de==="value"?ae:One(ae);if(xe.attrName=ut,xe.attrValue=Te,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Z(O.uponSanitizeAttribute,ge,xe),Te=xe.attrValue,jt&&(ut==="id"||ut==="name")&&mE(Te,he)!==0&&(Ge(de,ge),Te=he+Te),Bt&&Ta(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Te)){Ge(de,ge);continue}if(ut==="attributename"&&hE(Te,"href")){Ge(de,ge);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Ge(de,ge);continue}if(!zt&&Ta(/\/>/i,Te)){Ge(de,ge);continue}Ut&&dm([I,j,U],ot=>{Te=Fd(Te,ot," ")});const Qe=Ze(ge.nodeName);if(!we(Qe,ut,Te)){Ge(de,ge);continue}if(P&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ie)switch(v.getAttributeType(Qe,ut)){case"TrustedHTML":{Te=P.createHTML(Te);break}case"TrustedScriptURL":{Te=P.createScriptURL(Te);break}}if(Te!==ae)try{Ie?ge.setAttributeNS(Ie,de,Te):ge.setAttribute(de,Te),Mt(ge)?et(ge):dE(e.removed)}catch{Ge(de,ge)}}Z(O.afterSanitizeAttributes,ge,null)},Et=function(ge){let $=null;const xe=ft(ge);for(Z(O.beforeSanitizeShadowDOM,ge,null);$=xe.nextNode();)Z(O.uponSanitizeShadowNode,$,null),it($),Ot($),$.content instanceof s&&Et($.content);Z(O.afterSanitizeShadowDOM,ge,null)};return e.sanitize=function(tt){let ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,xe=null,ne=null,me=null;if(De=!tt,De&&(tt="<!-->"),typeof tt!="string"&&!be(tt)&&(tt=Wne(tt),typeof tt!="string"))throw ng("dirty is not a string, aborting");if(!e.isSupported)return tt;if(wt||_t(ge),e.removed=[],typeof tt=="string"&&(ze=!1),ze){const Ke=tt.nodeName;if(typeof Ke=="string"){const ut=Ze(Ke);if(!Q[ut]||Ae[ut])throw ng("root node is forbidden and cannot be sanitized in-place")}}else if(tt instanceof c)$=ht("<!---->"),xe=$.ownerDocument.importNode(tt,!0),xe.nodeType===fm.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?$=xe:$.appendChild(xe);else{if(!vt&&!Ut&&!re&&tt.indexOf("<")===-1)return P&&Wt?P.createHTML(tt):tt;if($=ht(tt),!$)return vt?null:Wt?z:""}$&&Nt&&et($.firstChild);const de=ft(ze?tt:$);for(;ne=de.nextNode();)it(ne),Ot(ne),ne.content instanceof s&&Et(ne.content);if(ze)return tt;if(vt){if(Ut){$.normalize();let Ke=$.innerHTML;dm([I,j,U],ut=>{Ke=Fd(Ke,ut," ")}),$.innerHTML=Ke}if(Tt)for(me=K.call($.ownerDocument);$.firstChild;)me.appendChild($.firstChild);else me=$;return(pe.shadowroot||pe.shadowrootmode)&&(me=k.call(a,me,!0)),me}let Ie=re?$.outerHTML:$.innerHTML;return re&&Q["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Ta(Y4,$.ownerDocument.doctype.name)&&(Ie="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
4508`+Ie),Ut&&dm([I,j,U],Ke=>{Ie=Fd(Ie,Ke," ")}),P&&Wt?P.createHTML(Ie):Ie},e.setConfig=function(){let tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(tt),wt=!0},e.clearConfig=function(){ue=null,wt=!1},e.isValidAttribute=function(tt,ge,$){ue||_t({});const xe=Ze(tt),ne=Ze(ge);return we(xe,ne,$)},e.addHook=function(tt,ge){typeof ge=="function"&&hm(O[tt],ge)},e.removeHook=function(tt,ge){if(ge!==void 0){const $=Ine(O[tt],ge);return $===-1?void 0:Bne(O[tt],$,1)[0]}return dE(O[tt])},e.removeHooks=function(tt){O[tt]=[]},e.removeAllHooks=function(){O=wE()},e}var are=q4();pr.setOptions({breaks:!0,gfm:!0});function ire(t,e){if(!t)return"";let n=t.replace(/\{(\d+)\}/g,(o,c)=>{const d=parseInt(c)-1;return e&&d>=0&&d<e.length?(e[d],`%%SUP_LINK_${d}_%%`):o});const a=pr.parse(n,{async:!1});let s=are.sanitize(a,{ALLOWED_TAGS:["p","br","strong","em","b","i","u","s","del","a","ul","ol","li","blockquote","code","pre","sup"],ALLOWED_ATTR:["href","target","rel","title","class"],ADD_ATTR:["target"]}).replace(/<a /g,'<a target="_blank" rel="noopener noreferrer" ');return e&&(s=s.replace(/%%SUP_LINK_(\d+)_%%/g,(o,c)=>{const d=parseInt(c);if(d>=0&&d<e.length){const m=e[d],f=m.label||new URL(m.url).hostname.replace("www.","");return`<sup><a href="${m.url}" target="_blank" rel="noopener noreferrer" title="${f}" class="text-blue-600 dark:text-blue-400 hover:underline">[${d+1}]</a></sup>`}return o})),s}function sre({link:t,index:e}){const n=t.label||t.url,a=!t.label&&t.url.length>50;return r.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[r.jsxs("span",{className:"text-gray-500 dark:text-gray-400 flex-shrink-0",children:[e
4508+1,"."]}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline break-all",title:t.url,children:a?`${t.url.substring(0,50)}...`:n})]})}const SE=new Map,FE=new Map;async function vg(t,e,n){try{await fetch("/api/timeline/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({itemId:t,type:e,action:n})})}catch(a){console.error("Failed to send feedback:",a)}}function ore({itemId:t,isDark:e,editorMode:n=!1,counts:a}){const[i,s]=x.useState(()=>SE.get(t)||null),[o,c]=x.useState(null),d=f=>{if(n)return;const p=i;let b;p===f?(b=null,vg(t,f,"decrement")):(p&&vg(t,p,"decrement"),b=f,vg(t,f,"increment")),SE.set(t,b),s(b),b&&(c(b),setTimeout(()=>c(null),300))},m=`p-1.5 rounded transition-all duration-200 ${n?"cursor-default":e?"hover:bg-gray-700":"hover:bg-gray-100"}`;return r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsxs("button",{onClick:()=>d("helpful"),disabled:n,className:`${m} ${i==="helpful"?"text-green-500":""} ${o==="helpful"?"scale-125":""} flex items-center gap-0.5`,title:n?`${a?.helpful||0} found this helpful`:i==="helpful"?"Click to remove":"Yes, helpful",children:[r.jsx("svg",{className:"w-4 h-4",fill:i==="helpful"&&!n?"currentColor":"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"})}),n&&r.jsx("span",{className:"text-xs text-green-500",children:a?.helpful||0})]}),r.jsxs("button",{onClick:()=>d("notHelpful"),disabled:n,className:`${m} ${i==="notHelpful"?"text-orange-500":""} ${o==="notHelpful"?"scale-125":""} flex items-center gap-0.5`,title:n?`${a?.notHelpful||0} found this not helpful`:i==="notHelpful"?"Click to remove":"Not helpful",children:[r.jsx("svg",{className:"w-4 h-4",fill:i==="notHelpful"&&!n?"currentColor":"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018c.163 0 .326.02.485.06L17 4m-7 10v2a2 2 0 002 2h.095c.5 0 .905-.405.905-.905 0-.714.211-1.412.608-2.006L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"})}),n&&r.jsx("span",{className:"text-xs text-orange-500",children:a?.notHelpful||0})]})]})}function lre({itemId:t,isDark:e,editorMode:n=!1,count:a=0}){const[i,s]=x.useState(()=>FE.get(t)||!1),[o,c]=x.useState(!1),d=()=>{i||n||(FE.set(t,!0),s(!0),vg(t,"issues","increment"),c(!0),setTimeout(()=>c(!1),300))},m=`p-1.5 rounded transition-all duration-200 flex items-center gap-1 ${n?"cursor-default":e?"hover:bg-gray-700":"hover:bg-gray-100"}`;return n?r.jsxs("div",{className:`${m} ${a>0?"text-red-500":e?"text-gray-500":"text-gray-400"}`,title:`${a} flags for review`,children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})}),r.jsxs("span",{className:"text-xs",children:[a," flagged"]})]}):r.jsxs("button",{onClick:d,disabled:i,className:`${m} ${i?"text-red-500 cursor-default":e?"text-gray-400 hover:text-red-400":"text-gray-400 hover:text-red-500"} ${o?"scale-125":""}`,title:i?"Thanks for the feedback!":"Flag this item for review",children:[i?r.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})}):r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})}),r.jsx("span",{className:`text-xs ${i?"":e?"text-gray-400":"text-gray-500"}`,children:i?"Flagged":"Flag for review"})]})}function cre({item:t,position:e,itemBox:n,canvasBounds:a,axisY:i,categoryColor:s="#888888",onClose:o,isDark:c=!1,editorMode:d=!1,olderItem:m,newerItem:f,onNavigate:p,allItems:b,connectorLinesOpacity:v=1}){const C=x.useRef(null),S=x.useRef(null),[F,w]=x.useState(null),A=x.useCallback(()=>
4508{if(C.current){const B=C.current.getBoundingClientRect();w({left:B.left,top:B.top,right:B.right,bottom:B.bottom})}},[]);x.useEffect(()=>{n&&A()},[n,t.id,A]),x.useEffect(()=>{const B=()=>{requestAnimationFrame(A)};return window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[A]);const N=x.useMemo(()=>ire(t.body||"",t.links),[t.body,t.links]);x.useEffect(()=>{if(d)return;const B=O=>{C.current&&!C.current.contains(O.target)&&o()},k=setTimeout(()=>{document.addEventListener("mousedown",B)},100);return()=>{clearTimeout(k),document.removeEventListener("mousedown",B)}},[o]),x.useEffect(()=>{const B=k=>{k.key==="Escape"&&o()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[o]);const P=x.useCallback(async()=>{if(S.current)try{const B=`
4509        <h3>${t.term} (${t.yearDisplay})</h3>
4510        <p><em>${t.names}</em></p>
4511        ${t.body?`<p>${t.body}</p>`:""}
4512        ${t.links?.length?`
4513          <p><strong>Sources:</strong></p>
4514          <ul>
4515            ${t.links.map(O=>`<li><a href="${O.url}">${O.label||O.url}</a></li>`).join("")}
4516          </ul>
4517        `:""}
4518      `.trim(),k=[`${t.term} (${t.yearDisplay})`,t.names,"",t.body||"","",t.links?.length?"Sources:":"",...t.links?.map((O,I)=>`${I+1}. ${O.label||O.url}: ${O.url}`)||[]].filter(Boolean).join(`
4519`);await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([B],{type:"text/html"}),"text/plain":new Blob([k],{type:"text/plain"})})]),console.log("Copied to clipboard")}catch(B){console.error("Failed to copy:",B);try{const k=`${t.term} (${t.yearDisplay})
4520${t.names}
4521
4522${t.body||""}`;await navigator.clipboard.writeText(k)}catch{}}},[t]),D=(()=>{const I=a?.left??0,j=a?.top??0,U=a?.right??window.innerWidth,q=a?.bottom??window.innerHeight,Y=q-j;let W,H,J,ie,Q=!1;const ve=j+Y/2;if(n){const pe=(n.left+n.right)/2,We=(n.top+n.bottom)/2>ve;if(W=pe-450/2,Q=!0,We){const Ae=ve-12,Ce=Ae-j-20;ie=Math.min(Ce,Y*.6),J=window.innerHeight-Ae,H=void 0}else{const Ae=ve+12,Ce=q-Ae-20;ie=Math.min(Ce,Y*.6),H=Ae,J=void 0}}else W=e.x-450/2,H=e.y-100,J=void 0,ie=Y*.5;return W=Math.max(I+20,Math.min(U-450-20,W)),!Q&&H!==void 0&&(H=Math.max(j+20,Math.min(q-ie-20,H))),{style:{left:`${W}px`,top:H!==void 0?`${H}px`:"auto",bottom:J!==void 0?`${J}px`:"auto",maxWidth:"450px",maxHeight:`${ie}px`}}})(),{style:T}=D,K=x.useMemo(()=>{if(!n||!F)return null;const B=[{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.left,y:n.bottom},{x:n.right,y:n.bottom}],k=[{x:F.left,y:F.top},{x:F.right,y:F.top},{x:F.left,y:F.bottom},{x:F.right,y:F.bottom}],O=[];for(const U of B)for(const q of k){const Y=Math.hypot(U.x-q.x,U.y-q.y);O.push({itemCorner:U,popupCorner:q,dist:Y})}O.sort((U,q)=>U.dist-q.dist);const I=O[0];let j=O.find(U=>U.itemCorner!==I.itemCorner&&U.popupCorner!==I.popupCorner);return j||(j=O[1]),[I,j]},[n,F]);return r.jsxs(r.Fragment,{children:[K&&r.jsxs("svg",{className:"fixed inset-0 z-40 pointer-events-none",style:{width:"100vw",height:"100vh",opacity:v,transition:"opacity 200ms ease-out"},children:[a&&r.jsx("defs",{children:r.jsx("clipPath",{id:"canvas-clip",children:r.jsx("rect",{x:a.left,y:a.top,width:a.right-a.left,height:a.bottom-a.top})})}),r.jsx("g",{clipPath:a?"url(#canvas-clip)":void 0,children:K.map((B,k)=>r.jsx("line",{x1:B.itemCorner.x,y1:B.itemCorner.y,x2:B.popupCorner.x,y2:B.popupCorner.y,stroke:s,strokeWidth:1.5},k))})]}),r.jsxs("div",{ref:C,className:`
4523          fixed z-50 rounded-lg shadow-xl flex flex-col overflow-hidden
4524          animate-fade-in-scale
4525          ${c?"bg-gray-800 text-white":"bg-white text-gray-900"}
4526        `,style:{...T,border:`2px solid ${s}`},children:[r.jsxs("div",{className:`flex items-start justify-between p-4 pb-2 flex-shrink-0 ${c?"bg-gray-800":"bg-white"}`,children:[r.jsxs("div",{className:"flex-1 pr-2",children:[r.jsx("h3",{className:"text-lg font-semibold leading-tight",children:t.term}),r.jsxs("p",{className:`text-sm ${c?"text-gray-400":"text-gray-500"}`,children:[t.names,", ",t.yearDisplay]}),t.relatedItems&&t.relatedItems.length>0&&b&&p&&r.jsxs("p",{className:`text-xs mt-1.5 ${c?"text-gray-400":"text-gray-500"}`,children:["See also:"," ",t.relatedItems.map(k=>b.find(O=>O.id===k)).filter(k=>k!=null).sort((k,O)=>k.year-O.year).map((k,O)=>r.jsxs("span",{children:[O>0&&", ",r.jsx("button",{onClick:()=>
4526p(k),className:"text-blue-600 dark:text-blue-400 hover:underline",children:k.term===t.term?k.yearDisplay:`${k.term} (${k.yearDisplay})`})]},k.id))]})]}),r.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[r.jsx("button",{onClick:P,className:"p-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Copy to clipboard",children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),r.jsx("button",{onClick:o,className:"p-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Close (Escape)",children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),r.jsxs("div",{ref:S,className:`px-4 pb-4 overflow-y-auto flex-1 min-h-0 ${c?"text-gray-200":"text-gray-700"}`,children:[t.image&&r.jsx("img",{src:t.image,alt:t.altText||t.term,title:t.altText||void 0,className:"float-left mr-4 mb-2 max-w-[40%] max-h-40 object-contain rounded-lg"}),t.body&&r.jsx("div",{className:`text-sm leading-relaxed mb-4 prose prose-sm dark:prose-invert max-w-none
4527                         prose-p:my-2 prose-a:text-blue-600 dark:prose-a:text-blue-400
4528                         prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5
4529                         prose-blockquote:border-l-2 prose-blockquote:pl-3 prose-blockquote:italic`,dangerouslySetInnerHTML:{__html:N}}),r.jsx("div",{className:"clear-both"}),t.links&&t.links.length>0&&r.jsx("div",{className:`pt-3 border-t ${c?"border-gray-700":"border-gray-200"}`,children:r.jsx("div",{className:"space-y-1.5",children:t.links.map((B,k)=>r.jsx(sre,{link:B,index:k},k))})}),r.jsx("div",{className:`mt-4 pt-3 border-t ${c?"border-gray-700":"border-gray-200"}`,children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:`
4530                inline-block px-2 py-0.5 text-xs rounded
4531                ${c?"bg-gray-700 text-gray-300":"bg-gray-100 text-gray-600"}
4532              `,children:t.subcategory||t.category}),r.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[r.jsx("span",{className:c?"text-gray-400":"text-gray-500",children:d?"Feedback:":"Was this useful?"}),r.jsx(ore,{itemId:t.id,isDark:c,editorMode:d,counts:t.feedback?{helpful:t.feedback.helpful,notHelpful:t.feedback.notHelpful}:void 0}),r.jsx("span",{className:`ml-2 ${c?"text-gray-500":"text-gray-400"}`,children:"|"}),r.jsx(lre,{itemId:t.id,isDark:c,editorMode:d,count:t.feedback?.issues||0})]})]})})]})]})]})}const CE={light:{background:"#ffffff",axis:"#333333",axisText:"#333333",connectorLine:"#aaaaaa",boxBackground:"#f8f8f8",boxBorder:"#e0e0e0",boxText:"#333333",boxSubtext:"#666666",footnoteText:"#666666",glowColor:"rgba(255, 255, 255,",clipArrow:"#999999",linkText:"#2563eb"},dark:{background:"#1a1a2e",axis:"#e0e0e0",axisText:"#e0e0e0",connectorLine:"#888888",boxBackground:"#2a2a3e",boxBorder:"#444466",boxText:"#e0e0e0",boxSubtext:"#aaaaaa",footnoteText:"#999999",glowColor:"rgba(26, 26, 46,",clipArrow:"#888888",linkText:"#60a5fa"}},ure=1920,Ps=40,dre=.45,_E=5;function Ts(t,e,n){return(t-n)*Ps*e.scale+e.offsetX}function EE(t,e,n){return(t-e.offsetX)/e.scale/Ps+n}function Cd(t){return qa.find(n=>n.id===t)?.color??"#888888"}function pm(t){return t*dre}const kE=38,AE=8,ag=64;function NE(t,e,n,a){return t<a&&e>n}const kd=32;function hre(t,e,n,a,i,s,o,c){const d=n.scaleY,m=`bold ${Math.round(11*d)}px sans-serif`,f=`${Math.round(10*d)}px sans-serif`,p=3,b=4,v=Math.max(14,kd*d-2*p),C=new Map,S=new Map,F=new Map,w=t.filter(B=>a.has(B.category)),A=new Map,N=w.filter(B=>B.body?.trim()).sort((B,k)=>B.year-k.year);let P=1;for(const B of N)A.set(B.id,P.toString()),P++;const z=[...w].sort((B,k)=>k.priority!==B.priority?k.priority-B.priority:B.year-k.year),D=new Map,T=new Map;let K=!0;for(const B of z){const k=!!B.body?.trim(),O=A.get(B.id)||"",I=(B.year-s)*Ps*n.scale;e.font=m;const j=e.measureText(B.term).width;e.font=f;const U=`(${B.names}, ${B.yearDisplay})`,q=e.measureText(U).width,Y=Math.max(j,q);let W=0;
4532if(B.image){const zt=o(B.image)??1;W=v*zt+b}const H=Y+12+W,J=I-H/2-AE,ie=I+H/2+AE,Q=100;let ve=1,pe=K,Me=!1;const We=c(B.category);let Ae;We==="above"?Ae=[!0]:We==="below"?Ae=[!1]:Ae=K?[!0,!1]:[!1,!0];for(const zt of Ae){const Ut=zt?D:T,Bt=zt?1:2;for(let re=Bt;re<=Q&&!Me;re++)if(!(Ut.get(re)||[]).some(vt=>!vt.hidden&&NE(J,ie,vt.left,vt.right))){ve=re,pe=zt,Me=!0;break}if(Me)break}Me&&pe===K&&(K=!K);let Ce=!1,He=!1;if(!Me){const zt=We==="below"?!1:We==="above"?!0:K;ve=zt?1:2,pe=zt;const Ut=pe?D:T,Bt=pe?1:2,wt=(Ut.get(Bt)||[]).filter(Nt=>!Nt.hidden&&NE(J,ie,Nt.left,Nt.right));if(wt.length>0){const Nt=Math.max(...wt.map(vt=>vt.item.priority));if(B.priority>Nt)for(const vt of wt)vt.item.priority<B.priority&&(vt.hidden=!0);else if(B.priority<Nt)Ce=!0;else{He=!0;for(const vt of wt)vt.item.priority===B.priority&&(vt.conflict=!0)}}}const Ct={item:B,row:pe?-ve:ve,left:J,right:ie,boxWidth:H,hidden:Ce,conflict:He,moved:ve>1&&!Ce,hasFootnote:k,footnoteSymbol:O};C.set(B.id,Ct);const bt=pe?D:T,Rt=bt.get(ve)||[];Rt.push(Ct),bt.set(ve,Rt)}return{items:C,categoryExtents:S,categoryYPositions:F}}const J4="timeline-viewport",mre="timeline-visible-bands",X4="timeline-category-states";function fre(){try{const t=localStorage.getItem(J4);if(t){const e=JSON.parse(t);return{viewport:{offsetX:e.offsetX??200,offsetY:e.offsetY??0,scale:e.scale??1,scaleY:e.scaleY??1,width:800,height:600},isFresh:!1}}}catch{}return{viewport:{offsetX:200,offsetY:0,scale:.5,scaleY:.5,width:800,height:600},isFresh:!0}}const pre={products:"above",concepts:"above",research:"below",infrastructure:"below",events:"below",fiction:"below"};function gre(){const t={};for(const e of qa){const n=pre[e.id]??"both",a=n==="off"?"both":n;t[e.id]={state:n,lastNonOff:a}}try{const e=localStorage.getItem(X4);if(e){const a=JSON.parse(e);for(const i of qa){const s=a[i.id];s&&typeof s=="object"&&["off","above","below","both"].includes(s.state)&&(t[i.id]={state:s.state,lastNonOff:["above","below","both"].includes(s.lastNonOff)?s.lastNonOff:"both"})}return t}const n=localStorage.getItem(mre);if(n){const a=JSON.parse(n),i=new Set(a);for(const s of qa){const o=i.has(s.id)?"both":"off";t[s.id]={state:o,lastNonOff:"both"}}}}catch{}return t}function xre({categoryStates:t,isDark:e,onToggle:n,onPlace:a}){function i(o,c){const d=t[o].state,m=d==="above"||d==="both",f=d==="below"||d==="both",p=c==="above"?!m:m,b=c==="below"?!f:f;!p&&!b?n(o):p&&b?a(o,"both"):p?a(o,"above"):a(o,"below")}const s=e?"#1e293b":"#ffffff";return r.jsxs("div",{className:"relative flex items-stretch gap-2 px-2 pb-2",style:{userSelect:"none",touchAction:"manipulation"},children:[r.jsx("div",{"aria-hidden":!0,className:`absolute left-2 right-2 ${e?"bg-slate-300":"bg-gray-500"}`,style:{top:24,height:2,zIndex:0}}),qa.map(o=>{const c=t[o.id].state,d=c==="off",m=c==="above"||c==="both",f=c==="below"||c==="both";return r.jsxs("div",{className:"relative flex flex-col items-center gap-0.5",style:{zIndex:1},children:[r.jsx("button",{type:"button",onClick:()=>i(o.id,"above"),"aria-label":`${m?"Hide":"Show"} ${o.label} above the timeline`,className:"w-5 h-3 flex items-center justify-center rounded-t-sm border-x border-t transition-opacity",style:{borderColor:o.color,backgroundColor:m?o.color:"transparent",opacity:m?1:.4},title:`Show items above timeline (currently ${m?"on":"off"})`,children:r.jsx("span",{className:"text-[8px] leading-none",style:{color:m?e?"#000":"#fff":o.color},children:"▲"})}),r.jsx("button",{type:"button",onClick:()=>n(o.id),"aria-label":`Toggle category ${o.label}; currently ${c}`,className:"relative px-2 py-0.5 rounded-md text-[10px] font-medium whitespace-nowrap border",style:{borderColor:o.color,color:d?o.color:e?"#fff":"#000",backgroundColor:s,backgroundImage:d?void 0:e?`linear-gradient(${o.color}33, ${o.color}33)`:`linear-gradient(${o.color}22, ${o.color}22)`,opacity:d?.5:1},title:`${o.label} (${c}) — click to toggle on/off`,children:o.label}),r.jsx("button",{type:"button",onClick:()=>i(o.id,"below"),"aria-label":`${f?"Hide":"Show"} ${o.label} below the timeline`,className:"w-5 h-3 flex items-center justify-center rounded-b-sm border-x border-b transition-opacity",style:{borderColor:o.color,backgroundColor:f?o.color:"transparent",opacity:f?1:.4},title:`Show items below timeline (currently ${f?"on":"off"})`,children:r.jsx("span",{className:"text-[8px] leading-none",style:{color:f?e?"#000":"#fff":o.color},children:"▼"})})]},o.id)})]})}function p1({editorMode:t=!1,selectedItemId:e=null,onSelectItem:n,items:a,showNew:i=!1,newItemIds:s=new Set,showDuplicates:o=!1,duplicateItemIds:c=new Set,focu
4532sItemId:d=null,onFocusComplete:m,editingItems:f=new Map}={}){const p=x.useRef(null),b=x.useRef(null),[v,C]=x.useState([]),S=a??v,[F,w]=x.useState(()=>gre()),A=x.useMemo(()=>{const be=new Set;for(const Z of qa)F[Z.id].state!=="off"&&be.add(Z.id);return be},[F]),N=x.useRef(new Map),[P,z]=x.useState(0),{yearMin:D,yearMax:T}=x.useMemo(()=>{const be=new Date().getFullYear();return S.length===0?{yearMin:ure-_E,yearMax:be}:{yearMin:Math.min(...S.map(it=>Math.floor(it.year)))-_E,yearMax:be}},[S]);x.useEffect(()=>{a||fetch("/api/timeline").then(be=>be.json()).then(be=>C(be)).catch(be=>console.error("[Timeline] Failed to load:",be))},[a]),x.useEffect(()=>{if(!ve.current||S.length===0)return;const be=Q.current;if(!be.width)return;ve.current=!1;const Z=1950,it=new Date().getFullYear(),we=Math.max(1,it-Z);be.scale=Math.max(.2,Math.min(3,be.width/(we*Ps))),be.offsetX=-(Z-D)*Ps*be.scale},[S.length,D]),x.useEffect(()=>{const be=S.filter(Z=>Z.image&&!N.current.has(Z.image));be.length!==0&&be.forEach(Z=>{if(!Z.image)return;const it=new Image;it.onload=()=>{N.current.set(Z.image,it),z(we=>we+1)},it.onerror=()=>{console.warn("[Timeline] Failed to load image:",Z.image)},it.src=Z.image})},[S]);const{theme:K}=H1(),[B,k]=x.useState(()=>typeof document>"u"?!1:document.documentElement.classList.contains("dark")),[O,I]=x.useState(()=>typeof window<"u"?window.innerWidth<window.innerHeight||window.innerWidth<500:!1),j=x.useRef(0),U=x.useCallback(()=>{clearTimeout(j.current),j.current=window.setTimeout(()=>{I(!0)},6e3)},[]),q=x.useCallback(()=>{clearTimeout(j.current),j.current=window.setTimeout(()=>{I(!0)},1e3)},[]);x.useEffect(()=>(O?clearTimeout(j.current):U(),()=>clearTimeout(j.current)),[O,U]),x.useEffect(()=>{const be=()=>{k(K==="dark"?!0:K==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches)};be();const Z=window.matchMedia("(prefers-color-scheme: dark)");return Z.addEventListener("change",be),()=>Z.removeEventListener("change",be)},[K]);const Y=B?CE.dark:CE.light,W=x.useCallback(be=>{try{localStorage.setItem(X4,JSON.stringify(be))}catch{}},[]),H=x.useCallback(be=>{w(Z=>{const it=Z[be],we=it.state==="off"?it.lastNonOff:"off",st={...Z,[be]:{state:we,lastNonOff:we==="off"?it.state==="off"?it.lastNonOff:it.state:it.lastNonOff}};return W(st),st})},[W]),J=x.useCallback((be,Z)=>{w(it=>{const we={...it,[be]:{state:Z,lastNonOff:Z}};return W(we),we})},[W]),ie=x.useMemo(()=>fre(),[]),Q=x.useRef(ie.viewport),ve=x.useRef(ie.isFresh),pe=x.useRef({min:D,max:T});pe.current={min:D,max:T};const Me=x.useCallback(be=>{const{min:Z,max:it}=pe.current,we=(it-Z)*Ps*be.scale,st=100,Lt=st,Ot=be.width-we-st;we+2*st<be.width?be.offsetX=(be.width-we)/2:be.offsetX=Math.max(Ot,Math.min(Lt,be.offsetX))},[]),We=x.useRef({hasClippedAbove:!1,hasClippedBelow:!1,minRowAbove:0,maxRowBelow:0}),Ae=x.useCallback(be=>{const Z=We.current,it=pm(be.height),we=kE*be.scaleY,st=we,Lt=Z.minRowAbove<0,Ot=Z.maxRowBelow>=2,Et=Lt?st-it-Z.minRowAbove*we:0,tt=Ot?be.height-st-it-(ag+(Z.maxRowBelow-2)*we):0,ge=Math.min(Et,tt),$=Math.max(Et,tt);be.offsetY=Math.max(ge,Math.min($,be.offsetY))},[]),Ce=x.useRef(new Map),He=x.useRef(""),Ct=x.useRef(!1),bt=300,Rt=x.useRef([]),zt=x.useRef({}),Ut=x.useRef(0),Bt=be=>{const Z=performance.now(),it=Z-Ut.current;zt.current[be]=(zt.current[be]||0)+it,Ut.current=Z},re=()=>{zt.current={},Ut.current=performance.now()},wt=()=>{const be=zt.current;let Z=0;for(const we in be)Z+=be[we];be.total=Z;const it=Rt.current;it.push(be),it.length>bt&&it.shift()};x.useEffect(()=>{const be=Z=>{if(Z.key!=="p"&&Z.key!=="P")return;const it=Z.target;if(it&&(it.tagName==="INPUT"||it.tagName==="TEXTAREA"||it.isContentEditable))return;const we=Rt.current;if(we.length===0){console.log("[Timeline perf] no frames recorded yet");return}const st=new Set;for(const Et of we)for(const tt in Et)st.add(tt);const Lt={};for(const Et of st){const tt=we.map(ne=>ne[Et]||0).sort((ne,me)=>ne-me),ge=tt.reduce((ne,me)=>ne+me,0)/tt.length,$=tt[Math.floor(tt.length*.95)],xe=tt[tt.length-1];Lt[Et]={avg:ge,p95:$,max:xe}}const Ot=[...we].sort((Et,tt)=>(tt.total||0)-(Et.total||0)).slice(0,5);console.group(`[Timeline perf] ${we.length} frames (press P again to refresh)`),console.table(Object.fromEntries(Object.entries(Lt).map(([Et,tt])=>[Et,{avg_ms:+tt.avg.toFixed(2),p95_ms:+tt.p95.toFixed(2),max_ms:+tt.max.toFixed(2)}]))),console.log("Slowest frames:"),console.table(Ot.map(Et=>Object.fromEntries(Object.entries(Et).map(([tt,ge])=>[tt,+ge.toFixed(2)])))),console.groupEnd()};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[]);const Nt=x.useRef(0),vt=x.useRef(!1),Tt=5,[Wt,Dt]=x.useState(null),[jt,he]=x.use
4532State(!1),ee=x.useRef(0),ze=x.useRef(0),Ve=x.useRef(null),lt=500,[qe,It]=x.useState(null),[gt,Ee]=x.useState(null),[Je,$e]=x.useState(null),[Xe,X]=x.useState(1);x.useEffect(()=>{t&&e===null&&(It(null),Ee(null))},[t,e]);const ke=x.useRef(()=>0),De=x.useRef([]),oe=x.useRef(0),te=x.useCallback(()=>{clearTimeout(oe.current),oe.current=window.setTimeout(()=>{const{offsetX:be,offsetY:Z,scale:it,scaleY:we}=Q.current;localStorage.setItem(J4,JSON.stringify({offsetX:be,offsetY:Z,scale:it,scaleY:we}))},300)},[]);x.useEffect(()=>{if(!d||!p.current)return;const be=S.find(xe=>xe.id===d);if(!be)return;const Z=p.current,it=Q.current,we=Z.width/(window.devicePixelRatio||1),st=Z.height/(window.devicePixelRatio||1),Lt=(be.year-D)*Ps,Ot=we/2-Lt*it.scale,Et=it.offsetX,tt=400,ge=performance.now(),$=xe=>{const ne=xe-ge,me=Math.min(ne/tt,1),de=1-Math.pow(1-me,3);if(it.offsetX=Et+(Ot-Et)*de,fe.current&&fe.current(),me<1)requestAnimationFrame($);else{const Ie=Z.getBoundingClientRect();It(d),Ee({x:Ie.left+we/2,y:Ie.top+st/2}),setTimeout(()=>{const Ke=Ce.current.get(d);if(Ke&&!Ke.hidden){const ut=ke.current,ae=kd*Q.current.scaleY,Te=Ts(Ke.item.year,Q.current,D),Qe=ut(Ke.row),ot=Ke.boxWidth,pt=Te-ot/2,ct=Qe-ae/2,Vt=p.current?.getBoundingClientRect();Vt&&$e({left:Vt.left+pt,top:Vt.top+ct,right:Vt.left+pt+ot,bottom:Vt.top+ct+ae})}},0),te(),m?.()}};requestAnimationFrame($)},[d,S,D,te,m]);const ye=x.useRef({isDragging:!1,startX:0,startY:0,lastX:0,lastY:0,velocityX:0,velocityY:0,lastTime:0}),Re=x.useRef({touches:new Map,initialDxFingers:0,initialDyFingers:0,initialScale:1,initialScaleY:1,initialCenterX:0,initialCenterY:0}),Le=x.useRef(0),fe=x.useRef(()=>{}),Se=x.useCallback(()=>{const be=p.current;if(!be)return;const Z=be.getContext("2d");if(!Z)return;re();const it=Q.current,{width:we,height:st}=it,Lt=it.scaleY,Ot=kE*Lt,Et=kd*Lt,tt=`bold ${Math.round(11*Lt)}px sans-serif`;Bt("setup"),Z.fillStyle=Y.background,Z.fillRect(0,0,we,st),Bt("clear");const ge=pm(st)+it.offsetY;rt.current=ge,Z.strokeStyle=Y.axis,Z.lineWidth=4,Z.beginPath(),Z.moveTo(0,ge),Z.lineTo(we,ge),Z.stroke();const $=Ps*it.scale;let xe,ne;$>=120?(xe=1,ne=1):$>=80?(xe=1,ne=5):$>=20?(xe=5,ne=5):$>=10?(xe=5,ne=10):(xe=10,ne=20);
4532const me=Math.floor(EE(0,it,D)/xe)*xe,de=Math.ceil(EE(we,it,D)/xe)*xe,Ie=[];for(let mn=me;mn<=de;mn+=xe){const En=Ts(mn,it,D);if(En<-50||En>we+50)continue;mn%ne===0&&Ie.push({x:En,year:mn})}Bt("axisAndTicks");let Ke;const ut=qa.map(mn=>F[mn.id]?.state??"").join(","),ae=`${S.length}|${A.size}|${ut}|${it.scale}|${it.scaleY}|${we}|${st}|${P}`,Te=ae===He.current&&Ce.current.size>0;(Ct.current||Te)&&Ce.current.size>0?Ke=Ce.current:(Ke=hre(S,Z,it,A,st,D,Wn=>{const yn=N.current.get(Wn);return!yn||!yn.width||!yn.height?null:yn.width/yn.height},Wn=>{const yn=F[Wn]?.state??"both";return yn==="off"?"both":yn}).items,He.current=ae),Bt("layout");const Qe=2,ot=new Map,pt=new Map;for(const[mn,En]of Ke){if(En.hidden)continue;const Sn=Math.round(Ts(En.item.year,it,D)),Wn=pt.get(Sn)||[];Wn.push(mn),pt.set(Sn,Wn)}for(const[,mn]of pt)if(mn.length===1)ot.set(mn[0],0);else{const Sn=-((mn.length-1)*Qe)/2;mn.forEach((Wn,yn)=>{ot.set(Wn,Sn+yn*Qe)})}const ct=mn=>mn<0?ge+mn*Ot:ge+ag+(mn-2)*Ot;Bt("lineOffsets");const Vt=Z.globalAlpha;Z.globalAlpha=.75*Xe,Z.lineWidth=.5;const sn=5,cn=5;for(const[mn,En]of Ke){if(En.hidden)continue;const Sn=En.item,Wn=Ts(Sn.year,it,D),yn=ot.get(mn)||0,xn=Wn+yn;if(xn<-100||xn>we+100)continue;const Mn=ct(En.row),mr=En.row<0,zn=mr?Mn+Et/2:Mn-Et/2,lr=Cd(Sn.category);Z.strokeStyle=lr,Z.fillStyle=lr,Z.beginPath(),Z.moveTo(Math.round(xn),Math.round(zn)),Z.lineTo(Math.round(xn),Math.round(ge)),Z.stroke(),Z.beginPath(),mr?(Z.moveTo(xn-sn,zn),Z.lineTo(xn+sn,zn),Z.lineTo(xn,zn+cn)):(Z.moveTo(xn-sn,zn),Z.lineTo(xn+sn,zn),Z.lineTo(xn,zn-cn)),Z.closePath(),Z.fill()}Z.globalAlpha=Vt,Bt("connectors"),Z.font="12px sans-serif",Z.textAlign="center",Z.textBaseline="middle";const St=ge+22,le=6,Ne=4;for(const{x:mn,year:En}of Ie){const Sn=En.toString(),Wn=Z.measureText(Sn).width;Z.fillStyle=Y.background,Z.fillRect(mn-Wn/2-le,St-6-Ne,Wn+le*2,12+Ne*2),Z.fillStyle=Y.axisText,Z.fillText(Sn,mn,St)}Z.textBaseline="alphabetic",Bt("yearLabelText");const Oe=ue.current;if(Oe){const mn=S.find(En=>En.id===Oe);if(mn?.relatedItems&&mn.relatedItems.length>0){const En=Ke.get(Oe);if(En&&!En.hidden){const Sn=Ts(mn.year,it,D),Wn=ct(En.row),yn=qn=>{const ka=qn.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return ka?[parseInt(ka[1],16),parseInt(ka[2],16),parseInt(ka[3],16)]:[100,100,100]},Mn=qa.find(qn=>qn.id===mn.category)?.color||"#646464",[mr,zn,lr]=yn(Mn);Z.lineWidth=10,Z.lineCap="round";for(const qn of mn.relatedItems){const ka=S.find(Ua=>Ua.id===qn);if(!ka)continue;const Ji=Ke.get(qn);if(!Ji||Ji.hidden)continue;const La=Ts(ka.year,it,D),Vn=ct(Ji.row);if(Sn<-500&&La<-500||Sn>we+500&&La>we+500)continue;const sa=qa.find(Ua=>Ua.id===ka.category)?.color||"#646464",[di,Bo,Xs]=yn(sa),Ia=Z.createLinearGradient(Sn,Wn,La,Vn);Ia.addColorStop(0,`rgba(${mr}, ${zn}, ${lr}, 0.5)`),Ia.addColorStop(1,`rgba(${di}, ${Bo}, ${Xs}, 0.5)`),Z.strokeStyle=Ia;const ps=La-Sn,Or=Vn-Wn,Ba=Math.atan2(Or,ps)*(180/Math.PI),Oo=Math.abs(ps),Oa=Math.max(50,Oo*.4);let gs,Xr,Xi,hi;if(Ba>60&&Ba<120||Ba<-60&&Ba>-120){const Ua=Math.max(30,Math.abs(Or)*.3);gs=Sn,Xr=Wn+(Or>0?Ua:-Ua),Xi=La,hi=Vn+(Or>0?-Ua:Ua)}else gs=Sn+(ps>0?Oa:-Oa),Xr=Wn,Xi=La+(ps>0?-Oa:Oa),hi=Vn;Z.beginPath(),Z.moveTo(Sn,Wn),Z.bezierCurveTo(gs,Xr,Xi,hi,La,Vn),Z.stroke()}}}}Bt("relatedCurves");const at=6,xt=Et;for(const[mn,En]of Ke){if(En.hidden)continue;const Sn=En.item,Wn=Ts(Sn.year,it,D),yn=ot.get(mn)||0,xn=Wn+yn;if(Wn<-200||Wn>we+200)continue;const Mn=ct(En.row),mr=En.row<0,zn=En.boxWidth,lr=Wn-zn/2,qn=Mn-xt/2;if(qn+xt<0||qn>st)continue;const Ji=Sn.term,La=`(${Sn.names}, ${Sn.yearDisplay})`,Vn=Sn.id===e,Za=Sn.deleted===!0,sa=i&&s.has(Sn.id),di=o&&c.has(Sn.id),Bo=f.has(Sn.id),Xs=Sn.pending===!0,Ia=Oe?S.find(Sr=>Sr.id===Oe):null,ps=Ia?.relatedItems?.includes(Sn.id)||!1;Xs?Z.fillStyle=B?"rgba(234, 179, 8, 0.25)":"rgba(234, 179, 8, 0.2)":Z.fillStyle=Y.boxBackground,Z.beginPath(),Z.roundRect(lr,qn,zn,xt,3),Z.fill();const Ba=qa.find(Sr=>Sr.id===Sn.category)?.color||Y.boxBorder;if(Vn){const Sr=[{offset:6,alpha:.1},{offset:4,alpha:.2},{offset:2,alpha:.35}];for(const{offset:$n,alpha:Dr}of Sr)Z.strokeStyle=`rgba(255, 215, 0, ${Dr})`,Z.lineWidth=$n*2,Z.beginPath(),Z.roundRect(lr-$n,qn-$n,zn+$n*2,xt+$n*2,3+$n),Z.stroke()}if(sa){const Sr=[{offset:6,alpha:.15},{offset:4,alpha:.25},{offset:2,alpha:.4}];for(const{offset:$n,alpha:Dr}of Sr)Z.strokeStyle=`rgba(34, 197, 94, ${Dr})`,Z.lineWidth=$n*2,Z.beginPath(),Z.roundRect(lr-$n,qn-$n,zn+$n*2,xt+$n*2,3+$n),Z.stroke()}if(Za){const Sr=[{offset:6,alpha:.15},{offset:4,alpha:.25},{offset:2,alpha:.4}];for(const{offset:$n,alpha:Dr}of Sr)Z.strokeStyle=`rgba(239, 68, 68, ${Dr})`,Z.lineWidth=$n*2,Z.beginPath(),Z.roundRect(lr-$n,qn-$n,zn+$n*2,xt+$n*2,3+$n),Z.stroke()}if(di){const Sr=[{offset:6,alpha:.2},{offset:4,alpha:.3},{offset:2,alpha:.5}];for(const{offset:$n,alpha:Dr}of Sr)Z.strokeStyle=`rgba(236, 72, 153, ${Dr})`,Z.lineWidth=$n*2,Z.beginPath(),Z.roundRect(lr-$n,qn-$n,zn+$n*2,xt+$n*2,3+$n),Z.stroke()}if(Bo){const Sr=[{offset:6,alpha:.25},{offset:4,alpha:.4},{offset:2,alpha:.6}];for(const{offset:$n,alpha:Dr}of Sr)Z.strokeStyle=`rgba(147, 51, 234, ${Dr})`,Z.lineWidth=$n*2,Z.beginPath(),Z.roundRect(lr-$n,qn-$n,zn+$n*2,xt+$n*2,3+$n),Z.stroke()}if(ps&&Ia){const Dr=(qa.find(Ni=>Ni.id===Ia.category)?.color||Y.boxBorder).match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/),[xh,Pc,vh]=Dr?[Dr[1],Dr[2],Dr[3]]:["100","100","100"],jc=[{offset:6,alpha:.15},{offset:4,alpha:.25},{offset:2,alpha:.4}];for(const{offset:Ni,alpha:Al}of jc)Z.strokeStyle=`rgba(${xh}, ${Pc}, ${vh}, ${Al})`,Z.lineWidth=Ni*2,Z.beginPath(),Z.roundRect(lr-Ni,qn-Ni,zn+Ni*2,xt+Ni*2,3+Ni),Z.stroke()}const Oo=En.conflict?"#ff0000":Ba,Oa=Vn?2:1;Z.strokeStyle=Oo,Z.lineWidth=Oa,Za&&Z.setLineDash([4,2]),Z.beginPath(),Z.roundRect(lr,qn,zn,xt,3),Z.stroke(),Za&&Z.setLineDash([]),Z.strokeStyle=Y.connectorLine,Z.lineWidth=.5;const gs=mr?qn+xt:qn,Xr=mr?gs+at:gs-at;Z.beginPath(),Z.moveTo(Math.round(xn),Math.round(gs)),Z.lineTo(Math.round(xn),Math.round(Xr)),Z.stroke();const Xi=3,hi=4,Tr=Sn.image?N.current.get(Sn.image):null,Ua=Tr&&Tr.width&&Tr.height?Tr.width/Tr.height:1,xs=Math.max(14,xt-2*Xi),Zs=Sn.image?xs*Ua:0,Tu=Sn.image?(Zs+hi)/2:0;
4532if(Sn.image){const Sr=lr+Xi,$n=qn+(xt-xs)/2;if(Tr)Z.save(),Z.beginPath(),Z.roundRect(Sr,$n,Zs,xs,3),Z.clip(),Z.drawImage(Tr,0,0,Tr.width,Tr.height,Sr,$n,Zs,xs),Z.restore(),Z.strokeStyle=Ba,Z.lineWidth=1,Z.beginPath(),Z.roundRect(Sr,$n,Zs,xs,3),Z.stroke();else{const Dr=xs;Z.fillStyle=B?"#3a3a4e":"#e8e8e8",Z.beginPath(),Z.roundRect(Sr,$n,Dr,Dr,3),Z.fill(),Z.fillStyle=Y.footnoteText,Z.font="8px sans-serif",Z.textAlign="center",Z.fillText("...",Sr+Dr/2,$n+Dr/2+3)}}Z.fillStyle=Y.boxText,Z.font=tt,Z.textAlign="center",Z.fillText(Ji,Wn+Tu,Mn-3*Lt),Z.font=`${Math.round(9*Lt)}px sans-serif`,Z.fillStyle=Y.footnoteText,Z.fillText(La,Wn+Tu,Mn+10*Lt)}Bt("items");const Qt=3,Gt=10,Xt=90,Zt=kd,_n=6,rn=[],or=[];for(const[,mn]of Ke){if(mn.hidden||mn.item.priority<Qt)continue;const En=Ts(mn.item.year,it,D);En<-50?rn.push(mn):En>we+50&&or.push(mn)}rn.sort((mn,En)=>En.item.priority!==mn.item.priority?En.item.priority-mn.item.priority:mn.item.year-En.item.year),or.sort((mn,En)=>En.item.priority!==mn.item.priority?En.item.priority-mn.item.priority:En.item.year-mn.item.year);const Nr=(mn,En)=>{if(Z.font="bold 10px sans-serif",Z.measureText(mn).width<=En)return[mn];const Sn=mn.split(" ");if(Sn.length===1)return[mn];let Wn="",yn="";for(let xn=0;xn<Sn.length;xn++){const Mn=Wn+(Wn?" ":"")+Sn[xn];if(Z.measureText(Mn).width<=En)Wn=Mn;else{yn=Sn.slice(xn).join(" ");break}}return[Wn,yn]},Ca=we<500,qi=we>=500&&we<900,fs=Ca?3:5,_a=8,Pa=6,qr=65,Jr=Zt,ui=4,Ea=Ca?_a*2+6:Zt+6;De.current=[];for(let mn=0;mn<Math.min(rn.length,fs);mn++){const En=Math.floor(mn/2),Sn=mn%2===0,Wn=Sn?ge-Ot:ge+ag,yn=Sn?Wn-En*Ea:Wn+En*Ea;if(Ca)Z.fillStyle=Y.clipArrow,Z.beginPath(),Z.moveTo(Gt,yn),Z.lineTo(Gt+_a,yn-_a),Z.lineTo(Gt+_a,yn+_a),Z.closePath(),Z.fill();else if(qi){const xn=rn[mn],Mn=ui,mr=Mn,zn=yn-Jr/2;Z.fillStyle=B?"rgba(42, 42, 62, 0.75)":"rgba(248, 248, 248, 0.75)",Z.beginPath(),Z.roundRect(mr,zn,qr,Jr,2),Z.fill(),Z.strokeStyle=Cd(xn.item.category),Z.lineWidth=2,Z.stroke(),Z.fillStyle=Y.boxSubtext,Z.beginPath(),Z.moveTo(Mn+4,yn),Z.lineTo(Mn+4+Pa,yn-Pa),Z.lineTo(Mn+4+Pa,yn+Pa),Z.closePath(),Z.fill(),Z.fillStyle=Y.boxText,Z.font="bold 8px sans-serif",Z.textAlign="left";const lr=qr-16;let qn=xn.item.term;for(;Z.measureText(qn).width>lr&&qn.length>3;)qn=qn.slice(0,-1);qn!==xn.item.term&&(qn+="…"),Z.fillText(qn,Mn+12,yn+3),De.current.push({x:mr,y:zn,width:qr,height:Jr,year:xn.item.year,itemId:xn.item.id})}else{const xn=rn[mn],Mn=Gt,mr=Mn,zn=yn-Zt/2;Z.fillStyle=B?"rgba(42, 42, 62, 0.75)":"rgba(248, 248, 248, 0.75)",Z.beginPath(),Z.roundRect(mr,zn,Xt,Zt,3),Z.fill(),Z.strokeStyle=Cd(xn.item.category),Z.lineWidth=2,Z.stroke(),Z.fillStyle=Y.boxSubtext,Z.beginPath(),Z.moveTo(Mn+8,yn),Z.lineTo(Mn+8+_n,yn-_n),Z.lineTo(Mn+8+_n,yn+_n),Z.closePath(),Z.fill();const lr=Nr(xn.item.term,Xt-26);Z.fillStyle=Y.boxText,Z.font="bold 10px sans-serif",Z.textAlign="left",lr.length===1?Z.fillText(lr[0],Mn+18,yn+4):(Z.fillText(lr[0],Mn+18,yn-2),Z.fillText(lr[1],Mn+18,yn+10)),De.current.push({x:mr,y:zn,width:Xt,height:Zt,year:xn.item.year,itemId:xn.item.id})}}for(let mn=0;mn<Math.min(or.length,fs);mn++){const En=Math.floor(mn/2),Sn=mn%2===0,Wn=Sn?ge-Ot:ge+ag,yn=Sn?Wn-En*Ea:Wn+En*Ea;if(Ca)Z.fillStyle=Y.clipArrow,Z.beginPath(),Z.moveTo(we-Gt,yn),Z.lineTo(we-Gt-_a,yn-_a),Z.lineTo(we-Gt-_a,yn+_a),Z.closePath(),Z.fill();else if(qi){const xn=or[mn],Mn=we-ui-qr,mr=Mn,zn=yn-Jr/2;Z.fillStyle=B?"rgba(42, 42, 62, 0.75)":"rgba(248, 248, 248, 0.75)",Z.beginPath(),Z.roundRect(mr,zn,qr,Jr,2),Z.fill(),Z.strokeStyle=Cd(xn.item.category),Z.lineWidth=2,Z.stroke(),Z.fillStyle=Y.boxSubtext,Z.beginPath(),Z.moveTo(Mn+qr-4,yn),Z.lineTo(Mn+qr-4-Pa,yn-Pa),Z.lineTo(Mn+qr-4-Pa,yn+Pa),Z.closePath(),Z.fill(),Z.fillStyle=Y.boxText,Z.font="bold 8px sans-serif",Z.textAlign="right";const lr=qr-16;let qn=xn.item.term;for(;Z.measureText(qn).width>lr&&qn.length>3;)qn=qn.slice(0,-1);qn!==xn.item.term&&(qn+="…"),Z.fillText(qn,Mn+qr-12,yn+3),De.current.push({x:mr,y:zn,width:qr,height:Jr,year:xn.item.year,itemId:xn.item.id})}else{const xn=or[mn],Mn=we-Gt-Xt,mr=Mn,zn=yn-Zt/2;Z.fillStyle=B?"rgba(42, 42, 62, 0.75)":"rgba(248, 248, 248, 0.75)",Z.beginPath(),Z.roundRect(mr,zn,Xt,Zt,3),Z.fill(),Z.strokeStyle=Cd(xn.item.category),Z.lineWidth=2,Z.stroke(),Z.fillStyle=Y.boxSubtext,Z.beginPath(),Z.moveTo(Mn+Xt-8,
4532yn),Z.lineTo(Mn+Xt-8-_n,yn-_n),Z.lineTo(Mn+Xt-8-_n,yn+_n),Z.closePath(),Z.fill();const lr=Nr(xn.item.term,Xt-26);Z.fillStyle=Y.boxText,Z.font="bold 10px sans-serif",Z.textAlign="right",lr.length===1?Z.fillText(lr[0],Mn+Xt-18,yn+4):(Z.fillText(lr[0],Mn+Xt-18,yn-2),Z.fillText(lr[1],Mn+Xt-18,yn+10)),De.current.push({x:mr,y:zn,width:Xt,height:Zt,year:xn.item.year,itemId:xn.item.id})}}Bt("edgeIndicators");const ja=6,jn=4;let Br=!1,hr=!1,Io=0,Ai=0;for(const[mn,En]of Ke){if(En.hidden)continue;En.row<0?Io=Math.min(Io,En.row):Ai=Math.max(Ai,En.row);const Sn=Ts(En.item.year,it,D);if(Sn<-50||Sn>we+50)continue;const Wn=ot.get(mn)||0,yn=Sn+Wn,xn=ct(En.row),Mn=xn-xt/2,mr=xn+xt/2;if(Z.fillStyle=Cd(En.item.category),Mn<0){Br=!0;const zn=jn;Z.beginPath(),Z.moveTo(yn,zn),Z.lineTo(yn-ja,zn+ja),Z.lineTo(yn+ja,zn+ja),Z.closePath(),Z.fill()}if(mr>st){hr=!0;const zn=st-jn;Z.beginPath(),Z.moveTo(yn,zn),Z.lineTo(yn-ja,zn-ja),Z.lineTo(yn+ja,zn-ja),Z.closePath(),Z.fill()}}We.current={hasClippedAbove:Br,hasClippedBelow:hr,minRowAbove:Io,maxRowBelow:Ai},Bt("clipArrows"),Ce.current=Ke,ke.current=ct,wt()},[S,A,F,Y,t,e,i,s,o,c,f,B,P]);fe.current=Se;const Be=x.useCallback((be,Z)=>{const it=Q.current,we=Ce.current,st=ke.current,Lt=kd*it.scaleY;for(const[,Ot]of we){if(Ot.hidden)continue;const Et=Ts(Ot.item.year,it,D);if(Et<-200||Et>it.width+200)continue;const tt=st(Ot.row),ge=Ot.boxWidth,$=Et-ge/2,xe=tt-Lt/2;if(!(xe+Lt<0||xe>it.height)&&be>=$&&be<=$+ge&&Z>=xe&&Z<=xe+Lt)return Ot.item}return null},[D]),Ze=x.useCallback(be=>{const Z=p.current;if(!Z)return null;const it=Z.getBoundingClientRect(),we=Q.current,st=Ce.current,Lt=ke.current,Ot=kd*we.scaleY,Et=st.get(be);if(!Et||Et.hidden)return null;const tt=Ts(Et.item.year,we,D),ge=Lt(Et.row),$=Et.boxWidth,xe=tt-$/2,ne=ge-Ot/2;return{left:it.left+xe,top:it.top+ne,right:it.left+xe+$,bottom:it.top+ne+Ot}},[D]),ue=x.useRef(null);ue.current=qe;const rt=x.useRef(0),je=x.useCallback(()=>{if(ue.current){const be=Ze(ue.current);be&&$e(be)}},[Ze]),_t=x.useCallback(()=>{const be=ye.current,Z=Q.current;!be.isDragging&&(Math.abs(be.velocityX)>.1||Math.abs(be.velocityY)>.1)&&(Z.offsetX+=be.velocityX,Z.offsetY+=be.velocityY,Me(Z),Ae(Z),be.velocityX*=.95,be.velocityY*=.95,fe.current(),je(),te(),Le.current=requestAnimationFrame(_t))},[Me,Ae,te,je]),Kt=x.useCallback(be=>{const Z=ye.current,it=Re.current;if(q(),it.touches.set(be.pointerId,{x:be.clientX,y:be.clientY}),it.touches.size===1)Z.isDragging=!0,Z.startX=be.clientX,Z.startY=be.clientY,Z.lastX=be.clientX,Z.lastY=be.clientY,Z.velocityX=0,Z.velocityY=0,Z.lastTime=Date.now(),Nt.current=0,vt.current=!1,cancelAnimationFrame(Le.current);else if(it.touches.size===2){vt.current=!0,Ct.current=!0;const[we,st]=Array.from(it.touches.values());it.initialDxFingers=Math.abs(st.x-we.x),it.initialDyFingers=Math.abs(st.y-we.y),it.initialScale=Q.current.scale,it.initialScaleY=Q.current.scaleY,it.initialCenterX=(we.x+st.x)/2,it.initialCenterY=(we.y+st.y)/2}be.target.setPointerCapture(be.pointerId)},[q]),gn=x.useCallback(be=>{const Z=ye.current,it=Re.current,we=Q.current;if(it.touches.set(be.pointerId,{x:be.clientX,y:be.clientY}),it.touches.size===2){const[st,Lt]=Array.from(it.touches.values()),Ot=Math.abs(Lt.x-st.x),Et=Math.abs(Lt.y-st.y),tt=(st.x+Lt.x)/2,ge=(st.y+Lt.y)/2,$=p.current?.getBoundingClientRect(),xe=20;if(it.initialDxFingers>xe){const ne=Ot/it.initialDxFingers,me=Math.max(.2,Math.min(3,it.initialScale*ne));if($){const de=tt-$.left,Ie=me/we.scale;we.offsetX=de-(de-we.offsetX)*Ie}we.scale=me}if(it.initialDyFingers>xe){const ne=Et/it.initialDyFingers,me=Math.max(.5,Math.min(2,it.initialScaleY*ne));if($){const de=ge-$.top,Ie=me/we.scaleY,Ke=pm(we.height);we.offsetY=de-Ke-(de-Ke-we.offsetY)*Ie}we.scaleY=me}Me(we),Ae(we),Se(),je(),te()}else if(Z.isDragging&&it.touches.size===1){const st=be.clientX-Z.lastX,Lt=be.clientY-Z.lastY,Ot=Date.now();Nt.current+=Math.abs(st)+Math.abs(Lt),Nt.current>=Tt&&(vt.current=!0),Z.velocityX=st*.8+Z.velocityX*.2,Z.velocityY=Lt*.8+Z.velocityY*.2,we.offsetX+=st,we.offsetY+=Lt,Me(we),Ae(we),Z.lastX=be.clientX,Z.lastY=be.clientY,Z.lastTime=Ot,Se(),je(),te()}},[Me,Ae,Se,te,je]),_e=x.useCallback(be=>{if(ye.current.isDragging){clearTimeout(ee.current),clearTimeout(ze.current),he(!1);return}const it=p.current?.getBoundingClientRect();if(!it)return;const we=be.clientX-it.left,st=be.clientY-it.top,Lt=Be(we,st);if(Lt?.url){const Ot=be.clientX,Et=be.clientY;clearTimeout(ze.current);
4532const tt=Lt.id!==Ve.current&&Wt?.item.id!==Lt.id;Dt({item:Lt,x:Ot,y:Et}),tt&&(he(!1),Ve.current=Lt.id,clearTimeout(ee.current),ee.current=window.setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{he(!0)})})},lt))}else clearTimeout(ee.current),Ve.current=null,he(!1),clearTimeout(ze.current),ze.current=window.setTimeout(()=>{Dt(null)},500)},[Be,Wt?.item.id]),et=x.useCallback(()=>{clearTimeout(ee.current),Ve.current=null,he(!1),clearTimeout(ze.current),ze.current=window.setTimeout(()=>{Dt(null)},500)},[]),Ge=x.useCallback(be=>{const Z=ye.current,it=Re.current;if(it.touches.delete(be.pointerId),it.touches.size<2&&Ct.current&&(Ct.current=!1,Se()),it.touches.size===0){const we=Nt.current<Tt&&!vt.current;if(Z.isDragging=!1,we){const st=p.current?.getBoundingClientRect();if(st){const Lt=be.clientX-st.left,Ot=be.clientY-st.top,Et=De.current.find(tt=>Lt>=tt.x&&Lt<=tt.x+tt.width&&Ot>=tt.y&&Ot<=tt.y+tt.height);if(Et){const tt=Q.current,{min:ge,max:$}=pe.current,xe=($-ge)*Ps*tt.scale,ne=100;let me=tt.width/2-(Et.year-ge)*Ps*tt.scale;const de=ne,Ie=tt.width-xe-ne;xe+2*ne<tt.width?me=(tt.width-xe)/2:me=Math.max(Ie,Math.min(de,me));const Ke=tt.offsetX,ut=me-Ke,ae=400,Te=performance.now(),Qe=S.find(pt=>pt.id===Et.itemId);Qe&&n?.(Qe);const ot=pt=>{const ct=pt-Te,Vt=Math.min(ct/ae,1),sn=Vt<.5?4*Vt*Vt*Vt:1-Math.pow(-2*Vt+2,3)/2;tt.offsetX=Ke+ut*sn,fe.current(),Vt<1?requestAnimationFrame(ot):te()};requestAnimationFrame(ot)}else{const tt=Be(Lt,Ot);if(tt)if(n?.(tt),qe===tt.id)It(null),Ee(null),$e(null);else{const ge=p.current?.getBoundingClientRect();ge&&(It(tt.id),Ee({x:ge.left+Lt,y:ge.top+Ot}),$e(Ze(tt.id)))}else n?.(null),It(null),Ee(null),$e(null)}}}else(Math.abs(Z.velocityX)>.5||Math.abs(Z.velocityY)>.5)&&(Le.current=requestAnimationFrame(_t))}else if(it.touches.size===1){const[we]=Array.from(it.touches.values());Z.lastX=we.x,Z.lastY=we.y,Z.lastTime=Date.now()}be.target.releasePointerCapture(be.pointerId)},[_t,Be,Se,te,qe,n,Ze,S]),ht=x.useCallback(be=>{be.preventDefault(),q();const Z=Q.current,it=p.current?.getBoundingClientRect();if(!it)return;const we=be.clientX-it.left,st=be.clientY-it.top,Ot=(Math.abs(be.deltaY)>=Math.abs(be.deltaX)?be.deltaY:be.deltaX)>0?.9:1.1;if(be.shiftKey){const Et=Math.max(.5,Math.min(2,Z.scaleY*Ot)),tt=Et/Z.scaleY,ge=pm(Z.height);Z.offsetY=st-ge-(st-ge-Z.offsetY)*tt,Z.scaleY=Et}else{const Et=Math.max(.2,Math.min(3,Z.scale*Ot)),tt=Et/Z.scale;Z.offsetX=we-(we-Z.offsetX)*tt,Z.scale=Et}Me(Z),Ae(Z),Se(),je(),te()},[Me,Ae,Se,te,je,q]);x.useEffect(()=>{const be=p.current,Z=b.current;if(!be||!Z)return;const it=()=>{const Lt=Z.clientWidth,Ot=Z.clientHeight,Et=window.devicePixelRatio||1,tt=window.outerWidth/window.innerWidth,$=Et<tt*.9?Et*tt:Et;be.width=Lt*$,be.height=Ot*$,be.style.width=`${Lt}px`,be.style.height=`${Ot}px`;const xe=be.getContext("2d");xe&&xe.scale($,$),Q.current.width=Lt,Q.current.height=Ot,Se()};it(),window.addEventListener("resize",it);let we=null;const st=()=>{we?.();const Lt=`(resolution: ${window.devicePixelRatio}dppx)`,Ot=matchMedia(Lt),Et=()=>{it(),st()};Ot.addEventListener("change",Et),we=()=>Ot.removeEventListener("change",Et)};return st(),be.addEventListener("wheel",ht,{passive:!1}),()=>{window.removeEventListener("resize",it),we?.(),be.removeEventListener("wheel",ht),cancelAnimationFrame(Le.current)}},[ht,Se]),x.useEffect(()=>{Se()},[Se]),x.useEffect(()=>{if(!qe)return;const be=()=>{Se(),je()};return window.addEventListener("resize",be),()=>window.removeEventListener("resize",be)},[qe,Se,je]);const ft=x.useCallback(()=>{It(null),Ee(null),$e(null)},[]),Mt=x.useCallback(be=>{const Z=p.current;if(!Z)return;const it=Q.current,we=Z.width/(window.devicePixelRatio||1),st=Z.height/(window.devicePixelRatio||1);X(0);const Lt=(be.year-D)*Ps,Ot=we/2-Lt*it.scale,Et=it.offsetX,tt=400,ge=performance.now(),$=xe=>{const ne=xe-ge,me=Math.min(ne/tt,1),de=1-Math.pow(1-me,3);if(it.offsetX=Et+(Ot-Et)*de,fe.current(),me<1)requestAnimationFrame($);else{const Ie=Z.getBoundingClientRect();It(be.id),Ee({x:Ie.left+we/2,y:Ie.top+st/2}),setTimeout(()=>{$e(Ze(be.id)),setTimeout(()=>X(1),50)},0),te(),t&&n&&n(be)}};requestAnimationFrame($)},[D,te,t,n,Ze]);return r.jsxs("div",{ref:b,className:"w-full h-full relative",style:{touchAction:"none",background:B?"#1a1a2e":"#ffffff"},children:[r.jsx("canvas",{ref:p,onPointerDown:Kt,onPointerMove:gn,onPointerUp:Ge,onPointerCancel:Ge,onMouseMove:_e,onMouseLeave:et,className:Wt||qe?"curs
4532or-pointer":"cursor-grab active:cursor-grabbing",role:"img","aria-label":`Interactive timeline visualization of XR history from 1838 to present, displaying ${S.length} entries across categories: Products, Research, Concepts, Infrastructure, Events, and Fiction. Use the Table view toggle for an accessible alternative.`,tabIndex:0}),Wt&&Wt.item.links?.length>0&&r.jsx("div",{className:`fixed z-50 px-2 py-1 text-xs rounded shadow-lg pointer-events-none max-w-xs truncate ${B?"bg-slate-700 text-gray-200":"bg-gray-800 text-white"}`,style:{left:Wt.x+12,top:Wt.y+12,opacity:jt?1:0,transition:"opacity 0.5s ease-in-out"},children:Wt.item.links[0].label||Wt.item.links[0].url}),r.jsxs("div",{className:`absolute top-3 left-3 z-20 inline-block backdrop-blur-sm border rounded-lg shadow-sm text-xs ${B?"bg-slate-800/90 border-slate-600":"bg-white/90 border-gray-200"}`,onPointerDown:U,onMouseEnter:U,onMouseMove:U,children:[r.jsxs("button",{onClick:()=>I(!O),className:`flex items-center gap-1.5 font-semibold text-[11px] w-full px-2 py-1 ${B?"text-gray-200 hover:text-white":"text-gray-700 hover:text-gray-900"}`,"aria-expanded":!O,children:[r.jsx("svg",{className:`w-3 h-3 transition-transform ${O?"-rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"Categories"]}),!O&&r.jsx(xre,{categoryStates:F,isDark:B,onToggle:be=>{U(),H(be)},onPlace:(be,Z)=>{U(),J(be,Z)}})]}),qe&&gt&&(()=>{const be=S.find(ne=>ne.id===qe);if(!be)return null;const Z=be.term.toLowerCase(),it=S.filter(ne=>ne.id!==qe&&ne.term.toLowerCase()===Z).sort((ne,me)=>ne.year-me.year),we=it.filter(ne=>ne.year<be.year).pop()||null,st=it.find(ne=>ne.year>be.year)||null,Ot=qa.find(ne=>ne.id===be.category)?.color||"#888888",Et=p.current?.getBoundingClientRect(),tt=Et?{left:Et.left,top:Et.top,right:Et.right,bottom:Et.bottom}:void 0,ge=Q.current.height,$=ge>0?pm(ge)+Q.current.offsetY:0,xe=Et&&ge>0?Et.top+$:void 0;return r.jsx(cre,{item:be,position:gt,itemBox:Je||void 0,canvasBounds:tt,axisY:xe,categoryColor:Ot,onClose:ft,isDark:B,editorMode:t,olderItem:we,newerItem:st,onNavigate:Mt,allItems:S,connectorLinesOpacity:Xe})})()]})}function vre(t){return{term:t.term,year:t.year,yearDisplay:t.yearDisplay,names:t.names||"",category:t.category,subcategory:t.subcategory||"",description:t.body||"",sources:(t.links||[]).map(e=>({url:e.url,label:e.label||""})),...t.image&&{image:t.image},...t.altText&&{altText:t.altText}}}const yre={products:"Products",research:"Research",concepts:"Concepts",infrastructure:"Infrastructure",events:"Events",fiction:"Fiction"};function bre({items:t,onSelectItem:e}){const[n,a]=x.useState("year"),[i,s]=x.useState("asc"),[o,c]=x.useState(null),[d,m]=x.useState("all"),f=x.useMemo(()=>{let F=t;return d!=="all"&&(F=t.filter(w=>w.category===d)),[...F].sort((w,A)=>{let N=0;switch(n){case"year":N=w.year-A.year;break;case"term":N=w.term.localeCompare(A.term);break;case"category":N=w.category.localeCompare(A.category);break;case"names":N=(w.names||"").localeCompare(A.names||"");break}return i==="asc"?N:-N})},[t,n,i,d]),p=F=>{n===F?s(w=>w==="asc"?"desc":"asc"):(a(F),s("asc"))},b=({field:F})=>n!==F?null:i==="asc"?r.jsx(gl,{className:"w-4 h-4 inline ml-1"}):r.jsx(Ja,{className:"w-4 h-4 inline ml-1"}),v=F=>{c(w=>w===F.id?null:F.id),e?.(F)},C=(F,w)=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),v(w))},S=x.useCallback(()=>{const F=t.map(vre),w=JSON.stringify(F,null,2),A=new Blob([w],{type:"application/json"}),N=URL.createObjectURL(A),P=document.createElement("a");P.href=N,P.download=`xr-timeline-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(P),P.click(),document.body.removeChild(P),URL.revokeObjectURL(N)},[t]);return r.jsxs("div",{className:"w-full",role:"region","aria-label":"Timeline of XR history",children:[r.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":"Filter by category",children:[r.jsxs(Fe,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>m("all"),"aria-pressed":d==="all",children:["All (",t.length,")"]}),qa.map(F=>{const w=t.filter(A=>A.category===F.id).length;return r.jsxs(Fe,{variant:d===F.id?"default":"outline",size:"sm",onClick:()=>m(F.id),"aria-pressed":d===F.id,style:{borderColor:d===F.id?F.color:void 0},children:[F.label," (",w,")"]},F.id)})]}),r.jsx("div",{className:"ml-auto",children:r.jsxs(Fe,{variant:"outline",size:"sm",onClick:S,className:"gap-1",children:[r.jsx(F1,{className:"w-4 h-4"}),"Download JSON"]})})]}),r.jsx("div",{className:"border rounded-lg overflow-hidden",children:r.jsxs("table",{className:"w-full",role:"grid","aria-label":"Timeline entries",children:[r.jsx("thead",{className:"bg-muted",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"w-8 p-2","aria-label":"Expand row"}),r.jsxs("th",{scope:"col",className:"p-2 text-left font-semibold cursor-pointer hover:bg-muted/80 transition-colors",onClick:()=>p("year"),onKeyDown:F=>F.key==="Enter"&&p("year"),tabIndex:0,role:"columnheader","aria-sort":n==="year"?i==="asc"?"ascending":"descending":"none",children:["Year ",r.jsx(b,{field:"year"})]}),r.jsxs("th",{scope:"col",className:"p-2 text-left font-semibold cursor-pointer hover:bg-muted/80 transition-colors",onClick:()=>p("term"),onKeyDown:F=>F.key==="Enter"&&p("term"),tabIndex:0,role:"columnheader","aria-sort":n==="term"?i==="asc"?"ascending":"descending":"none",children:["Term ",r.jsx(b,{field:"term"})]}),r.jsxs("th",{scope:"col",className:"p-2 text-left font-semibold cursor-pointer hover:bg-muted/80 transition-colors hidden sm:table-cell",onClick:()=>p("category"),onKeyDown:F=>F.key==="Enter"&&p("category"),tabIndex:0,role:"columnheader","aria-sort":n==="category"?i==="asc"?"ascending":"descending":"none",children:["Category ",r.jsx(b,{field:"category"})]}),r.jsxs("th",{scope:"col",className:"p-2 text-left font-semibold cursor-pointer hover:bg-muted/80 transition-colors hidden md:table-cell",onClick:()=>p("names"),onKeyDown:F=>F.key==="Enter"&&p("names"),tabIndex:0,role:"columnheader","aria-sort":n==="names"?i==="asc"?"ascending":"descending":"none",children:["Attribution ",r.jsx(b,{field:"names"})]})]})}),r.jsx("tbody",{children:f.map((F,w)=>r.jsxs(r.Fragment,{children:[r.jsxs("tr",{className:`border-t cursor-pointer hover:bg-muted/50 transition-colors ${o===F.id?"bg-muted/30":""}`,onClick:()=>v(F),onKeyDown:A=>C(A,F),tabIndex:0,role:"row","aria-expanded":o===F.id,"aria-rowindex":w+2,children:[r.jsx("td",{className:"p-2 text-center",role:"gridcell",children:r.jsx(nh,{className:`w-4 h-4 transition-transform ${o===F.id?"rotate-90":""}`,"aria-hidden":"true"})}),r.jsx("td",{className:"p-2 font-mono text-sm",role:"gridcell",children:F.yearDisplay}),r.jsx("td",{className:"p-2 font-medium",role:"gridcell",children:F.term}),r.jsx("td",{className:"p-2 hidden sm:table-cell",role:"gridcell",children:r.jsx("span",{className:"inline-block px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${qa.find(A=>A.id===F.category)?.color}20`,color:qa.find(A=>A.id===F.category)?.color},children:yre[F.category]})}),r.jsx("td",{className:"p-2 text-muted-foreground text-sm hidden md:table-cell",role:"gridcell",children:F.names||"-"})]},F.id),o===F.id&&r.jsx("tr",{className:"bg-muted/20",children:r.jsx("td",{colSpan:5,className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex gap-4",children:[F.image&&r.jsx("img",{src:F.image,alt:F.altText||F.term,title:F.altText,className:"w-32 h-24 object-contain rounded border bg-white"}),r.jsxs("div",{className:"flex-1",children:[F.subcategory&&r.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:F.subcategory}),F.body?r.jsx("p",{className:"text-sm",children:F.body}):r.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No description available."})]})]}),F.links&&F.links.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs font-semibold text-muted-foreground mb-1",children:"Sources"}),r.jsx("ul",{className:"space-y-1",children:F.links.map((A,N)=>r.jsx("li",{children:r.jsxs("a",{href:A.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 dar
4532k:text-blue-400 hover:underline inline-flex items-center gap-1",children:[A.label||new URL(A.url).hostname,r.jsx(_i,{className:"w-3 h-3","aria-hidden":"true"}),r.jsx("span",{className:"sr-only",children:"(opens in new tab)"})]})},N))})]})]})})},`${F.id}-details`)]}))})]})}),r.jsxs("p",{className:"sr-only",role:"status","aria-live":"polite",children:["Showing ",f.length," of ",t.length," timeline entries, sorted by ",n," in ",i==="asc"?"ascending":"descending"," order."]})]})}function wre(t,e){const n=t.toLowerCase(),a=e.toLowerCase();if(a===n)return{matches:!0,score:100};if(a.startsWith(n))return{matches:!0,score:90};if(a.includes(n))return{matches:!0,score:80};let i=0,s=0,o=-2;for(let c=0;c<a.length&&i<n.length;c++)a[c]===n[i]&&(c===o+1&&(s+=5),o=c,i++);if(i===n.length){const c=50+s-(a.length-n.length);return{matches:!0,score:Math.max(10,c)}}return{matches:!1,score:0}}function yg({items:t,onSelect:e,placeholder:n="Search timeline..."}){const[a,i]=x.useState(""),[s,o]=x.useState(!1),[c,d]=x.useState(0),m=x.useRef(null),f=x.useRef(null),p=a.length>=2?t.map(S=>({item:S,...wre(a,S.term)})).filter(S=>S.matches).sort((S,F)=>F.score-S.score).slice(0,10).map(S=>S.item):[];x.useEffect(()=>{d(0)},[p.length]),x.useEffect(()=>{s&&f.current&&f.current.children[c]?.scrollIntoView({block:"nearest"})},[c,s]);const b=x.useCallback(S=>{e(S),i(""),o(!1),m.current?.blur()},[e]),v=x.useCallback(S=>{if(!s||p.length===0){S.key==="Escape"&&(i(""),m.current?.blur());return}switch(S.key){case"ArrowDown":S.preventDefault(),d(F=>Math.min(F+1,p.length-1));break;case"ArrowUp":S.preventDefault(),d(F=>Math.max(F-1,0));break;case"Enter":S.preventDefault(),p[c]&&b(p[c]);break;case"Escape":S.preventDefault(),o(!1),i(""),m.current?.blur();break}},[s,p,c,b]),C=()=>{i(""),o(!1),m.current?.focus()};return r.jsxs("div",{className:"relative w-full max-w-sm",children:[r.jsxs("div",{className:"relative",children:[r.jsx(Eu,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx(un,{ref:m,type:"text",value:a,onChange:S=>{i(S.target.value),o(S.target.value.length>=2)},onFocus:()=>a.length>=2&&o(!0),onBlur:()=>{setTimeout(()=>o(!1),150)},onKeyDown:v,placeholder:n,className:"pl-9 pr-8"}),a&&r.jsx("button",{type:"button",onClick:C,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground",children:r.jsx(gr,{className:"w-4 h-4"})})]}),s&&p.length>0&&r.jsx("div",{ref:f,className:"absolute top-full left-0 right-0 mt-1 bg-popover border rounded-md shadow-lg max-h-64 overflow-y-auto z-50",children:p.map((S,F)=>r.jsxs("button",{type:"button",className:`w-full px-3 py-2 text-left flex items-center justify-between hover:bg-accent ${F===c?"bg-accent":""}`,onMouseDown:()=>b(S),onMouseEnter:()=>d(F),children:[r.jsx("span",{className:"font-medium truncate",children:S.term}),r.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:S.yearDisplay})]},S.id))}),s&&a.length>=2&&p.length===0&&r.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border rounded-md shadow-lg p-3 text-sm text-muted-foreground z-50",children:"No results found"})]})}function TE(){const[t,e]=x.useState([]),[n,a]=x.useState(null),[i,s]=x.useState("canvas"),[o,c]=x.useState(null);x.useEffect(()=>{fetch("/api/timeline").then(p=>p.json()).then(p=>e(p)).catch(p=>console.error("Failed to load timeline:",p))},[]);const d=x.useCallback(p=>{a(p.id)},[]),m=x.useCallback(()=>{a(null)},[]),f=x.useCallback(p=>{c(p?.id??null)},[]);return r.jsxs("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[r.jsx("div",{className:"landscape:hidden lg:landscape:block",children:r.jsx(Os,{})}),r.jsxs("div",{className:"flex-1 pt-24 pb-4 px-4 flex flex-col min-h-0 landscape:hidden lg:landscape:flex",children:[r.jsxs("div",{className:"shrink-0 mb-3 flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"shrink-0",children:[r.jsx("h1",{className:"text-2xl font-bold",children:"Timeline of XR"}),r.jsx("p",{className:"text-muted-foreground text-sm hidden md:block",children:i==="canvas"?"Drag to pan, scroll to zoom. Touch: one finger to pan, two fingers to zoom.":"Click column headers to sort. Click rows to expand details."})]}),i==="canvas"&&r.jsx("div",{className:"hidden md:flex flex-1 justify-center max-w-sm",children:r.jsx(yg,{items:t,onSelect:d})}),r.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[r.jsxs("div",{className:"flex border rounded-lg overflow-hidden text-sm",role:"group","aria-label":"View mode",children:[r.jsx(Fe,{variant:i==="c
4532anvas"?"default":"ghost",size:"sm",onClick:()=>s("canvas"),"aria-pressed":i==="canvas",className:"rounded-none px-3",children:"Visual"}),r.jsx(Fe,{variant:i==="table"?"default":"ghost",size:"sm",onClick:()=>s("table"),"aria-pressed":i==="table",className:"rounded-none px-3",children:"Table"})]}),r.jsxs(xo,{to:"/member?redirect=/member/timeline-editor",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[r.jsx(Sg,{className:"w-4 h-4"}),r.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})]})]}),i==="canvas"?r.jsxs("div",{className:"flex-1 min-h-0 border rounded-lg overflow-hidden bg-white dark:bg-slate-900 relative",children:[r.jsx(p1,{items:t,focusItemId:n,onFocusComplete:m,selectedItemId:o,onSelectItem:f}),r.jsx("div",{className:"md:hidden absolute bottom-3 left-1/2 -translate-x-1/2 w-64",children:r.jsx(yg,{items:t,onSelect:d,placeholder:"Search..."})})]}):r.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:r.jsx(bre,{items:t})})]}),r.jsxs("div",{className:"hidden landscape:block lg:landscape:hidden h-full w-full relative",children:[r.jsx("div",{className:"absolute inset-0 bg-white dark:bg-slate-900",children:r.jsx(p1,{items:t,focusItemId:n,onFocusComplete:m,selectedItemId:o,onSelectItem:f})}),r.jsx("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 pointer-events-none",children:r.jsx("h1",{className:"text-lg font-bold text-foreground/80 bg-background/70 backdrop-blur-sm px-4 py-1 rounded-full shadow-sm",children:"Timeline of XR"})}),r.jsx("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 w-64",children:r.jsx(yg,{items:t,onSelect:d,placeholder:"Search..."})}),r.jsxs(xo,{to:"/member?redirect=/member/timeline-editor",className:"absolute top-3 right-3 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors bg-background/70 backdrop-blur-sm px-2 py-1 rounded-full shadow-sm",children:[r.jsx(Sg,{className:"w-3 h-3"}),"Edit"]})]})]})}function Sre({open:t,sessionId:e,onClose:n}){const[a,i]=x.useState(!1),[s,o]=x.useState(!1),c=async()=>{if(a&&e){o(!0);try{await fetch("/api/member/timeline/member",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":e},body:JSON.stringify({noSplash:!0})})}catch(d){console.error("Failed to save splash preference:",d)}o(!1)}n(a)};return r.jsx(Sa,{open:t,onOpenChange:()=>c(),children:r.jsxs(da,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(ha,{children:[r.jsx(ma,{className:"text-xl",children:"Welcome to the Timeline Editor"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Curated by the members of the XR Guild"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6 text-sm text-muted-foreground py-2",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Educational Resource"}),r.jsx("p",{className:"mt-1",children:"This is a free resource for documenting our field's history. Use your best ethical judgement for any additions."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Approval Process"}),r.jsx("p",{className:"mt-1",children:"New editors' contributions enter an approval queue. You'll see your own edits, and we'll notify you when they're approved."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Content Guidelines"}),r.jsxs("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[r.jsx("li",{children:"Descriptions should be 1-2 sentences; link sources for more info"}),r.jsx("li",{children:"Use 'merge' to combine duplicates at the same point in time"}),r.jsx("li",{children:"Use 'Related' sparingly to connect threads across time"}),r.jsx("li",{children:"Document existing terms/products, not personal opinions or promotions"})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Image Rights"}),r.jsxs("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[r.jsx("li",{children:"No AI-generated art unless properly licensed"}),r.jsx("li",{children:'Use only "free to use" images (Creative 
4532Commons, etc.)'}),r.jsx("li",{children:"Add attribution to the description if required by license"}),r.jsx("li",{children:"Avoid images with visible watermarks"}),r.jsx("li",{children:"Always add alt-text for accessibility"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Codes of Conduct"}),r.jsx("p",{className:"mt-1",children:"All content must conform to:"}),r.jsxs("ul",{className:"list-disc pl-5 space-y-1 mt-1",children:[r.jsx("li",{children:r.jsxs("a",{href:"https://www.w3.org/policies/code-of-conduct/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",children:["W3C Code of Conduct ",r.jsx(_i,{className:"h-3 w-3"})]})}),r.jsx("li",{children:r.jsxs("a",{href:"https://www.w3.org/WAI/standards-guidelines/wcag/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",children:["WCAG Accessibility Guidelines ",r.jsx(_i,{className:"h-3 w-3"})]})})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Becoming an Editor"}),r.jsx("p",{className:"mt-1",children:"Make great contributions and you may be promoted to editor status, allowing you to edit without approval and help approve others' work."})]})]})]}),r.jsxs(_o,{className:"flex-col sm:flex-row gap-4 sm:gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"dont-show-again",checked:a,onCheckedChange:d=>i(d===!0)}),r.jsx(Ht,{htmlFor:"dont-show-again",className:"text-sm cursor-pointer",children:"Don't show this again"})]}),r.jsx(Fe,{onClick:c,disabled:s,children:s?"Saving...":"Got it, let me edit!"})]})]})})}const Fre=1e3,Cre=3e4;function _re(t){const[e,n]=x.useState(!1),[a,i]=x.useState(new Map),s=x.useRef(null),o=x.useRef(0),c=x.useRef(null),d=x.useRef(null),m=x.useRef(null),f=x.useRef(null),p=x.useRef(null),b=x.useCallback(()=>t?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?sessionId=${t}`:null,[t]),v=x.useCallback(D=>{switch(D.type){case"connected":console.log("[TimelineWS] Connected to server");break;case"timeline-item-editing":{const T=D.data;i(K=>{const B=new Map(K);return T.editor?B.set(T.itemId,{editor:T.editor,term:T.term}):B.delete(T.itemId),B});break}case"timeline-item-locked":{const T=D.data;console.log("[TimelineWS] Item locked:",T),f.current?.(T);break}case"timeline-item-lock-acquired":{const T=D.data;console.log("[TimelineWS] Lock acquired:",T),i(K=>{const B=new Map(K);return B.delete(T.itemId),B}),p.current?.(T);break}case"timeline-item-queue-cleared":{const T=D.data;console.log("[TimelineWS] Queue cleared:",T),i(K=>{const B=new Map(K);return B.delete(T.itemId),B});break}case"timeline-item-saved":{const T=D.data;console.log("[TimelineWS] Item saved:",T),i(K=>{const B=new Map(K);return B.delete(T.itemId),B}),d.current?.(T);break}case"timeline-feedback-update":{const T=D.data;m.current?.(T);break}}},[]),C=x.useCallback(()=>{const D=b();if(!D){console.log("[TimelineWS] No URL - sessionId not available");return}console.log("[TimelineWS] Connecting...");const T=new WebSocket(D);s.current=T,T.onopen=()=>{console.log("[TimelineWS] Connected"),n(!0),o.current=0},T.onmessage=K=>{try{const B=JSON.parse(K.data);v(B)}catch(B){console.error("[TimelineWS] Error parsing message:",B)}},T.onclose=K=>{console.log("[TimelineWS] Disconnected:",K.code,K.reason),n(!1),s.current=null,S()},T.onerror=K=>{console.error("[TimelineWS] Error:",K)}},[b,v]),S=x.useCallback(()=>{c.current&&clearTimeout(c.current);const D=Math.min(Fre*Math.pow(2,o.current),Cre);console.log(`[TimelineWS] Reconnecting in ${D}ms (attempt ${o.current+1})`),c.current=setTimeout(()=>{o.current++,C()},D)},[C]),F=x.useCallback((D,T)=>{if(!s.current||s.current.readyState!==WebSocket.OPEN){console.warn("[TimelineWS] Cannot send focus - not connected");return}s.current.send(JSON.stringify({type:"timeline-presence",action:"focus",data:{itemId:D,term:T}}))},[]),w=x.useCallback(D=>{if(!s.current||s.current.readyState!==WebSocket.OPEN){console.warn("[TimelineWS] Cannot send blur - not connected");return}s.current.send(JSON.stringify({type:"timeline-presence",action:"blur",data:{itemId:D}}))},[]),A=x.useCallback(D=>{d.current=D},[]),N=x.useCallback(D=>{m.current=D},[]),P=x.useCallback(D=>{f.current=D},[]),z=x.useCallback(D=>{p.current=D},[]);return x.useEffect(()=>(t&&C(),()=>{c.current&&clearTimeout(c.current),s.current&&s.current.close()}),[t,C]),{isConnected:e,editingItems:a,sendFocus:F,sendBlur:w,onItemSaved:A,onFeedbackUpdate:N,onItemLocked:P,onLockAcquired:z}}const ME=[{id:"not-appropriate",label:"Not appropriate for this feature"},{id:"redundant",label:"Possibly redundant, please check existing entries"},{id:"needs-source",label:"Needs a credible source or citation"},{id:"inaccurate",label:"Contains inaccurate information"}];function Ere(t){const e=t.trim(),n=e.match(/^(\d{4})s$/);if(n)return parseInt(n[1]);const a=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(a){const o=parseInt(a[1]),c=parseInt(a[2]),d=parseInt(a[3]),m=(c-1)*30.44+d;return o+m/365}const i=e.match(/^(\d{4})-(\d{2})$/);if(i){const o=parseInt(i[1]),c=parseInt(i[2]);return o+(c-1)/12}const s=e.match(/^(\d{4})$/);return s?parseInt(s[1]):2e3}const ig={term:"",yearDisplay:"",names:"",category:"concepts",subcategory:"",body:"",links:[],priority:0,locked:!1,image:"",altText:""};function kre(){const t=_r(),[e,n]=x.useState(!0),[a,i]=x.useState(!1),[s,o]=x.useState(""),[c,d]=x.useState(""),[m,f]=x.use
4532State(!1),[p,b]=x.useState(!1),[v,C]=x.useState(!1),[S,F]=x.useState([]),[w,A]=x.useState([]),[N,P]=x.useState(!1),[z,D]=x.useState(!1),[T,K]=x.useState(!1),[B,k]=x.useState(null),[O,I]=x.useState(""),[j,U]=x.useState(!0),[q,Y]=x.useState(null),[W,H]=x.useState(null),[J,ie]=x.useState(ig),[Q,ve]=x.useState(!1),[pe,Me]=x.useState(!1),[We,Ae]=x.useState(!1),[Ce,He]=x.useState(null),[Ct,bt]=x.useState(""),[Rt,zt]=x.useState(null),[Ut,Bt]=x.useState(null),{isConnected:re,editingItems:wt,sendFocus:Nt,sendBlur:vt,onItemSaved:Tt,onFeedbackUpdate:Wt,onItemLocked:Dt,onLockAcquired:jt}=_re(c||null),he=W&&wt.has(W.id)&&Ut,ee=W?.locked&&!m||!!he,ze=x.useMemo(()=>{if(!J.term.trim()||J.term.length<2)return[];const ne=J.term.toLowerCase().trim(),me=W?.relatedItems||[];return S.filter(de=>{if(W&&de.id===W.id)return!1;const Ie=de.term.toLowerCase();return Ie===ne||Ie.includes(ne)||ne.includes(Ie)}).sort((de,Ie)=>{const Ke=me.includes(de.id)?1:0,ut=me.includes(Ie.id)?1:0;return Ke!==ut?Ke-ut:de.year-Ie.year}).slice(0,10)},[J.term,S,W]),Ve=x.useMemo(()=>{const ne=new Set,me=new Map;for(const de of S){const Ie=de.term.toLowerCase().trim();me.has(Ie)||me.set(Ie,[]),me.get(Ie).push(de)}for(const[,de]of me)if(de.length>1)for(const Ie of de)de.some(ut=>ut.id!==Ie.id&&!Ie.relatedItems?.includes(ut.id))&&ne.add(Ie.id);return ne},[S]),lt=x.useMemo(()=>{if(!Ct.trim()||Ct.length<2||!W)return[];const ne=Ct.toLowerCase().trim(),me=W.relatedItems||[];return S.filter(de=>de.id===W.id||me.includes(de.id)?!1:de.term.toLowerCase().includes(ne)).sort((de,Ie)=>{const Ke=de.term.toLowerCase()===ne?0:1,ut=Ie.term.toLowerCase()===ne?0:1;return Ke!==ut?Ke-ut:de.term.localeCompare(Ie.term)}).slice(0,3)},[Ct,S,W]),[qe,It]=x.useState([]),[gt,Ee]=x.useState({}),[Je,$e]=x.useState(0),[Xe,X]=x.useState(!1),ke=x.useRef(null),[De,oe]=x.useState(!1),[te,ye]=x.useState(!1),[Re,Le]=x.useState([]),[fe,Se]=x.useState(""),Be=Q||Xe||Je>0,Ze=Q||Xe,ue=x.useMemo(()=>{if(!B)return new Set(S.filter(me=>me.Created).map(me=>me.id));const ne=new Date(B).getTime();return new Set(S.filter(me=>me.Created&&new Date(me.Created).getTime()>ne).map(me=>me.id))},[S,B]),rt=x.useMemo(()=>{const ne=N?[...S,...w]:S;return W&&(Xe||Je>0)?ne.map(me=>me.id===W.id?{...me,term:J.term,year:Ere(J.yearDisplay),yearDisplay:J.yearDisplay,names:J.names,category:J.category,subcategory:J.subcategory,body:J.body,links:J.links,priority:J.priority,image:J.image,deleted:!1}:me):ne},[S,w,N,W,J,Xe,Je]),je=x.useMemo(()=>{let ne=w.length;return W?.deleted&&(Xe||Je>0)&&ne--,Math.max(0,ne)},[w,W,Xe,Je]);x.useEffect(()=>{(async()=>{let me=sessionStorage.getItem("memberSession");if(!me)try{const de=await fetch("/api/validateSession",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(de.ok){const Ie=await de.json();Ie.valid&&Ie.sessionId&&(me=Ie.sessionId,sessionStorage.setItem("memberSession",me))}}catch{}if(!me){t("/member?redirect=/member/timeline-editor");return}try{const de=await fetch("/api/validateSession",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":me}});if(de.ok){const Ie=await de.json();Ie.valid?(i(!0),o(Ie.email||""),d(me),I(Ie.memberKey||""),k(Ie.timelineEditSession||null),f(Ie.isTimelineEditor||!1),b(Ie.editsRequireApproval||!1),Ie.timelineNoSplash||C(!0)):(sessionStorage.removeItem("memberSession"),t("/member?redirect=/member/timeline-editor"))}else t("/member?redirect=/member/timeline-editor")}catch{t("/member?redirect=/member/timeline-editor")}finally{n(!1)}})()},[t]),x.useEffect(()=>{if(!a)return;(async()=>{try{const[me,de]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(me.ok){const Ie=await me.json();F(Ie)}else He("Failed to load timeline data");if(de.ok){const Ie=await de.json();A(Ie)}}catch{He("Failed to connect to server")}finally{U(!1)}})()},[a]),x.useEffect(()=>{Tt(ne=>{console.log("[Editor] Item saved by another editor:",ne),W?.id===ne.itemId&&Bt(null),fetch("/api/timeline?includePending=true").then(me=>me.json()).then(me=>F(me)).catch(me=>console.error("Failed to refresh items:",me))}),Wt(ne=>{F(me=>me.map(de=>de.id===ne.itemId?{...de,feedback:ne.feedback}:de))}),Dt(ne=>{Bt(ne.lockedBy),zt(`"${ne.term||"This item"}" is being edited by ${ne.lockedBy}`),setTimeout(()=>zt(null),5e3)}),jt(ne=>{console.log("[Editor] Lock acquired for item:",ne.itemId),W?.id===ne.itemId&&(Bt(null),zt(`You now have the lock on "${ne.term||"this item"}"`),setTimeout(()=>zt(null),3e3))})},[Tt,Wt,Dt,jt,W?.id]);const _t=()=>{sessionStorage.removeItem("memberSession"),t("/timeline")},Kt=async()=>
4532{if(!(!c||!O))try{const ne=await fetch("/api/updateTimelineEditSession",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":c},body:JSON.stringify({memberKey:O})});if(ne.ok){const me=await ne.json();me.success&&me.timelineEditSession&&(k(me.timelineEditSession),D(!1))}}catch{}},gn=x.useCallback(async ne=>{if(W&&re&&vt(W.id),H(ne),ve(!1),He(null),It([]),Ee({}),$e(0),X(!1),bt(""),Bt(null),ne){re&&Nt(ne.id,ne.term),ie({term:ne.term,yearDisplay:ne.yearDisplay,names:ne.names||"",category:ne.category,subcategory:ne.subcategory||"",body:ne.body||ne.footnote||"",links:ne.links||(ne.url?[{url:ne.url,label:""}]:[]),priority:ne.priority||0,locked:ne.locked||!1,image:ne.image||"",altText:ne.altText||""});try{const me=await fetch(`/api/member/timeline/item/${ne.id}/history`);if(me.ok){const de=await me.json();de.history&&de.history.length>0&&It(de.history),de.editors&&Ee(de.editors)}}catch{}}else ie(ig)},[W,re,vt,Nt]),_e=x.useCallback(ne=>{Y(ne.id)},[]),et=x.useCallback(()=>{Y(null)},[]),Ge=x.useCallback(ne=>{if(ne?.id!==W?.id){if(Ze&&W){ke.current=ne,oe(!0);return}gn(ne)}},[W,Ze,gn]),ht=()=>{H(null),ve(!0),ie(ig),He(null),It([]),Ee({}),$e(0),X(!1)},ft=()=>{W&&re&&vt(W.id),H(null),ve(!1),ie(ig),He(null),It([]),Ee({}),$e(0),X(!1)},Mt=()=>{oe(!1);const ne=ke.current;ke.current=null,ne!=="pending"&&gn(ne)},be=async()=>{if(oe(!1),await st()){const me=ke.current;ke.current=null,me!=="pending"&&gn(me)}},Z=ne=>{$e(ne),X(!1);const me=qe[ne];me&&ie({term:me.term,yearDisplay:me.yearDisplay,names:me.names||"",category:me.category,subcategory:me.subcategory||"",body:me.body||me.footnote||"",links:me.links||(me.url?[{url:me.url,label:""}]:[]),priority:me.priority||0,locked:me.locked||!1,image:me.image||"",altText:me.altText||""})},it=(ne,me)=>{ie(de=>({...de,[ne]:me})),X(!0)},we=(ne,me)=>{const de=/\{(\d+)\}/g,Ie=[];let Ke;for(;(Ke=de.exec(ne))!==null;){const ot=parseInt(Ke[1]);!Ie.includes(ot)&&ot>=1&&ot<=me.length&&Ie.push(ot)}if(Ie.length===0)return{body:ne,links:me};const ut={};Ie.forEach((ot,pt)=>
4532{ut[ot]=pt+1});const ae=ne.replace(/\{(\d+)\}/g,(ot,pt)=>{const ct=parseInt(pt);return ut[ct]!==void 0?`{${ut[ct]}}`:ot}),Te=[],Qe=new Set;return Ie.forEach(ot=>{const pt=ot-1;pt>=0&&pt<me.length&&(Te.push(me[pt]),Qe.add(pt))}),me.forEach((ot,pt)=>{Qe.has(pt)||Te.push(ot)}),{body:ae,links:Te}},st=async()=>{if(!J.term.trim()||!J.yearDisplay.trim())return He("Term and Year are required"),!1;Me(!0),He(null);const ne=we(J.body,J.links),me={...J,body:ne.body,links:ne.links};try{const de=Q?"/api/member/timeline/item":`/api/member/timeline/item/${W?.id}`,Ke=await fetch(de,{method:Q?"POST":"PUT",headers:{"Content-Type":"application/json","X-Session-ID":c},body:JSON.stringify(me)});if(Ke.ok){const[ut,ae]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(ut.ok){const Te=await ut.json();if(F(Te),!Q&&W){const Qe=Te.find(ot=>ot.id===W.id);if(Qe){H(Qe),ie({term:Qe.term,yearDisplay:Qe.yearDisplay,names:Qe.names||"",category:Qe.category,subcategory:Qe.subcategory||"",body:Qe.body||Qe.footnote||"",links:Qe.links||(Qe.url?[{url:Qe.url,label:""}]:[]),priority:Qe.priority||0,locked:Qe.locked||!1,image:Qe.image||"",altText:Qe.altText||""});try{const ot=await fetch(`/api/member/timeline/item/${W.id}/history`);if(ot.ok){const pt=await ot.json();pt.history&&pt.history.length>0&&(It(pt.history),$e(0)),pt.editors&&Ee(pt.editors)}}catch{}X(!1)}}else ft()}if(ae.ok){const Te=await ae.json();A(Te)}return!0}else{const ut=await Ke.json();return He(ut.error||"Failed to save"),!1}}catch{return He("Failed to connect to server"),!1}finally{Me(!1)}},Lt=async()=>{if(W&&confirm(`Delete "${W.term}"? You can restore it using "Show deleted".`)){Me(!0),He(null);try{const ne=await fetch(`/api/member/timeline/item/${W.id}`,{method:"DELETE",headers:{"X-Session-ID":c}});if(ne.ok){const[me,de]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(me.ok){const Ie=await me.json();F(Ie)}if(de.ok){const Ie=await de.json();A(Ie)}ft()}else{const me=await ne.json();He(me.error||"Failed to delete")}}catch{He("Failed to connect to server")}finally{Me(!1)}}},Ot=async()=>{if(!(!W||!W.pending)){Me(!0),He(null);try{const ne=await fetch(`/api/member/timeline/item/${W.id}/approve`,{method:"POST",headers:{"X-Session-ID":c}});if(ne.ok){const[me,de]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(me.ok){const Ie=await me.json();F(Ie);const Ke=Ie.find(ut=>ut.id===W.id);Ke&&H(Ke)}if(de.ok){const Ie=await de.json();A(Ie)}}else{const me=await ne.json();He(me.error||"Failed to approve")}}catch{He("Failed to connect to server")}finally{Me(!1)}}},Et=()=>{!W||!W.pending||(Le([]),Se(""),ye(!0))},tt=async()=>{if(!W)return;const me=[...ME.filter(Ie=>Re.includes(Ie.id)).map(Ie=>Ie.label)];fe.trim()&&me.push(fe.trim());const de=me.join("; ")||"No reason provided";ye(!1),Me(!0),He(null);try{const Ie=await fetch(`/api/member/timeline/item/${W.id}/reject`,{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":c},body:JSON.stringify({reason:de})});if(Ie.ok){H(null);const[Ke,ut]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(Ke.ok){const ae=await Ke.json();F(ae)}if(ut.ok){const ae=await ut.json();A(ae)}}else{const Ke=await Ie.json();He(Ke.error||"Failed to reject")}}catch{He("Failed to connect to server")}finally{Me(!1)}},ge=async ne=>{if(!W)return;const me=S.find(de=>de.id===ne)||w.find(de=>de.id===ne);if(me&&confirm(`Merge "${me.term}" (${me.yearDisplay}) into the current item?
4533
4534This will change the duplicate's timelineId to match "${W.term}" and combine their version histories.`)){Me(!0),He(null);try{const de=await fetch("/api/member/timeline/merge",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":c},body:JSON.stringify({sourceId:ne,targetId:W.id})});if(de.ok){const[Ie,Ke]=await Promise.all([fetch("/api/timeline?includePending=true"),fetch("/api/timeline/deleted")]);if(Ie.ok){const ut=await Ie.json();F(ut);const ae=ut.find(Te=>Te.id===W.id);if(ae){H(ae);try{const Te=await fetch(`/api/member/timeline/item/${W.id}/history`);if(Te.ok){const Qe=await Te.json();Qe.history&&It(Qe.history),Qe.editors&&Ee(Qe.editors)}}catch{}}}if(Ke.ok){const ut=await Ke.json();A(ut)}}else{const Ie=await de.json();He(Ie.error||"Failed to merge")}}catch{He("Failed to connect to server")}finally{Me(!1)}}},$=async ne=>{if(!W)return;const me=S.find(ut=>ut.id===ne)||w.find(ut=>ut.id===ne);if(!me)return;const de=W.relatedItems?.includes(ne),Ie=de?"disconnect":"connect";if(confirm(`${de?"Disconnect":"Connect"} "${W.term}" (${W.yearDisplay}) ${de?"from":"with"} "${me.term}" (${me.yearDisplay})?
4535
4536This will ${de?"remove":"add"} a "See also" link between these entries.`)){Me(!0),He(null);try{const ut=await fetch("/api/member/timeline/connect",{method:"POST",headers:{"Content-Type":"application/json","X-Session-ID":c},body:JSON.stringify({itemId1:W.id,itemId2:ne,action:Ie})});if(ut.ok){const ae=await fetch("/api/timeline?includePending=true");if(ae.ok){const Te=await ae.json();F(Te);const Qe=Te.find(ot=>ot.id===W.id);Qe&&H(Qe)}}else{const ae=await ut.json();He(ae.error||`Failed to ${Ie}`)}}catch{He("Failed to connect to server")}finally{Me(!1)}}};if(e)return r.jsxs("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[r.jsx(Os,{}),r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsxs(Ft,{className:"p-12 text-center",children:[r.jsx(on,{className:"w-12 h-12 text-primary animate-spin mx-auto mb-4"}),r.jsx("p",{className:"text-muted-foreground",children:"Checking authentication..."})]})})]});if(!a)return null;const xe=W||Q;return r.jsxs("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[r.jsx(Os,{}),r.jsxs("div",{className:"flex-1 pt-24 pb-4 px-4 flex flex-col min-h-0",children:[r.jsxs("div",{className:"shrink-0 mb-2 flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"shrink-0",children:[r.jsx("h1",{className:"text-2xl font-bold",children:"Timeline Editor"}),r.jsxs("p",{className:"text-muted-foreground text-sm",children:["Editing as ",r.jsx("span",{className:"font-medium",children:s}),m&&" (editor)"]})]}),r.jsx("div",{className:"hidden md:flex flex-1 justify-center max-w-sm",children:r.jsx(yg,{items:rt,onSelect:_e})}),r.jsxs("div",{className:"shrink-0 flex items-center gap-4",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ar,{checked:N,onCheckedChange:ne=>P(ne===!0)}),r.jsxs("span",{className:"text-muted-foreground",children:["Show deleted ",je>0&&`(${je})`]})]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ar,{checked:z,onCheckedChange:ne=>D(ne===!0),disabled:ue.size===0}
4536),r.jsxs("span",{className:ue.size===0?"text-muted-foreground/50":"text-muted-foreground",children:["Show new ",ue.size>0&&`(${ue.size})`]})]}),z&&ue.size>0&&r.jsx(Fe,{variant:"outline",size:"sm",onClick:Kt,children:"Mark as seen"}),r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx(ar,{checked:T,onCheckedChange:ne=>K(ne===!0),disabled:Ve.size===0}),r.jsxs("span",{className:Ve.size===0?"text-muted-foreground/50":"text-muted-foreground",children:["Show duplicates ",Ve.size>0&&`(${Ve.size})`]})]}),r.jsxs(Fe,{variant:"outline",size:"sm",onClick:_t,children:[r.jsx(rh,{className:"w-4 h-4 mr-2"}),"Exit Editor"]})]})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex gap-4",children:[r.jsx("div",{className:"flex-1 min-h-0 border rounded-lg overflow-hidden bg-white dark:bg-slate-900",children:j?r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(on,{className:"w-8 h-8 text-primary animate-spin"})}):r.jsx(p1,{editorMode:!0,selectedItemId:W?.id??null,onSelectItem:Ge,items:rt,showNew:z,newItemIds:ue,showDuplicates:T,duplicateItemIds:Ve,editingItems:wt,focusItemId:q,onFocusComplete:et})}),r.jsxs("div",{className:`w-80 shrink-0 border rounded-lg overflow-y-auto ${W?.pending?"bg-yellow-50 dark:bg-yellow-900/20":"bg-card"}`,children:[r.jsxs("div",{className:"p-4 border-b",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"font-semibold",children:he?`Editing: ${Ut}`:W?.locked&&!m?"Entry Locked":Q?"New Entry":W?"Edit Entry":"Edit Panel"}),xe?r.jsx(Fe,{variant:"ghost",size:"icon",onClick:ft,className:"h-8 w-8",children:r.jsx(gr,{className:"w-4 h-4"})}):r.jsxs(Fe,{size:"sm",onClick:ht,children:[r.jsx(ko,{className:"w-4 h-4 mr-1"}),"Add New"]})]}),qe.length>1&&W&&r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"Oldest"}),r.jsxs("span",{children:["v",qe.length-Je," of ",qe.length]}),r.jsx("span",{children:"Newest"})]}),r.jsx(uf,{value:[qe.length-1-Je],onValueChange:([ne])=>Z(qe.length-1-ne),max:qe.length-1,step:1}),r.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[qe[Je]?.Created?new Date(qe[Je].Created).toLocaleString():"Original import",qe[Je]?.deleted&&r.jsx("span",{className:"text-red-500 ml-1",children:"(deleted)"})]}),qe[Je]?.memberKey&&gt[qe[Je].memberKey]&&r.jsx("div",{className:"flex justify-center mt-2",children:r.jsx(Fo,{variant:"compact",name:gt[qe[Je].memberKey].name,memberKey:gt[qe[Je].memberKey].memberKey,profileImageUrl:gt[qe[Je].memberKey].profileImageUrl,title:gt[qe[Je].memberKey].title,company:gt[qe[Je].memberKey].company,city:gt[qe[Je].memberKey].city})})]})]}),r.jsx("div",{className:"p-4",children:xe?r.jsxs("fieldset",{disabled:ee,className:"space-y-4",children:[Ce&&r.jsx("div",{className:"p-2 text-sm text-red-600 bg-red-50 dark:bg-red-900/20 rounded",children:Ce}),he&&r.jsxs("div",{className:"p-2 text-sm text-purple-800 bg-purple-100 dark:bg-purple-900/40 dark:text-purple-200 rounded border border-purple-200 dark:border-purple-800",children:["This entry is currently being edited by ",r.jsx("strong",{children:Ut}),". You can view it but cannot make changes until they're done."]}),W?.pending&&r.jsx("div",{className:"p-2 text-sm text-yellow-800 bg-yellow-100 dark:bg-yellow-900/40 dark:text-yellow-200 rounded border border-yellow-200 dark:border-yellow-800",children:"This entry is pending approval. It won't appear on the public timeline until approved by an editor."}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Ht,{htmlFor:"term",className:"w-16 shrink-0 text-right",children:["Term ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx(un,{id:"term",value:J.term,onChange:ne=>it("term",ne.target.value),placeholder:"e.g., Metaverse"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Ht,{htmlFor:"year",className:"w-16 shrink-0 text-right",children:["Year ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx(un,{id:"year",value:J.yearDisplay,onChange:ne=>it("yearDisplay",ne.target.value),placeholder:"e.g., 1992 or 1980s",className:"w-24"}),r.jsxs("span",{className:"text-[10px] text-muted-foreground leading-tight",children:["YYYY",r.jsx("br",{}),"YYYY-MM",r.jsx("br",{}),"YYYY-MM-DD"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ht,{htmlFor:"names",className:"w-16 shrink-0 text-right",children:"Names"}),r.jsx(un,{id:"names",value:J.names,onChange:ne=>it("names",ne.target.value),placeholder:"Last, First; Last, First"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ht,{htmlFor:"category",className:"w-16 shrink-0 text-right",children:"Category"}),r.jsxs(Sl,{value:J.category,onValueChange:ne=>it("category",ne),children:[r.jsx(To,{className:"flex-1",children:r.jsx(Fl,{})}),r.jsx(Mo,{children:qa.map(ne=>r.jsx(ta,{value:ne.id,children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:ne.color}}),ne.label]})},ne.id))})]}),m&&r.jsxs(r.Fragment,{children:[r.jsx(Ht,{htmlFor:"priority",className:"shrink-0 text-right",children:"Pri"}),r.jsxs(Sl,{value:String(J.priority),onValueChange:ne=>it("priority",parseInt(ne)),children:[r.jsx(To,{className:"w-16",children:r.jsx(Fl,{})}),r.jsxs(Mo,{children:[r.jsx(ta,{value:"0",children:"0"}),r.jsx(ta,{value:"1",children:"1"}),r.jsx(ta,{value:"2",children:"2"}),r.jsx(ta,{value:"3",children:"3"})]})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ht,{htmlFor:"subcategory",className:"w-16 shrink-0 text-right",children:"Type"}),r.jsx(un,{id:"subcategory",value:J.subcategory,onChange:ne=>it("subcategory",ne.target.value),placeholder:"e.g., Book, Paper, Article"})]}),W&&!Q&&(()=>{const ne=W.relatedItems||[],me=new Set,de=[],Ie=Ke=>{if(me.has(Ke.id))return;me.add(Ke.id);const ut=!!J.term.trim()&&Ke.term.toLowerCase().trim()===J.term.toLowerCase().trim();de.push({item:Ke,isConnected:ne.includes(Ke.id),isExactMatch:ut})};for(const Ke of ne){const ut=S.find(ae=>ae.id===Ke);ut&&Ie(ut)}for(const Ke of ze)Ie(Ke);for(const Ke of lt)Ie(Ke);return r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ht,{htmlFor:"relatedSearch",className:"w-16 shrink-0 text-right",children:"Connect"}),r.jsx(un,{id:"relatedSearch",value:Ct,onChange:Ke=>bt(Ke.target.value),placeholder:"Search to find more items…",className:"flex-1"})]}),de.length>0&&r.jsx("ul",{className:"space-y-1",children:de.map(({item:Ke,isConnected:ut,isExactMatch:ae})=>{const Te=m&&ae&&!ut;return r.jsxs("li",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-16 shrink-0 flex items-center justify-end gap-1",children:ut?r.jsx("button",{type:"button",onClick:()=>$(Ke.id),disabled:pe,title:"Disconnect","aria-label":`Disconnect from ${Ke.term}`,className:"w-5 h-5 flex items-center justify-center text-sm leading-none font-semibold bg-blue-200 dark:bg-blue-800 hover:bg-blue-300 dark:hover:bg-blue-700 rounded disabled:opacity-50",children:"−"}):r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",onClick:async()=>{await $(Ke.id),bt("")},disabled:pe,title:"Connect","aria-label":`Connect to ${Ke.term}`,className:"w-5 h-5 flex items-center justify-center text-sm leading-none font-semibold bg-blue-200 dark:bg-blue-800 hover:bg-blue-300 dark:hover:bg-blue-700 rounded disabled:opacity-50",children:"+"}),Te&&r.jsx("button",{type:"button",onClick:()=>ge(Ke.id),disabled:pe,title:"Merge (combine into this entry)","aria-label":`Merge ${Ke.term} into this entry`,className:"w-5 h-5 flex items-center justify-center text-sm leading-none font-semibold bg-amber-200 dark:bg-amber-800 hover:bg-amber-300 dark:hover:bg-amber-700 rounded disabled:opacity-50",children:"="})]})}),r.jsxs("span",{className:`flex-1 min-w-0 truncate px-2 py-1 text-sm rounded ${ut?"bg-blue-50 dark:bg-blue-900/30":"bg-muted/40 dark:bg-muted/20"}`,children:[r.jsx("span",{className:"font-medium",children:Ke.term}),r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(",Ke.yearDisplay,")"]})]})]},Ke.id)})})]})})(),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ht,{htmlFor:"body",children:"Body"}),r.jsx(zi,{id:"body",value:J.body,onChange:ne=>it("body",ne.target.value),placeholder:"Extended description...",rows:4}),r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["**bold** *italic* [text](url) ","{1}"," for sources"]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{children:"Image"}),J.image?r.jsxs("div",{className:"space-y-2",children:[r.jsx("img",{src:J.image,alt:J.altText||"Timeline item image",title:J.altText||void 0,className:"w-full max-h-32 object-contain rounded border bg-muted"}),r.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>{ie(ne=>({...ne,image:""})),X(!0)},disabled:We,children:[r.jsx(gr,{className:"w-4 h-4 mr-1"}),"Remove Image"]})]}):r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:"file",accept:"image/jpeg,image/png,image/gif,image/webp,image/avif",onChange:async ne=>{const me=ne.target.files?.[0];if(me){Ae(!0),He(null);try{const de=new FormData;de.append("image",me),de.append("timelineId",W?.id||"new");const Ie=await fetch("/api/uploadTimelineImage",{method:"POST",body:de});if(Ie.ok){const Ke=await Ie.json();ie(ut=>({...ut,image:Ke.imageUrl})),X(!0)}else{const Ke=await Ie.json();He(Ke.error||"Failed to upload image")}}catch{He("Failed to upload image")}finally{Ae(!1),ne.target.value=""}}},className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:We}),r.jsxs(Fe,{type:"button",variant:"outline",size:"sm",className:"w-full pointer-events-none",disabled:We,children:[We?r.jsx(on,{className:"w-4 h-4 mr-1 animate-spin"}):r.jsx(b3,{className:"w-4 h-4 mr-1"}),We?"Uploading...":"Upload Image"]})]}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:"JPEG, PNG, GIF, or WEBP (max 5MB)"}),J.image&&r.jsxs("div",{className:"space-y-1 mt-2",children:[r.jsx(Ht,{htmlFor:"altText",className:"text-xs",children:"Alt Text (for accessibility)"}),r.jsx(un,{id:"altText",value:J.altText,onChange:ne=>{ie(me=>({...me,altText:ne.target.value})),X(!0)},placeholder:"Describe the image for screen readers...",className:"text-sm"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Ht,{children:"Sources"}),r.jsxs(Fe,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>{ie(ne=>({...ne,links:[...ne.links,{url:"",label:""}]})),X(!0)},children:[r.jsx(ko,{className:"w-3 h-3 mr-1"}),"Add"]})]}),J.links.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:"No sources added"}):r.jsx("div",{className:"space-y-1.5",children:J.links.map((ne,me)=>r.jsxs("div",{className:"flex gap-1 items-center",children:[r.jsxs("span",{className:"text-xs text-muted-foreground w-4 shrink-0",children:[me+1,"."]}),r.jsx(un,{value:ne.label,onChange:de=>{const Ie=[...J.links];Ie[me]={...Ie[me],label:de.target.value},ie(Ke=>({...Ke,links:Ie})),X(!0)},placeholder:"Label",className:"h-7 text-xs w-20 shrink-0"}),r.jsx(un,{type:"url",value:ne.url,onChange:de=>{const Ie=[...J.links];if(Ie[me]={...Ie[me],url:de.target.value},!Ie[me].label)try{const ut=new URL(de.target.value).hostname.toLowerCase();ut.includes("wikipedia.org")?Ie[me].label="Wikipedia":ut.includes("archive.org")?Ie[me].label="Archive.org":ut.includes("youtube.com")||ut.includes("youtu.be")?Ie[me].label="YouTube":ut.includes("vimeo.com")?Ie[me].label="Vimeo":ut.includes("github.com")&&(Ie[me].label="GitHub")}catch{}ie(Ke=>({...Ke,links:Ie})),X(!0)},placeholder:"https://...",className:"h-7 text-xs flex-1"}),r.jsx(Fe,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{ie(de=>({...de,links:de.links.filter((Ie,Ke)=>Ke!==me)})),X(!0)},children:r.jsx(gr,{className:"w-3 h-3"})})]},me))})]}),(m||J.locked)&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:"locked",checked:J.locked,onCheckedChange:ne=>it("locked",ne===!0),disabled:!m}),r.jsx(Ht,{htmlFor:"locked",className:m?"":"text-muted-foreground",children:"Locked"})]}),r.jsxs("div",{className:"flex gap-2 pt-2",children:[r.jsxs(Fe,{onClick:st,disabled:pe||!Be,className:"flex-1",children:[pe?r.jsx(on,{className:"w-4 h-4 mr-1 animate-spin"}):r.jsx(Py,{className:"w-4 h-4 mr-1"}),Je>0&&!Xe?"Save as New":"Save New"]}),W&&Je===0&&!W.deleted&&r.jsxs(Fe,{variant:"destructive",onClick:Lt,disabled:pe,className:"flex-1",children:[r.jsx(gu,{className:"w-4 h-4 mr-1"}),"Delete"]})]}),p&&r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Your edits will be reviewed by an editor before appearing on the public timeline. This usually takes about a day."}
4536),m&&W?.pending&&Je===0&&r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(Fe,{variant:"outline",onClick:Ot,disabled:pe,className:"flex-1 border-green-500 text-green-600 hover:bg-green-50 dark:hover:bg-green-900/20",children:[pe?r.jsx(on,{className:"w-4 h-4 mr-1 animate-spin"}):r.jsx(d3,{className:"w-4 h-4 mr-1"}),"Approve"]}),r.jsxs(Fe,{variant:"outline",onClick:Et,disabled:pe,className:"flex-1 border-red-500 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20",children:[pe?r.jsx(on,{className:"w-4 h-4 mr-1 animate-spin"}):r.jsx(h3,{className:"w-4 h-4 mr-1"}),"Reject"]})]})]}):r.jsx(Ft,{className:"p-4 bg-muted/50",children:r.jsx("p",{className:"text-sm text-muted-foreground text-center",children:'Click an item on the timeline to edit it, or click "Add New" to create a new entry.'})})})]})]})]}),De&&r.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:r.jsxs(Ft,{className:"p-6 max-w-md mx-4",children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Unsaved Changes"}),r.jsx("p",{className:"text-muted-foreground mb-4",children:"You have unsaved changes. Do you want to save them before switching?"}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(Fe,{variant:"outline",onClick:()=>oe(!1),children:"Cancel"}),r.jsx(Fe,{variant:"destructive",onClick:Mt,children:"Discard"}),r.jsx(Fe,{onClick:be,children:"Save"})]})]})}),r.jsx(Sa,{open:te,onOpenChange:ye,children:r.jsxs(da,{className:"sm:max-w-md",children:[r.jsxs(ha,{children:[r.jsx(ma,{children:"Reject Entry"}),r.jsx(Fa,{children:"Select reason(s) for rejection. This will be sent to the author."})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsx("div",{className:"space-y-2",children:ME.map(ne=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ar,{id:ne.id,checked:Re.includes(ne.id),onCheckedChange:me=>{Le(me?[...Re,ne.id]:Re.filter(de=>de!==ne.id))}}),r.jsx(Ht,{htmlFor:ne.id,className:"text-sm font-normal cursor-pointer",children:ne.label})]},ne.id))}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ht,{htmlFor:"customReason",className:"text-sm",children:"Additional comments (optional)"}),r.jsx(zi,{id:"customReason",value:fe,onChange:ne=>Se(ne.target.value),placeholder:"Add a custom message...",rows:2})]})]}),r.jsxs(_o,{className:"gap-2",children:[r.jsx(Fe,{variant:"outline",onClick:()=>ye(!1),children:"Cancel"}),r.jsx(Fe,{variant:"destructive",onClick:tt,children:"Reject Entry"})]})]})}),r.jsx(Sre,{open:v,sessionId:c,onClose:()=>C(!1)}),Rt&&r.jsx("div",{className:"fixed bottom-4 left-4 z-50 bg-yellow-600 text-white px-4 py-2 rounded-lg shadow-lg text-sm",children:Rt}),a&&r.jsx(ku,{isConnected:re})]})}var Js="Accordion",Are=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[pS,Nre,Tre]=Vm(Js),[zx]=Xa(Js,[Tre,$N]),gS=$N(),Z4=Jt.forwardRef((t,e)=>{const{type:n,...a}=t,i=a,s=a;return r.jsx(pS.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?r.jsx(Pre,{...s,ref:e}):r.jsx(Dre,{...i,ref:e})})});Z4.displayName=Js;var[Q4,Mre]=zx(Js),[eR,Rre]=zx(Js,{collapsible:!1}),Dre=Jt.forwardRef((t,e)=>{const{value:n,defaultValue:a,onValueChange:i=()=>{},collapsible:s=!1,...o}=t,[c,d]=ds({prop:n,defaultProp:a??"",onChange:i,caller:Js});return r.jsx(Q4,{scope:t.__scopeAccordion,value:Jt.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:Jt.useCallback(()=>s&&d(""),[s,d]),children:r.jsx(eR,{scope:t.__scopeAccordion,collapsible:s,children:r.jsx(tR,{...o,ref:e})})})}),Pre=Jt.forwardRef((t,e)=>{const{value:n,defaultValue:a,onValueChange:i=()=>{},...s}=t,[o,c]=ds({prop:n,defaultProp:a??[],onChange:i,caller:Js}),d=Jt.useCallback(f=>c((p=[])=>[...p,f]),[c]),m=Jt.useCallback(f=>c((p=[])=>p.filter(b=>b!==f)),[c]);return r.jsx(Q4,{scope:t.__scopeAccordion,value:o,onItemOpen:d,onItemClose:m,children:r.jsx(eR,{scope:t.__scopeAccordion,collapsible:!0,children:r.jsx(tR,{...s,ref:e})})})}),[jre,Gx]=zx(Js),tR=Jt.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:a,dir:i,orientation:s="vertical",...o}=t,c=Jt.useRef(null),d=Hn(c,e),m=Nre(n),p=uh(i)==="ltr",b=vn(t.onKeyDown,v=>{if(!Are.includes(v.key))return;const C=v.target,S=m().filter(K=>!K.ref.current?.disabled),F=S.findIndex(K=>
4536K.ref.current===C),w=S.length;if(F===-1)return;v.preventDefault();let A=F;const N=0,P=w-1,z=()=>{A=F+1,A>P&&(A=N)},D=()=>{A=F-1,A<N&&(A=P)};switch(v.key){case"Home":A=N;break;case"End":A=P;break;case"ArrowRight":s==="horizontal"&&(p?z():D());break;case"ArrowDown":s==="vertical"&&z();break;case"ArrowLeft":s==="horizontal"&&(p?D():z());break;case"ArrowUp":s==="vertical"&&D();break}const T=A%w;S[T].ref.current?.focus()});return r.jsx(jre,{scope:n,disabled:a,direction:i,orientation:s,children:r.jsx(pS.Slot,{scope:n,children:r.jsx(Tn.div,{...o,"data-orientation":s,ref:d,onKeyDown:a?void 0:b})})})}),$g="AccordionItem",[Lre,xS]=zx($g),nR=Jt.forwardRef((t,e)=>{const{__scopeAccordion:n,value:a,...i}=t,s=Gx($g,n),o=Mre($g,n),c=gS(n),d=wo(),m=a&&o.value.includes(a)||!1,f=s.disabled||t.disabled;return r.jsx(Lre,{scope:n,open:m,disabled:f,triggerId:d,children:r.jsx(qN,{"data-orientation":s.orientation,"data-state":lR(m),...c,...i,ref:e,disabled:f,open:m,onOpenChange:p=>{p?o.onItemOpen(a):o.onItemClose(a)}})})});nR.displayName=$g;var rR="AccordionHeader",aR=Jt.forwardRef((t,e)=>{const{__scopeAccordion:n,...a}=t,i=Gx(Js,n),s=xS(rR,n);return r.jsx(Tn.h3,{"data-orientation":i.orientation,"data-state":lR(s.open),"data-disabled":s.disabled?"":void 0,...a,ref:e})});aR.displayName=rR;var g1="AccordionTrigger",iR=Jt.forwardRef((t,e)=>{const{__scopeAccordion:n,...a}=t,i=Gx(Js,n),s=xS(g1,n),o=Rre(g1,n),c=gS(n);return r.jsx(pS.ItemSlot,{scope:n,children:r.jsx(oU,{"aria-disabled":s.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...c,...a,ref:e})})});iR.displayName=g1;var sR="AccordionContent",oR=Jt.forwardRef((t,e)=>{const{__scopeAccordion:n,...a}=t,i=Gx(Js,n),s=xS(sR,n),o=gS(n);return r.jsx(lU,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...o,...a,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});oR.displayName=sR;function lR(t){return t?"open":"closed"}var Ire=Z4,Bre=nR,Ore=aR,cR=iR,uR=oR;const Ure=Ire,dR=x.forwardRef(({className:t,...e},n)=>r.jsx(Bre,{ref:n,className:ln("border-b",t),...e}));dR.displayName="AccordionItem";const hR=x.forwardRef(({className:t,children:e,...n},a)=>r.jsx(Ore,{className:"flex",children:r.jsxs(cR,{ref:a,className:ln("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,r.jsx(Ja,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));hR.displayName=cR.displayName;const mR=x.forwardRef(({className:t,children:e,...n},a)=>r.jsx(uR,{ref:a,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:r.jsx("div",{className:ln("pb-4 pt-0",t),children:e})}));mR.displayName=uR.displayName;const zre=[{icon:v3,title:"Career Advancement & Confidence Building",description:"Helping mentees proactively define clear, measurable goals and follow through on actions."},{icon:vP,title:"Knowledge Transfer & Skill Development",description:"Bridging skill gaps and working through real-world technical challenges."},{icon:kP,title:"Leadership Development",description:"Providing mentors with coaching experience and equipping both parties with fresh perspectives."},{icon:SP,title:"Professional Relationships",description:"Expanding networks, sharing resources, and discussing strategies for industry presence."}],Gre=["3+ years of professional experience in XR, AI, or an adjacent field (hardware, software, design, business development, research, etc.)","A track record of navigating real challenges - career pivots, technical problem-solving, team leadership, or building something from scratch","Strong communication skills and genuine enthusiasm for developing others","Ability to commit to bi-weekly or monthly 1:1 conversations for the 6-month program"],Hre=["Leadership and coaching experience that sharpens your own skills","A fresh perspective from someone newer to the field","Recognition within the XR Guild community","The chance to shape the next generation of ethical builders and innovators"],Wre=["A clear (or clarifying) sense of what you want to get out of the program - a skill, a decision, a next step","Willingness to show up consistently and take ownership of your own goals","Openness to feedback and new perspectives","Ability to commit to bi-weekly or monthly 1:1 conversations for the 6-month program"],Vre=["Personalized guidance from someone who's navigated similar challenges","Support building measurable, actionable career goals","An expanded network and access to real-world industry knowledge","A structured space for accountability and growth"],$re=[{question:"Is there a cost to participate?",answer:"No - the XR Guild Mentorship Program is free for all members. If you're not yet a member, joining the XR Guild is also free."},{question:"How are mentors and mentees matched?",answer:"We pair participants based on shared interests, career goals, industry background, and availability. Our goal is to create pairings where both sides get real value from the relationship."},{question:"How much time does the program require?",answer:"Expect bi-weekly or monthly 1:1 conversations over a 6-month period, plus a bit of time for goal-setting and reflection between sessions. The exact cadence is agreed upon by each mentor/mentee pair."},{question:"Can I apply if I've never mentored (or been mentored) before?",answer:"Absolutely. Many of our mentors are stepping into a coaching role for the first time, and many of our mentees are new to structured mentorship. We provide guidance to help both sides get started."},{question:"What if I'm not sure whether to apply as a mentor or a mentee?",answer:"That's okay - some professionals fit either role depending on where they are in their career. Reach out to us, or just apply for the one that feels most aligned with your current goals; we can help you sort it out."},{question:"Can I be both a mentor and a mentee?",answer:"Yes, some participants do both simultaneously, especially if you're experienced in one area and looking to grow in another."},{question:"What happens after I apply?",answer:"Once applications open in September, you'll fill out a short questionnaire about your background and goals. We'll use that information to make matches and notify you once pairings are finalized."}];function sg({items:t}){return r.jsx("ul",{className:"space-y-3",children:t.map(e=>r.jsxs("li",{className:"flex gap-3 text-muted-foreground leading-relaxed",children:[r.jsx(us,{className:"w-5 h-5 text-primary shrink-0 mt-0.5"}),r.jsx("span",{children:e})]},e))})}function Kre(){return r.jsxs("div",{className:"min-h-screen bg-background",children:[r.jsx(Os,{}),r.jsxs("main",{children:[r.jsx("section",{className:"pt-36 pb-20 px-4 bg-gradient-to-br from-primary/10 via-background to-accent/10",children:r.jsxs("div",{className:"container mx-auto max-w-6xl grid lg:grid-cols-2 gap-12 items-center",children:[r.jsxs("div",{children:[r.jsx(an,{className:"mb-5 bg-primary/10 text-primary hover:bg-primary/10 border border-primary/20",children:"XR Guild Community Program"}),r.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent leading-tight",children:"XR Guild Mentorship Program"}
vendor: 8,303 bytes, line 4536
4536),r.jsx("p",{className:"text-xl sm:text-2xl text-foreground/80 mb-8 leading-relaxed",children:"Fostering growth, knowledge, and connection in XR & AI."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[r.jsx(Fe,{asChild:!0,size:"lg",className:"bg-gradient-to-r from-primary to-accent hover:opacity-90",children:r.jsxs(xo,{to:"/join",children:["Join XR Guild",r.jsx(km,{className:"w-4 h-4 ml-2"})]})}),r.jsx(Fe,{asChild:!0,size:"lg",variant:"outline",children:r.jsx("a",{href:"#qualify",children:"See if you qualify"})})]})]}),r.jsxs("figure",{children:[r.jsxs("div",{className:"relative rounded-2xl overflow-hidden border-2 border-primary/20 shadow-xl",children:[r.jsx("img",{src:"/images/mentorship-stand-in.jpg",alt:"XR professionals participating in a small-group mentoring session",className:"w-full aspect-[3/2] object-cover"}),r.jsx(an,{variant:"secondary",className:"absolute bottom-4 left-4 shadow-md",children:"Temporary stand-in image"})]}),r.jsx("figcaption",{className:"text-sm text-muted-foreground mt-3 text-center",children:"Stand-in program photo - a final mentorship image will replace this."})]})]})}),r.jsx("section",{className:"py-20 px-4",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsx(Ft,{className:"p-8 md:p-10 mb-20 border-2 border-primary/20 bg-primary/5",children:r.jsxs("div",{className:"grid md:grid-cols-[auto_1fr] gap-6 items-start",children:[r.jsx("div",{className:"p-4 bg-gradient-to-br from-primary to-accent rounded-full w-fit",children:r.jsx(na,{className:"w-7 h-7 text-primary-foreground"})}),r.jsxs("div",{children:[r.jsx(an,{variant:"outline",className:"mb-3",children:"Coming Fall 2026"}),r.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4 text-foreground",children:"Join Our Next Cohort This Fall"}),r.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed mb-4",children:"We are currently gearing up for our next mentorship cohort, kicking off in September/October 2026! Whether you are an experienced professional ready to share your insights, or a mentee eager to define your career trajectory and learn from real-world experiences, we invite you to join us."}),r.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["If you are not yet a member of the XR Guild, ",r.jsx(xo,{to:"/join",className:"text-primary font-medium underline underline-offset-4 hover:text-primary/80",children:"you can join here"}),". It's free! Then look out for official announcements and sign-up links coming soon. Let's continue building this future together!"]})]})]})}),r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"About the Program"}),r.jsxs("div",{className:"text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed space-y-4",children:[r.jsx("p",{children:"The XR Guild Mentorship Program provides a structured yet flexible framework designed to foster professional growth, knowledge sharing, and meaningful connections within our community of ethical builders and innovators. We pair experienced XR and AI professionals with mentees to shape the next generation of leaders, encouraging accountability and meaningful outcomes."}),r.jsx("p",{children:"Our typical 3-month program features bi-weekly or monthly 1:1 virtual conversations, focusing on:"})]})]}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-6 mb-20",children:zre.map(t=>r.jsxs(Ft,{className:"p-6 border-2 hover:border-primary/40 transition-colors",children:[r.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/10 to-accent/10 rounded-lg w-fit mb-4",children:r.jsx(t.icon,{className:"w-6 h-6 text-primary"})}),r.jsx("h3",{className:"text-xl font-semibold mb-2 text-foreground",children:t.title}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:t.description})]},t.title))}),r.jsxs("div",{className:"bg-muted/30 rounded-2xl p-8 md:p-12",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4 text-foreground",children:"Our Journey So Far"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:"Since launching our inaugural pilot phase in early 2025, the program has experienced tremendous success and community engagement. Here are a few highlights of what we've accomplished together:"})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[r.jsxs(Ft,{className:"p-6 bg-card/70",children:[r.jsx("p",{className:"text-4xl font-bold text-primary mb-3",children:"4.6/5"}),r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Successful Pilot & Expansion"}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We started with a successful 3-month pilot in early 2025. This first cohort of 27 mentors and mentees gave the program overwhelming praise, including a 4.6/5 satisfaction score. Our next cohort in October 2025 doubled in size!"})]}),r.jsxs(Ft,{className:"p-6 bg-card/70",children:[r.jsx("p",{className:"text-4xl font-bold text-primary mb-3",children:"AWE 2026"}),r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"AWE 2026 Mentorship Track"}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We brought the XR Guild mentorship experience to AWE 2026. Participants enjoyed on-site meetups, networking opportunities, and dedicated spaces to connect in person."})]}),r.jsxs(Ft,{className:"p-6 bg-card/70",children:[r.jsx("p",{className:"text-4xl font-bold text-primary mb-3",children:"Community"}),r.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Community Impact"}),r.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"From sharing industry insights to building lasting networks, participants consistently highlight the real-world value of these connections and the mutual learning experienced by both mentors and mentees."})]})]})]})]})}),r.jsx("section",{id:"qualify",className:"py-20 px-4 bg-gradient-to-br from-primary/5 via-background to-accent/5 scroll-mt-24",children:r.jsxs("div",{className:"container mx-auto max-w-6xl",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Curious If You Qualify?"}),r.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Whether you're looking to guide or be guided, here's what we look for on each side of the mentorship relationship."})]}),r.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[r.jsxs(Ft,{className:"p-8 border-2",children:[r.jsx("div",{className:"p-4 bg-gradient-to-br from-primary to-accent rounded-full w-fit mb-5",children:r.jsx(f3,{className:"w-7 h-7 text-primary-foreground"})}),r.jsx("h3",{className:"text-2xl font-bold mb-3",children:"Are You Ready to Be a Mentor?"}),r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:"We welcome mentors from all corners of XR and AI - you don't need decades of experience, just real insight to share and a genuine interest in helping someone else grow."}),r.jsx("h4",{className:"font-semibold text-lg mb-4",children:"What we look for:"}),r.jsx(sg,{items:Gre}),r.jsx("h4",{className:"font-semibold text-lg mt-8 mb-4",children:"What mentors gain:"}),r.jsx(sg,{items:Hre})]}),r.jsxs(Ft,{className:"p-8 border-2",children:[r.jsx("div",{className:"p-4 bg-gradient-to-br from-primary to-accent rounded-full w-fit mb-5",children:r.jsx(mP,{className:"w-7 h-7 text-primary-foreground"})}),r.jsx("h3",{className:"text-2xl font-bold mb-3",children:"Are You Ready to Be a Mentee?"}),r.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:"This program is for anyone in XR or AI looking to grow with intention - whether you're early in your career, navigating a pivot, or leveling up into new responsibilities."}),r.jsx("h4",{className:"font-semibold text-lg mb-4",children:"What we look for:"}),r.jsx(sg,{items:Wre}),r.jsx("h4",{className:"font-semibold text-lg mt-8 mb-4",children:"What mentees gain:"}),r.jsx(sg,{items:Vre})]})]}),r.jsxs("div",{className:"text-center text-lg text-muted-foreground max-w-3xl mx-auto mt-10 leading-relaxed space-y-4",children:[r.jsx("p",{children:"Not sure if you qual
4536ify - as a mentor or mentee? If you're motivated to either share what you know or grow through the experience of someone who's been there, you're likely a great fit."}),r.jsx("p",{children:"When applications open, we'll ask a few quick questions to help us make thoughtful pairings."})]})]})}),r.jsx("section",{className:"py-20 px-4",children:r.jsxs("div",{className:"container mx-auto max-w-3xl",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("h2",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-4 text-foreground",children:"Frequently Asked Questions"}),r.jsx("p",{className:"text-lg text-muted-foreground",children:"Learn more about participation, matching, and what to expect."})]}),r.jsx(Ft,{className:"px-6 md:px-8 border-2",children:r.jsx(Ure,{type:"single",collapsible:!0,children:$re.map((t,e)=>r.jsxs(dR,{value:`faq-${e}`,children:[r.jsx(hR,{className:"text-left text-base",children:t.question}),r.jsx(mR,{className:"text-muted-foreground leading-relaxed text-base",children:t.answer})]},t.question))})}),r.jsxs("div",{className:"text-center mt-12",children:[r.jsx("h3",{className:"text-2xl font-bold mb-3",children:"Ready to grow together?"}),r.jsx("p",{className:"text-muted-foreground mb-6",children:"Join the XR Guild today and watch for the next cohort announcement."}),r.jsx(Fe,{asChild:!0,size:"lg",className:"bg-gradient-to-r from-primary to-accent hover:opacity-90",children:r.jsxs(xo,{to:"/join",children:["Join XR Guild",r.jsx(km,{className:"w-4 h-4 ml-2"})]})})]})]})})]}),r.jsx(iw,{})]})}const Yre=new tI;function qre(){const{pathname:t,hash:e}=Do();return x.useEffect(()=>{e?setTimeout(()=>{const n=document.querySelector(e);n&&n.scrollIntoView({behavior:"smooth"})},100):window.scrollTo({top:0,left:0,behavior:"auto"})},[t,e]),null}const Jre=()=>r.jsx(rI,{client:Yre,children:r.jsx(o6,{defaultTheme:"system",children:r.jsxs(Lr,{children:[r.jsx(hj,{}),r.jsx(Wj,{}),r.jsxs(n6,{children:[r.jsx(l6,{}),r.jsx(qre,{}),r.jsxs(_k,{children:[r.jsx(tr,{path:"/",element:typeof window<"u"&&window.location.hostname==="timeline.xrguild.org"?r.jsx(TE,{}):r.jsx(Z9,{})}),r.jsx(tr,{path:"/join",element:r.jsx(Q9,{})}),r.jsx(tr,{path:"/member",element:r.jsx(CU,{})}),r.jsx(tr,{path:"/member/verify",element:r.jsx(_U,{})}),r.jsx(tr,{path:"/admin/*",element:r.jsx(qte,{})}),r.jsx(tr,{path:"/profiles",element:r.jsx(mK,{})}),r.jsx(tr,{path:"/standby",element:r.jsx(Jte,{})}),r.jsx(tr,{path:"/timeline",element:r.jsx(TE,{})}),r.jsx(tr,{path:"/mentorship",element:r.jsx(Kre,{})}),r.jsx(tr,{path:"/member/timeline-editor",element:r.jsx(kre,{})}),r.jsx(tr,{path:"/manage",element:r.jsx(uc,{to:"/member",replace:!0})}),r.jsx(tr,{path:"/profile",element:r.jsx(uc,{to:"/member",replace:!0})}),r.jsx(tr,{path:"/membership",element:r.jsx(uc,{to:"/member",replace:!0})}),r.jsx(tr,{path:"/calendar",element:r.jsx(uc,{to:"/#events",replace:!0})}),r.jsx(tr,{path:"/leadership",element:r.jsx(uc,{to:"/#leadership",replace:!0})}),r.jsx(tr,{path:"/mission",element:r.jsx(uc,{to:"/#mission",replace:!0})}),r.jsx(tr,{path:"/about",element:r.jsx(uc,{to:"/#about",replace:!0})}),r.jsx(tr,{path:"*",element:r.jsx(QT,{})})]})]})]})})});rD.createRoot(document.getElementById("root")).render(r.jsx(Jre,{}));export{Nae as u};

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.